Store Purchase Server Notifications, Explained: Apple Server Notifications and Google Play RTDN
How Apple App Store Server Notifications and Google Play Real-time developer notifications keep your backend current on renewals, refunds and cancellations - and the integration traps that corrupt entitlement ledgers.
The most expensive sentence in subscription engineering is "we will check when the app opens." Renewals, refunds, revocations and grace periods happen while the app is closed, and both stores will push every one of them to your backend in real time - Apple's App Store Server Notifications and Google Play's Real-time developer notifications (RTDN). They solve the same problem with different machinery, and each has one trap that bites almost every first integration.
Apple: signed JWS, version 2 only
App Store Server Notifications is a server-to-server service that pushes real-time In-App Purchase events - plus notifications for unreported external purchase tokens - to an HTTPS URL you configure in App Store Connect. The version 1 endpoint and its notification format are deprecated; new integrations implement the V2 endpoint. Every V2 notification body is a single signedPayload: a JSON Web Signature object signed by the App Store. You parse the JWS header, payload and signature, Base64URL-decode the payload to get the notification type and data, and then - this is the part people miss - the data object nests two more signed JWS representations, signedTransactionInfo and, for subscription events, signedRenewalInfo, each of which you verify and decode the same way. Signing is not decorative: verify the chain before you trust a word of it, because this endpoint is reachable from the public internet. Apple also gives you a built-in integration test: request a TEST notification, and use the returned testNotificationToken with the Get Test Notification Status endpoint to see how your server responded. Your server's job on receipt is simple - update the user-account database, and monitor and respond to refunds - and you acknowledge with HTTP status codes that tell the App Store whether the post succeeded.
Google Play: Pub/Sub, and the notification is only a doorbell
Play's RTDN arrive as messages on a Cloud Pub/Sub topic you own. The envelope carries a base64-encoded data field; decoding it yields a DeveloperNotification with a version, package name, event timestamp and exactly one payload: a subscription notification, a one-time product notification, a voided purchase notification, a pending refund-review notification, or a test notification. The subscription vocabulary is the deep one - twenty-two event types, from the happy path (PURCHASED, RENEWED, RESTARTED) through the money-losers (ON_HOLD, IN_GRACE_PERIOD, PAUSED, EXPIRED, REVOKED) to newer entries like PRICE_STEP_UP_CONSENT_UPDATED for regions where step-up consent is required. Two habits from the reference page save real money. First, dedupe on messageId: the docs explicitly recommend checking uniqueness to avoid processing duplicates and burning Developer API quota. Second - the trap - Play states plainly that the notification tells you only that the purchase state changed; it does not give you complete information. You must call the Google Play Developer API after receiving an RTDN to get the full status before you touch your own state. Acting on the event type alone (grant on PURCHASED, pull on CANCELED) corrupts entitlement ledgers, because CANCELED fires at voluntary cancellation while the subscription still runs to expiry.
The shared architecture underneath
Both systems are doorbells, not databases. The notification says "something changed about this purchase"; your backend then confirms against the owning API (Apple's App Store Server API, Google's Developer API), updates entitlements, and acknowledges. That shape drives the same design decisions on both sides: an endpoint or subscriber that is idempotent (duplicates happen), fast to acknowledge (process asynchronously after the 200), and writes events to an append-only log before mutating state so a bad deploy can be replayed. It also clarifies ownership: the app itself should be a consumer of your entitlement state, not the source of it, because the app is closed exactly when the interesting events fire.
A short build checklist
- Apple: configure the V2 URL, verify JWS signatures on all three nested payloads, handle the TEST notification flow, and respond with accurate status codes.
- Play: subscribe a Pub/Sub topic, dedupe messageIds, map the 22 subscription event types to "fetch fresh state," and call the Developer API before any entitlement change.
- Both: log raw events immutably, process off the request path, and replay from the log after bugs - you will have bugs.
- Never let the app be the entitlement source of truth. Notifications plus server state beat client-reported purchases every time.
The honest summary
Apple sends signed JWS you must verify and decode three levels deep; Google sends Pub/Sub messages that are deliberately incomplete and require an API call to act on. Both are deprecated-format-free, testable (Apple's TEST notification, Play's test publish), and the difference between a subscription backend that learns about churn from a webhook and one that learns about it from support tickets.
Sources
- Apple Developer Documentation: App Store Server Notifications
- Apple Developer Documentation: responseBodyV2
- Android Developers: Real-time developer notifications reference guide
Prepared with AI assistance and reviewed before publication. Notification formats, event types and integration requirements are drawn from the source pages above, checked on 19 November 2026.