FWIW the grace period is set to 3 days in Play Console so I was expecting some time to pass between CANCELLATION and EXPIRATION.
Thank you
Hey @vic-a563d7 !
This is expected in the case of billing issues. If a subscriber with an active subscription encounters a billing issue, RevenueCat will immediately dispatch a BILLING_ISSUE
event and a CANCELLATION
event with a cancel_reason
of BILLING_ERROR
.
If you do not have grace periods enabled, you’ll immediately receive an EXPIRATION
webhook and the subscriber’s entitlements will be revoked. If you do have grace periods enabled, the subscriber will retain entitlements as the app store retries the subscriber’s billing method. At the end of the grace period, if billing has not been successful, an EXPIRATION
event will be sent and entitlements will be revoked. If billing succeeds at any point during the grace period, you’ll receive a RENEWAL
event and entitlements won’t be revoked. (This RENEWAL
event may show up before the billing issue in the Customer History timeline. Be sure to check the timestamps on the event pages.) It’s important to note that the BILLING_ISSUE
, CANCELLATION
, and EXPIRATION
(if no grace period is involved) webhooks are dispatched in order at the same time, so it is unlikely but possible to receive these events in a different order than described here due to network irregularities.
While similar, there is a difference between cancellation and expiration events. Cancellation events happen when a subscription or non-renewing purchase has been cancelled or refunded. See cancellation reasons for more details. Expiration events in most cases come after the cancellation event and the cancellation can be seen as a trigger for these expiration events to occur.
Mainly, which event tells me to remove the extra paid features for the user?
According to the docs, sounds like EXPIRATION is the only one to remove user functionality and not CANCELLATION? Would CANCELLATION ever come alone with nothing after?
Cancellation events could come without an expiration immediately in a couple of cases but to keep things simpler on your end I would recommend waiting for the expiration event to make sure that you revoke the features and that can be the designation that a user is truly expired.
Let me know if that helps!
yes this helps thank you @Michael Fogel !
Hi @Michael Fogel @Jens ,
As mentioned in the above comment and also in this doc (https://www.revenuecat.com/docs/event-flows) in the billing issue flow section that if a billing issue is encountered, then the following events happen:-
1. If grace period is enabled, then billing issue and cancellation event is dispatched simultaneously and when the grace period ends, then expiration event is dispatched immediately.
2. If grace period is not enabled, then billing issue, cancellation and expiration is dispatched immediately.
I have been testing the events in the sandbox environment for two products I created in play console in which I enabled grace period in one of them and disabled in the other one and I bought the subscription successfully and then I chose the test card always decline option before renewal to test the billing issue events. I observe that billing issue and cancellation event is dispatched in both scenarios but the expiration event is dispatched exactly after 10 mins if I don’t enable grace period and is dispatched exactly after 15 mins if I enabled the grace period. My whole concern is that I don’t get any events when the grace period ends. As per docs, an expiration event should have been dispatched immediately when the grace period ends if any but I don’t see it happening in the sandbox environment.
I have attached the screenshot(when grace period is not enabled) and all the screenshot shows the timestamp of the events at the top right corner. The expiration event is sent 10 minutes later after the billing and cancellation event is sent. This 10 minutes is equivalent to 30 days of account being put to hold in real transactions. I have a use case where I need to update the custom claim of the user when the grace period ends but I don’t receive any events for it. Ideally as per docs, expiration event should have been received but it’s not happening. Please look into the issue and let us know if this issue is specific to the sandbox environment only or if this will happen when real transactions are done.
Regards,
Abhishek