I’m trying to keep a everyday history of the user, so I use webhook to determinate when is on trial, optout, billing issue, normal, renew, etc.
I’m seeing some events from the future, for example I received an event that is a renewal trial convertion today at 8 PM, when we receive the event we fetch RevenueCat API, and it indicates that the user purchase date is tomorrow at 4 AM.
This information is also like that in the webhook event itself:
"event_timestamp_ms": 1633207743275, → Saturday, 2 October 2021 20:49:03.275
"purchased_at_ms": 1633233485000, → Sunday, 3 October 2021 03:58:05
The thing is now I’m setting on our internal db that the Saturday, 2 October the user change from trial to normal subscription with a purchase the date Sunday, 3 October.
Now I don’t know when the user actually paid or when is a normal subscription.
We could write that all was done the Sunday, 3 October, the thing is that at midnight I make a snapshot of the last state of the user that day, then I would be losing the information for Sunday, 2 October.
Why do we receive future transactions? is there a way we can avoid this and receive them when they actually happen? I can understand delay transactions, but this is not the case
I hope to explain myself.
Best answer by tinaView original
This is due to the way Apple’s transaction queue works. Apple does try to charge customers up to 24 hours before the expiration and RevenueCat will dispatch the event once we receive the information from Apple. This is the reason why Apple recommends customers to opt out of renewal at least 24 hours before the set expiration date. Apple Support article for reference: https://support.apple.com/en-us/HT202039