The error
Stripe webhook signature verification failed
Quick answer: Stripe webhook verification could not confirm that the received payload and signature match the signing secret used by the webhook endpoint.
What this error means
Stripe webhook verification could not confirm that the received payload and signature match the signing secret used by the webhook endpoint.
Start with the first application-owned file, operation, request, query, plugin, or component identified by the error. Fix the underlying failure before changing unrelated parts of the application.
Common causes
- The webhook signing secret belongs to a different endpoint.
- A test-mode and live-mode configuration are mixed.
- The request body was parsed or modified before signature verification.
- The Stripe-Signature header is missing or incorrect.
- The application is using an outdated or incorrect webhook secret.
Immediate repair pattern
app.post(
'/stripe-webhook',
express.raw({
type: 'application/json'
}),
(req, res) => {
const signature =
req.headers['stripe-signature'];
let event;
try {
event =
stripe.webhooks.constructEvent(
req.body,
signature,
process.env
.STRIPE_WEBHOOK_SECRET
);
} catch (error) {
return res.status(400).send(
'Webhook signature failed'
);
}
return res.json({
received: true
});
}
);
Apply the repair only when it matches the actual runtime condition shown by the complete error and application context.
Do not hide the root cause
Do not disable verification simply to make the webhook appear to work. Verify against the correct endpoint secret and the request body expected by the Stripe SDK.
Repair checklist
- Capture the complete error and stack trace.
- Identify the first application-owned location or resource involved.
- Confirm the runtime value, state, response, or configuration reported by the error.
- Apply the smallest repair that addresses the actual cause.
- Retest both the successful path and the original failing path.
- Confirm the original error no longer occurs.
Still getting the error?
Paste the complete error and stack trace into 0-69. The matching repair engine can classify the failure and prepare specific repair steps and copy-ready code for the detected pattern.
Analyze My Stripe ErrorReference: Official platform documentation