POST
/v1/customers/google-play/linkLink a Google Play customer to an application account
Links a verified Google Play purchase to an application account. This endpoint requires an application API credential with customers:write.
Authentication: BearerRequired scope:
customers:writeRequest 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.
applicationAccountIdentifierRequiredstringA stable account identifier from the application.
Responses
200The linked customer's current entitlements.
customerIdentifierRequiredstring | null · uuidapplicationIdentifierRequiredstring · uuidentitlementsRequiredCustomerEntitlement[]400The request body, parameter, or verified store payload is invalid.
errorRequiredstringA stable machine-readable error code.
401The application API credential is missing or invalid.
errorRequiredstringA stable machine-readable error code.
403The application API credential does not include the required scope.
errorRequiredstringA stable machine-readable error code.
404The application, store configuration, customer, or paywall was not found.
errorRequiredstringA stable machine-readable error code.
409The customer identity conflicts with an existing verified identity.
errorRequiredstringA stable machine-readable error code.
Request example
cURL
curl 'https://api.purpl.sh/v1/customers/google-play/link' \
--header 'Authorization: Bearer <application-api-credential>' \
--header 'Content-Type: application/json' \
--data '{
"packageName": "com.example.app",
"purchaseToken": "<purchase-token>",
"productKind": "subscription",
"productIdentifier": "plus.monthly",
"applicationAccountIdentifier": "user-123"
}'