Apple has offered the chance to trade in your old Mac, iPhone or iPad for credit for a while now. But now you can do so and get instant credit for the purchase of the new device at the very same time.
When you go to purchase a new iPhone, iPad or Mac you get a prompt for “Apple GiveBack” which is meant to allow you to easily send in your old device for recycling and save some money on your new one. But previously it was hard to do so since you’d have to pay full price for your new device, and get the money for the old one back later on.
The amount you get will depend on the age and condition of the device. For very old devices, you may get nothing other than knowing that it was properly recycled. You can check the trade-in value of any device at Apple’s page.