Duplicate In-App Order with Different Transaction ID - How is the Second Order Generated?

Description: I am facing an issue with iOS in-app purchases. When a player initiates a payment, Apple returns a successful payment result. However, after a certain interval of time, I receive another payment success callback with a second order. The appaccounttoken for the second order is the same as the initial one, but the platform order number (transactionid) is different from the first result. I have consulted Apple Developer Support, and they have confirmed that both orders are valid. My concern is, how is this second order generated, and what could be the reason behind the difference in the transaction ID?

I would greatly appreciate any insights or suggestions from the community on understanding the cause of this issue and how to handle these duplicate orders correctly. Thank you in advance for your help!

Assuming your purchase is not a consumable, this could be due to calling https://developer.apple.com/documentation/storekit/skpaymentqueue/1506123-restorecompletedtransactions on the device, or simply by the user being signed into multiple devices. https://developer.apple.com/documentation/appstoreserverapi/originaltransactionid will let you know for non-consumables that they all refer to the same purchase, and https://developer.apple.com/documentation/appstoreserverapi/weborderlineitemid will let you know for a single subscription renewal that all these transactions refer to the same purchase. In the subscription case the original transaction id will let you know these purchases are all for the same subscription.

Duplicate In-App Order with Different Transaction ID - How is the Second Order Generated?
 
 
Q