Stripe · sdk · fg-0158

Webhook signature check fails with 'No signatures found matching the expected signature for payload'

If you see No signatures found matching the expected signature for payload, the cause and the fix for Stripe are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
No signatures found matching the expected signature for payloadWorks under stripe listen but fails on the deployed endpoint, or the reversereq.body is already an object when constructEvent runs
Cause
The signature covers the exact raw bytes Stripe sent, so any middleware that parses or re-serializes the body first, such as app.use(express.json()) registered before the route, breaks it. The other common cause is using the CLI whsec secret in production or a Dashboard endpoint secret locally.
Fix
Give the webhook route the raw body and register it before the global JSON parser. In the Next.js App Router read await request.text(). Use the secret that belongs to the endpoint actually sending the event.
Apply
app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => { const event = stripe.webhooks.constructEvent(req.body, req.headers['stripe-signature'], process.env.STRIPE_WEBHOOK_SECRET); res.sendStatus(200); }); app.use(express.json()); // only after the webhook route
Affected
stripe-node with Express, Next.js and other body-parsing frameworks, all versions, checked October 2026
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun