Glossary · Platform

What is StoreKit 2?

StoreKit 2

StoreKit 2 is Apple's Swift-based in-app purchase API, available from iOS 15. It uses async code, returns transactions signed by the App Store in JWS format, and has an API for current entitlements and ready-made SwiftUI store views. The older StoreKit 1 relies on a receipt file that you parse and validate yourself.

With StoreKit 2 you fetch products with Product, buy with purchase, and listen for changes with Transaction.updates. You iterate Transaction.currentEntitlements to learn what a customer may use. StoreKit verifies each signed value and hands it back as verified or unverified, and you can also verify the JWS string yourself on a server. Start the transaction listener when the app launches, because purchases can finish outside the app, for example an offer code or a win-back offer redeemed in the App Store.

Apple's store views, such as the subscription store view from iOS 17, can draw a complete paywall in a few lines. You can also test without App Store Connect, because a StoreKit configuration file in Xcode lets you configure products locally, offline, in the simulator or on a device. Apple's server side pairs with it: App Store Server Notifications V2 and the App Store Server API return the same signed format.

RevenueDot works with the RevenueCat SDKs, which post StoreKit 2 signed transactions to POST /v1/receipts. RevenueDot verifies the signature against Apple's root certificate, and with the In-App Purchase key it reads the full history. StoreKit 1 receipts need the key. Without it RevenueDot answers 500 with code 7234, so the SDK keeps the purchase and retries once you add the key.

Sources: Apple: Apple In-App Purchase (StoreKit) · Apple: VerificationResult · Apple: Product · Apple: Testing at all stages of development with Xcode and the sandbox

FAQ

StoreKit 2: questions people ask

What is the difference between StoreKit 1 and StoreKit 2?

StoreKit 2 is a Swift concurrency API that returns signed transactions and entitlements. StoreKit 1 hands you a receipt file that your code or server has to parse and check.

Does StoreKit 2 verify purchases for me?

Yes. StoreKit verifies the signed transaction, renewal and app transaction values automatically and reports verified or unverified. You can also verify them yourself, on the device or on a server.

Can I test StoreKit 2 without App Store Connect?

Yes. A StoreKit configuration file in Xcode lets you test locally, without a network connection, before you create products in App Store Connect.

Get started

Run subscriptions without the revenue share.

Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue, or move an existing RevenueCat app with one line of code.

Already have an account? Sign in · Prefer your own servers? Self-host free