#Vortex
1 messages · Page 1 of 1 (latest)
Hi there
Usually folks create the Customer alongisde their authentication system on their site. So whenever your customers would "login".
In terms of provisioning, you likely want to use customer.subscription.updated which will fire any time anything on the Sub updates, and you want to examine the status property. You can read more about each webhook for Subs here: https://stripe.com/docs/billing/subscriptions/webhooks
Gotcha! That makes sense. So on signup (we're using nextauth), I could have a function trigger, create a Stripe customer, and associate the two together at that point. For any stripe requests going forward, I provide that customer object
Does this include the initial subscription creation as well?
Ah no sorry, you would want customer.subscription.created for new Subs. The customer.subscription.updated would be for renewal provisioning.
Gotcha, so then the flow would be
1.) When user signs up for the site, we also create a Stripe customer for them.
2.) For any Stripe requests (create checkout session) we provide that stripe customer id.
3.) When a subscription goes through, we'll receive via a subscription created event through webhook, and provide authorization/provisioning then (with expire date at the end of the subscription period).
4.) On subscription updated event, we update the provisioning.
Yep pretty much!