API action
Cancel a website booking(and refund it)
Cancel one website booking from your software, and choose what the guest gets back.
About this action
- What it does
- Cancels a whole that a guest made on the hotel's own website. The nights go back on sale on every . The guest gets the usual cancellation message, and the you chose.
- When to use it
- When a guest phones the hotel to cancel. Or when the hotel must undo a booking, for example after an .
- Who can use it
- A or a . A company key names the hotel with the . The key needs the
direct-bookings:cancel. - Address
POSThttps://api.zimmerstack.com/api/v1/connect-api/v1/direct-bookings/{bookingId}/cancel- Before this
- You need the
bookingId. The scopedirect-bookings:cancelis given on its own: a key that can read website bookings cannot cancel them without it.
What you send
In the address:
- bookingId
- Number. ZimmerStack's id of the website booking.
The body is optional. Without a body, the refund follows the booking's own .
- refund
- Text. Optional. One of the three words below. Without it:
policy. - refund: policy
- The guest gets what the booking's own cancellation policy gives back now. It is the same as when the guest cancels on the website.
- refund: full
- The guest gets back all that was paid online. Use it when the hotel is at fault.
- refund: none
- No money moves. The hotel settles the money with the guest itself.
- reason
- Text, up to 500 letters. Optional. Why the booking is cancelled. It is kept in the booking's history in ZimmerStack.
{
"refund": "policy",
"reason": "Guest phoned the front desk to cancel"
}Things to know
- The refund goes back to the guest's online payment. It is never more than the guest paid online. Money paid at the is for the hotel to settle.
- Only an upcoming booking can be cancelled. After , after or after a , the answer is 409. The hotel handles it at the front desk.
- You can send it twice. A booking that is already cancelled answers 200 with
replay: true. No money moves a second time. - Your own cancellation comes back as a webhook. Your gets
direct.booking.cancelledtoo, with the reasonCancelled by the hotel. Match it by the bookingidand do nothing more.
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.
Save the example above as cancel-a-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-ZS-Property: YOUR_PROPERTY_ID" -H "Content-Type: application/json" -d "@cancel-a-website-booking.json"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.
Save the example above as cancel-a-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 "Content-Type: application/json" -d "@cancel-a-website-booking.json"What comes back
The is 200. The booking is cancelled. The answer has booking, the booking after the cancellation, and refund, what the guest gets back.
{
"statuscode": 200,
"message": "Booking cancelled",
"data": {
"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
}
}- booking
- The booking after the cancellation. Its
statusisCANCELLED. - refund.requested
- The refund you asked for. It is
nullwhen the booking was already cancelled. - refund.amount
- The money the guest gets back, in
refund.currency. It is 0 when nothing is owed. - refund.status
- What happened to the money. The table below explains each value.
- replay
- With
true, the booking was already cancelled before this request. Nothing changed and no money moved.
What the refund status means
Read refund.status, and tell the person who cancelled.
- NONE
- No money is owed. You chose
none, or the policy gives nothing back now, or the guest paid nothing online. - PROCESSED
- The accepted the refund. The money is on its way to the guest.
- PENDING
- The refund is saved and will be sent.
- MANUAL
- Money is owed, but there is no online payment to send it back to. The hotel pays the guest itself. The amount is in
refund.amount.
Common mistakes
- 400 VALIDATION
- The body is wrong:
refundis not one of the three words, or the body has a field that is not known. - 404 BOOKING_NOT_FOUND
- This hotel has no website booking with this id. An OTA booking is cancelled on the OTA. A booking your key created is cancelled with Cancel your booking.
- 409 BOOKING_NOT_CANCELLABLE
- The guest has checked in, has checked out, or is a no-show. The hotel handles it at the front desk. Do not send the request again.
- 429 RATE_LIMITED
- Too many cancellations. A key may send 10 in a minute, and a hotel may get 50 in 24 hours. Wait the seconds in the
Retry-Afterheader.
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-Propertyheader. - 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
direct-bookings:cancel. - 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-Afterheader, 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 website 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
- Bookings from the hotel's own website: How a booking made on the hotel's website reaches your PMS.
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
- Refund
- Money given back to a guest.
- Overbooking
- Selling the same room to two guests for the same night.
- 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.
- Cancellation policy
- The hotel's rule for how much money a guest gets back after cancelling.
- Front desk
- The reception of a hotel, where guests arrive and leave.
- Check-in
- The day a guest arrives.
- Check-out
- The day a guest leaves. It is not a night of the stay.
- No-show
- A guest who booked but did not arrive.
- Webhook endpoint
- The address of your server where ZimmerStack sends webhooks.
- Sandbox
- Your test hotel. It works like a real hotel, but no OTA can see it and it costs nothing.
- Status code
- A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
- Payment gateway
- The company that moves the money when a guest pays online.
- Test key
- A key that starts with zsk_test_. It works only on a sandbox, so it can never change a real hotel.
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 16:20:28 UTC.