Skip to main content

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 customerUserId or profileId. At least one is required to return the correct result.

Notes:
  • transactionId and originalTransactionId must come from StoreKit (or StoreKit 2).

  • paywallId, isExperiment, and aiPricingModelId must match the values returned by Get Paywall.

  • Use environment: production for live apps and sandbox for testing.

  • The optional source field 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 transactionId and originalTransactionId, use the SKPaymentTransaction object.

  • For sourceProductId, use SKPaymentTransaction.payment.productIdentifier.

  • For originalPrice use the SKProduct object.

StoreKit2
  • For transactionId, originalTransactionId, and sourceProductId, use the Transaction object.

  • For originalPrice use the Product object.

A successful request confirms the validation and returns the updated user profile associated with the purchase.

Request

Responses

Validated.