#celine-billing-event

1 messages ยท Page 1 of 1 (latest)

crystal mauve
#

it should be subscription_create, do you have an example event ID that I can check

bleak echo
#

here it is: evt_1JcnySHK9WuDN2ZRBg4PMLnj

crystal mauve
#

I see, that is an invoice.payment_succeeded event; in order to get the invoice billing_reason as subscription_create, you should listen to invoice.created event instead

#

because,
invoice.created event -> billing reason = subscription_create
invoice.payment_succeeed-> update the invoice / mark subscription as active -> subscription_update will be the billing reason

bleak echo
#

but at invoice.created the payment is not yet sure to push through so I should not set that payment method as the default.

crystal mauve
#

right

bleak echo
#

event_id: evt_1Jd7IrHK9WuDN2ZRL9v90tIG
event_type: invoice.created
"billing_reason": "subscription_update",

also for invoice.created billing_reason is subscription update ๐Ÿ™‚

crystal mauve
#

Hmmm, it is weird, there might be some bug here

#

I think probably Check the subscription has a default_payment_method first and then update it instead of using the billing_reason

#

that is safer for sure

#

I will raise this to the team

bleak echo
#

Thank you!

crystal mauve
#

np, thank you for reaching out

crystal mauve
bleak echo
#

ah i have to change my api version

crystal mauve
#

right. your account default API version is 2016-06-15 which is before the change

bleak echo
#

thank you. ๐Ÿ™‚

crystal mauve
#

np

#

I will need to run and need to archive this thread. feel free to answer any questions in the main channel #dev-help again. My teammate will help you from there