#simeng
1 messages · Page 1 of 1 (latest)
👋 how may I help?
Greetings. So I have an implementation using stripe's checkout session to create a subscription for the user. After a success payment, as recommended, we rely on listen to the webhooks to handle the product provision process.
So I have a question related to what would be the best practice to handle those async webhooks
- We rely on the checkout session success webhook event to link the subscription with a tenant or user. Since the checkout session is the only entity that can carry a customer identifier
- And we need to create a subscription entity in our DB for that user. Subscrtion data itself does not contains any user-related metadata that can identify the user. So it relies on the checkout session
Since the webhook events are all async. So wondering is there any recommended best practice to handle such a flow?
In short words, I have a situation relying on a checkout session event data to get the target userId. Relying on subscription success data to get subscription details for that user. Those two from the webhooks event perspective are distinct.
take your time, thx
sorry for the delay
we have a very thorough doc about this https://stripe.com/docs/billing/subscriptions/webhooks
would you mind first taking a look and then let me know if you need any more help
sure thing.