Code
40
SDK error · code 40
What it means
purchaseBelongsToOtherUser (code 40) means the web purchase behind a redemption link was already redeemed by a different app user, reported as backend code 7852. A purchase moves to one customer only. Ask the customer to sign in with the account that redeemed it first, or contact support to move it. Opening the link again does not change the result.
Code
40
iOS (Swift)
ErrorCode.purchase
Android (Kotlin)
No matching code in the Android SDK; see the causes below.
Causes
purchaseBelongsToOtherUser result in the Swift async API (BackendErrorCode.swift).| Backend code | Meaning |
|---|---|
| 7852 | Purchase belongs to another user. iOS maps it to purchaseBelongsToOtherUser; Android maps it to productAlreadyPurchasedError. |
Fix
Ask the customer to log in with the account that redeemed the link first. Entitlements follow that app user.
Look up the web purchase in the dashboard to see which app user holds it.
If the wrong account redeemed it, move the purchase through support, or grant a promotional entitlement to the right account.
Tell buyers that the link is personal. Show this in the email and success page.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .purchaseBelongsToOtherUser {
// handle purchase belongs to another user
} On RevenueDot: RevenueDot claims the purchase before it moves anything, so of two simultaneous redeems exactly one wins. The other gets HTTP 400 with code 7852, unless it is the same app user ID retrying, which gets the same customer back.
FAQ
Backend code 7852 means another user already redeemed the web purchase. The iOS SDK reports it as purchaseBelongsToOtherUser (code 40), and the Android SDK as productAlreadyPurchasedError.
Yes. A retry by the same app user ID returns the same customer instead of an error.
The React Native PURCHASES_ERROR_CODE enum in the SDK source has no member for it, so compare error.code with the string "40". In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.purchaseBelongsToOtherUser.
Get started
RevenueDot answers the same SDK calls with the same error codes. Start free on RevenueDot Cloud, free up to $10,000 a month in tracked revenue.
Already have an account? Sign in · Prefer your own servers? Self-host free