7 min read
What Is A Webhook In Ecommerce? How Stores Use Them
A webhook is a message your store sends to another system the moment something happens, like a paid order or a refund. How webhooks differ from an API, what stores use them for, and how to keep them safe.
By Juan Molina

On this page
A webhook is a message your store sends to another system the moment something happens. An order is paid, a refund goes out, stock hits zero, and your store posts a small packet of data to a URL you chose. Nobody has to ask for it. The store tells you, instead of you checking over and over.
I am John, and I build DashForDevs, the platform behind a few dozen live stores. Webhooks are the part of ecommerce that looks simplest on a diagram and causes the most quiet damage when it is done carelessly. This guide covers what they are, what stores use them for, and the things I learned by having them fail on real orders.
Webhook vs API
With an API, your code asks the store a question: "what orders came in since noon?" With a webhook, the store calls your code when an order comes in. An API is you phoning the warehouse. A webhook is the warehouse phoning you.
Most real setups use both. The webhook tells you something happened, and then your code uses the API to fetch the full, current record. Our guide to the ecommerce API covers the asking side.
Why not just ask every minute? Because asking is wasteful and slow at the same time. A store with ten orders a day would make 1,440 requests to learn about ten things, and each one would still arrive up to a minute late. A webhook makes ten calls, each within a second or two of the event.
What stores use webhooks for
- Fulfillment. A paid order goes straight to the warehouse or the shipping tool, so a label can print before the customer has closed the tab.
- Accounting. Each payment and refund lands in the books without a nightly export.
- Customer messages. Shipped, delivered and back in stock notices fire on the real event, not on a schedule.
- Inventory. A sale in one channel lowers stock everywhere else.
- Subscriptions. A renewal payment creates the next order, and a failed card starts the retry emails.
- Your own tools. A message in the team chat for every order over a set amount, a row in a spreadsheet, a ping to a sales rep.
Much of this is what people mean by ecommerce automation. The webhook is the trigger under almost all of it.
What a webhook looks like
This is a made up example to show the shape. Field names differ between platforms, but nearly every webhook carries these parts.
| Part | Example | What it is for |
|---|---|---|
| Event id | evt_81f3 | A unique id, so you can spot a repeat |
| Event type | order.paid | What happened |
| Created at | 2026-11-28 14:02:11 UTC | When it happened, not when it arrived |
| Data | Order number, total, line items | The record, or enough to look it up |
| Signature | A long string in a header | Proof the message came from your store |
Your side is a small program at a public URL. It receives the message, checks the signature, answers "got it" with a success code, and then does the work.
What goes wrong
Webhooks fail quietly. That is the whole problem. Nothing crashes and nobody gets an error page. An order simply never reaches the warehouse, and you find out when a customer asks where it is.
Here is one from our own platform. During a short window one evening, one of our internal services answered with errors. Orders kept coming in and payments kept succeeding, but a link that should have been written on each new subscription order was not. By the time the service was healthy, 51 orders were missing that link. Customers saw nothing wrong. We only caught it quickly because every event and its result is logged, so we could list exactly which 51 were affected and replay them. Without the log it would have surfaced a month later, as 51 renewals that never ran.
That is typical. The failure itself lasted minutes. What matters is whether you can answer "which events did we miss?" afterward. Four habits make that possible.
1. Retries
The sender should try again when your server does not answer with a success code, with longer waits between tries. If your platform gives up after one attempt, a thirty second restart on your side loses orders.
2. Duplicate handling
Retries mean the same event can arrive twice. So can network hiccups. Store each event id you have handled and skip any you have seen. If you do not, a retry can ship the same order twice or email the customer two receipts.
3. Answer first, work second
Senders wait a few seconds for your answer and then mark the delivery failed. If your code prints a label and calls three other services before it answers, slow days turn into "failed" deliveries that actually succeeded, and then the retry does it all again. Save the event, answer right away, do the work after.
4. A delivery log you can replay from
Keep every delivery and its response. When something breaks you want a list and a replay button, not a guess.
Events arrive out of order
This one catches people who have the first four right. "Order paid" and "order updated" can be sent a second apart and arrive in the opposite order. If your code trusts the data inside each message, the older one can overwrite the newer one.
The fix is to treat the webhook as a tap on the shoulder. When it arrives, fetch the current record through the API and act on that. Then the order of arrival stops mattering.
How to keep webhooks safe
A webhook URL is a door on the public internet. Anyone who finds it can knock.
- Check the signature on every message. The store signs each one with a secret only the two of you know. Reject anything that does not match. This is the one step you cannot skip.
- Reject old messages. A signed message that is copied and sent again an hour later should fail. Check the timestamp.
- Use HTTPS only.
- Do not put secrets in the URL. URLs end up in logs.
- Send as little personal data as the job needs. An order number the receiver can look up is safer than a full customer record flying across the internet. For stores handling health information this matters a great deal.
A checklist before you turn one on
- Does the sender retry, and for how long?
- Do I store event ids and skip repeats?
- Do I answer within a second or two, before doing the work?
- Do I verify the signature and the timestamp?
- Can I see a log of every delivery?
- Can I replay one event by hand?
- Who gets told when deliveries start failing?
- Have I tested what happens when my server is down for five minutes?
If you cannot answer number seven, start there. A webhook nobody is watching is the kind that fails for a week.
Common questions
Do I need a developer to use webhooks?
To receive one in your own code, yes. To connect your store to common tools, often no: many shipping, accounting and email tools give you a URL to paste in. The checklist above still applies. Ask the tool how it handles retries and repeats.
Are webhooks real time?
Close to it. Usually a second or two. Never build something that breaks if one arrives a minute late, because some will.
What is the difference between a webhook and an event?
The event is the thing that happened, like "order paid". The webhook is the delivery of that event to your URL.
How many webhooks should a store have?
As few as the work needs. Each one is something to monitor. Start with paid orders and refunds, and add others when a real task calls for them.
Webhooks on DashForDevs
DashForDevs sends events for orders, payments, bookings and form submissions, and you can act on them with your own code or with built in automations. Open the docs to see the events and how they are signed.














