I don't know the details, but for the Boeing 737 you'll have to switch power source from APU to the engines before powering down the apu. Examine the overhead panel of the MD80.
Maybe watch how AI pilot is doing the procedure.
The start script for the MD80 contains (maybe that gives you a hint):
------------------------
--- TURN OFF THE APU ---
------------------------
bleedair_APU_switch = 0 -- turn the bleed air from APU to off
cross_tie_APU_L = 0 -- turn the L bus connection with the APU power to off
cross_tie_APU_R = 0 -- turn the R bus connection with the APU power to off
APU_starter_switch = 0 -- APU starter to "off"
autostart_step = 11 -- go to the next step