Guide
No signatures found matching the expected signature for payload
How this guide was made: Written with AI assistance and checked against the sources linked on this page.
Updated
Short answer: Stripe returns this when it cannot verify a webhook. The check needs three inputs: the exact raw request body, the Stripe-Signature header, and the signing secret of that endpoint. If one of them differs, the check fails. Fix the body first, then compare the secret with the endpoint in the Stripe dashboard or CLI.
What does it mean?
Stripe signs each webhook event and sends the signature in the Stripe-Signature header. Your server recomputes the signature from the body and the endpoint secret, and rejects the request when they do not match. The Stripe troubleshooting page gives the full message as "Webhook signature verification failed. Err: No signatures found matching the expected signature for payload." It says that at least one of the three parameters you passed is incorrect. The message does not name which one, so check each of them.
Which cause is it?
| What you see | Cause | Fix |
|---|---|---|
The error starts after you added a body parser, or the webhook route sits below express.json() | The body was parsed as JSON before verification | Read the raw body on the webhook route and verify that string |
The webhook works with stripe listen, but fails on the live site (or the other way round) | The secret belongs to another endpoint or mode | Copy the secret of the endpoint that receives the events |
| The check passes in a plain test but fails behind a framework or gateway | Something changes the body before your code reads it | Read the body before the change, or remove the change |
Cause 1: The body is parsed as JSON before verification
Stripe requires the body exactly as it was sent. The troubleshooting page says the request body "must be the exact UTF-8 string Stripe sent, without any modifications", and that some frameworks change it "by reordering keys, stripping whitespace, converting to JSON, or changing encoding". The stripe-node README says the raw body must be passed "this will not work with a parsed (i.e., JSON) request body".
- Find the route that receives the webhook.
- In Express, give that route the raw parser:
express.raw({ type: 'application/json' }). - In Express, put
app.use(express.json())after the webhook route. Stripe notes that Express applies middleware in order, so a parser that runs first changes the body before verification. - In Next.js App Router, Next.js says you do not need
bodyParserthere. Read the raw body before any JSON parsing. - In Next.js Pages Router, disable
bodyParserfor the route and read the body withbuffer(request), as Stripe's example does. - Pass the string, the header value and the secret to the verification call.
app.post('/webhook', express.raw({ type: 'application/json' }), (request, response) => {
const sig = request.headers['stripe-signature'];
const event = stripe.webhooks.constructEvent(request.body, sig, endpointSecret);
});
// Other JSON routes go after the webhook route
app.use(express.json());
Next.js App Router (app/api/webhook/route.ts): read the body as text.
export async function POST(req: Request) {
const body = await req.text();
const sig = req.headers.get('stripe-signature')!;
const event = stripe.webhooks.constructEvent(body, sig, process.env.STRIPE_WEBHOOK_SECRET!);
return new Response(null, { status: 200 });
}
Supabase Edge Function (Deno): use the async call with the Web Crypto provider, as Supabase's Stripe webhook example does.
const cryptoProvider = Stripe.createSubtleCryptoProvider();
const body = await req.text();
const event = await stripe.webhooks.constructEventAsync(
body, req.headers.get('Stripe-Signature')!, Deno.env.get('STRIPE_WEBHOOK_SECRET')!, undefined, cryptoProvider
);
Cause 2: The signing secret is from another endpoint or mode
Stripe says the most common cause is "using the wrong endpoint secret". The secret for a CLI-forwarded endpoint differs from the secret for a Dashboard-managed endpoint. Each event destination has its own signing secret, and both kinds start with whsec_.
- Find where your code reads the secret. The Stripe endpoint-management page uses the environment variable
STRIPE_WEBHOOK_SECRET. - Get the secret of the endpoint that receives your events. For a Dashboard endpoint, open it in Workbench and click Reveal secret. For local testing, copy the
whsec_value thatstripe listenprints. - Put the matching value in your server environment, for the live site the live destination's secret. Do not paste it into code. Stripe's sample code says "Don't put any keys in code."
- Check the value has no extra spaces or line breaks.
- Restart the server. Our suggestion: restart it before you trigger a test event.
STRIPE_WEBHOOK_SECRET=whsec_...
Cause 3: A framework or gateway changes the body
Stripe's examples show two cases. One is a framework parser that runs first, covered in Cause 1. The other is a gateway in front of your code. Stripe's AWS API Gateway example uses a Body Mapping Template to expose the body as rawBody, which is the string to verify. Any proxy, CDN rule or edge function that re-encodes JSON, trims whitespace or changes the character set breaks the check in the same way.
- Check the header. It should contain
t=and at least onev1=entry. Your integration must accept unknown entries. - Check the middleware and gateway between Stripe and your handler. List each body parser, Next.js config setting and API gateway mapping.
- Move the webhook route above any parser, or switch it to the raw method used in Cause 1.
- Use the
payloadentry in theStripe-Signatureheader to diagnose a change. It holds a suffix of the SHA-256 digest of the exact body. Compare it with a SHA-256 of the body your handler received. Do not use this entry to verify the request, because Stripe says it is not signed.
How do I check it's fixed?
- Local test: run
stripe listen --forward-to http://localhost:4242/webhookand copy thewhsec_value it prints intoSTRIPE_WEBHOOK_SECRET. Restart the server, then runstripe trigger payment_intent.succeededin another terminal. The listen output should show a line that starts with[200 POST]. - Live check: open the Stripe Workbench, go to Webhooks, select the endpoint and open the Event deliveries tab. New events should show the 200 status code.
- Missed events: Stripe automatically retries undelivered events for up to three days. You can list events that failed to deliver with the Events API parameter
delivery_success=false. The API returns events from the last 30 days. - Logs: the message "Webhook signature verification failed" should no longer appear in your server logs.
Want it fixed? Our AI agent fixes it in your code for $79 and tests your live app again. If we can't complete your re-check, you get your money back.
FAQ
Can I turn off the check to make the error go away?
No. Stripe warns that "without verification, an attacker could send fake webhook events to your endpoint to trigger actions like fulfilling orders, granting account access, or modifying records." Fix the body or the secret instead.
Is the endpoint secret my Stripe API key?
No. The verification call takes the endpoint secret, which starts with whsec_. The API key is a separate value that the Stripe client uses to call the API.
Which function should I call?
Stripe recommends thin events for new integrations. For thin events, use parseEventNotification(). For snapshot events, use constructEvent().
Should my handler return 400 when the check fails?
Stripe's examples return 400 when signature verification fails, and return 200 after the event is handled. Stripe retries events that do not get a successful response.
Can VibeFix fix it for me?
Yes, for apps built in Lovable or any app whose code is on GitHub. The free check confirms the problem on your live app first. If you want it fixed, our AI agent finds the cause, fixes it in your code for $79 and tests your live app again. See pricing.
Related guides
Sources
- Stripe: Manage webhook endpoints (signature errors, endpoint secret, body frameworks, retries, Event deliveries): https://docs.stripe.com/events/manage-webhook-endpoints
- Stripe: Set up events (signature checking, constructEvent, parseEventNotification, Stripe CLI listen): https://docs.stripe.com/events/set-up-events
- Stripe: Webhooks (stripe trigger; unverified-event warning): https://docs.stripe.com/webhooks
- Stripe: stripe-node README (raw body requirement): https://github.com/stripe/stripe-node
- Next.js: Route Handlers (no bodyParser needed): https://nextjs.org/docs/app/api-reference/file-conventions/route
- Supabase: Stripe webhooks Edge Function example (constructEventAsync, req.text()): https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/stripe-webhooks/index.ts
Last checked: 16 November 2026
VibeFix is independent. Stripe, Supabase and Next.js are trademarks of their owners.
Want it fixed?
Our AI agent fixes it in your code for $79 and tests your live app again. If we can't complete your re-check, you get your money back.
It starts with a free check that confirms the problem on your live app, no account needed.
More guides · Shopify store accessibility · About · Your privacy choices