Hello!
I’m currently implementing a job for application that has 2 use cases.
- Determine all users who have been ADDED to an entitlement this week
- Determine all users who have been REMOVED from an entitlement this week
The entitlement in question is a monthly subscription to one of our premium features, and I have to manually make a report of all users who were added / removed from this subscription / entitlement, so we can manually turn on/off this premium feature for them.
(But NOT a user who successfully renewed their subscription this cycle and therefore isn’t added or removed, just continuing their subscription)
We store a lot of information from revenue cat:
- All the webhooks we receive
- All of the information from the Get or create subscriber endpoint
My first stab at attempting to do this is looking at all the webhook events a user has received in the past week. And seeing if they have an: initial_purchase, expiration, renewal, cancelation, un-cancelation, ect. and determining if they have been added/removed from those events.
This approach is becoming more complicated than I anticipated, there are a lot of edge cases to manage:
- Cancelation / un-cancelation
- does this mean their subscription is good until the end of the billing cycle? Ect.
- Renewal
- Does this mean they are just continuing their subscription from last month, or did they resubscribe after a cancelation? ect.
- Ect. Ect.
I was wondering if anyone has seen this type of use case before and how the best approach to implementing this?
I’m starting to think that using the information from our subscription or entitlement tables will be more manageable? Maybe use the expires_date on the subscription or entitlement to determine if the user has lapsed on their entitlements?
Happy to provide more info or details if needed about this - Thanks in advance!