Skip to content

Basics · page 4 of 5

What is a webhook?

A guest books a room on an OTA. Your software must know about it fast. This page shows how ZimmerStack tells your server, so your server does not have to ask.

The problem

A guest books a Deluxe Room on Booking.com. The goes from the to ZimmerStack. Your software does not know about it yet.

Your software must know fast. It must lower its own number of free rooms. If it does not, the front desk may sell the same room again. That is .

The last page said: your software sends a , and the answers. The API never starts. So how does your software hear about the booking?

The slow way: ask again and again

Your software could ask the API every minute: "Is there a new booking?"

Most of the time the answer is no. Each of those requests is wasted.

And when a booking does come, your software learns of it only at its next request. Until then it does not know.

Asking again and again has a name: .

The better way: ZimmerStack tells you

With a , your software does not ask. You give ZimmerStack one address on your . When a booking comes, ZimmerStack sends a message to that address within seconds.

The message is the webhook. The address is your .

Think of a parcel. Polling is walking to the post office every hour to ask for it. A webhook is the post office bringing it to your door.

See the difference

Press the buttons a few times. Then switch to "By webhook" and press again.

Your server learns of a booking

The channel manager

ZimmerStack

Bookings from the OTAs

0

Your software

Your server

Bookings it knows about

0

Requests it sent: 0. Found nothing: 0.

Nothing has happened yet. Press the first button to make a booking. Press the second button to let your server ask.

How one webhook travels

  1. An OTA

    A guest books a room on Booking.com.

    the booking
  2. ZimmerStack

    It gets the booking from the OTA.

    a webhook, within seconds 200: I have it
  3. Your server

    It saves the booking and lowers its free rooms.

  1. The OTA sends the booking to ZimmerStack.
  2. ZimmerStack sends a request to your webhook endpoint. This time ZimmerStack sends, and your server answers.
  3. Your server answers with the 200. It means: "I have it."
  4. Your server saves the booking and lowers its own number of free rooms.

What is inside a webhook

Each webhook carries one . An event is one thing that happened. These three are about OTA bookings:

channel.booking.created
An OTA sent a new booking.
channel.booking.modified
The OTA changed a booking: its dates, its rooms, its price or its guest.
channel.booking.cancelled
The OTA cancelled a booking.

There are more events. One example is a booking made on the hotel's own website.

The message is written in JSON. Here is one in short form. The real message has a few more fields, and the whole booking.

a webhook, in short form
{
  "id": "evt_5d3f0c4a-6b1e-4a7e-9c1b-2f0e8d1a9b77",
  "type": "channel.booking.created",
  "occurredAt": "2026-12-12T08:14:03.201Z",
  "mode": "live",
  "property": {
    "id": 61,
    "name": "The Lantern House",
    "currency": "INR",
    "timezone": "Asia/Kolkata"
  },
  "data": {
    "booking": {
      "…": "the guest, the dates, the rooms and the price"
    }
  }
}
id
The id of this event. No other event has the same id.
type
What happened. Here: a new booking from an OTA.
occurredAt
When it happened.
mode
live for a real hotel. test for a test hotel.
property
The hotel the event is about.
data
The booking itself.

Five things your server must do

1. Be on the internet, with HTTPS

ZimmerStack must be able to reach your webhook endpoint. So it must be on a server that is on the internet. Its address must start with https://. This is .

An address on your own computer, like localhost, does not work. ZimmerStack cannot reach it.

To test on your own computer, use a . It gives your computer a public https address for a short time. Two such tools are cloudflared and ngrok.

2. Answer fast, with 200

When a webhook arrives, answer with a status code from 200 to 299. Answer within 10 seconds.

So first save the message, and answer. Do the slow work after that.

A late answer, or any other status code, means "not received" to ZimmerStack.

3. If your server is down, ZimmerStack tries again

Every server is down sometimes. A webhook that fails is not lost. ZimmerStack sends it again. This is called a .

Before each new try, ZimmerStack waits a little longer:

After try 1
It waits about 30 seconds.
After try 2
About 2 minutes.
After try 3
About 10 minutes.
After try 4
About 30 minutes.
After try 5
About 1 hour.
After try 6
About 3 hours.
After try 7
About 6 hours.
After try 8
About 12 hours. Then comes try 9, the last one.

That is about one day in all. If the last try also fails, the webhook is marked as failed.

ZimmerStack also sends an email to the person who added the endpoint. One email comes after an hour of failed tries, and one after a day. After 72 hours with no webhook received, ZimmerStack stops sending to that address.

4. Expect the same webhook two times

Sometimes your server gets a webhook, but its answer is lost on the way. ZimmerStack then cannot know that you have it. So it sends the webhook again.

Now your server has the same webhook two times. It must not save the booking two times.

The fix is simple:

  1. Every event has an id, in the field id. A webhook that is sent again has the same id.
  2. Save the id of every event you have handled.
  3. When a webhook arrives, look at its id first.
  4. If you have this id already, answer 200 and do nothing more.

5. Check the signature

Your webhook endpoint is a public address. Someone who finds it could send you a fake message: a booking that does not exist.

So ZimmerStack signs every webhook. When you add your endpoint, you get a . It is shown one time. Only you and ZimmerStack know it.

Each webhook carries a . It is a code made from the message and the secret. Your server makes the same code and compares the two.

  • The two codes are the same: the message is from ZimmerStack. Use it.
  • The two codes are different: the message is fake. Do not use it.

You do not have to invent this check. For Node.js, the ZimmerStack package has a ready function for it.

Where you add your webhook endpoint

  • A software partner adds the address in the partner portal, under Developers.
  • For one hotel, the hotel's owner adds the address in Admin, under Developers.

You can test all of this without a real guest. Your can make a test booking and send you the real webhook. The next page explains the sandbox.

What to remember

  • Polling is asking again and again. It is slow, and most requests are wasted.
  • A webhook is a message ZimmerStack sends to your server when something happens.
  • Your webhook endpoint must be on the internet, with an https address.
  • Answer with 200 within 10 seconds. Do the slow work after that.
  • If your server is down, ZimmerStack tries again for about one day.
  • The same webhook can come two times. Save the ids you have handled.
  • Check the signature, so nobody can send you a fake booking.

Words on this page

Booking
A guest has reserved a room for some nights. Also called a reservation.
OTA
Online travel agency: a website that sells hotel rooms, like Booking.com, MakeMyTrip or Agoda. Learn more
Overbooking
Selling the same room to two guests for the same night.
Request
One message your software sends to the API.
API
A way for one software to talk to another software over the internet.
Polling
Asking the API again and again if something is new. Learn more
Webhook
A message ZimmerStack sends to your server when something happens, like a new booking.
Server
A computer that runs your software all the time and can be reached over the internet.
Webhook endpoint
The address of your server where ZimmerStack sends webhooks.
Status code
A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
Event
One thing that happened, like a new booking. Each webhook carries one event.
HTTPS
The safe way to send data over the internet. An address that uses it starts with https://. Learn more
Tunnel
A tool that gives your own computer a public https address for a short time, so you can test webhooks on it. Learn more
Retry
One more try to send the same message, after a try that failed. Learn more
Signing secret
A secret code ZimmerStack shares with you once. With it your server can check that a webhook is really from ZimmerStack.
Signature
A code sent with each webhook. Your server checks it with the signing secret.
Sandbox
Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.