Guide
Bookings from the hotel's own website
Some hotels keep their own , and also sell rooms on their own website with the ZimmerStack . This guide shows how those bookings reach your PMS. It also shows the one rule that stops a sold room from going back on sale.
Who this guide is for
You build or run the PMS of a hotel, and the hotel keeps it. It is not the ZimmerStack PMS. The hotel uses ZimmerStack as its , to sell on the . It uses the ZimmerStack booking engine to sell on its own website.
One small example. A guest books a Deluxe Room for 24 December on the website of The Lantern House. No OTA is part of this. So without this guide, your PMS would not hear of the booking. And its next update of would put the room back on sale.
A booking like this is a . It reaches your PMS under its own names: three , and GET /direct-bookings to read them. The booking inside has the same shape as an OTA booking. So one piece of code reads both.
This guide is about website bookings only: the bookings for nights and the of the ZimmerStack booking engine. A booking made at the is not in this family: the hotel's staff made it. A booking that a key created with POST /bookings is not in it either: your own system made it.
The three events
The three events are a family of their own. They are not channel.booking.*. So the OTA events stay about OTAs only. And an endpoint that was added before one of these types existed gets nothing new, until its owner ticks the type. The envelope, the signature and the retries are the same as for every webhook: Webhooks.
| Type | When it is sent |
|---|---|
| direct.booking.created | A guest confirmed a booking on the hotel's website, for nights or for hours. |
| direct.booking.modified | The hotel recorded in ZimmerStack that the guest did not arrive (a no-show), or took that back. The booking is not cancelled. stayStatus says NOSHOW, or UPCOMING again. Added on 21 Nov 2026. |
| direct.booking.cancelled | The guest cancelled on the booking page. Or the hotel cancelled or deleted the booking in ZimmerStack. cancellation.reason says which. |
- Typedirect.booking.createdWhen it is sentA guest confirmed a booking on the hotel's website, for nights or for hours.
- Typedirect.booking.modifiedWhen it is sentThe hotel recorded in ZimmerStack that the guest did not arrive (a no-show), or took that back. The booking is not cancelled. stayStatus says NOSHOW, or UPCOMING again. Added on 21 Nov 2026.
- Typedirect.booking.cancelledWhen it is sentThe guest cancelled on the booking page. Or the hotel cancelled or deleted the booking in ZimmerStack. cancellation.reason says which.
- created, in detail
- A booking for nights, or an hourly booking, that the guest confirmed.
- modified, in detail
- A , or the undo of one.
statusstaysCONFIRMED, and the payment is not touched.stayStatusand thestatusof each room sayNOSHOWorUPCOMING.NOSHOW: the nights are on sale again on every OTA, so free the room.UPCOMINGagain: the nights are taken again, so hold the room. - changes and previous
- On
modified,changesnames what changed, like"stayStatus"and"rooms[0].status".previouscarries the booking as it was before, with itsstayStatus. On the other two events both arenull. - cancelled, in detail
- The guest cancelled on the booking page. Or the hotel cancelled or deleted the booking, in ZimmerStack or with
POST /direct-bookings/{bookingId}/cancel.cancellation.reasonis"Cancelled by the guest"or"Cancelled by the hotel". - Your own cancel comes back
- A cancel that your own PMS made comes back to you as this event too. Match it on the booking id, and treat it as already done.
- Other changes send no event yet
- The hotel can change other things on a website booking in ZimmerStack: other dates, one room of several cancelled, a payment taken at the front desk. These send no event yet.
modifiedis a no-show and its undo only. Readchangesto see what amodifiedevent is about. - So also read on a slow schedule
GET /direct-bookingslists such a booking again, becausesincelooks at its last change. So read it on a slow schedule too, not only before you send availability. Once an hour is enough.- An event for a booking you do not know
- A
modifiedor acancelledevent can arrive for a booking whosecreatedevent your endpoint never got. This happens when the types were ticked later. Treat a booking id you do not know as a new booking. Read it withGET /direct-bookings/{bookingId}.
{
"id": "evt_9b1d7c52-3e0a-4f6b-8a14-6c2e5d0f7a31",
"type": "direct.booking.created",
"apiVersion": "2026-09-01",
"occurredAt": "2026-12-10T12:00:00.000Z",
"mode": "live",
"property": {
"id": 61,
"name": "The Lantern House",
"currency": "INR",
"timezone": "Asia/Kolkata"
},
"data": {
"booking": {
"id": 100001,
"reference": "TEST-WEB-4H7P9D",
"version": 1,
"status": "CONFIRMED",
"stayStatus": "UPCOMING",
"channel": {
"otaName": "Website",
"otaReservationCode": "TEST-WEB-4H7P9D",
"source": "DIRECT_WEB",
"sourceGroup": "DIRECT"
},
"stay": {
"checkIn": "2026-12-24",
"checkOut": "2026-12-26",
"nights": 2,
"dayUse": false
},
"guest": {
"fullName": "Asha Verma",
"firstName": "Asha",
"lastName": "Verma",
"phone": "+919876500000",
"email": "asha.verma@example.com",
"country": "IN",
"language": "en"
},
"guestNotes": null,
"occupancy": {
"adults": 2,
"children": 0
},
"rooms": [
{
"roomTypeId": 412,
"ratePlanId": 901,
"roomTypeName": "Deluxe Garden Room",
"mealPlan": "CP",
"mealPlanSource": null,
"mealPlanText": null,
"mealPrice": null,
"adults": 2,
"children": 0,
"checkIn": "2026-12-24",
"checkOut": "2026-12-26",
"nights": 2,
"dayUse": false,
"ratePerNight": 2700,
"amount": 5400,
"nightlyRates": null,
"commission": null,
"status": "UPCOMING"
}
],
"amounts": {
"currency": "INR",
"total": 5400,
"paid": 1080,
"balanceDue": 4320,
"paymentCollect": "property"
},
"finance": null,
"cancellation": null,
"createdAt": "2026-12-10T12:00:00.000Z",
"updatedAt": "2026-12-10T12:00:00.000Z"
}
},
"changes": null,
"previous": null
}finance is null on every website booking. The booking is the same object that the OTA events carry. It uses the hotel's room type ids, the numbers from GET /catalog. So one piece of code reads both families. See also what a no-show tells your PMS.
How to tell them from OTA bookings
The simplest test is the event type. If one function reads bookings from both places, read channel.source: DIRECT_WEB is the website.
| OTA booking | Website booking | |
|---|---|---|
| Event types | channel.booking.created · modified · cancelled | direct.booking.created · modified · cancelled |
| channel.otaName | The OTA: "Booking.com", "MakeMyTrip" and so on | "Website" |
| channel.otaReservationCode | The OTA's reservation code | ZimmerStack's own booking reference |
| channel.source · channel.sourceGroup | CHANNEL_MANAGER · INDIRECT | DIRECT_WEB · DIRECT |
| finance | The OTA's money part (commission, payout), or null | null: there is no OTA and no commission |
| amounts.paymentCollect | ota, property or unknown | property: the money is the hotel's, not an OTA's |
| amounts.paid | The amount recorded as paid so far | What the guest paid online. amounts.balanceDue is what the front desk collects |
| changes · previous | Set on a modified event | Set on a modified event (a no-show, or its undo). previous carries stayStatus too |
| To read them | GET /channel-bookings, scope channel-bookings:read | GET /direct-bookings, scope direct-bookings:read |
- Event typesOTA bookingchannel.booking.created · modified · cancelledWebsite bookingdirect.booking.created · modified · cancelled
- channel.otaNameOTA bookingThe OTA: "Booking.com", "MakeMyTrip" and so onWebsite booking"Website"
- channel.otaReservationCodeOTA bookingThe OTA's reservation codeWebsite bookingZimmerStack's own booking reference
- channel.source · channel.sourceGroupOTA bookingCHANNEL_MANAGER · INDIRECTWebsite bookingDIRECT_WEB · DIRECT
- financeOTA bookingThe OTA's money part (commission, payout), or nullWebsite bookingnull: there is no OTA and no commission
- amounts.paymentCollectOTA bookingota, property or unknownWebsite bookingproperty: the money is the hotel's, not an OTA's
- amounts.paidOTA bookingThe amount recorded as paid so farWebsite bookingWhat the guest paid online. amounts.balanceDue is what the front desk collects
- changes · previousOTA bookingSet on a modified eventWebsite bookingSet on a modified event (a no-show, or its undo). previous carries stayStatus too
- To read themOTA bookingGET /channel-bookings, scope channel-bookings:readWebsite bookingGET /direct-bookings, scope direct-bookings:read
How to receive them
An endpoint gets these events only when it lists their types. Each type is ticked on its own.
- 1
Add the endpoint
As for any booking: in Admin → Developers → Webhooks, in Channels → Integrations, or in the Developers part of the partner portal for a company endpoint. - 2
Tick the three types
direct.booking.created,direct.booking.modifiedanddirect.booking.cancelled. An endpoint gets each one only when it lists that type. - 3
An older endpoint needs its owner's tick
An endpoint added before these events existed gets none of them, until its owner ticks them.direct.booking.modifiedwas added on 21 Nov 2026. An endpoint that listed created and cancelled before that day still gets exactly those two, until its owner ticks the third. Nothing you built before changes. - 4
Allow the read
The key that reads them needs the scopedirect-bookings:read. It is a scope of its own, in the channel manager family. A software company's company key may hold it. A key that holds onlychannel-bookings:readdoes not read website guests. Cancelling one from your PMS needs another scope again,direct-bookings:cancel. That scope is never given by default.
Use the booking before you send availability
A PMS that sends only what changed, like a price or a , is not caught by this. A PMS that sends full room counts with PUT /availability (Update availability) is. The number it sends is the number the OTAs will hold. A website booking makes that number one lower, before your PMS has heard of the booking.
An example: your PMS holds 5 Deluxe rooms
- 10:00
- Your PMS holds 5 Deluxe rooms for 24 December. You sent that number, so the OTAs hold 5.
- 10:20
- A guest books one Deluxe room for that night on the hotel's website. The OTAs hold 4 at once. ZimmerStack holds 4.
- 10:21
- direct.booking.created reaches your endpoint. If you do nothing, your PMS still shows 5.
- 10:30
- Your PMS sends its full calendar with PUT /availability. The number for that night is 5, because it never heard of the booking. The OTAs hold 5 again. The room the guest took is on sale, and an OTA can sell it a second time.
- Instead
- Put the booking into your own calendar first. Your PMS then holds 4, and it sends 4.
Selling one room twice is . Two things keep you safe. Both are yours to do.
- Put
direct.booking.createdinto your calendar before anything else the event starts. Give the nights back on a cancellation (direct.booking.cancelled), and on a no-show (direct.booking.modifiedwithstayStatusNOSHOW). - Before you send a full calendar, read
GET /direct-bookingssince the last time you read it. It catches a booking that no webhook has delivered yet.
ZimmerStack does not check the number for you. It does not refuse an update that is higher than what the website has sold.
The file below does both things. The webhook route calls onWebhookEvent after the signature is checked. The code that sends availability calls catchUpWebsiteBookings before it works out the numbers. The file runs on your server. It uses the client from Build a rate grid. MyCalendar stands for your PMS. The rest shows what to call, and in which order.
/**
* Bookings guests make on the hotel's own website, in your own PMS (the direct.booking.* family). Runs on your
* server, on top of zimmerstack.ts. Three jobs:
*
* 1. onWebhookEvent: your webhook route calls it with an event whose signature you have already checked
* (the Webhooks page has the check). A website booking is put in your own calendar, and taken out of its
* nights again when it is cancelled or the hotel records that the guest did not arrive.
* 2. pushRoomCounts: your PMS's push of absolute room counts. It reads GET /direct-bookings first, so every
* website booking is in your calendar before the counts are worked out. Without that, the push would put
* the room the guest took back on sale.
* 3. cancelWebsiteBooking: your PMS cancels a website booking, with the refund the person at the desk chose.
*
* The key needs the scope direct-bookings:read (ari:write to push, direct-bookings:cancel to cancel). The
* endpoint must list the three types direct.booking.created, direct.booking.modified and
* direct.booking.cancelled; an endpoint hears only the types its owner has ticked (modified was added on
* 21 Nov 2026, so an older endpoint hears the other two until the third is ticked).
*/
import { zs } from "./zimmerstack";
/** The booking object. It is the one OTA bookings use; only the fields this file reads are named here. */
export interface WebsiteBooking {
id: number;
reference: string;
status: "CONFIRMED" | "CANCELLED";
/**
* The stay's own state: UPCOMING · INHOUSE · COMPLETED · CANCELLED · NOSHOW. A no-show is NOT a cancellation:
* `status` stays CONFIRMED and the hotel keeps the payment, but the nights are on sale again.
*/
stayStatus: string;
/** Website bookings: otaName "Website", source "DIRECT_WEB", sourceGroup "DIRECT". */
channel: { otaName: string; otaReservationCode: string; source: string; sourceGroup: string };
stay: { checkIn: string; checkOut: string; nights: number; dayUse: boolean };
/** One entry per room. `status`: UPCOMING · CHECKEDIN · CHECKEDOUT · CANCELLED · NOSHOW. */
rooms: Array<{ roomTypeId: number; ratePlanId: number | null; checkIn: string; checkOut: string; status: string }>;
/** Every change of the booking (created, a no-show or its undo, cancelled) moves this forward. */
updatedAt: string;
}
/** A verified delivery. `type` is a string: a newer API may add events. */
export interface WebhookEvent {
id: string;
type: string;
data: { booking?: WebsiteBooking };
}
/** Yours to write: your own PMS. */
export interface MyCalendar {
/**
* Store the booking under its `id` with its status, and count its rooms against your own availability room
* by room with `roomHoldsNights`: a room that reads CANCELLED or NOSHOW gives its nights back, any other
* holds them. So a cancelled booking frees every room, a no-show frees the rooms that did not arrive, and a
* no-show the hotel undid holds them again. Applying the same booking twice, or an older version after a
* newer one, must change nothing: key it on `id` and ignore an older `updatedAt`.
*/
setWebsiteBooking(booking: WebsiteBooking): Promise<void>;
/** The updatedAt of the last website booking you applied, kept between runs; undefined before the first. */
lastSeen(): Promise<string | undefined>;
saveLastSeen(updatedAt: string): Promise<void>;
}
/**
* Does this room still hold its nights? Not once it is cancelled, and not once the hotel recorded that the guest
* did not arrive: both put the nights back on sale on every channel, so your own calendar frees them too.
*/
export const roomHoldsNights = (room: { status: string }) => room.status !== "CANCELLED" && room.status !== "NOSHOW";
/** A website booking, not an OTA one. An OTA booking would name the OTA and say CHANNEL_MANAGER. */
export const isWebsiteBooking = (booking: WebsiteBooking) => booking.channel.source === "DIRECT_WEB" && booking.channel.otaName === "Website";
/**
* Call this from your webhook route once the signature is checked, then answer 2xx at once. Deliveries are
* at-least-once: remember event.id too if your calendar cannot take the same booking twice.
*/
export async function onWebhookEvent(event: WebhookEvent, calendar: MyCalendar): Promise<"applied" | "ignored"> {
switch (event.type) {
case "direct.booking.created": // a guest booked: the room is off the count the channels hold already
case "direct.booking.modified": // a no-show (stayStatus NOSHOW: the nights are on sale again) or its undo (UPCOMING again)
case "direct.booking.cancelled": // the guest or the hotel cancelled: the booking says CANCELLED, with cancellation.reason
if (event.data.booking && isWebsiteBooking(event.data.booking)) {
await calendar.setWebsiteBooking(event.data.booking);
return "applied";
}
return "ignored";
default:
// channel.booking.* is an OTA booking: your existing code handles it.
return "ignored";
}
}
interface WebsiteBookingsPage {
since: string;
items: WebsiteBooking[];
more: boolean;
nextCursor: string | null;
}
/**
* Apply every website booking changed since the last one you applied. since is on a booking's last change, so
* a cancellation or a no-show lists the booking again; the oldest change comes first. On the first run pass `firstSince`,
* the date of the oldest booking your PMS needs to know of: with none, the API reads the last seven days.
*/
export async function catchUpWebsiteBookings(calendar: MyCalendar, propertyId?: number, firstSince?: string): Promise<number> {
const since = (await calendar.lastSeen()) ?? firstSince;
let cursor: string | undefined;
let applied = 0;
let newest: string | undefined;
for (;;) {
// While `more` is true, ask again with cursor = nextCursor. A cursor replaces since.
const page = await zs<WebsiteBookingsPage>("/direct-bookings", { propertyId, query: { since: cursor ? undefined : since, limit: 100, cursor } });
for (const booking of page.items) {
await calendar.setWebsiteBooking(booking);
newest = booking.updatedAt;
applied++;
}
if (!page.more || !page.nextCursor) break;
cursor = page.nextCursor;
}
// Start the next read at the last change you saw: it lists that booking once more, which is harmless.
if (newest) await calendar.saveLastSeen(newest);
return applied;
}
export interface AvailabilityUpdate {
roomTypeId: number;
dateFrom: string;
dateTo: string;
/** The rooms left to sell: absolute, not a change. */
available: number;
}
/**
* Your PMS's full push of room counts. The website bookings come first, so the counts you work out already
* hold the rooms they took; the push then never reopens a room a guest has booked.
*/
export async function pushRoomCounts(calendar: MyCalendar, countsFromMyCalendar: () => Promise<AvailabilityUpdate[]>, propertyId?: number) {
await catchUpWebsiteBookings(calendar, propertyId);
const updates = await countsFromMyCalendar(); // read AFTER the catch-up, never before it
return zs("/availability", { method: "PUT", body: { updates }, propertyId });
}
/** What the guest gets back, from the answer of a cancel. */
export interface WebsiteRefund {
/** The refund this call asked for; null when the booking was already cancelled (a replay). */
requested: "policy" | "full" | "none" | null;
/** In major units (4130 = 4,130.00 of the hotel's currency); 0 when nothing is owed. */
amount: number;
currency: string;
/** NONE nothing owed · PROCESSED the gateway accepted it · PENDING on its way · MANUAL owed, with no online payment to refund against: the hotel settles it. */
status: "NONE" | "PENDING" | "PROCESSED" | "MANUAL";
}
export interface WebsiteCancelResult {
/** The booking after the cancel: CANCELLED, every room CANCELLED. */
booking: WebsiteBooking;
refund: WebsiteRefund;
/** true: it was already cancelled; nothing changed and no money moved. */
replay: boolean;
}
/**
* Cancel a whole website booking from your PMS. Call it from a person's own cancel button, with the refund they
* chose, never from a sync job: it moves the guest's money.
*
* "policy" (the default): the guest asked to cancel. What the booking's own cancellation policy gives back now,
* as if the guest had cancelled on the booking page.
* "full": the hotel is at fault (an overbooking). Everything the guest paid online.
* "none": the hotel settles the money another way. Nothing moves.
*
* A checked-in, checked-out or no-show booking throws BOOKING_NOT_CANCELLABLE: show the message, the desk handles
* it. The cancel comes back to your webhook as direct.booking.cancelled ("Cancelled by the hotel"), and
* onWebhookEvent applying it a second time changes nothing.
*/
export async function cancelWebsiteBooking(
calendar: MyCalendar,
bookingId: number,
refund: "policy" | "full" | "none" = "policy",
reason?: string,
propertyId?: number
): Promise<WebsiteCancelResult> {
// zs() sends one x-idempotency-key per call and reuses it on its retries: a retry gets the first answer back
// and never refunds twice. A booking already cancelled answers replay: true and moves no money.
const answer = await zs<WebsiteCancelResult>(`/direct-bookings/${bookingId}/cancel`, {
method: "POST",
body: reason ? { refund, reason } : { refund },
propertyId,
});
// The nights are on sale on the channels again: give them back in your own calendar too.
await calendar.setWebsiteBooking(answer.booking);
return answer;
}
Read them: GET /direct-bookings
The answer has since, items, more and nextCursor, like GET /channel-bookings. Each item is the booking, as the webhook carries it. Put your key in place of zsk_test_YOUR_KEY.
Open a terminal and run this. On Windows PowerShell, type curl.exe instead of curl.
curl "https://api.zimmerstack.com/api/v1/connect-api/v1/direct-bookings?since=2026-12-01T00:00:00.000Z&limit=100" -H "Authorization: Bearer zsk_test_YOUR_KEY"- since
- Optional. An . Only bookings changed at or after this time are listed. If you leave it out, it is the last 7 days. On your first read, send the date of the oldest booking your PMS needs to know. After that, send the time of the last change you used.
- status
- Optional. CONFIRMED or CANCELLED. If you leave it out, you get both.
- limit
- Optional. From 1 to 100. If you leave it out, it is 50.
- cursor
- Optional. The
nextCursorof the answer before (). Whilemoreistrue, ask again with it. The cursor is used in place ofsince. A cursor that this API did not give is refused:400 VALIDATION. - The order
- Oldest change first. since looks at the last change of a booking. So a booking that was cancelled is listed again.
- The scope
direct-bookings:read. It is given apart fromchannel-bookings:read.- A deleted booking
- A booking the hotel deleted in ZimmerStack stays in the list, as CANCELLED.
- One booking
GET /direct-bookings/{bookingId}reads one. The answer is404 BOOKING_NOT_FOUNDfor a booking that is not this hotel's, or that was not made on its website.- Never in this list
- OTA bookings (GET /channel-bookings), front desk bookings, and bookings a key created (GET /bookings).
- With a company key
- Also send the X-ZS-Property header, with the id of the hotel.
The full pages of these two requests are List website bookings and Get a website booking.
Cancellations
- Who can cancel
- The guest, on the booking page. The hotel, by cancelling or deleting the booking in ZimmerStack. Or your PMS, with the API (below). cancellation.reason is "Cancelled by the guest" or "Cancelled by the hotel". A cancel from your PMS counts as the hotel's.
- What your PMS does
- Give the nights back in your own calendar, and keep the booking as cancelled. The room is on sale again on the OTAs. Your next update should say so too.
- A deleted booking
- A booking the hotel deleted in ZimmerStack stays listed by GET /direct-bookings, as CANCELLED, with every room.
- From your PMS
- POST /direct-bookings/{bookingId}/cancel cancels it, and says what the guest gets back. The next part explains it.
Cancel from your PMS
A guest phones the hotel to cancel. Or the hotel has an overbooking that it must undo. Your PMS can cancel the website booking itself, and choose what the guest gets back. ZimmerStack then gives the nights back on the OTAs, sends the guest the usual cancellation message, and moves the .
- What it cancels
- A whole website booking that is still UPCOMING.
- The scope
direct-bookings:cancel. The hotel's owner gives it on its own, and never by default. A key that holds onlydirect-bookings:readcannot cancel.- What happens after
- The nights go back on sale on the OTAs. The guest gets the usual cancellation message. direct.booking.cancelled says "Cancelled by the hotel".
- The limits
- 10 cancels a minute for one key. 50 cancels in any 24 hours for one hotel.
{
"refund": "policy",
"reason": "Guest phoned the front desk to cancel"
}- refund
- Optional. "policy", "full" or "none". The table below explains the three. If you leave it out, it is "policy".
- reason
- Optional. Why the booking is cancelled, in 500 characters at most. ZimmerStack keeps it in the activity log of the booking.
You can leave the body out. Then refund is "policy". The request also sends the header X-Idempotency-Key. It is your . Put a new code of your own in place of YOUR-OWN-CODE-0001, for each cancel a person asks for. A company key also sends X-ZS-Property. The full page of this request is Cancel a website booking.
Save the example above as cancel-website-booking.json. Open a terminal in the same folder and run this. On Windows PowerShell, type curl.exe instead of curl.
curl -X POST "https://api.zimmerstack.com/api/v1/connect-api/v1/direct-bookings/100001/cancel" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "X-Idempotency-Key: YOUR-OWN-CODE-0001" -H "Content-Type: application/json" -d "@cancel-website-booking.json"With the Node package:
// refund: "policy" when the guest asked to cancel, "full" when the hotel is at fault (an overbooking),
// "none" when the hotel settles the money another way. Left out, it is "policy".
const answer = await zs().directBookings.cancel(bookingId, { refund, reason });
// What the guest gets back, in major units, and where it stands: NONE, PENDING, PROCESSED or MANUAL.
console.log(answer.booking.status, answer.refund.amount, answer.refund.currency, answer.refund.status);
// replay: true means it was already cancelled and no money moved this time.
if (answer.replay) console.log("already cancelled");
Which refund
| refund | What the guest gets back | Choose it when |
|---|---|---|
| "policy" | What the booking's own cancellation policy gives back now. It is the policy the guest booked under. The result is the same as when the guest cancels on the booking page. This is the default: leave refund out, and you get it. | The guest asked the hotel to cancel. |
| "full" | Everything the guest paid online. | The hotel is at fault: an overbooking, a room that cannot be used, the hotel is closed. |
| "none" | Nothing. The booking is cancelled and no money moves. | The hotel settles the money another way: at the front desk, as a credit for another stay, or not at all under its own terms. |
- refund"policy"What the guest gets backWhat the booking's own cancellation policy gives back now. It is the policy the guest booked under. The result is the same as when the guest cancels on the booking page. This is the default: leave refund out, and you get it.Choose it whenThe guest asked the hotel to cancel.
- refund"full"What the guest gets backEverything the guest paid online.Choose it whenThe hotel is at fault: an overbooking, a room that cannot be used, the hotel is closed.
- refund"none"What the guest gets backNothing. The booking is cancelled and no money moves.Choose it whenThe hotel settles the money another way: at the front desk, as a credit for another stay, or not at all under its own terms.
A is the hotel's rule for what a guest gets back. The refund goes back to the guest's online payment, and it is never more than that payment. A guest who paid a part online gets at most that part back here. Any money above it, such as money paid at the front desk, is the hotel's to settle. The hotel's share of that online payment is taken back first.
The answer
The answer is 200. It carries the booking as the webhook carries it: CANCELLED, with every room CANCELLED. It also carries the money, and replay.
{
"booking": {
"id": 100001,
"reference": "TEST-WEB-4H7P9D",
"version": 1,
"status": "CANCELLED",
"stayStatus": "CANCELLED",
"channel": {
"otaName": "Website",
"otaReservationCode": "TEST-WEB-4H7P9D",
"source": "DIRECT_WEB",
"sourceGroup": "DIRECT"
},
"stay": {
"checkIn": "2026-12-24",
"checkOut": "2026-12-26",
"nights": 2,
"dayUse": false
},
"guest": {
"fullName": "Asha Verma",
"firstName": "Asha",
"lastName": "Verma",
"phone": "+919876500000",
"email": "asha.verma@example.com",
"country": "IN",
"language": "en"
},
"guestNotes": null,
"occupancy": {
"adults": 2,
"children": 0
},
"rooms": [
{
"roomTypeId": 412,
"ratePlanId": 901,
"roomTypeName": "Deluxe Garden Room",
"mealPlan": "CP",
"mealPlanSource": null,
"mealPlanText": null,
"mealPrice": null,
"adults": 2,
"children": 0,
"checkIn": "2026-12-24",
"checkOut": "2026-12-26",
"nights": 2,
"dayUse": false,
"ratePerNight": 2700,
"amount": 5400,
"nightlyRates": null,
"commission": null,
"status": "CANCELLED"
}
],
"amounts": {
"currency": "INR",
"total": 5400,
"paid": 1080,
"balanceDue": 4320,
"paymentCollect": "property"
},
"finance": null,
"cancellation": {
"at": "2026-12-11T09:15:00.000Z",
"reason": "Cancelled by the hotel"
},
"createdAt": "2026-12-10T12:00:00.000Z",
"updatedAt": "2026-12-11T09:15:00.000Z"
},
"refund": {
"requested": "policy",
"amount": 1080,
"currency": "INR",
"status": "PROCESSED"
},
"replay": false
}- refund.requested
- The refund this request asked for. null on a replay.
- refund.amount
- What the guest gets back, in of
refund.currency. It is 0 when nothing is owed. - refund.status
- Where the refund stands. The table below has the four values.
- replay
truemeans the booking was already cancelled, and this request changed nothing (a ).
| refund.status | What it means |
|---|---|
| NONE | Nothing is owed. The refund was none, or the policy gives nothing back at this time, or the guest paid nothing. |
| PROCESSED | The payment gateway accepted the refund. It reaches the guest's card or account on the gateway's own timetable. |
| PENDING | The refund is recorded and on its way. The gateway is still working on it, or ZimmerStack sends it by hand. |
| MANUAL | Money is owed, but there is no online payment to refund it to. For example, the guest paid at the front desk. amount is what is owed, and the hotel settles it with the guest. |
- refund.statusNONEWhat it meansNothing is owed. The refund was none, or the policy gives nothing back at this time, or the guest paid nothing.
- refund.statusPROCESSEDWhat it meansThe payment gateway accepted the refund. It reaches the guest's card or account on the gateway's own timetable.
- refund.statusPENDINGWhat it meansThe refund is recorded and on its way. The gateway is still working on it, or ZimmerStack sends it by hand.
- refund.statusMANUALWhat it meansMoney is owed, but there is no online payment to refund it to. For example, the guest paid at the front desk. amount is what is owed, and the hotel settles it with the guest.
The is the company that moves the money when a guest pays online.
Retries, replays and the event that follows
- Send X-Idempotency-Key
- Use a new key for each cancel a person asks for. Use the same key when you try that cancel again. A second try then gets the first answer back, and never refunds twice. The same key with another body is 409 IDEMPOTENCY_KEY_REUSED.
- The key, in detail
- It is 10 to 64 letters, digits, dashes or underscores. ZimmerStack keeps the first answer for 7 days. An answer that is given again carries the header X-Idempotent-Replay: true. A 429 answer or a 5xx answer is never kept, so a second try runs.
- Already cancelled
- The answer is 200 with replay: true. Nothing changes and no money moves. refund.requested is null. refund.amount and refund.status are what was recorded when the booking was cancelled. A booking that the guest or the hotel cancelled first answers the same way.
- Your own cancel comes back
- direct.booking.cancelled reaches every endpoint that lists it, yours too, with cancellation.reason "Cancelled by the hotel". Match it on the booking id and treat it as already done. The booking in the answer was the same booking, CANCELLED.
The Node package sends every cancel with an X-Idempotency-Key. It uses the same key when it tries again after a network failure. So a second try gets the first answer back, and never cancels or refunds twice. Give your own idempotencyKey when a second try can come from another process. Calling it again later is safe too: a booking that is already cancelled answers replay: true and moves no money.
When it is refused
- 409 BOOKING_NOT_CANCELLABLE
- The guest has checked in, has checked out, or is a no-show. A cancel is no longer possible, so the hotel settles it at the front desk. Do not try again.
- 404 BOOKING_NOT_FOUND
- It is not a booking of this hotel, or not a website booking. An OTA booking is cancelled on the OTA. A booking your key created is cancelled with POST /bookings/{bookingId}/cancel.
- 403 SCOPE_MISSING
- The key does not hold direct-bookings:cancel. The hotel's owner gives it on its own. A key that reads website bookings cannot cancel them without it.
- 429 RATE_LIMITED
- data.scope direct-cancels: 10 cancels a minute for one key. data.scope property-direct-cancels-day: 50 in any 24 hours for one hotel. Wait as long as Retry-After says. Tell the person when the limit of the day is used up.
On a it works with a , on a test website booking. The nights come back, and the event says "Cancelled by the hotel". No money moves: refund.status is NONE. See Try it on your sandbox.
A guest who did not arrive: direct.booking.modified
A no-show is not a cancellation. The hotel keeps what the guest paid, and the room goes back on sale. Your PMS hears of it as direct.booking.modified. It reads stayStatus, not status, to know which way it went.
- When it is sent
- The hotel records in ZimmerStack that the guest did not arrive, or takes that back. Nothing else sends direct.booking.modified yet.
- Not a cancellation
- status stays CONFIRMED, cancellation stays null, and the payment is not touched: amounts reads as it did before. Do not refund anything, and do not tell the guest.
- What your PMS does
- Read stayStatus. NOSHOW: the nights are on sale again on every OTA, so free the room in your own calendar. UPCOMING again (the no-show was taken back): the nights are taken again, so hold the room.
- Room by room
- The status of each room says the same thing. A room that reads NOSHOW or CANCELLED gives its nights back. Any other status holds them. When only some rooms of a booking did not arrive, stayStatus may stay as it was, and the rooms say which.
- changes and previous
- changes names what changed, such as "stayStatus" and "rooms[0].status". previous is the booking as it was before, with previous.stayStatus. On created and cancelled both stay null.
- The read says it too
- GET /direct-bookings lists the booking again, with the same stayStatus. So a PMS that missed the event still frees the room when it reads.
Try it on your sandbox
On a sandbox you can make a test website booking, and receive the real webhooks. You need a test key that holds the channel manager scopes: Sandbox in depth says how to get one.
- 1
Add a sandbox endpoint
On your sandbox, add a webhook endpoint and tick the three direct types. - 2
Make a test website booking
SendPOST /sandbox/bookingswith"otaName": "Website". The other fields are the same as for an OTA booking. The availability of the sandbox goes down by the rooms booked. Your endpoint gets the realdirect.booking.created, signed, withmode"test".paidByOta: truemeans the guest paid online, in full. - 3
Read it back, then cancel it
GET /direct-bookingslists it.POST /sandbox/bookings/{bookingId}/cancelcancels it as the guest would.POST /direct-bookings/{bookingId}/cancelcancels it as your PMS would. Each one gives the rooms back, and your endpoint getsdirect.booking.cancelled, with "Cancelled by the guest" or "Cancelled by the hotel". On a sandbox no money moves:refund.statusisNONE. - 4
Then a no-show, and its undo
POST /sandbox/bookings/{bookingId}/no-showon that website booking marks the guest as a no-show. The stay and its rooms readNOSHOW. The nights come back on the availability of the sandbox. Your endpoint gets the realdirect.booking.modified. Send{ "undo": true }to take it back. The nights are taken again, and a seconddirect.booking.modifiedsaysUPCOMING. - 5
Know what it refuses
POST /sandbox/bookings/{bookingId}/modifyon a website booking is409 BOOKING_NOT_MODIFIABLE. The real booking engine never changes the dates of a booking.
This is the request of step 2. Put your test key in place of zsk_test_YOUR_KEY.
{
"roomTypeId": 412,
"checkIn": "2026-12-24",
"nights": 2,
"rooms": 1,
"adults": 2,
"guestName": "Asha Verma",
"otaName": "Website",
"paidByOta": true
}Save the example above as make-test-website-booking.json. Open a terminal in the same folder and run this. On Windows PowerShell, type curl.exe instead of curl.
curl -X POST "https://api.zimmerstack.com/api/v1/connect-api/v1/sandbox/bookings" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "Content-Type: application/json" -d "@make-test-website-booking.json"Then use these requests on the same booking. Put its id in place of the word in brackets.
- Read it back
GET /direct-bookings- Cancel it as the guest would
POST /sandbox/bookings/{bookingId}/cancel. You getdirect.booking.cancelled, "Cancelled by the guest".- Cancel it as your PMS would
POST /direct-bookings/{bookingId}/cancel. You get "Cancelled by the hotel", andrefund.statusNONE.- A no-show
POST /sandbox/bookings/{bookingId}/no-show. You get the realdirect.booking.modified, withstayStatusNOSHOW.- The undo of the no-show
- The same request, with the body
{ "undo": true }. You getdirect.booking.modifiedagain, withstayStatusUPCOMING.
Do you need a key? A software company signs up as a partner. It is free: sign up. The developer of one hotel gets a sandbox key from the hotel's owner: Get your key from the hotel's owner.
With the Node package
- From version 0.3.0
isWebsiteBookingEvent(event)andisOtaBookingEvent(event)tell a checked event apart.zs.directBookings.list(),.get(id)and.all({ since })read the bookings, and follow the cursor for you.zs.sandbox.bookings.create({ …, otaName: "Website" })makes a test one.- From version 0.4.0
zs.directBookings.cancel(bookingId, { refund, reason })cancels one from your PMS.- From version 0.6.0
isWebsiteBookingEvent(event)is true fordirect.booking.modifiedtoo. So readevent.data.booking.stayStatusbefore you treat an event as a cancellation.
The package is @zimmerstack/connect. Node package has the example route that handles both families.
What is not there yet
- No event for other changes
- direct.booking.modified is a no-show and its undo only. Other dates, one room of several cancelled, or a payment taken at the front desk send no event yet. GET /direct-bookings lists the booking again, so read it on a slow schedule too.
- No check on the number
- ZimmerStack does not stop an update that puts the sold room back on sale. Using the booking first is the job of your PMS.
- Not the other direction
- Bookings that your own booking engine hands to the ZimmerStack PMS are another thing. They use
POST /bookings: Create a booking.
Words on this page
- Website booking
- A booking a guest made on the hotel's own website, through the ZimmerStack booking engine.
- PMS
- Property management system: the software a hotel uses at its front desk for bookings, guests and bills.
- Booking engine
- The part of a hotel's own website where a guest books a room.
- Channel manager
- Software that keeps a hotel's rooms and prices the same on every OTA. Learn more
- OTA
- Online travel agency: a website that sells hotel rooms, like Booking.com, MakeMyTrip or Agoda. Learn more
- Availability
- How many rooms of one room type are free to sell on one night. Learn more
- Webhook
- A message ZimmerStack sends to your server when something happens, like a new booking.
- Hourly booking
- A room booked for some hours of one day, not for a night.
- Front desk
- The reception of a hotel, where guests arrive and leave.
- No-show
- A guest who booked but did not arrive.
- Restrictions
- Stay rules for a night, like a minimum stay of 2 nights, or no arrival on that day. Learn more
- Overbooking
- Selling the same room to two guests for the same night.
- ISO time
- A date and time written like 2026-12-24T08:14:03.201Z. The Z at the end means UTC, the world's standard clock.
- Cursor
- A marker that says where a long list stopped. Send it back to get the next part of the list.
- Refund
- Money given back to a guest.
- Idempotency key
- A code you choose and send with an update. If the same update is sent twice by mistake, it is done only once.
- Cancellation policy
- The hotel's rule for how much money a guest gets back after cancelling.
- Major unit
- The main unit of a currency: the rupee, the euro, the yen.
- Replay
- The first answer, given again for a request that was already done. Nothing is done a second time.
- Payment gateway
- The company that moves the money when a guest pays online.
- Sandbox
- Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.
- Test key
- A key that starts with zsk_test_. It works only on a sandbox, so it can never change a real hotel.
- Scope
- One permission of a key. For example ari:write lets the key update availability, rates and restrictions.
- Company key
- The key of a software company. One key works for all the hotels of that company.
- X-ZS-Property
- The header that tells ZimmerStack which hotel a request is for. Its value is the property id.
Routes, samples, limits and codes on this page come from the API's public contract, read live, Sat, 05 Dec 2026 02:11:15 UTC.