#Sam_Praveen-subscription

1 messages · Page 1 of 1 (latest)

patent gyro
#

Hello! What question do you have here? Are you asking which webhook event to listen for?

placid nacelle
#

Yes

patent gyro
#

Gotcha - you'll want to listen for the customer.subscription.updated event and/or the invoice.paid event

placid nacelle
#

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.

patent gyro
#

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)

placid nacelle
#

Ok so should we use "customer.subscription.updated" event and "invoice.paid" event together or only one?

patent gyro
#

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

placid nacelle
#

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.

merry yarrow
#

Which 2 Events are you referring to?

placid nacelle
#

First one is "customer.subscription.updated" and second one is "invoice.paid".

merry yarrow
#

Ah! Okay. I think probably the best association between the two is going to be the Subscription ID

placid nacelle
#

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?