In-App Purchase key vs App Store Connect API key vs shared secret

To check App Store purchases on your server in 2026, you need the In-App Purchase key. It signs the tokens for the App Store Server API, which confirms purchases, returns transaction history and reports renewal state. The App Store Connect API key is a different credential for managing your account, such as products and prices, and it cannot call the App Store Server API. The shared secret only works with verifyReceipt, which Apple has deprecated, so new servers do not need it.

This post is for developers who set up in-app purchases for the first time, often from a Flutter, React Native or Expo app, and for teams moving their purchase backend who are asked for "your Apple keys". It explains what each credential does, how to create the one you need, what the Issuer ID and Key ID are, and the mistakes that cause failed checks. Every fact about Apple and RevenueCat links its source and was checked on November 30, 2026.

Three cards: the In-App Purchase key for the App Store Server API, the App Store Connect API key for managing products and reports, and the shared secret for the deprecated verifyReceipt endpoint

The short answer#

Credential What it is for Do you need it?
In-App Purchase key (.p8) The App Store Server API: purchase checks, history, renewal state, refunds, promotional offer signatures Yes, for any server that checks purchases
App Store Connect API key (.p8) The App Store Connect API: apps, products, prices, users, sales reports Only to manage products or read reports from code
Shared secret (32 hex characters) The verifyReceipt endpoint for old-style receipts No, for a new server
  • The two .p8 keys look alike but are not interchangeable. Apple says each key works only with its own APIs (Apple).
  • Both keys download once. Apple keeps no copy, so store the file in a secret manager the moment you create it.
  • One Issuer ID covers your team. The Key ID changes per key; the Issuer ID does not.

Credential 1: the In-App Purchase key#

This is the key that matters for purchases. Apple's help page says it lets Apple "authenticate and validate client-to-server or server-to-server requests related to In-App Purchases, including App Store server APIs and promotional offers for auto-renewable subscriptions" (Apple).

With it, your server can:

  • confirm a StoreKit 2 transaction and fetch the latest state of a subscription,
  • read a customer's full transaction history,
  • look up a purchase by the order ID on the customer's receipt email,
  • extend a subscription's renewal date,
  • send consumption information for a refund request,
  • sign promotional offers.

Apple's reference says this key is for "the App Store Server API, the Advanced Commerce API, and the External Purchase Server API", and that "you can't use the key for other Apple services" (Apple).

How to create it#

You need the Account Holder or Admin role (Apple). Then:

  1. In App Store Connect, open Users and Access and click the Integrations tab.
  2. In the sidebar under Keys, click In-App Purchase.
  3. Click Generate In-App Purchase Key, or the + button if you already have one.
  4. Enter a name, such as the service that will use it, and click Generate.
  5. Click Download Key and save the .p8 file. The link disappears after the first download.
  6. Copy the Key ID from the list and the Issuer ID shown near the top of the page.

You can create several In-App Purchase keys. Give each service its own key, so you can revoke one without breaking the others.

How your server uses it#

Your server signs a short JSON Web Token with the key for each request. Apple's rules are specific: the header uses alg ES256 and your Key ID as kid, and the payload holds your Issuer ID as iss, the audience appstoreconnect-v1 and your app's bundle ID as bid. Apple says tokens that expire "more than 60 minutes after the time in iat are not valid" (Apple).

You rarely write this yourself. Apple's App Store Server Library builds the token for you:

JavaScript
// npm install @apple/app-store-server-library
import { AppStoreServerAPIClient, Environment } from "@apple/app-store-server-library";

const client = new AppStoreServerAPIClient(
  process.env.APPLE_IAP_KEY,     // the contents of the .p8 file
  process.env.APPLE_KEY_ID,      // 10 characters, from the In-App Purchase keys list
  process.env.APPLE_ISSUER_ID,   // the UUID shown above the keys list
  "com.example.app",             // your bundle ID
  Environment.SANDBOX,           // Environment.PRODUCTION for live purchases
);

// The current state of every subscription the customer has in your app.
const statuses = await client.getAllSubscriptionStatuses(originalTransactionId);

A RevenueCat page calls this key "a required configuration step" for every App Store app, and warns that with its SDK version 5 or later, which uses StoreKit 2, purchases can fail to be recorded without it (RevenueCat). The same is true for any backend built on StoreKit 2.

Credential 2: the App Store Connect API key#

The App Store Connect API automates the work you would otherwise do on the App Store Connect website: creating apps and in-app purchases, setting prices, managing TestFlight testers and users, and downloading sales and finance reports. Apple says these keys "are unique to the App Store Connect API and you can't use them for other Apple services" (Apple).

There are two kinds:

  • Team keys can reach all apps, with access set by the role you give the key. Only an Admin can create them.
  • Individual keys carry the access of one user. Apple says they cannot use provisioning endpoints, Sales and Finance, or notaryTool.

To create a team key, open Users and Access, click Integrations, select App Store Connect API, choose the Team Keys tab, click Generate API Key, name it and pick a role. Choose the smallest role that does the job. A key that only reads products and prices does not need Admin, which can also create and delete users.

When do you need this key for in-app purchases? Only when your tools manage the catalog for you, for example a script that creates subscriptions in App Store Connect, or a backend that imports your products and prices so you do not type them twice. It cannot check a purchase.

One practical note: the Issuer ID is the same for both kinds of key. RevenueCat's page says that if you cannot find the Issuer ID, you can create an App Store Connect API key to make it appear, and that "the Issuer ID is the same for both keys" (RevenueCat).

Credential 3: the shared secret#

