Webhook vs. API: who calls whom
- With an API, your system asks: “any new orders?” If it asks every five minutes, it either finds out late or asks for nothing most of the time.
- With a webhook, the other system tells you: “this order just came in.” The notice arrives right away and only when there is something.
They work together: the webhook says something happened and, if you need more detail, you ask for it through the API.
An example
Your online store receives an order that includes installation. Its webhook notifies your operations system, which creates the work order and puts it on the technician’s schedule. When the technician closes the job, an outgoing webhook tells the store to mark the order as installed.
Incoming and outgoing
An incoming webhook is the address where your system receives notices from others. An outgoing one is the notice your system sends to others when something changes inside it.
The usual mistake
Not keeping a record of what was sent. If the receiving system is down, the notice is lost and nobody finds out. A well-built webhook keeps a delivery history, lets you resend what failed and protects what it sends.