App Store Receipts
Validate app and In-App Purchase receipts with the App Store.
Overview
Your server can access the verifyReceipt endpoint to validate app and in-app transaction receipts. Submit a receipt to the App Store with your shared secret to receive a JSON response containing the app information and in-app purchase details in the fields that make up the receipt. Each field or combination of fields provides insight you can use to deliver service and content to the user, as you define.
In-app transactions that your app doesn’t mark as finished using finishTransaction(_:) or finish() remain in the App Store receipt. Auto-renewable subscriptions, non-renewing subscriptions, and non-consumables remain in the receipt indefinitely, and appear in the customer transaction history when you call the Get Transaction History V1 endpoint.
The responseBody.Latest_receipt_info object for auto-renewable subscriptions can grow over time because the renewal transactions stay in the receipt indefinitely. To optimize performance, the App Store may truncate receipts in the sandbox environment to remove old transactions.
You can test validating receipts in the sandbox environment. For more information, see Testing Apple In-App Purchases with sandbox and Test in-app purchases.
You can validate receipts from the App Store using server-side receipt validation or on-device validation. For more information about receipt validation options, see Choosing a receipt validation technique.