Stripe webhook not firing
Last verified:
The fix
Stripe webhook not firing: Checkout can succeed while your server never gets the event. Point the endpoint at the deployed URL and return 200.
- 1
Forward events locally
Install the Stripe CLI and run it while the app is up. Use the
whsec_it prints asSTRIPE_WEBHOOK_SECRETfor local requests. Trigger a test event instead of guessing.stripe listen --forward-to localhost:3000/api/stripe/webhook stripe trigger checkout.session.completed - 2
Point the Dashboard endpoint at the deployed route
The URL must be
https, include the path, and belong to the deployment that is actually running. Update it when the path changes. Test mode and live mode have separate endpoints and separate secrets. - 3
Subscribe to the event you handle
If the code switches on
checkout.session.completed, that event has to be selected on the endpoint. An endpoint subscribed only topayment_intent.succeededwill not deliver the session event. - 4
If the delivery is a 3xx, register the URL that does not redirect
In Workbench, open the endpoint and the event delivery. A
307,308, or any3xxmeans Stripe stopped before your handler. POST the endpoint URL and read the first status and thelocationheader. Point the Dashboard endpoint, in the same mode, at that finalhttpsURL, including the path and the slash form that does not redirect. The site can keep sendingwwwto the apex. The webhook has to use the host that already answers. Resend one event and confirm a2xx.curl -sI -X POST https://example.com/api/stripe/webhook curl -sI -X POST https://www.example.com/api/stripe/webhook - 5
Read the delivery in the Dashboard
Open the event and look at the response code and body. A 400 usually means signature verification. A 500 means your handler threw before it saved. Return 2xx only after the write succeeds, so Stripe retries when the write fails. Do not return 200 from an empty catch.
Why it happens
Stripe sends webhooks to a public HTTPS URL. Your laptop is not that URL unless the Stripe CLI is forwarding. A Dashboard endpoint pointing at the wrong path, the wrong mode, or an old preview deployment will show a successful Checkout and an empty database.
Events are also opt-in per endpoint. A test payment does not notify a live endpoint. If your handler returns anything outside 2xx, Stripe marks the delivery failed and retries. That looks like “the webhook never arrived” if you only watch the database.
A 307 or 308, or any other 3xx, is the same failed delivery. Stripe does not follow redirects. The usual ones are host rules, not your handler: www against the apex, http against https, or the trailing-slash form Next.js redirects to the other. Register the URL that already answers. A 400 that mentions the signature is a different page.
The next error you'll probably hit
Once this is fixed, the usual follow-up is No signatures found matching the expected signature for payload. No signatures found matching the expected signature for payload. Pass the raw body and this endpoint's whsec_ to constructEvent.
Prompt to paste back into your AI tool
Paste this above the error.
Stripe Checkout succeeds and our database never updates. We expect checkout.session.completed at /api/stripe/webhook. Do not mark the order paid from the success_url alone. Do not skip signature verification. 1. Say whether this environment needs the Stripe CLI forward or a Dashboard endpoint, and which whsec_ to use. 2. Confirm the endpoint is in the same mode as the Checkout key and is subscribed to checkout.session.completed. 3. Make the handler verify the signature, write the result, and return 2xx only after the write. Return 500 if the write fails so Stripe retries. 4. Show the route diff only.
Common questions
+The success page loaded. Is the payment recorded?
The success URL means the browser returned from Checkout. Your source of truth is the webhook, or a server-side retrieve of the session. Do not trust a query param the user can edit.
+Stripe shows the event as delivered with a 200, and the database is empty. Why?
The handler returned 200 before the write, or it wrote to a different database than the one you are looking at. Log the event id and the write result. Return 500 when the write fails.
+The route works when I open it in the browser. Why does Stripe say it redirected?
The browser followed the redirect and showed you the final page. Stripe stops at the first 3xx and marks the delivery failed. Register the URL in the location header, not the one you originally typed.
+Will turning off the www redirect fix it?
The site can keep redirecting www to the apex, or the other way around. Stripe's endpoint has to be the host that already answers, so the webhook request itself is not the request that gets redirected.
Related errors
- No signatures found matching the expected signature for payloadNo signatures found matching the expected signature for payload. Pass the raw body and this endpoint's whsec_ to constructEvent.CursorLovableBoltStripeNext.jsNov 4, 2026
- No such price: wrong Stripe modeNo such price: that price_ id is from the other Stripe mode, or the code sent a product id. Copy a price from the same mode as the secret key.CursorLovableBoltStripeNext.jsOct 14, 2026
- you must provide a return_urlyou must provide a return_url. Stripe will not confirm a PaymentIntent that might redirect the customer until confirmPayment gets an absolute return_url. Cards-only, with no redirect methods, is the other setting.CursorLovableBoltStripeNext.jsOct 27, 2026