#llamayama.

1 messages · Page 1 of 1 (latest)

pallid plankBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

tough sleet
#

Hello

#

We recommend listening for checkout.session.completed

#

From there you can retrieve the Checkout Session and expand the Subscription if you are looking for more details about that specific Subscription

#

In erms of renewals, you will want customer.subscription.updated Events

devout scroll
#

Will a invoice.paid event also be fired? Because I Noticed it has a billing_reason which can be subscription_create

tough sleet
#

Yep you could also use that if you so desired.

#

There are different options really

devout scroll
#

Yeah I'm just a bit lost since there seem to be multiple events that can fire for the same action

#

So the recommendation is we use checkout.session.completed for initial purchase, and customer.susbcription.updated for recurring payments?

tough sleet
#

That is what we generally recommend. If you want to just use invoice.paid you could do that too.

devout scroll
#

Okay thank you, another related question is for dealing with changes in the quantity of some subscription item for example, would you also recommend we use customer.subscription.updated?

tough sleet
#

Yep

devout scroll
#

And can we assume the customer.subscription.updated event will only fire if payment was a success?

tough sleet
#

It will fire any time any property on the Subscription object changes.

#

So for renewals for instance the current_period_start will update to the new month (if monthly)

#

Or if a payment fails, then the status of the Subscription would change to past_due

#

So no matter what, upon a renewal, that Event will fire