Validate Google Play Store Purchase
POST/purchases/play-store/validate
Validates an in-app purchase or subscription completed through the Google Play Store. This endpoint confirms the purchase token with Google and links the transaction to the user profile and paywall context.
Follow the notes below for a successful request:-
subscriptionOfferDetailsis required for subscriptions and must match the purchased offer. -
paywallId,isExperiment, andaiPricingModelIdmust match the values returned by the Get Paywall API. -
Use
environment:productionfor live apps andsandboxfor testing. -
If you previously called Get Paywall, include
isExperimentandaiPricingModelIdfrom that response to improve analytics attribution. -
At least one of
profileIdorcustomerUserIdmust be provided to identify the user.
If you are having trouble finding the token, you can refer to the official Google documentation:
A trial period is identified when at least one element within pricingPhases contains priceAmountMicros = 0.
For a trial subscription, the system expects to receive a pricingPhase with:
-
priceAmountMicros: 0(to indicate a free trial) -
The usual fields:
billingPeriod,recurrenceMode, andbillingCycleCount
This zero-priced phase allows our system to correctly identify the event as a trial rather than a paid subscription.
If this zero-priced phase is missing, the event will be interpreted as a paid subscription, which will impact your revenue statistics.
Update: One-Time Purchase (OTP) Support
This endpoint supports both subscription and one-time purchase (OTP) validations. In addition to the existing subscriptionOfferDetails field, you can send oneTimePurchaseOfferDetails for one-time purchases.
Important: You must send either oneTimePurchaseOfferDetails or subscriptionOfferDetails, but not both. The choice depends on whether you're validating a one-time purchase or a subscription.
Request
Responses
- 200
Validated.