RevenueCat/purchases-ios

Invalid receipt on production (No sandbox)

Closed this issue · 4 comments

Describe the bug
A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue. Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

  1. Environment

    1. Platform: ios
    2. SDK version: 4.41.2
    3. StoreKit version:
      • StoreKit 1
      • StoreKit 2 (enabled with usesStoreKit2IfAvailable(true))
    4. OS version: 17.5.1
    5. Xcode version: 15.2
    6. Device and/or simulator:
      • Device
      • Simulator
    7. Environment:
      • Sandbox
      • TestFight
      • Production
    8. How widespread is the issue. Percentage of devices affected. -> 3 users today at 9 a.m UTC
  2. Steps to reproduce, with a description of expected vs. actual behavior
    The user tries to purchase, and seem it has purchased but doesn't work.


  1. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)
Key Value for this event
nserror-code 8
nserror-domain RevenueCat.ErrorCode.RevenueCat.ErrorCode, 8
NSLocalizedDescription The receipt is not valid. The purchased product was missing in the receipt. This is typically due to a bug in StoreKit.
NSUnderlyingError Error Domain=RevenueCat.BackendErrorCode Code=7712 "The purchased product was missing in the receipt. This is typically due to a bug in StoreKit." UserInfo={NSLocalizedDescription=The purchased product was missing in the receipt. This is typically due to a bug in StoreKit., rc_backend_error_code=7712}
rc_backend_error_code 7712
rc_response_status_code 422
readable_error_code INVALID_RECEIPT
source_file RevenueCat/HTTPClient.swift:699
source_function parseUnsuccessfulResponse()
SwiftError RevenueCat.ErrorCode, 8

PurchasesOrchestrator.swift - Line 418
closure in PurchasesOrchestrator.purchase(sk1Product:payment:package:wrapper:completion:) + 418

  1. Additional context
    Add any other context about the problem here.

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

Hi @jesus-mg-ios, in production this error just means Apple won't accept the receipt because something is wrong with it. It could be due to something like a jailbroken device, or there could be a genuine error. Either way, this is an error that Apple's returning and there's not much we can do about it SDK-side.

One thing you can try is to delete the user from RevenueCat, you can do this either from the dashboard or via the REST API. Then, have the user delete and reinstall the app and attempt to purchase again. This should resync them with our servers and could clear the error.

As information, the device is not jailbroken, I can assure that because we have a check.
Would be great don't manage each case manually.

Hi @jesus-mg-ios,
Thanks for the additional information - the example of a jailbroken device is just a possibility, among others. As Ryan said, we don't have much insight into why this receipt was not accepted beyond the fact that it is invalid or malformed. As long as your configuration is correct (bundle ID and shared secret set correctly), the best next step is to retry syncing the receipt.
I'm going to close out this Issue but if you'd like to continue discussing the error, I'd recommend opening a support ticket from your RevenueCat dashboard.