E-commerce and payments

What is Webhook?

A webhook is an HTTP request a third-party service sends to your server when something happens — a payment succeeding, a subscription renewing, a refund being issued. It is the reliable place to fulfil an order, because it does not depend on the customer’s browser.

Also called: callback URL · HTTP callback

Why it matters more than the redirect

The common pattern in tutorials is to create the order when the customer returns to your success page. In production people close the tab, lose signal, or background the browser — and in a redirect-driven flow that customer has been charged with no order created.

A webhook arrives regardless. The browser redirect should display state; the webhook should create it.

The three things every handler needs

  1. Signature verification, so you only act on messages that genuinely came from the provider
  2. Idempotency — record the event id and make a repeat a no-op, because delivery is at-least-once
  3. A fast response. Do the minimum synchronously and queue the rest, or the provider times out and retries

The bug that appears one month later

Subscriptions fulfil on a different event from one-off orders. A handler that only listens for checkout completion works perfectly until the first renewal cycle, when nobody is watching any more.

Where this is covered in depth

A definition can only go so far. Stripe checkout integration, and the four failure modes nobody tests for covers this properly — 3 minutes, free, no email required.

Who wrote this

Anas Bin Masud builds e-commerce sites and does technical SEO for businesses in the UK, Canada and Pakistan. These definitions come from client work rather than from a content brief — where an entry describes a mistake, it is usually one found on a real site. More about how I work.

Related terms

All 184 terms in the glossary →

Want this handled rather than explained?

Send the brief and you get a reply within one business day — either questions, or a scoping call. If your project is not something I should take on, I will say so then.

Response
Replies within 1 business day
Hours
Mon–Fri, 09:00–18:00 PKT — overlaps 05:00–14:00 UK, 00:00–09:00 US Eastern
Booking
Booking projects from October 2026
WhatsApp — opens a chat with +92 346 5348466 in a new tab