Skip to content

Partner path · step 8 of 10

Receive a booking(by webhook)

A guest books a room on an . ZimmerStack sends that to your at once. In this step you receive your first one, on the you created.

What a webhook is

Until now, your software called ZimmerStack. A goes the other way: ZimmerStack calls your server when something happens. So you do not ask again and again if there is a new booking. The booking comes to you.

What is a webhook? explains it with a picture.

Before you start

  • Your , from step 2.
  • The id of your test hotel, from step 4. In the example it is 9001.
  • The id of one of that hotel, from step 5. In the example it is 412, the Deluxe Room.
  • A server with an address that starts with https://. ZimmerStack must be able to reach it from the internet.

1. Add your server's address

You tell ZimmerStack where to send the messages. This address is called a .

  1. 1

    Open Developers in the partner portal

    Sign in to the partner portal and open Developers. Go down to the box named Your company webhook.
  2. 2

    Press “Add company webhook”

    A panel opens. Its title is New company webhook.
  3. 3

    Type your address in the field URL

    It is the address on your server where the messages must arrive. It must start with https://.
  4. 4

    Under Receives, choose “Your sandboxes”

    It is already chosen while you have no real hotel. This one address then receives the bookings of all your test hotels.
  5. 5

    Leave Events as it is

    The events for OTA bookings are already ticked. Leave “Include the guest's phone and email” off for now.
  6. 6

    Tick the last box

    It reads: I understand guest booking details will be sent to this URL.
  7. 7

    Press “Add endpoint”

    The panel now shows your . It is one long line that starts with whsec_.
  8. 8

    Copy the signing secret

    Press Copy. Save the secret on your server, next to your key. You need it in part 2. Then press Done.

This one address is your . Later, the same kind of address receives the bookings of all your hotels. To see the secret again, press Show secret on the endpoint.

2. Check that a message is really from ZimmerStack

Anyone on the internet can send a message to your address. So each real message carries a . Your server checks it with the signing secret. The signature comes in three .

webhook-id
The id of this message.
webhook-timestamp
When the message was sent, as a number of seconds.
webhook-signature
The signature. It is made from the id, the timestamp and the body, with your signing secret.

This is the check, written for Node.js.

verify.mjs
import { createHmac, timingSafeEqual } from "node:crypto";

// Standard Webhooks: webhook-id, webhook-timestamp, webhook-signature headers.
export function verify(headers, rawBody, secret) {
  const id = headers["webhook-id"];
  const ts = headers["webhook-timestamp"];
  const given = String(headers["webhook-signature"] ?? "");
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false; // 5-minute window
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64");
  return given.split(" ").some((sig) => {
    const [, value] = sig.split(",");
    return value && value.length === expected.length && timingSafeEqual(Buffer.from(value), Buffer.from(expected));
  });
}

Use it like this, each time a message arrives.

  1. Read the as plain text, exactly as it arrived. Do this before you turn it into .
  2. Call verify with the headers, that text and your signing secret.
  3. If it gives false, answer with 400 and stop. Do not use the message.
  4. If it gives true, the message is real. Now read it as JSON.

The check also refuses a message that is more than 5 minutes old. ZimmerStack follows a public standard here. Its name is Standard Webhooks. The Node package has this check ready-made.

3. Make a test booking

Now ask your test hotel to make a booking, as an OTA would. ZimmerStack then sends the webhook to your server. First, this is what you send.

test-booking.json
{
  "roomTypeId": 412,
  "checkIn": "2026-12-24",
  "nights": 2,
  "rooms": 1,
  "adults": 2,
  "guestName": "Asha Verma",
  "otaName": "Booking.com",
  "paidByOta": false
}

It means: Asha Verma books 1 room for 2 nights from 2026-12-24, on Booking.com.

roomTypeId
The id of a room type of your test hotel. It is a number. Put your own number here: the one you read back when you created your room types.
checkIn
The day the guest arrives, as year-month-day. It must be today or a later day.
nights
How many nights the guest stays. From 1 to 30.
rooms
How many rooms. From 1 to 5. If you leave it out, it is 1.
adults
How many adults in each room. If you leave it out, it is 2.
guestName
The guest's name. Any name will do.
otaName
The OTA this booking pretends to come from: Booking.com, Expedia, Agoda, Airbnb, MakeMyTrip or Goibibo.
paidByOta
false means the guest pays at the hotel. true means the OTA took the money.

