Once your 12 is eligible for trade in, you can apply that credit to the purchase of a 13 … but only a purchase. You can’t apply credit towards a device on Apple’s “upgrade” program (the installment program that let’s you trade in a prior upgrade device for a new one after 12 payments). Trade-in credit such as what you’re trying to do will only go towards purchases at the Apple Store, I found that out when I paid off my X and traded it in, wanting to get on Apple’s annual upgrade plan, I was able to start a new upgrade plan, but had to use that credit for other stuff at Apple.
You can also check with your carrier, they may also have a trade-in program that let’s you apply that to financing a new device, assuming that you don’t want to make an outright purchase on a 13.