I'm trying to build a simple Subscriptions website with three or four different plans using Stripe.
In the application when a user registers, a Stripe Customer ID is assigned. Then, when subscribing to a plan, I'm listening to these webhook events:
customer.subscription.updated || customer.subscription.created
They are triggered every time there's a change in the subscription. Then I check the status property which will tell me if the user is active, incomplete, trialing, canceled, past_due, or unpaid and act accordingly in my database table for users.
This makes sense to me, but Stripe uses invoice event webhooks instead (https://stripe.com/docs/billing/subscriptions/checkout#provision-and-monitor):
- checkout.session.completed
- invoice.paid
- invoice.payment_failed
Should I listen to these events instead? I'm not sure, because, for example, invoice events won't track when a customer changes the plan in the middle of a billing cycle, so I'd have to add the customer.subscription.updated webhook anyways.