Then send it. Choose your language. Put your own key in place of zsk_test_YOUR_KEY, and the id of your test hotel in place of YOUR_PROPERTY_ID. The header says which test hotel gets the booking.

Save the example above as test-booking.json. Open a terminal in the same folder and run this. On Windows PowerShell, type curl.exe instead of curl.

terminal
curl -X POST "https://api.zimmerstack.com/api/v1/connect-api/v1/sandbox/bookings" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "X-ZS-Property: YOUR_PROPERTY_ID" -H "Content-Type: application/json" -d "@test-booking.json"

What comes back

response · status code 201
{
  "statuscode": 201,
  "message": "Simulated OTA booking created; the channel.booking.created webhook is queued.",
  "data": {
    "bookingId": 90311,
    "reference": "SBX-9001-MXHI8W001F6D",
    "channelBookingId": "sbx-1f6d0c2e-7b53-4a0e-9c5a-2d8f3b1e4c70",
    "otaName": "Booking.com",
    "status": "UPCOMING",
    "guestName": "Asha Verma",
    "checkIn": "2026-12-24",
    "checkOut": "2026-12-26",
    "nights": 2,
    "rooms": 1,
    "roomTypeId": 412,
    "nightlyRate": 4850,
    "total": 9700,
    "currency": "INR",
    "paidByOta": false,
    "oversold": false,
    "createdAt": "2026-12-10T12:00:00.000Z",
    "webhook": {
      "eventType": "channel.booking.created",
      "queued": true
    }
  }
}
bookingId
The id of the test booking. You need it to change or cancel this booking later.
reference
The booking's reference. The webhook carries the same one.
nightlyRate, total
The price of one night, and of the whole stay. They come from the rates of your test hotel, so your own numbers can be different.
oversold
true means no room was free on one of the nights. The booking is made anyway, as an OTA would do.
webhook
queued: true means the message is on its way to your server.

4. What your server receives

A few seconds later, ZimmerStack sends one to your address. This is the message for the test booking above. Compare the two: the reference, the guest, the nights and the total are the same.

the message your server receives
{
  "id": "evt_5d3f0c4a-6b1e-4a7e-9c1b-2f0e8d1a9b77",
  "type": "channel.booking.created",
  "apiVersion": "2026-09-01",
  "occurredAt": "2026-12-10T12:00:00.000Z",
  "mode": "test",
  "sequence": 41,
  "property": {
    "id": 9001,
    "name": "The Lantern House (sandbox)",
    "currency": "INR",
    "timezone": "Asia/Kolkata"
  },
  "data": {
    "booking": {
      "id": 90311,
      "reference": "SBX-9001-MXHI8W001F6D",
      "version": 1,
      "status": "CONFIRMED",
      "stayStatus": "UPCOMING",
      "channel": {
        "otaName": "Booking.com",
        "otaReservationCode": "SBX-9001-MXHI8W001F6D",
        "source": "BOOKINGCOM",
        "sourceGroup": "INDIRECT"
      },
      "stay": {
        "checkIn": "2026-12-24",
        "checkOut": "2026-12-26",
        "nights": 2,
        "dayUse": false
      },
      "guest": {
        "fullName": "Asha Verma",
        "firstName": "Asha",
        "lastName": "Verma",
        "country": null,
        "language": null
      },
      "guestNotes": null,
      "occupancy": {
        "adults": 2,
        "children": 0
      },
      "rooms": [
        {
          "roomTypeId": 412,
          "roomTypeName": "Deluxe Room",
          "ratePlanId": 900,
          "mealPlan": "EP",
          "mealPlanSource": null,
          "mealPlanText": null,
          "mealPrice": null,
          "adults": 2,
          "children": 0,
          "checkIn": "2026-12-24",
          "checkOut": "2026-12-26",
          "nights": 2,
          "dayUse": false,
          "ratePerNight": 4850,
          "amount": 9700,
          "nightlyRates": null,
          "commission": null,
          "status": "UPCOMING"
        }
      ],
      "amounts": {
        "currency": "INR",
        "total": 9700,
        "paid": 0,
        "balanceDue": 9700,
        "paymentCollect": "property"
      },
      "finance": null,
      "cancellation": null,
      "createdAt": "2026-12-10T12:00:00.000Z",
      "updatedAt": "2026-12-10T12:00:00.000Z"
    }
  },
  "changes": null,
  "previous": null
}

