There are two ways one system can find out that something happened in another. One is polling: calling the post office every five minutes to ask whether you’ve got mail. The other is a webhook: the postman rings the bell as soon as the letter arrives.
How does it work?
When an event happens – say, an online payment succeeds – the provider (such as Barion or Stripe) sends an HTTP request to an address you’ve specified. The request contains all the data (in JSON), and your system reacts instantly: it issues the invoice, sends the confirmation and adds the booking to the calendar.
A typical chain: booking → payment → invoice → email → calendar, with no human involvement, in seconds.
What to watch out for
- Verify the sender. A webhook address is public – anyone can send a request to it. Serious providers sign their requests or let you double-check via their API; always verify, or anyone could fake a “paid” order.
- Idempotency. The same event sometimes arrives twice. The system must remember what it has already processed – otherwise one payment produces two invoices.
- Respond quickly. Acknowledge the request immediately and leave slow work (PDF generation, emails) to a background queue.
- Retries and logging. If your system is briefly unavailable, providers usually retry later. Log every event so problems can be traced.
- Order. Events don’t always arrive in the order they happened – your logic shouldn’t rely on it.
If you’d like to connect your booking system, webshop or invoicing, let’s look at what can be automated in your business.