What does Product.PurchaseError.purchaseNotAllowed mean?
Product.PurchaseError.purchaseNotAllowed means the person on this device is not allowed to make purchases.
Quick facts#
| Error | Product.PurchaseError.purchaseNotAllowed |
| Where | StoreKit 2, Swift (Product.purchase(options:)) |
| Available since | iOS 15.0, iPadOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, visionOS 1.0 |
| What the vendor says | The user is not allowed to make purchases. |
Cause#
- Apple's
AppStore.canMakePaymentspage lists two conditions that make itfalse: Content & Privacy Restrictions in Screen Time that prevent purchases, and a mobile device management (MDM) profile that prevents purchases (AppStore.canMakePayments). - Apple documents
purchaseNotAllowedas the user not being allowed to make purchases, which is the state those two conditions put the device in. Apple does not list other triggers. - It is a setting on the device or account, so retrying does not help until the person or an administrator changes it.
Fix#
- Check
AppStore.canMakePaymentsbefore you show the buy button. Apple says that when it isfalseyou should not offer In-App Purchases. - Tell the person purchases are turned off on this device, and point them to Screen Time or their administrator.
- Show the paywall again on the next launch, because the setting can change.
- Do not retry the purchase and do not unlock content.
Example#
Swift
import StoreKit
// Ask first: when the device cannot make payments, show a message instead of a buy button that always fails.
func buy(_ product: Product) async {
guard AppStore.canMakePayments else {
print("Purchases are turned off on this device")
return
}
do {
_ = try await product.purchase()
} catch Product.PurchaseError.purchaseNotAllowed {
print("The App Store says this person is not allowed to buy")
} catch {
print("Purchase failed: \(error)")
}
}Compile-checked: npm run check:snippets type-checks this snippet with swiftc against the Apple SDK (macOS target, checked 2026-10-03).
How the RevenueDot SDK reports it#
The RevenueDot purchases-ios fork maps Product.PurchaseError.purchaseNotAllowed to ErrorCode.purchaseNotAllowedError (code 3). The SDK offers Purchases.canMakePayments() for the same check. See what purchaseNotAllowedError means.
Related#
- What does purchaseNotAllowedError (code 3) mean in the purchases SDK?
- What does StoreKitError.userCancelled mean?
- What does Play Billing BILLING_UNAVAILABLE (3) mean?
Source#
- Apple: AppStore.canMakePayments
- Apple: Product.PurchaseError.purchaseNotAllowed
- Apple: Product.PurchaseError
- RevenueDot purchases-ios: StoreKitError+Extensions.swift (how the SDK maps StoreKit 2 errors)
Checked: 2026-10-03