Receive webhooks reliably and verify their signatures

8 steps · about 1 h 19 min · Intermediate

  1. Learn how webhooks push events to your server (reference, GitHub Docs, 5 min)

    Sets out the delivery model you are building for.

  2. Create and test a webhook endpoint for payment events (reference, Stripe, 15 min)

    A full endpoint walkthrough including local testing.

  3. Validate an HMAC SHA-256 signature on each delivery (reference, GitHub Docs, 10 min)

    Shows constant-time comparison with code in several languages.

  4. Reject replayed events using signed timestamps (reference, Stripe, 8 min)

    Adds the tolerance window that stops replay attacks.

  5. Follow the Standard Webhooks signing specification (reference, Standard Webhooks, 15 min)

    Gives a vendor-neutral format for IDs, timestamps and signatures.

  6. Verify payloads against the raw request body (guide, Svix, 8 min)

    Explains why parsed JSON breaks signatures and how to avoid it.

  7. Respond fast and process deliveries in the background (reference, GitHub Docs, 8 min)

    Covers timeouts, queuing and handling redelivery.

  8. Deduplicate retried deliveries by event ID (reference, Shopify, 10 min)

    Shows how a large platform retries and how to ignore repeats.