#testanib

1 messages · Page 1 of 1 (latest)

halcyon skiffBOT
astral sonnet
#

Hey there

#

This is possible but will take a bit of filtering on your end.

#

You mostly want to use the customer.subscription.updated event here for all cases.

#

But, you can determine a renewal based on the previous_attributes that will be in the customer.subscription.renewal event.

mint rock
#

is the customer.subscription.renewal event only fired when it is a renewing charge? and customer.subscription.updated only after the charge was successful?

astral sonnet
#

Hmm where are you seeing customer.subscription.renewal? That isn't a webhook event we support afaik

#

The customer.subscription.updated event will fire any time anything changes with a Subscription object

mint rock
astral sonnet
#

Sorry, maybe I shouldn't have put renewal in backticks... I refer to a "renewal" as the natural payment that happens when a Subscription cycles.

#

We have no event that will just indicate a renewal.

#

Any time a renewal happens though a customer.subscription.updated event will fire

#

Which will indicate the new billing period

#

This event will also fire when you make other Subscription updates

#

However then the event will contain a lot of other info as well

mint rock
#

alright thanks for the help

mint rock
#

@astral sonnet just want to confirm the subscription updated webhook fires before the charge webhook right? thats how it seems currently from my tests

neon musk
mint rock
neon musk
#

If you specifically need those previous attributes, you'll want the corresponding subscription update event, that's the only place they exist

#

Yes otherwise you'd need to retrieve the subscription and look at the current state, comparing to your latest records of the relevant fields