What does productNotAvailableForPurchaseError (code 5) mean in the purchases SDK?

The purchases SDK raises productNotAvailableForPurchaseError (code 5) when the store reports the product as unavailable for this customer.

Quick facts#

Error ErrorCode.productNotAvailableForPurchaseError (iOS), PurchasesErrorCode.ProductNotAvailableForPurchaseError (Android), code 5
Where Purchases SDK (iOS, Android and the hybrid SDKs built on them)
What the vendor says The product is not available for purchase.

Cause#

  • StoreKit 1: SKError.storeProductNotAvailable. StoreKit 2: StoreKitError.notAvailableInStorefront and Product.PurchaseError.productUnavailable.
  • Android: Play Billing ITEM_UNAVAILABLE. Google says to refresh product details and check the product's configuration and country availability.
  • In the RevenueDot Android SDK's Test Store, a product with no price also raises this error.

Fix#

  1. Check the product in App Store Connect or Play Console: it must exist, be approved or active and be sold in the customer's country.
  2. Match the product ID exactly. The ID in your offering must equal the store's product ID.
  3. Wait after you create a product, then test again with a fresh install.
  4. Hide the package so the customer is not stuck on a button that cannot work.

Example#

Swift
// The purchases SDK throws `ErrorCode` values; match the one you handle and let the rest fall through.
func handle(_ error: Error) {
    guard let code = error as? ErrorCode else {
        print("Not a purchases SDK error: \(error)")
        return
    }
    switch code {
    case .productNotAvailableForPurchaseError:
        // Do not retry the same call: hide the package and log the product ID.
        print("The product is not available for purchase")
    default:
        print("Other purchases error: \(code.description)")
    }
}

Compile-checked: npm run check:snippets type-checks this snippet with swiftc together with the ErrorCode.swift file of the RevenueDot purchases-ios fork (checked 2026-10-03).

How the RevenueDot SDK reports it#

In RevenueDot, a product whose store_identifier differs from the store's ID returns no product from the store. See why an entitlement is not active. Deep dive: revenuedot.app/errors/product-not-available-for-purchase-error.

Source#

Checked: 2026-10-03

Edit this page on GitHub ↗ View as Markdown Last updated