Validate an Apple App Store in-app purchase receipt server-side using the App Store Server API

domain: app-store-server-api · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Generate a short-lived JWT using your App Store Connect API key (Key ID, Issuer ID, and private key) with audience 'appstoreconnect-v1' and a short expiry
  2. After the client completes a StoreKit 2 purchase, retrieve the transaction ID from the SKPaymentTransaction or Transaction object and send it to your backend
  3. GET https://api.storekit.itunes.apple.com/inApps/v1/transactions/{transactionId} with the JWT in the Authorization header to receive a signed JWSTransaction
  4. Decode and verify the JWSTransaction using Apple's public key (fetched from https://appleid.apple.com/auth/keys); check the bundleId, productId, and transactionId fields
  5. Use https://api.storekit-sandbox.itunes.apple.com for the sandbox environment; never trust client-supplied receipt data without server-side verification

Known gotchas

Related routes

Validate Apple App Store in-app purchase receipts and handle server-to-server notifications (App Store Server Notifications V2)
developer.apple.com · 6 steps · unrated
Handle in-game purchase refund requests using the Apple App Store Server API CONSUMPTION_REQUEST flow
app-store-server-api · 5 steps · unrated
Validate a Google Play in-app product purchase server-side using purchases.products.get
google-play-developer-api · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans