#xqprtzcv
1 messages · Page 1 of 1 (latest)
You can use customer.subscription.updated for both since this event will be triggered when a subscription moves from trialing to active
You can also listen for customer.subscription.trial_will_end if you want to be alerted three days before a trial ends
Will I be able to see the change from trialing to active in a single webhook, or do I need to keep track on my end?
Not sure what you mean by that
I guess I meant to say single event
The event payload for customer.subscription.updated will include both a subscription object and a previous_attributes hash so you can see what changed
Great, thank you!
If you haven't already, I recommend playing with test clocks: https://stripe.com/docs/billing/testing/test-clocks
You can use these to create a test subscription and "advance" time to see status changes, new invoices, etc. related to changes to billing cycles
Am I seeing this correctly that customer.subscription.updated is not called when the subscription ends? I need to listen for customer.subscription.deleted as well?
If a customer opts to cancel at the end of the billing period, you should see customer.subscription.updated and customer.subscription.deleted
If a customer opts to cancel immediately, you will only see customer.subscription.deleted
Right now I am only seeing the customer.subscription.updated when I switch to 'cancel_at_period_end': True and then when I advance the test clock I only see customer.subscription.deleted (but not another customer.subscription.updated) at the end of the trial
Right, that makes sense
Ok, so if I want to do something when the trial ends (and subscription has been cancelled), then I need to keep track in my own database? Or is there a single webhook event that I can listen for to identify this situation?
you'll need to keep track of this yourself