#thecoder
1 messages · Page 1 of 1 (latest)
Hi 👋 there are a couple to choose from, what information are you most interested in getting from the event?
customer.subscription.updated is a good option
Just that the invoice is paid, and checking that it is for a subscription
We're licensing time in our application, so when the subscription is renewed we'd like to generate new monthly or annual licenses
If subscription updated is what gets called I believe that should work for us
Haven't experimented with test clocks and using them with webhooks yet
customer.subscription.updated is a good option, and you can check for changes in the current_period_end and current_period_start to detect if the event was generated from the Subscription moving to a new billing period (as opposed to other Subscription changes such as adjusting quantity or changing statuses).
You can also listen for invoice.payment_succeeded which is triggered whenever an Invoice's payment succeeds. That event will contain the associated Invoice object, which will contain the ID of its related Subscription.
Very interesting toby thank you.
Yeah we are using customer.subscription.updated for quantity and/or plan changes atm
but the desired action would be the same for subscription renewal as the subscription quantity being >= the current customer's licenses in our system
Where we just reassign all licenses
Any time, always happy to help!
I'm about to step away, and wanted to make sure before I do, did that fully address your question?
Yes thank you very much 10/10