Skip to content

API action

Cancel a test booking(as the OTA would)

Cancel a test booking, as the OTA would. Your server gets the real webhook.

About this action

What it does
Cancels a test on your . Its nights become free again, and your gets the real channel.booking.cancelled .
When to use it
When you build the part of your software that handles a cancelled booking. Also to tidy up after a test.
Who can use it
A or a . A company key names the hotel with the . The key needs the ari:write.
Address
POST https://api.zimmerstack.com/api/v1/connect-api/v1/sandbox/bookings/{bookingId}/cancel
Before this
You need a and the bookingId of a test booking. Get it from the answer of Make a test booking, or from List test bookings. With a company key, put the property id of your sandbox in the X-ZS-Property header.

What you send

In the address:

bookingId
The id of the test booking. A number, like 90311.

Things to know

  1. A website booking sends another event. For a , made with otaName: "Website", your server gets direct.booking.cancelled.
  2. Cancelling twice is safe. The second answer is 200 again, with webhook.queued: false. No second webhook is sent.

The request, in your language

Show the examples for

A sandbox's own key works for one hotel: choose "A hotel key" for it.

Put your key in place of zsk_test_YOUR_KEY, and your hotel's property id in place of YOUR_PROPERTY_ID.

Open a terminal 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/90311/cancel" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "X-ZS-Property: YOUR_PROPERTY_ID"

Put your key in place of zsk_test_YOUR_KEY. A hotel key works for one hotel, so the request does not name the hotel.

Open a terminal 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/90311/cancel" -H "Authorization: Bearer zsk_test_YOUR_KEY"

What comes back

The is 200. The booking is cancelled and its rooms are free again. The webhook is on its way to your server.

response · status code 200
{
  "statuscode": 200,
  "message": "OK",
  "data": {
    "bookingId": 90311,
    "reference": "SBX-9001-MXHI8W001F6D",
    "channelBookingId": "sbx-1f6d0c2e-7b53-4a0e-9c5a-2d8f3b1e4c70",
    "otaName": "Booking.com",
    "status": "CANCELLED",
    "guestName": "Asha Verma-Rao",
    "checkIn": "2026-12-24",
    "checkOut": "2026-12-27",
    "nights": 3,
    "rooms": 1,
    "roomTypeId": 412,
    "nightlyRate": 4966.67,
    "total": 14900,
    "currency": "INR",
    "paidByOta": false,
    "oversold": false,
    "createdAt": "2026-12-10T12:00:00.000Z",
    "webhook": {
      "eventType": "channel.booking.cancelled",
      "queued": true
    }
  }
}
status
CANCELLED.
webhook.eventType
channel.booking.cancelled. For a website booking it is direct.booking.cancelled.
webhook.queued
true: the webhook is waiting to be sent. false: the booking was already cancelled, so nothing is sent.

Common mistakes

403 SANDBOX_ONLY
You used a . This action works only with a test key, on a sandbox.
404 BOOKING_NOT_FOUND
No test booking on this sandbox has this id. Read the ids again with List test bookings.
409 BOOKING_NOT_CANCELLABLE
Only an upcoming booking can be cancelled. This one is not upcoming any more: for example, it was marked as a no-show.
Other errors this request can give
401 API_KEY_INVALID
The key is not right. Copy it again, all of it, with no space before or after.
400 PROPERTY_REQUIRED
You hold a company key and did not name the hotel. Add the X-ZS-Property header.
404 PROPERTY_NOT_FOUND
The property id is not one of your hotels. Use an id from List your hotels.
403 SCOPE_MISSING
The key is not allowed to do this. It needs the scope ari:write.
403 IP_NOT_ALLOWED
The key only works from the addresses its owner allowed.
429 RATE_LIMITED
Too many requests in a short time. Wait the number of seconds in the Retry-After header, then send again.
401 API_KEY_REVOKED
The key was switched off, or it was replaced and its extra 24 hours are over. Ask the key's owner for the new key. Nothing else makes this key work.

Try it now

No code and no install. This box sends a real request to your . It works with a only, so it can never change a real hotel.

Try it here: cancel a test booking

It starts with zsk_test_. It is kept in this browser tab only. Never paste a live key into a web page.

Go deeper

  • Sandbox in depth: Test keys, test bookings and test failures.
  • Webhooks: Receive every booking, check that it is real, and never lose one.

Words on this page

Booking
A guest has reserved a room for some nights. Also called a reservation.
Sandbox
Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.
Webhook endpoint
The address of your server where ZimmerStack sends webhooks.
Webhook
A message ZimmerStack sends to your server when something happens, like a new booking.
Company key
The key of a software company. One key works for all the hotels of that company.
Hotel key
A key that works for one hotel only. The hotel's owner makes it, or a partner makes it for a hotel it added.
X-ZS-Property
The header that tells ZimmerStack which hotel a request is for. Its value is the property id.
Header
A small piece of extra information sent with a request, like your key.
Scope
One permission of a key. For example ari:write lets the key update availability, rates and restrictions.
Test key
A key that starts with zsk_test_. It works only on a sandbox, so it can never change a real hotel.
Website booking
A booking a guest made on the hotel's own website, through the ZimmerStack booking engine.
Status code
A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
Live key
A key that starts with zsk_live_. It works on real hotels.

New here? Start with the partner path or the one-hotel path.

Routes, samples, limits and codes on this page come from the API's public contract, read live, Fri, 04 Dec 2026 21:22:33 UTC.