401 error when validating IAP receipt using App Store Server API before App first release

Hi,

I'm using the App Store Server API for in-app purchase receipt validation. However I received 401 error status code.

  • My app is ready for submit in App Store Connect, but not yet published the first version.
  • The receipt is generated using StoreKit test configuration and follow the Sandbox testing instruction. It is generated on a real device using Sandbox Apple account registered in the App Sandbox tester section.
  • If I go back to use the deprecated verifyReceipt API sandbox endpoint, I get {'status': 21002} error instead.

Is it expected for an App that has not yet published in App Store?

If not, is there any way to test the in-app purchase server-side validation before the App is release?

Could you file and reply with your feedback assistant #? This sounds expected but we will need to verify. Providing in the ticket the app ID #, the base64 encoded app receipt, sandbox Apple ID and the verifyReceipt response will be very helpful. Thanks.

Why wouldn't you share the solution publicly @App Store Commerce Engineer ? I'm facing the same issue.

401 error when validating IAP receipt using App Store Server API before App first release
 
 
Q