How a webhook works
Imagine two ways of finding out whether a parcel has arrived. Either you run to the letterbox every five minutes, or the courier rings the bell. With an API, a system usually asks for itself: “Anything new?” A webhook is the doorbell. When an event happens, the system sends a short message with the details, such as the order number and payment status, to an address set up in advance. The other system receives it and reacts straight away.
Where webhooks are used
- A payment gateway tells the online shop about a successful payment, and the order is marked as paid automatically.
- A carrier sends a parcel status update, and the customer gets an email saying the parcel is on its way.
- An online shop sends a new order to the invoicing software or warehouse.
- A website form creates a contact in the CRM or posts a message to the company chat.
Why it matters
Webhooks connect systems instantly and without manual work. Nobody has to check bank statements or retype orders. They also save resources, because there is no need to keep checking whether something has changed. This makes it possible to build automations that would otherwise take hours every week.
A real-world example
A cosmetics shop had a problem: customers paid by card, but the order stayed in “pending payment” status, and sometimes they even got a payment reminder. The cause was a misconfigured payment gateway webhook that still pointed to the old address after the website’s URL changed. After the fix, payments are matched within seconds.
What to watch out for
- Verify where the message came from. A webhook should be signed with a secret key, otherwise anyone could send a fake “paid”.
- Plan for outages. If your website isn’t running at that moment, the message may be lost. Good services resend it.
- After changing your domain or hosting, check the addresses of all webhooks.
I build webhook and API integrations as part of web application development.