# Stripe webhook: No signatures found matching the expected signature

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/stripe-webhook-signature-failed.html
> Category: Payments | Tools: Cursor, Bolt, Replit, v0 | Published: 2026-10-13 | Updated: 2026-10-13

## The error

StripeSignatureVerificationError: No signatures found matching the expected signature for payload

## Why it happens

constructEvent needs the raw request body exactly as Stripe sent it. Frameworks that parse JSON first (Express json(), Next.js req.json()) change the body, so the signature fails. A wrong webhook secret (CLI secret vs dashboard secret, test vs live) causes the same error.

## How to fix it

1. Read the raw body: in Next.js App Router use await req.text(); in Express use express.raw({type: 'application/json'}) on that route only.
2. Use the whsec_ secret for this exact endpoint and mode (stripe listen prints a different one).
3. Pass the stripe-signature header unchanged.
4. Return 200 quickly and do slow work afterwards.

## Error codes this fixes

- `StripeSignatureVerificationError` (Stripe): https://unbreakmyapp.vercel.app/errors.html#stripesignatureverificationerror

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
My Stripe webhook fails with 'No signatures found matching the expected signature'. Rewrite the webhook route to verify using the raw request body (req.text() in Next.js App Router or express.raw for that route), read STRIPE_WEBHOOK_SECRET from server env, return 400 on bad signatures and 200 after handling checkout.session.completed. Don't parse JSON before verification.
```

## FAQ

### Which secret do I use locally?

The whsec_ printed by stripe listen. In production use the endpoint's secret from the Dashboard.

### Test vs live?

Each mode and each endpoint has its own signing secret.

## Sources (official documentation)

- [Stripe: Verify webhook signatures](https://docs.stripe.com/webhooks/signature)

## Related fixes

- [Stripe webhook returns 401 from a Supabase Edge Function (Missing authorization header / Invalid JWT)](https://unbreakmyapp.vercel.app/fixes/stripe-webhook-401-supabase-edge-function-jwt-verification.html)
- [Stripe email: Your webhook endpoint is failing and will be disabled. How to fix and re-enable it](https://unbreakmyapp.vercel.app/fixes/stripe-webhook-failing-email-endpoint-will-be-disabled.html)
- [Supabase: Edge Function returned a non-2xx status code (how to find the real error and fix it)](https://unbreakmyapp.vercel.app/fixes/supabase-edge-function-non-2xx-status-code.html)
- [App works on localhost but breaks in production: a checklist to find the cause](https://unbreakmyapp.vercel.app/fixes/works-on-localhost-breaks-in-production.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
