Code
17
SDK error · code 17
What it means
invalidAppleSubscriptionKeyError (code 17) means the backend has no valid App Store In-App Purchase key for your app, reported as backend code 7234. Without the key, it cannot verify StoreKit 1 receipts or sign promotional offers. Create the key in App Store Connect, add it to the app's settings on the server, and the SDK will retry on its own.
Code
17
iOS (Swift)
ErrorCode.invalid
Android (Kotlin)
PurchasesErrorCode.Invalid
Causes
.p8 file, or Apple rejected it with an authorization error.failIfInvalidSubscriptionKeyDetectedInDebug flag fails loudly, and any other build falls back to offline entitlements computed on the device (CustomerInfoResponseHandler.swift).| Backend code | Meaning |
|---|---|
| 7234 | Invalid Apple subscription key: the In-App Purchase key is missing, incomplete or rejected. |
Fix
Create an In-App Purchase key under App Store Connect's Integrations. Apple explains how API keys are created in Creating API keys to authorize API requests. Download the .p8 file once; Apple does not show it again.
Enter the key ID, the issuer ID and the private key on the app in your server's settings. See Connect the App Store.
The app's bundle_id on the server must equal your app's bundle ID.
You can set the allow_unsigned_receipts credential on a development server to skip the key. Never use it in production.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .invalidAppleSubscriptionKeyError {
// handle invalid apple subscription key
}
// Kotlin
if (error.code == PurchasesErrorCode.InvalidAppleSubscriptionKeyError) { /* ... */ } On RevenueDot: RevenueDot answers POST /v1/receipts with HTTP 500 and code 7234 when a StoreKit 1 receipt arrives and the app has no In-App Purchase key, when the key is incomplete or not a valid .p8, and when Apple rejects it. It uses 500 on purpose, so the SDK keeps the purchase and retries once you add the key. POST /v1/offers answers 400 with 7234 when the key is missing, which fails only that offer. See 4xx or 5xx on a receipt.
FAQ
Backend code 7234 means the App Store In-App Purchase key is missing or invalid. The iOS SDK reports it as invalidAppleSubscriptionKeyError (code 17).
Yes for the default setup. The SDK's own documentation warns that StoreKit 2 mode needs an In-App Purchase key configured for the app. On RevenueDot the key is required for StoreKit 1 receipts and promotional offer signing.
No. RevenueDot answers 7234 with a 5xx status, so the SDK keeps the transaction and posts it again after you add the key.
In React Native, compare error.code with PURCHASES_ERROR_CODE.INVALID_APPLE_SUBSCRIPTION_KEY_ERROR. In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.invalidAppleSubscriptionKeyError.
Get started
RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.
Already have an account? Sign in · Prefer your own servers? Self-host free