@David ******
depends which airport, at Don Mueang is after immigration, at Suvarnabhuni depends on which immigration gate, one is before the other you first go through immigration then go to the other gate and get it done, it’s not important before or after as long as you do it before you depart!