Webhook signature verification failed. No signatures found matching the expected signature for payload
On this page
Short answer
One of the three inputs to constructEvent() is wrong: the raw body, the Stripe-Signature header, or the endpoint secret. Stripe says the wrong endpoint secret is the most common cause. A framework that parses or changes the body before your code checks it also causes this error.
Stripe Payments That Work Pack
Webhook setup, signature checks, test and live mode, and customer portal setup.
Secure checkout by Stripe
One-time payment through Stripe. Priced in USD. Local taxes such as UK VAT may be added at checkout.
The exact error you'll see
In your server or function logs, as Stripe's docs show it:
Webhook signature verification failed. Err: No signatures found matching the expected signature for payload.
Source: https:/
The full stripe-node message continues:
No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
Source: https:/
If the body arrived as a parsed object, stripe-node throws a different message:
Payload was provided as a parsed JavaScript object instead.
Source: https:/
In the Stripe Dashboard, the delivery shows as Failed under Workbench → Webhooks → your endpoint → Event deliveries.
Applies to
- stripe-node
stripe.webhooks.constructEvent() - Next.js App Router route handlers, Next.js Pages Router API routes, and Express
- The endpoint signing secret (
whsec_...), stored asSTRIPE_WEBHOOK_SECRETin Stripe's Next.js example
Why it happens
- Wrong secret. Stripe: "The secret for a CLI-forwarded endpoint is different from the secret for a Dashboard-managed endpoint."
- The body was changed. Some frameworks parse or modify the body "by reordering keys, stripping whitespace, converting to JSON, or changing encoding," which breaks the signature.
- Express middleware order. If
express.json()runs before the webhook route, "it parses the body before signature verification." - A forwarder rewrote the body. stripe-node's message warns that a third-party tool must preserve "the exact request body, including JSON formatting and new line style."
How to fix it, step by step
- In the Dashboard, open Workbench → Webhooks, open the live endpoint and click Reveal secret. If you're testing locally with
stripe listen, use the secret printed in the terminal instead. Both start withwhsec_. - Put that value in your host's production environment and redeploy.
- Print the secret your code actually loads (in a log you then delete) and compare it with the Dashboard value.
- Pass the raw body:
- Next.js App Router: Stripe's example passes
await req.text()toconstructEvent. - Next.js Pages Router: "Disable bodyParser and use buffer(request)."
- Express: register the webhook route before
app.use(express.json()).
- Next.js App Router: Stripe's example passes
- Read the header named
Stripe-Signature. Its value should look liket=xxx,v1=yyy,v0=zzz.
What the docs don't spell out
- A stray newline in the secret breaks it. stripe-node checks the secret for whitespace and appends: "The provided signing secret contains whitespace. This often indicates an extra newline or space is in the value." A trailing newline pasted into a hosting dashboard can cause it. (Webhooks.ts (opens in a new tab))
- Old or replayed events fail even with the right secret. stripe-node's default tolerance is 300 seconds. Older timestamps throw "Timestamp outside the tolerance zone", so a body you saved and replay later will fail. (Webhooks.ts (opens in a new tab))
- Rolling the secret allows overlap. Stripe lets you delay expiry of the old secret by up to 24 hours. During that time it sends one signature per active secret, so you have time to deploy the new value before the old one expires. (Signature docs (opens in a new tab))
How to check it worked
- In Workbench → Webhooks → your endpoint → Event deliveries, open the newest event after your fix. It should show Delivered, and its details show the HTTP status code your handler returned.
- Your logs show the event ID instead of the signature error.
Sources
- https:/
/ : error text, most common cause, Reveal secret, CLI secret, framework table, Express order, header format, Event deliveries, rolling secretsdocs. stripe. com/ webhooks/ signature (opens in a new tab) - https:/
/ : full error messages, whitespace note, 300-second tolerancegithub. com/ stripe/ stripe- node/ blob/ master/ src/ Webhooks. ts (opens in a new tab) - https:/
/ : App Router example usinggithub. com/ stripe/ stripe- node/ blob/ master/ examples/ webhook- signing/ nextjs/ app/ api/ webhooks/ route. ts (opens in a new tab) await req.text()
Related fixes
Tool to consider: Stripe.
Stripe Payments That Work Pack
Webhook setup, signature checks, test and live mode, and customer portal setup.
Secure checkout by Stripe
One-time payment through Stripe. Priced in USD. Local taxes such as UK VAT may be added at checkout.