Validate Apple Store Purchase
POST/purchases/apple-store/validate
Validates an in-app purchase or subscription completed through the Apple App Store.
Follow the notes below for a successful request:-
Trigger this endpoint after a successful purchase or restore event on the client. The server validates the transaction with Apple and associates it with the corresponding user profile, paywall, and AI Pricing model for accurate conversion tracking and attribution.
-
Identify the user by providing either
customerUserIdorprofileId. At least one is required to return the correct result.
-
transactionIdandoriginalTransactionIdmust come from StoreKit (or StoreKit 2). -
paywallId,isExperiment, andaiPricingModelIdmust match the values returned by Get Paywall. -
Use
environment: productionfor live apps andsandboxfor testing. -
The optional
sourcefield can be used to indicate whether the purchase comes from a restore flow, direct purchase, or observation.
Finding Required IDs
If you are having trouble finding transaction details, refer to the following StoreKit objects.
StoreKit-
For
transactionIdandoriginalTransactionId, use theSKPaymentTransactionobject. -
For
sourceProductId, useSKPaymentTransaction.payment.productIdentifier. -
For
originalPriceuse theSKProductobject.
-
For
transactionId,originalTransactionId, andsourceProductId, use theTransactionobject. -
For
originalPriceuse theProductobject.
A successful request confirms the validation and returns the updated user profile associated with the purchase.
Request
Responses
- 200
Validated.