#stefano-subscription
1 messages · Page 1 of 1 (latest)
hi! to clarify, how exactly do customers cancel renewal in your system? Do you call https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end in our API for example?
Hi Karllekko!
I am not a Developer but a Data Analyst but I suppose that the answer to your question is yes if it changes the fields in the subscription item cancel_at_period_end, cancel_at, etc.
it's hard to give an accurate answer then
if you are using cancel_at_period_end then a good approach to start with is to list events on your account filtered to the customer.subscription.updated type https://stripe.com/docs/api/events/list
that gives you a list of recent updates to subscriptions and you can parse from that what changed(there's a previous_attributes field in the data.object field that helps) and give you the information you'd need
This is exactly what I was looking for!
I would do:
- list all events by type customer.subscription.updated
- filter in the previous_attributes field at least cancel_at_period_end
In this way I would have all the subscription renew changes, is it correct?
I found one example:
I think it would be a good start yep