Documentation menu
POST/v1/customers/apple/link

Link an Apple customer to an application account

Links verified Apple purchase identity to an application account. This endpoint requires an application API credential with customers:write.

Request body

signedAppTransactionRequired
string

A signed StoreKit AppTransaction JWS value.

signedTransactionsOptional
string[]

Optional StoreKit transaction JWS values.

applicationAccountIdentifierRequired
string

A stable account identifier from the application.

Responses

200The linked customer's current entitlements.
customerIdentifierRequired
string | null · uuid
applicationIdentifierRequired
string · uuid
entitlementsRequired
CustomerEntitlement[]
400The request body, parameter, or verified store payload is invalid.
errorRequired
string

A stable machine-readable error code.

401The application API credential is missing or invalid.
errorRequired
string

A stable machine-readable error code.

403The application API credential does not include the required scope.
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 customer identity conflicts with an existing verified identity.
errorRequired
string

A stable machine-readable error code.

Request example

cURL
curl 'https://api.purpl.sh/v1/customers/apple/link' \
  --header 'Authorization: Bearer <application-api-credential>' \
  --header 'Content-Type: application/json' \
  --data '{
    "signedAppTransaction": "<app-transaction-jws>",
    "signedTransactions": ["<transaction-jws>"],
    "applicationAccountIdentifier": "user-123"
  }'