palbaseDocs

Palbase IAP · API

POST/iap/webhooks/apple

Take the App Store's notification

Where the App Store reports the connected app's purchases (App Store Server Notifications V2), sandbox's and production's alike — no key. The signed payload is verified: Apple's root, the app's bundle, the sandbox or production (production naming the app's Apple ID); a developer's machine's (Xcode, LocalTesting) is refused. Each notification is kept once, sealed, by its notificationUUID: one sent again is answered and not applied twice. A TEST notification proves the address (notifications.verified_at). One about a purchase applies what Apple signed of it — the transaction, the renewal info, the subscription's status — to the ledger: the newest by Apple's time is the state, an older one is recorded and not applied. A purchase new to the ledger is the customer's its appAccountToken names, else nobody's until the app reports it. Apple hears 200 once that is written; anything else, and it sends the notification again.

Called by .

Request body

signedPayloadstring · requiredThe notification, signed by the App Store (JWS).
curl
curl -X POST "https://<your-ref>.palbase.studio/iap/webhooks/apple" \
  -H "content-type: application/json" \
  -d '{"signedPayload":"string"}'

Responses

200Taken: applied, taken before, or nothing a customer has

400The body is no notification, or its signed payload is not the App Store's for the connected app (`invalid_notification`)

404The project has no In-App Purchase key connected (`apple_not_connected`)

413The delivery is over 512 KiB (`body_too_large`)

429Over the project's request limit; Retry-After says when to try again

503A production notification before the app's Apple ID is known (`apple_not_bound`), the signing certificates' revocation could not be checked (`apple_unreachable`), or the platform could not answer now: the App Store sends it again

defaultAn error: the App Store sends the notification again

Operation ReceiveAppleNotification of iap's contract.