21007 Status Code being returned by Sandbox Verify Receipt Endpoint

We have an issue with validating in-app purchases which just seemed to start occurring today. When you send a sandbox receipt to the production endpoint (https://buy.itunes.apple.com/verifyReceipt), it returns the status code 21007 with the message.

This receipt is from the test environment, but it was sent to the production environment for verification.

This is documented here:
https://developer.apple.com/documentation/appstorereceipts/status

It is then advised to attempt this receipt on the sandbox endpoint (https://sandbox.itunes.apple.com/verifyReceipt) due to the status code returned.

We have used this successfully for about a year now. We check the status code and if it is 21007, we then try the sandbox endpoint. As of today, we started seeing that the sandbox endpoint is returning a 21007 status code which does not make sense and threw our API into a recursive loop since it kept seeing that status and kept trying the sandbox endpoint. This status code is clearly wrong as it was not 'sent to the production environment' in these cases and this status code has never been returned in the past from the sandbox endpoint.

Is this a bug introduced by Apple as of today or has something changed that I have not seen the documentation for?

Accepted Reply

it's working now

Replies

I came here to ask the same questions. My IAP's were working when my app got approved a few days ago, but now they're failing. I'm getting code 21007 when I try to verify my receipts, and I'm getting this error on both endpoints, which shouldn't be possible.
Hi,

Same problem here - IAP was working fine a few hours ago, and suddenly the endpoint fails to verify receipts.

Hopefully, Apple will fix this for us soon.
I think it's fixed now!
I have same problem here, IAP was working fine yesterday,and now, I am getting code 21007 when i verify my receipts.
I noticed this issue too but it resolved by now. Has it resolved for you as well?
Still, the question remains how that can happen, how to handle it on the dev side (if possible) and how reliably the status codes are.
the problem is still there, I can't verify my receipts, the system returns 21007 from both addresses, production and sandbox.
The problem is still there too!
same here, 21007 return
Our team met this issue today too.
Same here! The sandbox endpoint returns 21007
We are facing the same issue, Any fix ?
Same here! A curl request to verify endpoint is succeeding on my machine, after initially throwing 21007 5-6 times. But it is still throwing 21007 when the curl request is made from my teammate's laptop.
Same here!
Same here!
We've suddenly started noticing this failure in both test & production env. I'm sure that we are not validating the receipts in the wrong env for verification: the production receipts are being sent to our production servers from customers' devices using apps distributed from AppStore, which cannot generate receipts for test env. The test receipts are generated by apps signed with ad-hoc certs and doing sandboxed purchases, and being sent and verified on our servers in test env.

The exact same code/config in both places was working perfectly yesterday and started failing today. This is hurting our signups (revenues), as well as our development cycle.

Please fix it quickly, Apple!