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.canMakePayments page lists two conditions that make it false: Content & Privacy Restrictions in Screen Time that prevent purchases, and a mobile device management (MDM) profile that prevents purchases (AppStore.canMakePayments).
  • Apple documents purchaseNotAllowed as 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#

  1. Check AppStore.canMakePayments before you show the buy button. Apple says that when it is false you should not offer In-App Purchases.
  2. Tell the person purchases are turned off on this device, and point them to Screen Time or their administrator.
  3. Show the paywall again on the next launch, because the setting can change.
  4. 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.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated