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.notAvailableInStorefrontandProduct.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#
- 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.
- Match the product ID exactly. The ID in your offering must equal the store's product ID.
- Wait after you create a product, then test again with a fresh install.
- 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.
Related#
- What does StoreKitError.notAvailableInStorefront mean?
- What does Product.PurchaseError.productUnavailable mean?
- What does Play Billing ITEM_UNAVAILABLE (4) mean?
- What RevenueDot's API errors mean (server codes)
Source#
- RevenueDot purchases-ios: ErrorCode.swift (the iOS ErrorCode enum)
- RevenueDot purchases-android: PurchasesErrorCode.kt (the Android enum)
- RevenueDot purchases-ios: StoreKitError+Extensions.swift
- RevenueDot purchases-android: google/errors.kt (Play Billing mapping)
Checked: 2026-10-03