#tonz18_webhooks
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1292799245320982672
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
You should mainly look out for checkout.session.completed and customer.subscription.created:
whats teh difference between the 2 tho
👋 taking over for my colleague. Let me catch up.
I would generally advise the use of these webhooks when using Checkout+Subscriptions
checkout.session.subscriptionto let your customer know that the checkout flow was done successfullyinvoice.paid(check whether thesubscriptionfield is not null and thebilling_reasonissubscription_create) to fulfill the subscription for your customer
So successful url should take the customer to a pending payment page ( loading page)
not necessarily
Then await for the checkout session subscriptions webhook to confirm payment
if you're listening to the checkout.session.completed event the hosted checkout page will wait for a 200 HTTP response from the webhook endpoint to that event before redirecting to the success page https://docs.stripe.com/checkout/fulfillment#:~:text=When you have,quickly as possible.
that doesn't really confirm the payment yet, especially if the payment is an asynchronous payment method such as Direct Debits
so you will receive a checkout.session.completed but the payment itself won't be completed (successful or failed) yet
that's why listening to invoice.paid is the best way to make sure that the subscription invoice has been paid and you can proceed to fulfill the subscription for your customer