Hello everyone.
I encountered a problem when integrating Apple Pay. I obtained all the renewal orders through the Apple interface, and their purchaseDate is 8 hours later than the actual payment time. Why is this happening?
According to the documentation, the purchaseDate value provided by Apple is a millisecond timestamp that represents the actual payment time of the user, so theoretically there shouldn’t be any timezone issues.
This works well in client-initiated subscriptions, but in renewal scenarios, the purchaseDate becomes unreliable. Could this be due to some configuration in the configuration center?
For example, I actually received an Apple notification at 1746686911000 (2025-05-08 06:48:31 Etc/GMT).
However, the data returned by the Apple interface is as shown below:
{
"appAccountToken": "xxxx",
"bundleId": "xxxx",
"currency": "GBP",
"environment": "Production",
"expiresDate": 1762616831000,
"inAppOwnershipType": "PURCHASED",
"isUpgraded": false,
"offerDiscountType": "",
"offerIdentifier": "",
"offerType": 0,
"originalPurchaseDate": 1746456432000,
"originalTransactionId": "320002311698411",
"price": 39990,
"productId": "xxxx",
"purchaseDate": 1746715631000,
"quantity": 1,
"revocationDate": 0,
"revocationReason": 0,
"signedDate": 1746687092825,
"storefront": "GBR",
"storefrontId": "xxxx",
"subscriptionGroupIdentifier": "xxxx",
"transactionId": "320002315815857",
"transactionReason": "RENEWAL",
"type": "Auto-Renewable Subscription",
"webOrderLineItemId": "320001062124562"
}
You can see that the purchaseDate is 1746715631000 (2025-05-08 14:48:31 Etc/GMT), which is even later than the current time.
Can someone explain this behavior that is inconsistent with the documentation, or did I do something wrong?
I would be very grateful for any help anyone can provide.