Intermittent Timeouts and Server Errors When Retrieving Transactions via App Store Server API

Hello,

We operate an app that grants users credits after a successful in-app purchase.

Our current purchase-processing flow is as follows:

A user completes an in-app purchase. Our app or server receives the purchase-related information. Our server sends a transaction verification request to the App Store Server API. After verifying the transaction, our service marks the purchase as completed and grants credits to the user.

However, we are intermittently experiencing connection timeouts and unidentified server errors when retrieving transaction information through the App Store Server API.

One example of the timeout error is:

HTTPSConnectionPool( host='api.storekit.itunes.apple.com', port=443 ): Max retries exceeded with url: /inApps/v1/transactions/330003085668123

Caused by ConnectTimeoutError: Connection to api.storekit.itunes.apple.com timed out. (connect timeout=3)

We also intermittently receive the following error response:

{ "code": 5000001, "message": "An unknown error occurred. Please try again." }

When this issue occurs, the payment may have been successfully completed through the App Store, but our server is unable to immediately verify the transaction. As a result, the user may not receive the purchased credits in our app.

We would appreciate your guidance on the following questions:

What are the common causes of connection timeouts or error code 5000001 when calling /inApps/v1/transactions/{transactionId}? What retry strategy does Apple recommend when these errors occur? Please advise whether there are recommended timeout values, retry limits, or exponential backoff parameters. Is there another reliable method to confirm a completed purchase when the transaction lookup API does not return a response immediately? Does Apple recommend using App Store Server Notifications V2 to process completed purchases asynchronously rather than relying solely on an immediate transaction or receipt verification response? For an app that grants consumable digital credits, which value should be used as the primary identifier for purchase completion and duplicate-grant prevention: transactionId, originalTransactionId, or the information contained in signedTransactionInfo? When a temporary API error occurs, is it recommended to store the purchase as pending and perform transaction verification again from our server until a definitive result is received?

We would appreciate Apple’s recommended implementation approach for reliable transaction verification and recovery, particularly to prevent cases in which a payment is successfully completed but the purchased credits are not granted due to a temporary API communication error.

Thank you.

Intermittent Timeouts and Server Errors When Retrieving Transactions via App Store Server API
 
 
Q