Validate app and in-app purchase receipts with the App Store.
Your server can access the verifyReceipt endpoint to validate app and in-app transaction receipts. Submit a receipt to the App Store to receive a JSON response containing the app information and in-app purchase details in a number of fields that make up the receipt. Each field or combination of fields provides insight that you can use to deliver service and content to the user as you define.
Receipts for auto-renewable subscriptions can grow over time since the renewal transactions stay in the receipt forever. To optimize performance, the App Store may truncate sandbox receipts to remove old transactions. When validating receipts for transactions made in the sandbox environment, consider creating new test accounts instead of reusing old accounts to test subscription purchases.