Here's Apple's two plans for trading in and conditions for eligibility:
Apple GiveBack [formerly: Apple Recycling Program; formerly: Apple Trade-up program] - All computer and mobile devices, including non-Aple brands - "Trade in your eligible device for an Apple Store Gift Card. If it’s not eligible for credit, we’ll recycle it for free. No matter the model or condition…"
https://www.apple.com/shop/trade-in
iPhone Upgrade Program - Apple
"Get a new iPhone every year. You’re eligible to upgrade to a new iPhone once you’ve made 12 payments. Just trade in your current iPhone and start a new plan."
https://www.apple.com/shop/iphone/iphone-upgrade-program