Your own message has your own ids, your dates and your prices.

id
The id of this event. It stays the same when the message is sent again.
type
What happened. channel.booking.created is a new OTA booking. A change is channel.booking.modified. A cancel is channel.booking.cancelled.
mode
test for a test hotel. live for a real hotel.
sequence
A number that counts the events of this hotel, in order. See .
property
The hotel this is about. With many hotels, read property.id to know which one.
data.booking
The booking itself.
changes, previous
Filled only when a booking changed. They say what changed, and how the booking was before.

Inside the booking

id
ZimmerStack's id of the booking. It is the bookingId of the answer above.
reference
The booking's reference. For an OTA booking it is the OTA's own code.
version
A number that counts the events of this one booking. A higher number is a newer state of the same booking.
status
CONFIRMED or CANCELLED.
channel.otaName
The OTA that sent the booking. Read this field to know the OTA.
channel.source
On a test booking it names the OTA in capital letters. On a real OTA booking it reads CHANNEL_MANAGER. Do not build on this field.
stay.checkIn, stay.checkOut
The day the guest arrives and the day the guest leaves. The day of leaving is not a night.
rooms
One item for each room booked. roomTypeId is the id of the room type. ratePlanId is the rate plan the room was sold on.
guest.fullName
The guest's name. Phone and email are there only when you switch guest contact on for the endpoint.
amounts.total
The total price of the booking, in the currency named in amounts.currency.
finance, guestNotes
Empty in this message. A real OTA booking can fill them: the OTA's commission, and the guest's own request.
A room's meal, nights and commission
Empty in this message too: a test booking has no OTA to say them. A real OTA booking says where the meal plan came from, the OTA's own words, each night's price and the room's commission.

Every field of a real OTA booking is on the guide Webhooks.

Before your saves a real OTA booking, read Meal plan, commission and money in your PMS. It says, step by step, how to post each night, set the meal plan, offer a meal price, post the commission and see who collects. Every kind of change a booking can go through is listed there too.

5. Answer fast

Your server does four things with each message, in this order.

  1. Check the signature.
  2. Save the message in your database.
  3. Answer with status code 200.
  4. Do the slow work after that, such as changing your calendar.
Answer within 10 seconds
Any status code from 200 to 299 means: I have it. A slower answer counts as failed.
A failed message comes again
ZimmerStack sends it again after 30 seconds, then after 2 minutes, then later and later, for about one day.
The same message can come twice
Keep the id of every event you have handled. If the same id comes again, answer 200 and do nothing more.

What you should see

On your server
One request has arrived. Its type is channel.booking.created and its mode is test.
In the partner portal
Under your endpoint, Recent deliveries shows a row named “A new OTA booking”, marked Delivered.
In your test hotel
The of that room type is one lower on the nights of the booking. Check it with Get availability.

Next, try a change and a cancel: Change a test booking and Cancel a test booking. Each one sends a real webhook too.

The three messages your server receives, in full

A booking reaches your server as one of three messages: new, changed or cancelled. Each one carries the whole booking. These are the full messages, as Send test sends them. Nothing is cut.

