Not sure about IUP since I paid for my phone in full but I ordered online and traded in my iPhone and Apple Watch in store. Received my refund same day for the Watch and received the iPhone refund today.
I'd recommend stopping by your Apple Store and talking to them about it. The first person I spoke to said it wouldn't be possible but I was nice about it and they looked into it further which they said it was fine to trade in at the store. They applied it to the original form of payment and to the order.
If you do have to ship the phone in, make sure that you drop off your trade in device at a FedEx store and not a drop off / Walgreens. They'll give you a receipt of the trade in with the weight of the box, this will confirm that you indeed shipped your phone with it inside. Plus there's a red tampering tape included in the trade in box. If Apple's trade in partner sees that the tape has been tampered with upon arrival, they know that it was tampered in transit.