#Sam_Praveen-subscription
1 messages · Page 1 of 1 (latest)
Hello! What question do you have here? Are you asking which webhook event to listen for?
Yes
Gotcha - you'll want to listen for the customer.subscription.updated event and/or the invoice.paid event
I think This Event "customer.subscription.updated" we use when something we change into the Subscription! But, we are not going to update anything in the subscription instead we just need to capture next month's payment information for the current subscription.
We also send that event when the automatically subscription renews (because we have to update things like current_period_start and current_period_end on the subscription)
Ok so should we use "customer.subscription.updated" event and "invoice.paid" event together or only one?
It depends on what information you need/what you care about - like if you are about making sure the invoice is paid, then it's important to listen for invoice.paid, but if you only care about knowing when the subscription renews then customer.subscription.updated has all the information you need
I need to hop off, but if you need anything else @merry yarrow can help you
I think I am clear with this. Thanks for the information.
One question came in my mind! Is there any related Id in both the events? For example if I insert the required details into local database when Subscription Updated and on Invoice Paid I check the last entry into db for the subscription updated and insert few records from Invoice Update in the same entry! I hope you get my point.
Which 2 Events are you referring to?
First one is "customer.subscription.updated" and second one is "invoice.paid".
Ah! Okay. I think probably the best association between the two is going to be the Subscription ID
On the Invoice it is this field: https://stripe.com/docs/api/invoices/object#invoice_object-subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
And the order of these two events change in any case! I mean some times subscription updates first come and then invoice paid and sometimes invoice paid comes and then subscription updated?