Palbase IAP · API
/iap/apple/account-tokenThe customer's App Store token
The signed-in customer's appAccountToken for the connected app — with no key connected and an Xcode certificate set, for Xcode's StoreKit Testing — a guest's too: a random UUID made the first time it is asked for, the same afterwards. The app passes it to StoreKit's purchase; the App Store's notifications carry it back, so a purchase is the customer's before the app reports it, and nothing personal goes to Apple. A guest's goes with it when it merges into an account.
Called by a signed-in user of your app, with their token and the publishable key.
curl -X POST "https://<your-ref>.palbase.studio/iap/apple/account-token" \
-H "apikey: $PALBASE_PUBLISHABLE_KEY" \
-H "authorization: Bearer $USER_ACCESS_TOKEN"Responses
200The token
400The request is malformed, or a field breaks a rule (the error names which)
401No customer's session (`session_required`): a customer's own is reached with the publishable key and their access token; or the edge refused the key or token
404The user's id is longer than a customer's (128 characters; `customer_not_found`)
409The project has no In-App Purchase key connected and no Xcode certificate set (`apple_not_connected`), or this guest's purchases went to the account it signed in to (`customer_merged`): ask with the account's session
410The user was deleted (`customer_erased`): their id is no customer's again
429Over the project's request limit; Retry-After says when to try again
503Another change to this customer is in progress (`customer_busy`), or the platform could not answer now; retrying is safe after Retry-After
defaultAn error: the envelope names it (`error`) and explains it (`error_description`).
Operation GetAppleAccountToken of iap's contract.