Skip to content
Providers

App Store Connect

Create an In-App Purchase key, connect the App Store Server API, and point App Store Server Notifications V2 at AppCore for iOS purchases and subscriptions.

On this page

AppCore verifies iOS purchases and subscriptions with Apple and turns them into entitlements:

  • The app buys through StoreKit and sends the signed transaction to POST /v1/commerce/purchases/verify. AppCore checks Apple's signature chain (ending at Apple Root CA G3 or G2; no certificates to configure), then fetches the current state from the App Store Server API with your In-App Purchase key before granting anything.
  • Apple sends lifecycle events (renewals, expiry, billing retry, refunds) as App Store Server Notifications V2 to a per-connection URL. Each event is stored before AppCore answers, and state is always re-read from Apple.
  • A scheduled sweep reconciles recent transaction history; no setup is needed.

Apple is the merchant of record: it charges the user, handles tax and issues the receipt. AppCore stores only a receipt reference and never issues its own invoice for store sales. See Stores as merchant of record. Console paths are as of 2026-11.

Note

Verification, notifications, refunds and reconciliation are implemented and tested in the Workers runtime against a test certificate chain and a fake App Store Server API. They have not yet run against Apple's sandbox (PROVIDER_TESTED is pending real credentials).

Warning

Not yet enabled:

  • Operator-initiated refunds for Apple. Apple refunds are requested by the customer from Apple. An operator refund request for an Apple purchase is recorded as awaiting_manual; AppCore applies the refund when Apple's REFUND notification arrives.
  • Automatic product sync from App Store Connect. Map product IDs by hand in Store mappings.
  • Upgrade/downgrade proration is taken from Apple's state as-is; AppCore does no proration math and does not warn about duplicate subscriptions across Apple and Google.

Before you begin

  • Account Holder or Admin role in App Store Connect. Only the Account Holder can accept agreements.
  • Business → Agreements: the Paid Apps agreement is Active, with tax and banking complete. This blocks production activation, not sandbox testing.
  • The app record exists in App Store Connect, with the bundle ID of this environment's build.
  • Your environment's API host, https://<your-api-host>, for each environment you connect (staging and production have different hosts and different connections).

Steps

  1. Find the app's identifiers. App Store Connect → Apps → your app → General → App Information: copy the Apple ID (digits) and the Bundle ID.

  2. Create the In-App Purchase key. App Store Connect → Users and Access → Integrations → In-App Purchase → Generate In-App Purchase Key (➕). Name it and generate. Copy the Key ID, and the Issuer ID shown at the top of the keys list. Download the .p8; Apple lets you download it once. Use an In-App Purchase key, not a Team key from the App Store Connect API tab, and not your APNs or Sign in with Apple key.

  3. Create the connection. In AppCore, open Setup and connections → Connections, choose the environment, and create an Apple in-app purchases and subscriptions connection. Fill in the public fields (below) and save. Paste the whole .p8 file into private_key_p8, then delete the local file.

  4. Run Check syntax, then Read-only check, then Activate. The notification URL only accepts events while the connection is active.

  5. Point notifications at AppCore. Copy the Callback URL from the connection page. It has the form:

    Code
    https://<your-api-host>/webhooks/apple-store/<connection-id>

    Then go to App Store Connect → Apps → your app → General → App Information → App Store Server Notifications, choose Version 2 Notifications, and set:

    • Sandbox Server URL: the URL from your staging (or development) connection.
    • Production Server URL: the URL from your production connection, once it exists.

    Never use one URL for both. Each environment rejects the other environment's events.

  6. Send a test notification. Call the App Store Server API's Request a Test Notification endpoint (POST /inApps/v1/notifications/test on the sandbox host, signed with your In-App Purchase key), or use the button in App Store Connect if your account shows one. AppCore stores it with outcome test and grants nothing. Record the test notification's ID as evidence for check iap-test-notification.

  7. Create products. Apps → your app → Monetization → In-App Purchases or Subscriptions. Product IDs must match exactly what you map in AppCore (Products and entitlements → Store mappings). Apple requires the first in-app purchase to be submitted for review together with an app version.

  8. Create sandbox testers. Users and Access → Sandbox → Test Accounts → ➕. On the device, sign in with the tester when StoreKit prompts during a purchase in a development or TestFlight build (iOS also lists the sandbox account in Settings; where depends on the iOS version).

  9. Buy in the app with the SDK (Getting started, step 7). IapStoreBridge sets StoreKit's appAccountToken to the purchase intent's account binding, so the purchase is tied to the signed-in AppCore user. Record the transaction ID as evidence for iap-sandbox-purchase, and attest iap-negative after checking a tampered or other-app transaction is rejected.

