Webhook: the automatic notice between two programs

A webhook is a notice one program sends another the moment something happens, without anyone having to ask. It is what makes a payment, an order or a signature appear in your system on its own.

1What it is, without the jargon

Think of the difference between ringing the courier every half hour to ask whether the parcel has arrived and the courier texting you when it does. The second is a webhook: the system where the event happens notifies the system that needs it, as soon as it happens.

Technically, the notice is a small request over the internet to an address your system keeps ready. It carries the details of the event (which order, what amount, which customer), and your system receives them and acts: marks the invoice as paid, creates the order or alerts a person.

2Two examples from a small business

The most common cases in a small company:

  • Payment confirmed: a customer pays by card on your website or through a payment link. The payment provider notifies your system, which marks the order as paid and sends it to picking without anyone checking the bank statement.
  • Online shop order: an order comes into the shop and the shop notifies the warehouse program, which reserves the stock and generates the delivery note.
  • Others: a document signed, an appointment booked, a form submitted, a shipment delivered.

3Webhook or checking every few minutes

The alternative to a webhook is for your system to ask the other one, every so often, whether there is anything new (known as polling). It works, and sometimes it is the only option, because not every program can send notices. It has two drawbacks: the data arrives late (at the next check) and many checks are made for nothing.

A webhook is quicker and lighter, but it depends on the other program offering it. So before promising that something will be “automatic”, it is worth checking the other program’s documentation for which notices it sends. Our page on what an API is explains the piece both methods hang from.

4What happens if the notice fails

This is the question that matters most and is asked least. A notice can get lost: your server was under maintenance, there was an outage, or it arrived in an unexpected format. Serious services retry several times over a period, but not for ever.

A well-built system therefore does three things: it checks the notice really comes from who it claims to, it does not process the same notice twice if it arrives repeated (so nothing is charged or shipped twice) and, every so often, it reconciles what it has received against the other system to find anything lost. Whatever does not match is shown to a person.

  • Which notices does the program we want to connect to offer?
  • How many times does it retry, and for how long?
  • How do we find out if a notice is lost altogether?

5Where we have needed it

  • Kiero: An AI employee on the business’s WhatsApp

    Kiero

    An AI employee on the business’s WhatsApp

    Kiero takes payment inside the WhatsApp chat through Stripe Connect, linked to the business’s account. It is the kind of integration where knowing for certain that a payment has been confirmed decides what happens next. Live at kiero.es.

    Live at kiero.es

    See the project page

See all projects

6Frequently asked questions

Are a webhook and an API the same thing?

No. The API is the door through which one program lets another request or send it data. A webhook is a specific use: the program calls you when something happens, instead of waiting for you to ask.

Does my management software support webhooks?

It depends on the program and sometimes on the plan you pay for. Some notify you of everything, others of almost nothing. We check their documentation before proposing a connection.

Could a repeated notice charge a customer twice?

If the system is not prepared for it, yes. That is why each notice is identified and, if it arrives twice, the second is ignored.

What if my server is down when the notice arrives?

The sender normally retries for a while. If it is still lost, the periodic check against the other system picks it up and puts it in front of a person.

Which figure do you copy by hand from one program to another?

Tell us which programs you use and we will tell you whether they can notify each other or need checking every so often.

Tell us your problem