Code
39
SDK error · code 39
What it means
invalidWebPurchaseToken (code 39) means the redemption link's token is not valid: it was cut off, edited, from another project, or never completed. The backend answers 7849. Pass the full link to parseAsWebPurchaseRedemption and redeemWebPurchase without changes, and ask the customer to use the original link from the success page or email.
Code
39
iOS (Swift)
ErrorCode.invalid
Android (Kotlin)
No matching code in the Android SDK; see the causes below.
Causes
invalidToken result (PurchasesOrchestrator.swift, WebPurchaseRedemptionHelper.swift).| Backend code | Meaning |
|---|---|
| 7849 | Invalid web redemption token. |
Fix
Call Purchases.parseAsWebPurchaseRedemption(url) on the exact URL your app received, and give the result to redeemWebPurchase. Do not edit the token.
Ask the customer to open the link from the success page or the email the buyer got, not a forwarded or shortened copy.
Make sure the link was issued by the project the app talks to. A token from another project is unknown.
Switch on the redemption result: invalidToken, purchaseBelongsToOtherUser, expired and success each need their own message.
In your app
// Swift
do {
let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .invalidWebPurchaseToken {
// handle invalid web purchase token
} On RevenueDot: RevenueDot answers HTTP 400 with code 7849 when the token is not shaped like rdrt_ plus a token of 20 to 100 characters, when it is unknown, or when its checkout was never completed or was not anonymous. See how a web purchase reaches the app and web billing.
FAQ
Backend code 7849 means the web redemption token is invalid. The iOS SDK reports it as invalidWebPurchaseToken (code 39), and the Android SDK as purchaseInvalidError.
Register your URL scheme, parse the incoming link with parseAsWebPurchaseRedemption, and call redeemWebPurchase. The result tells you if it worked, the token is invalid, the purchase belongs to another user or the link expired.
The React Native PURCHASES_ERROR_CODE enum in the SDK source has no member for it, so compare error.code with the string "39". In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.invalidWebPurchaseToken.
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