Paste into AppCore

AppCore fieldWhere to find itSecret?
bundle_idApps → your app → General → App Information → Bundle IDPublic
app_apple_idApps → your app → General → App Information → Apple ID (digits only)Public
issuer_idUsers and Access → Integrations → In-App Purchase → Issuer ID (top of the list)Public
key_idUsers and Access → Integrations → In-App Purchase → your key → Key IDPublic
private_key_p8The downloaded SubscriptionKey_<KEYID>.p8, whole contents including BEGIN/END linesSecret (write-only)
store_environmentsandbox for development and staging; production for production onlyPublic
agreement_evidenceBusiness → Agreements: who confirmed Paid Apps is Active, and whenPublic
verifier_releaseRecord that Version 2 notifications point at this connection's URLPublic
catalog_mapping_versionFilled by the platform from your published store mappingsPublic

Paste into Apple: the connection's Callback URL (https://<your-api-host>/webhooks/apple-store/<connection-id>) as the Sandbox or Production Server URL.

Verify

  • Read-only check passes with APPLE_STORE_AUTHENTICATED: AppCore signed a token with your key for your bundle and asked the App Store Server API (sandbox or production host, per store_environment) for a transaction that does not exist. Apple answering "not found" proves the key, Key ID, Issuer ID and bundle work together. Nothing is created.
  • After Activate, apple appears in purchase_providers of GET https://<your-api-host>/v1/config/public.
  • The test notification appears as processed with outcome test.
  • A sandbox purchase appears in Purchases and finance → Purchases, the subscription in Subscriptions, and the user's access in Products and entitlements → Entitlements.
  • With all sandbox checks evidenced the connection becomes sandbox_ready. Production additionally needs checks iap-policy and iap-live and the setup tasks Paid Apps agreement, products created and app review done.

Troubleshooting

SymptomLikely causeFix
Read-only check PROVIDER_AUTH_REJECTEDWrong Issuer ID or Key ID, revoked key, or a Team API key instead of an In-App Purchase keyGenerate an In-App Purchase key; copy the Issuer ID from the In-App Purchase tab
INVALID_P8_KEYPartial key pastedPaste the whole .p8 file
PROVIDER_REJECTED on bundle_idBundle ID does not belong to this key's teamCopy it from App Information
Notification URL returns 404Connection ID in the URL is not this environment's active connectionCopy the Callback URL from the active connection again
Notification URL returns 503 FEATURE_UNAVAILABLEConnection not active yetActivate, then resend the test
Notification returns 422Event is for another bundle ID, or a sandbox event reached production (or the reverse)Point the Sandbox URL at staging and the Production URL at production
Notification returns 401Signature chain did not verifyOnly Apple-signed payloads are accepted; check nothing rewrites the request body
Purchase returns 503 FEATURE_UNAVAILABLE "Store connection environment does not match"store_environment is production on staging, or the reverseSet sandbox outside production
404 PRODUCT_NOT_MAPPEDThe store product ID is not mapped in AppCoreMap it in Store mappings and publish
503 PROVIDER_UNAVAILABLE on verifyApple's API was unreachableThe SDK keeps the transaction unfinished and retries with the same idempotency key
409 on restore, job awaiting_manualThe purchase belongs to another AppCore accountHandle it in Purchases and finance → Restore cases