The shared secret is "a 32-character hexadecimal string" that you send with receipts to Apple's verifyReceipt endpoint. You can create one primary shared secret for all your apps, or an app-specific one per app (Apple).

The same page carries Apple's warning: "The verifyReceipt endpoint is deprecated. To validate In-App Purchases on your server without using receipts, use the App Store Server API instead." So a server written today should not use the shared secret at all. Two cases still bring it up:

  1. Old apps that send StoreKit 1 receipts. The App Store Server API can still look these purchases up by transaction ID, so you can move the server side first and keep the old app version working.
  2. A tool that asks for it. Some backends still store it for old integrations. Giving it to them is harmless, but it does not replace the In-App Purchase key.

If you rotate a shared secret, Apple warns of a transition period of up to 24 hours before the new one takes effect.

Mistakes that break purchase checks#

  1. Using the App Store Connect API key for the App Store Server API. The two .p8 files look the same. Apple rejects every call as unauthorized. Create an In-App Purchase key instead.
  2. Mixing a Key ID from one key with the file of another. The Key ID must belong to the .p8 file that signs the token. When you have several keys, keep the Key ID in each file's name so the pair never separates.
  3. The wrong bundle ID in the token. The bid claim must match the app whose purchases you ask about.
  4. Calling production for sandbox purchases. Purchases made in TestFlight or with a sandbox account live in the sandbox environment. Try production first and fall back to sandbox when Apple says the transaction is not found, or pick by the environment in the signed transaction.
  5. Losing the file. Apple does not keep a copy. Revoke the key and create a new one, then update every service that used it.
  6. Committing the key to git. Apple says not to "store keys in a code repository" or "include keys in client-side code" (Apple). A key in an app bundle can be extracted by anyone who downloads the app.

What about Google Play?#

Google Play uses one credential for the same jobs: a Google Cloud service account with access to your app in Play Console. Your server uses its JSON key to call the Google Play Developer API, which checks purchases, acknowledges them and reads subscription state. Our Google Play setup guide walks through it, and the post on acknowledging Google Play purchases shows why the server needs it.

Do it with RevenueDot#

RevenueDot is an open-source backend for in-app purchases and subscriptions on the App Store, Google Play and the web. It asks for Apple credentials in this order:

  • The In-App Purchase key is the one that matters. RevenueDot uses it to confirm each StoreKit 2 purchase, read a customer's full history and renewal state, and extend subscriptions. The dashboard's Check credentials button makes one harmless call to Apple and tells you whether the key, Key ID and Issuer ID fit together. Without the key, RevenueDot still verifies StoreKit 2 signed transactions against Apple's root certificate, but it knows only what the device sent. StoreKit 1 receipts need the key: without it RevenueDot answers with a temporary error, so the SDK keeps the purchase and sends it again after you add the key. See the App Store guide.
  • The App Store Connect API key is optional. With the App Manager role, it lets RevenueDot import your products from App Store Connect and create new ones there from your catalog.
  • The shared secret is stored but not used, because RevenueDot does not call the deprecated verifyReceipt endpoint. The API never returns stored keys.

A real App Store sandbox purchase has run end to end against RevenueDot, on a physical iPhone.

New apps install the RevenueDot SDK. Its code says import RevenueCat because it is built from RevenueCat's MIT-licensed SDK, and it needs no RevenueCat account. The SwiftUI, Flutter and React Native and Expo tutorials set up the app side, and server-side receipt validation explains what the server does with the key.

Switching from RevenueCat? Keep your SDK and change one line. RevenueDot stores these credentials under RevenueCat's field names, so the same In-App Purchase key works in both during a side-by-side run. An app that ships the RevenueCat SDK points its proxy URL at RevenueDot and keeps its code, offerings and customers. See migrating without data loss, the comparison and the fee calculator.

Start for free on RevenueDot Cloud. Building and testing are free, no card needed. Add a card when you go live; Pro costs $0 until your apps make $10,000 a month. See pricing.

FAQ#

Which Apple key do I need to validate in-app purchases on my server?#

The In-App Purchase key. Create it in App Store Connect under Users and Access, Integrations, In-App Purchase, and use it to sign tokens for the App Store Server API (Apple). The App Store Connect API key and the shared secret cannot do this job.

Can I use my App Store Connect API key for the App Store Server API?#

No. Apple says App Store Connect API keys "are unique to the App Store Connect API" and cannot be used for other Apple services (Apple). Calls signed with it get rejected.

Do I still need an app-specific shared secret in 2026?#

Not for a new server. The shared secret only works with verifyReceipt, which Apple has deprecated in favor of the App Store Server API (Apple). Keep it only if an old system still calls verifyReceipt.

Where do I find the Issuer ID?#

In App Store Connect under Users and Access, Integrations, near the top of the keys page. It is one UUID for your whole team and the same for In-App Purchase keys and App Store Connect API keys.

I lost my .p8 file. Can I download it again?#

No. Apple lets you download each private key once and does not keep a copy. Revoke the old key, create a new one, and update every service that used it.

About RevenueDot. RevenueDot is an open-source (AGPL-3.0) backend for in-app purchases and subscriptions on the App Store, Google Play and the web. Start for free on RevenueDot Cloud: Pro costs $0 until your apps make $10,000 a month, then 0.5% of revenue above $10,000, never more than $999 a month. New apps install the RevenueDot SDK and pass their key. Apps that ship the RevenueCat SDK point its proxy URL at RevenueDot and keep their code, offerings and customers. Read the quickstart or the code on GitHub.

Edit this post on GitHub ↗ View as Markdown Published