SDK error · code 41

expiredWebPurchaseToken (error code 41): Expired web purchase token

What it means

expiredWebPurchaseToken (code 41) means the redemption link for a web purchase has expired, reported as backend code 7853. A new link is sent to the email used to buy. The error carries an obfuscated email so you can say where it went. Show that hint, and ask the customer to open the new link.

Code

41

iOS (Swift)

ErrorCode.expiredWebPurchaseToken

Android (Kotlin)

No matching code in the Android SDK; see the causes below.

Causes

Why the SDK returns expiredWebPurchaseToken

  • The backend answered 7853 (expired web redemption token). The iOS SDK maps it here and returns the expired result with the obfuscated email (WebPurchaseRedemptionHelper.swift).
  • The customer opened the link after its validity period ended.
  • A newer link replaced this one, so the old token is treated as expired, not invalid.
  • Android maps 7853 to PurchaseInvalidError and has no member for this code (errors.kt).
Backend codeMeaning
7853Expired web redemption token. The response also carries purchase_redemption_error_info.obfuscated_email.

Fix

How to fix expiredWebPurchaseToken

  1. 01

    Show the email hint

    Read rc_obfuscated_email from the error's userInfo, or the expired result's email, and show "We sent a new link to j***@example.com".

  2. 02

    Ask for the new link

    Tell the customer to open the newest email and use that link.

  3. 03

    Lengthen the validity

    If links expire too soon for your buyers, raise redemption_link_hours in the web config.

  4. 04

    Offer a support path

    If the buyer lost access to the email, route them to support with their order details.

In your app

How to handle it in code

  • Do not retry the old link. It stays expired.
  • Show the obfuscated email, so the customer knows where to look.
  • Do not grant access from the error. Access appears after redemption with the new link.
Match the errorSwift
// Swift
do {
  let result = try await Purchases.shared.purchase(package: package)
} catch let error as ErrorCode where error == .expiredWebPurchaseToken {
  // handle expired web purchase token
}

On RevenueDot: RevenueDot answers HTTP 400 with code 7853 and purchase_redemption_error_info.obfuscated_email when the link is past redemption_link_hours (24 by default) or was replaced by a newer one. It emails a fresh link to the buyer, at most once an hour.

FAQ

expiredWebPurchaseToken: questions people ask

What is RevenueCat error 7853?

Backend code 7853 means the web redemption link expired. The iOS SDK reports it as expiredWebPurchaseToken (code 41), with an obfuscated email, and the Android SDK as purchaseInvalidError.

Does the customer get a new link when theirs expires?

On RevenueDot, yes. The server emails a fresh link to the buyer when someone opens an expired one, at most once an hour.

How do I check for expiredWebPurchaseToken in React Native and Flutter?

The React Native PURCHASES_ERROR_CODE enum in the SDK source has no member for it, so compare error.code with the string "41". In Flutter, convert the PlatformException with PurchasesErrorHelper.getErrorCode(e) and compare the result with PurchasesErrorCode.expiredWebPurchaseToken.

Get started

Keep the RevenueCat SDK. Change the backend.

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