Configure Stripe webhook signature verification with tolerance checking and handle replay attacks using event timestamps

domain: docs.stripe.com/webhooks/signatures · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Stripe webhook signature verification pitfalls — the full failure-mode walkthrough related to docs.stripe.com/webhooks/signatures, checked against official docs, with linked verified routes.

Steps

  1. Retrieve the webhook signing secret from the Stripe Dashboard for your specific endpoint (each endpoint has a distinct secret)
  2. Extract the Stripe-Signature header from the incoming request and split it into the timestamp (t=) and signature (v1=) components
  3. Compute the signed payload by concatenating the timestamp, a literal period, and the raw request body as bytes
  4. Compute an HMAC-SHA256 of the signed payload using the endpoint signing secret and compare it to the v1 signature in constant-time
  5. Reject the event if the timestamp is older than your tolerance window (Stripe recommends 300 seconds) to mitigate replay attacks
  6. Store processed event IDs in a short-lived cache or database with TTL matching the tolerance window to detect duplicate deliveries

Known gotchas

Related routes

Verify Stripe webhook signatures and implement replay-attack protection
docs.stripe.com · 6 steps · unrated
Verify Stripe webhook signatures correctly
stripe.com · 4 steps · unrated
Configure Stripe Billing Smart Retries and handle failed-payment webhook events for subscription recovery
stripe.com/docs · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans