Purpl
Docs menu
POST/v1/customers/google-play/synchronize

Synchronize 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

packageNameRequired
string

The Android package name registered in Purpl.

purchaseTokenRequired
string

The purchase token returned by Google Play.

productKindRequired
subscription | one_time_product

The Google Play product kind.

productIdentifierOptional
string | null

The optional product identifier used to narrow one-time purchase lookup.

applicationAccountIdentifierOptional
string | null

An optional stable account identifier from the application.

Responses

200The synchronized customer's current entitlements.
customerIdentifierRequired
string | null · uuid

The Purpl customer identifier, when a customer was resolved.

verifiedStoreEntitlementsOptional
CustomerEntitlement[]

Store-verified entitlements when the purchase is linked to another app account.

entitlementsRequired
CustomerEntitlement[]
400The request body, parameter, or verified store payload is invalid.
errorRequired
string

A stable machine-readable error code.

404The application, store configuration, customer, or paywall was not found.
errorRequired
string

A stable machine-readable error code.

409The purchase is pending, was canceled before completion, or conflicts with an existing customer.
errorRequired
string

A stable machine-readable error code.

502Google credentials are invalid or the verified API response is malformed. Do not grant fallback access.
errorRequired
string

A stable machine-readable error code.

503Google is temporarily unavailable. Retry or use current locally verified purchases when configured.
errorRequired
string

A stable machine-readable error code.

Request example

cURL
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"
  }'