What does productAlreadyPurchasedError (code 6) mean in the purchases SDK?
The purchases SDK raises productAlreadyPurchasedError (code 6) when the store refuses to sell a product the customer already owns.
Quick facts#
| Error | ErrorCode.productAlreadyPurchasedError (iOS), PurchasesErrorCode.ProductAlreadyPurchasedError (Android), code 6 |
| Where | Purchases SDK (iOS, Android and the hybrid SDKs built on them) |
| What the vendor says | This product is already active for the user. |
Cause#
- Android: Play Billing
ITEM_ALREADY_OWNED. Google says it is usually permanent but can be stale cache, and recommendsqueryPurchasesAsync(). - StoreKit 1: an
unknownSKErrorwhose underlying error says the customer is currently subscribed. - On Android, the backend answered 7852 (a web purchase that belongs to another user); iOS reports that as
purchaseBelongsToOtherUserinstead.
Fix#
- Call
getCustomerInfoand check the entitlement. If it is active, close the paywall. - If it is not active, call
restorePurchases()so the SDK posts the owned purchase. - On Android, acknowledge or consume purchases so they do not stay owned and block a second purchase.
- Hide the buy button for owners by checking the entitlement before you show the paywall.
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 .productAlreadyPurchasedError:
// Good news: the customer already owns it. Refresh customer info or restore, then close the paywall.
print("Already purchased; restore or refresh customer info")
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#
Deep dive: revenuedot.app/errors/product-already-purchased-error. See also how to restore purchases.
Related#
- What does Play Billing ITEM_ALREADY_OWNED (7) mean?
- What does receiptAlreadyInUseError (code 7) mean in the purchases SDK?
- What does paymentPendingError (code 20) mean in the purchases SDK?
- 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-android: google/errors.kt (Play Billing mapping)
- RevenueDot purchases-android: common/errors.kt (backend code mapping)
Checked: 2026-10-03