I'm confused about why Stripe's documentation suggests the customer.subscription.updated
event is not fired when I believe it should:
- A Stripe
subscription
object has the propertiescurrent_period_start
andcurrent_period_end
which would be updated whenever the customer successfully pays a subscription's invoices ( https://stripe.com/docs/api#subscriptions ) The documentation for the
customer.subscription.updated
event states that it...Occurs whenever a subscription changes. Examples would include switching from one plan to another, or switching status from trial to active.
...which would imply that the event would be raised if the
current_period_start
andcurrent_period_end
values change, but it doesn't affirm if it does or it does not in this case.However this third-party webpage states that it is not raised when a successful renewal is performed ( https://www.masteringmodernpayments.com/stripe-webhook-event-cheatsheet#8 ).
But raising the event just makes sense...
- And certainly if applications only needed to monitor a single event type (i.e.
customer.subscription.updated
) then it would greatly simplify program code without needing to also monitorinvoice.payment_succeeded
,invoice.created
andcharge.succeeded
. - However the documentation for the Subscription Lifecycle ( https://stripe.com/docs/subscriptions/lifecycle ) makes absolutely no mention of the
customer.subscription.updated
event at all.
It just seems odd that such an appropriate event is not raised when it should be. The documentation also really doesn't say when the current_period_end
and current_period_start
values are updated either, which limits their utility.
So in my application, after receiving an invoice.payment_succeeded
event, how can my program code determine when the customer's subscription period will end next?