Skip to content

🐛 Redemption Links returning wrong result when trying to redeem the same link twice on two different accounts. #5590

@matthewnaples

Description

@matthewnaples

Describe the bug

Hello, I believe a bug in the Redemption Link behavior either the Swift SDK or in the web billing API. There’s a chance it’s expected behavior, but it’s slightly confusing.

When calling Purchases.shared.redeemWebPurchase(webPurchaseRedemption) on the same redemption link twice with two different accounts,I expect that a WebPurchaseRedemptionResult.purchaseBelongsToOtherUser result to be returned when trying to click the redemption link for the second time on a different account from the original redemption. The actual behavior is that a WebPurchaseRedemptionResult.expired() result is returned.

This was in the sandbox environment. Swift SDK version 5.39.0

Maybe this is intended behavior and is a convenient way for someone to be able to restore purchases when the user does something like deleting the app on their device and there's no remote authentication mechanism in place, but I would expect redeeming it doesn't "expire" it, but "revokes" it in a sense.

Platform

iOS

SDK version

5.39.0

SDK integration method

Swift Package Manager

StoreKit version

StoreKit 2 (default on versions >=5.0.0)

OS version

ios 18.6.2

Xcode version

16.1

Device and/or simulator

Device

Environment

Sandbox

How widespread is the issue

only tried on one or two devices

Debug logs

DEBUG: ℹ️ PostRedeemWebPurchaseOperation: Started
DEBUG: ℹ️ There are no requests currently running, starting request POST /v1/subscribers/redeem_purchase
DEBUG: ℹ️ API request started: POST '/v1/subscribers/redeem_purchase'
DEBUG: ℹ️ API request completed: POST '/v1/subscribers/redeem_purchase' (200)
DEBUG: ℹ️ Web purchase redeemed successfully.
DEBUG: ℹ️ Sending updated CustomerInfo to delegate.
DEBUG: ℹ️ PostRedeemWebPurchaseOperation: Finished
DEBUG: ℹ️ Detected active subscriptions changed. Clearing trial or intro eligibility cache.
DEBUG: ℹ️ PurchasedProductsFetcher: invalidating cache
DEBUG: ℹ️ Serial request done: POST /v1/subscribers/redeem_purchase, 0 requests left in the queue

Steps to reproduce

  1. Go to my Web Payment Link (without attaching an id)
  2. check out.
  3. scan qr code to redeem in the app
  4. It redeems as expected. The subscription is now tied to a custom app ID in my system.
  5. Sign out of my account using Purchases.shared.logOut.
  6. go to my email and click the link to try and redeem in a different account.
  7. The api returns the “expired” result.
  8. I check my email and see another link was sent.
  9. I click the link and (signed into a different account) am granted the entitlement on the different account. The dashboard shows that a purchase transfers from the first user to the second.

Other information

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions