#celine-billing-event
1 messages ยท Page 1 of 1 (latest)
it should be subscription_create, do you have an example event ID that I can check
here it is: evt_1JcnySHK9WuDN2ZRBg4PMLnj
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
but at invoice.created the payment is not yet sure to push through so I should not set that payment method as the default.
right
event_id: evt_1Jd7IrHK9WuDN2ZRL9v90tIG
event_type: invoice.created
"billing_reason": "subscription_update",
also for invoice.created billing_reason is subscription update ๐
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
Great! sounds good. You'll have to update the docs too
https://stripe.com/docs/billing/subscriptions/elements#default-payment-method
here it says listen to the invoice.payment_succeeded which may send billing_reason=subscription_create
Thank you!
np, thank you for reaching out
@bleak echo ok my teammate is here to rescue me and actually the reason why it is subscription_update and not subscription_create is because of this API change
https://stripe.com/docs/upgrades#2018-10-31
ah i have to change my api version
right. your account default API version is 2016-06-15 which is before the change
thank you. ๐