channel.booking.created · a new booking
{
  "id": "evt_3f6b2a10-9c4e-4d27-8a51-0b7e6c1d2f93",
  "type": "channel.booking.created",
  "apiVersion": "2026-09-01",
  "occurredAt": "2026-12-10T12:00:00.000Z",
  "mode": "test",
  "property": {
    "id": 61,
    "name": "The Lantern House",
    "currency": "INR",
    "timezone": "Asia/Kolkata"
  },
  "data": {
    "booking": {
      "id": 100001,
      "reference": "TEST-ZS-8K3Q2M",
      "version": 1,
      "status": "CONFIRMED",
      "stayStatus": "UPCOMING",
      "channel": {
        "otaName": "MakeMyTrip",
        "otaReservationCode": "TEST-ZS-8K3Q2M",
        "source": "CHANNEL_MANAGER",
        "sourceGroup": "INDIRECT"
      },
      "stay": {
        "checkIn": "2026-12-24",
        "checkOut": "2026-12-26",
        "nights": 2,
        "dayUse": false
      },
      "guest": {
        "fullName": "Asha Verma",
        "firstName": "Asha",
        "lastName": "Verma",
        "country": "IN",
        "language": "en"
      },
      "guestNotes": "Late arrival around 22:00. Non-smoking room please. (test event)",
      "occupancy": {
        "adults": 2,
        "children": 0
      },
      "rooms": [
        {
          "roomTypeId": 412,
          "ratePlanId": 901,
          "roomTypeName": "Deluxe Sea View",
          "mealPlan": "CP",
          "mealPlanSource": "ota",
          "mealPlanText": "CP · Breakfast included",
          "mealPrice": null,
          "adults": 2,
          "children": 0,
          "checkIn": "2026-12-24",
          "checkOut": "2026-12-26",
          "nights": 2,
          "dayUse": false,
          "ratePerNight": 2700,
          "amount": 5400,
          "nightlyRates": [
            {
              "date": "2026-12-24",
              "amount": 2600
            },
            {
              "date": "2026-12-25",
              "amount": 2800
            }
          ],
          "commission": 1350,
          "status": "UPCOMING"
        }
      ],
      "amounts": {
        "currency": "INR",
        "total": 5400,
        "paid": 0,
        "balanceDue": 5400,
        "paymentCollect": "property"
      },
      "finance": {
        "otaName": "MakeMyTrip",
        "amountBasis": "GROSS_TOTAL",
        "currency": "INR",
        "grossAmount": 5400,
        "commissionAmount": 1350,
        "taxAmount": 648,
        "netPayoutAmount": 4050,
        "taxIncludedInAmount": false
      },
      "cancellation": null,
      "createdAt": "2026-12-10T12:00:00.000Z",
      "updatedAt": "2026-12-10T12:00:00.000Z"
    }
  },
  "changes": null,
  "previous": null
}

The changed message also has changes and previous: what moved, and how it was before. What your software must do with each of the three is in the guide: One booking's life.

If it does not work

403 SANDBOX_ONLY
You used a live key. A test booking works only with a test key.
400 PROPERTY_REQUIRED
The request did not say which hotel. Add the X-ZS-Property header with the id of your test hotel.
400 UNKNOWN_ROOM_TYPE
The roomTypeId is not a room type of this test hotel. Read the ids again with Get room types and rate plans.
400 STAY_INVALID
The checkIn date is in the past, or too far ahead. Use today or a later day.
The delivery is marked Failed
Your server did not answer with a status code from 200 to 299 within 10 seconds. The row in Recent deliveries shows the last error.
No delivery at all
Look at the label on your endpoint. It must say Sandbox. An endpoint that says Hotels does not receive test bookings.
The signature is always wrong
Use the body exactly as it arrived. Also check that you copied the whole secret, with whsec_ at the start.
Your address is refused
It must start with https:// and be reachable from the internet. An address that sends the request on to another address is not followed.

Words on this page

OTA
Online travel agency: a website that sells hotel rooms, like Booking.com, MakeMyTrip or Agoda. Learn more
Booking
A guest has reserved a room for some nights. Also called a reservation.
Server
A computer that runs your software all the time and can be reached over the internet.
Test hotel
A hotel in your sandbox. It works like a real hotel, but no OTA can see it and nothing is billed.
Webhook
A message ZimmerStack sends to your server when something happens, like a new booking.
Test key
A key that starts with zsk_test_. It works only on a sandbox, so it can never change a real hotel.
Room type
A kind of room the hotel sells, like Deluxe Room or Family Suite. A hotel can have 12 rooms of one room type.
Webhook endpoint
The address of your server where ZimmerStack sends webhooks.
Signing secret
A secret code ZimmerStack shares with you once. With it your server can check that a webhook is really from ZimmerStack.
Company webhook
One address of your server that receives the webhooks of all your hotels.
Signature
A code sent with each webhook. Your server checks it with the signing secret.
Header
A small piece of extra information sent with a request, like your key.
Body
The data you send inside a request, written in JSON.
JSON
A simple text format for data, made of names and values inside { }.
Status code
A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
X-ZS-Property
The header that tells ZimmerStack which hotel a request is for. Its value is the property id.
Request
One message your software sends to the API.
Sequence
A number that counts a hotel's events in order: 1, 2, 3 and so on.
Event
One thing that happened, like a new booking. Each webhook carries one event.
PMS
Property management system: the software a hotel uses at its front desk for bookings, guests and bills.
Availability
How many rooms of one room type are free to sell on one night. Learn more

Routes, samples, limits and codes on this page come from the API's public contract, read live, Sat, 05 Dec 2026 01:08:01 UTC.