SecureStartKit
SecurityFeaturesPricingDocsBlogChangelog
Sign inBuy Now
Home/Glossary/Stripe webhook signature verification
Payments

Stripe webhook signature verification

Also known as: stripe webhook verification, Stripe-Signature header verification, constructEvent

Definition

Stripe webhook signature verification is the HMAC-SHA256 check that proves a webhook payload came from Stripe and was not modified in transit. The Stripe-Signature header carries a timestamp and signature; the receiver recomputes HMAC over the raw body with the endpoint secret and compares.

What is Stripe webhook signature verification?

When Stripe sends an event to your webhook endpoint, it signs the request with HMAC-SHA256 over {timestamp}.{raw_body} using your endpoint secret. The signature lives in the Stripe-Signature header. Your handler recomputes the same HMAC and rejects the request if signatures don't match.

How is verification done in Next.js App Router?

Read the body as raw text first: const body = await request.text(). Never call request.json() before verification, which consumes the byte stream and produces different bytes when re-serialized. Pass the text body, the Stripe-Signature header, and your endpoint secret to stripe.webhooks.constructEvent, which handles the timestamp check (default 5-minute tolerance), the v1-only scheme check, and the HMAC comparison.

What are the common verification failures?

Five patterns account for almost all failures: framework parsed the body before verification, JSON.parse plus stringify changed the bytes, timestamp exceeded the 5-minute tolerance, wrong endpoint secret (test vs live), and accepting the fake v0 test signature scheme in production. Each shows up as the same opaque "No signatures found matching" error.

Learn more

  • Stripe Webhook Signature in Next.js: 5 Failure Modes
  • Free Stripe Webhook Verifier
  • Unverified Stripe Webhook Signature: the fix
  • Duplicate webhook events: the idempotency fix

Related terms

  • IdempotencyIdempotency is the property that running an operation multiple times produces the same result as running it once. For Stripe webhook handlers, idempotency means storing every processed event.id in a unique-constraint table so retries (Stripe retries failed deliveries for up to 3 days in live mode) cannot duplicate purchases or emails.
← Back to full glossary
SecureStartKit

The security-first Next.js SaaS template. Auth, payments, and everything you need to launch - with backend-only data access, Zod validation on every input, and built-in optimization for AI coding agents.

Summarize with AI

Product

  • Security
  • Features
  • Pricing
  • FAQ
  • Docs
  • About

Use Cases

  • For Indie Hackers
  • For Solo Developers
  • Fintech SaaS
  • Internal Tools
  • Healthtech SaaS

Free Tools

  • All Tools
  • RLS Policy Generator
  • Security Checklist
  • Security Headers
  • JWT Decoder
  • JWT Generator
  • CORS Config Generator
  • JSON to Zod Converter
  • API Key Generator
  • Stripe Webhook Verifier
  • Stripe Fee Calculator
  • SaaS Pricing Calculator
  • Tech Stack Costs
  • OG Image Preview

Compare

  • All comparisons
  • vs ShipFast
  • vs Makerkit
  • vs Supastarter
  • vs Divjoy
  • vs Nextbase
  • One-time vs subscription

Resources

  • Blog
  • Glossary
  • Security Patterns
  • Changelog
  • Contact
  • Privacy
  • Terms

More from the same maker

  • AppScreenshotStudio
  • QueryScope
  • FrictionScope
  • MCP Hunter
  • BookIllustrationAI
  • MyCVCraft
  • StyleMyFade

© 2026 SecureStartKit. All rights reserved.

Built with SecureStartKit