/v1/customers/google-play/synchronizeSynchronize a Google Play purchase
Verifies a Google Play purchase token, stores the purchase, and returns the current entitlements. The SDK acknowledges only completed and fulfilled purchases. PENDING is stored as inactive and returns 409 GOOGLE_PLAY_PURCHASE_PENDING; a canceled pending purchase returns GOOGLE_PLAY_PURCHASE_NOT_COMPLETED. Only network failures, Google rate limiting, or temporary Google failures return 503 GOOGLE_PLAY_API_REQUEST_FAILED and allow device verification fallback. Configuration errors (502 GOOGLE_PLAY_CONFIGURATION_ERROR), invalid responses (502 GOOGLE_PLAY_API_RESPONSE_INVALID), invalid purchases (400), and a successful response with inactive entitlements must not trigger fallback.
Request body
packageNameRequiredstringThe Android package name registered in Purpl.
purchaseTokenRequiredstringThe purchase token returned by Google Play.
productKindRequiredsubscription | one_time_productThe Google Play product kind.
productIdentifierOptionalstring | nullThe optional product identifier used to narrow one-time purchase lookup.
applicationAccountIdentifierOptionalstring | nullAn optional stable account identifier from the application.
Responses
200The synchronized customer's current entitlements.
customerIdentifierRequiredstring | null · uuidThe Purpl customer identifier, when a customer was resolved.
verifiedStoreEntitlementsOptionalCustomerEntitlement[]Store-verified entitlements when the purchase is linked to another app account.
entitlementsRequiredCustomerEntitlement[]400The request body, parameter, or verified store payload is invalid.
errorRequiredstringA stable machine-readable error code.
404The application, store configuration, customer, or paywall was not found.
errorRequiredstringA stable machine-readable error code.
409The purchase is pending, was canceled before completion, or conflicts with an existing customer.
errorRequiredstringA stable machine-readable error code.
502Google credentials are invalid or the verified API response is malformed. Do not grant fallback access.
errorRequiredstringA stable machine-readable error code.
503Google is temporarily unavailable. Retry or use current locally verified purchases when configured.
errorRequiredstringA stable machine-readable error code.
Request example
curl 'https://api.purpl.sh/v1/customers/google-play/synchronize' \
--header 'Content-Type: application/json' \
--data '{
"packageName": "com.example.app",
"purchaseToken": "<purchase-token>",
"productKind": "subscription",
"productIdentifier": "plus.monthly",
"applicationAccountIdentifier": "user-123"
}'