Skip to content
Web Design & Development

A Practical Guide to Webhooks

HTTP requests one system sends to another when an event happens, such as a payment succeeding or an order shipping, so the receiving system can react immediately.

Marcus Adeyemi Technical Director 2 min read 21 views
A Practical Guide to Webhooks

What is at stake

Webhooks connect stores, payment providers and business tools, and unverified or unreliable handlers cause missed orders and security holes.

The playbook

  1. Verify webhook signatures
  2. Process events idempotently using event IDs
  3. Acknowledge quickly and do heavy work in background jobs
  4. Log received events for troubleshooting
  5. Monitor failed deliveries in the provider dashboard

Where it goes wrong

Avoid:

  • Trusting unverified webhook requests
  • Long processing before responding
  • Assuming events arrive exactly once and in order
  • Exposing webhook endpoints without any authentication
What to do and what to avoid with webhooks, side by side
Good practice against the usual mistakes, from the sources listed below.

The numbers behind it

Published figures for Webhooks
MeasureFigure
Verificationproviders such as Stripe sign webhook payloads so receivers can verify them
Retriesproviders retry failed deliveries, so handlers must tolerate duplicates
Idempotencyprocessing the same event twice should have no extra effect
Responsehandlers should return a 2xx status quickly

Getting outside help

When to hand it over: Bring in help when orders or payments go missing between systems, or when building integrations with several providers.

Where this comes from

The figures and practices above come from the sources listed.

Working on something like this?

We take on Web Design & Development work for teams who want it done once, properly. Tell us what you are building and we will tell you honestly whether we are the right studio for it. Start a project.

Where to go next

Spotted something wrong? Report an error on this page. We correct on the page and say what changed.

All services

The work behind this article, and what it costs.

Marcus Adeyemi

Builds and maintains the web work. Writes about front-end architecture, performance, accessibility and the unglamorous parts of keeping a site alive.

Keep reading

More in Web Design & Development