In the old verifyReceipt endpoint doc, there is an important desc
As a best practice, always call the production URL
https://buy.itunes.apple.com/verifyReceipt
first and proceed to verify with the sandbox URL if you receive a21007
status
code. Following this approach ensures that you don’t have to switch between URLs while your app is in testing, in review by App Review, or live in the App Store.
So I can know the transactionId is for sandbox if return back 21007
.
And I am about to access to new App Store Server API, so the same, I wonder how can I recognize the transactionId is from sandbox by status code?
The most likely desc is this:
If you don’t have environment information, follow these steps:
- Call the endpoint using the production URL. If the call succeeds, the original transaction identifier belongs to the production environment.
- If you receive an [errorCode
4040005
] witherrorMessage
asOriginalTransactionIdNotFoundError
, (or HTTP response code404
from the Send Consumption Information endpoint), call the endpoint using the sandbox environment.- If the call succeeds, the original transaction identifier belongs to the sandbox environment. If the call fails with the same error code, the original transaction identifier isn’t present in either environment.
And I have a try for Get Transaction Info API, but actually get 4040010, Transaction id not found.
as return.
So I just wanna clear that is there any doc clarify this point that I miss?
Looking forward to your response, sincerely!! :)