Yes - I believe Apple's policy is you have 7 days post-purchase to do a trade-in and have it applied to the previous purchase as a decrease in purchase price. At least that's what it was recently in Los Angeles when I did it for my iPhone 15 Pro Max (traded in my iPhone 13 Pro).
If you do this, regardless of how you paid for the initial purchase, you should have the trade-in applied to your debit card of your main bank account if you can. The trade-in value then comes in as cash (although it takes a few days to post). Vs if you do it against your credit card, you just get a credit / refund posted to your credit card (which also makes you lose rewards points, of the amount of the trade-in, that you got from the full purchase in the first place). It doesn't matter what card you actually used to do the purchase - just tell the Apple employee you want it on your debit card.