API action
Close a room type(stop selling it on every OTA)
Stop selling one room type on some nights, on every OTA, with one request.
About this action
- What it does
- Sets the of one to 0. It also switches on a for every of that room type.
- When to use it
- When a room type must not be sold at all on some nights. For example its rooms are under repair.
- Who can use it
- A or a . A company key names the hotel with the . The key needs the
ari:write. - Address
POSThttps://api.zimmerstack.com/api/v1/connect-api/v1/availability/close- Before this
- You need a way to name the room type: your own for it, or its
roomTypeId. Get room types and rate plans shows both. You do not need the ids of the rate plans.
What you send
You send one room type and one range of nights. You name the room type by your own ref or by ZimmerStack's id.
- roomTypeId
- Number. ZimmerStack's id of the room type. Send this or
roomTypeRef, never both. - roomTypeRef
- Text. Your own for the room type: the one you gave it when you created it. Send this or
roomTypeId, never both. A room type that the hotel's owner made has no ref of yours. - dateFrom
- Text, like
2026-12-24(year-month-day). Required. The first night. - dateTo
- Text, like
2026-12-26. Required. The last night. To close one night only, send the same date in both. - days
- List, like
["fr", "sa"]. Optional. Only these days of the week are closed. - dryRun
trueorfalse. Optional. Withtrue, nothing is done: the answer only says what the request would do. See Test an update before you send it.
{
"roomTypeId": 412,
"dateFrom": "2026-12-24",
"dateTo": "2026-12-26"
}Things to know
- It does two things, and both are needed. Availability 0 closes the room type on every . But when a guest cancels on an OTA, one room can come back on sale. The stop sell keeps the room type closed.
- ZimmerStack remembers what it closed. So Reopen a room type can undo exactly this close later.
- It works when your updates are paused. A close only stops selling. So it is accepted even when your updates are paused. It is also accepted when your limit for the hour or the day is used up.
- Send an idempotency key. Put a code of your own in the header
X-Idempotency-Key. This is an . If the answer gets lost, send the same request again: it is done only once.
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 close-a-room-type.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/availability/close" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "X-ZS-Property: YOUR_PROPERTY_ID" -H "Content-Type: application/json" -d "@close-a-room-type.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 close-a-room-type.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/availability/close" -H "Authorization: Bearer zsk_test_YOUR_KEY" -H "Content-Type: application/json" -d "@close-a-room-type.json"What comes back
The is 202. It means: accepted. ZimmerStack saved the close and is now sending it to the OTAs. When nothing had to change, the status code is 200.
{
"statuscode": 202,
"message": "Accepted",
"data": {
"action": "close",
"dryRun": false,
"roomTypeId": 412,
"dateFrom": "2026-12-24",
"dateTo": "2026-12-26",
"nights": 3,
"count": {
"changedNights": 3,
"unchangedNights": 0
},
"ratePlans": [
{
"ratePlanId": 901,
"name": "Bed and breakfast",
"changedNights": 3,
"unchangedNights": 0,
"perOtaPlans": 1
},
{
"ratePlanId": 904,
"name": "Room only",
"changedNights": 2,
"unchangedNights": 1,
"perOtaPlans": 0
}
],
"notReached": [
{
"what": "ota-linked-rates",
"reason": "not-ours",
"message": "A rate an OTA links on its own side is not a rate plan here and takes no stop-sell from us. It is closed by the count alone, and an OTA cancellation puts one room back on the count: if this hotel has such a rate (its channels: BookingCom, Goibibo), send availability 0 again after a cancellation on these nights."
}
],
"skippedNights": 0,
"batches": [
{
"resource": "availability",
"batchId": "3c2b1a09-8f7e-4d6c-b5a4-938271605f4e",
"poll": "/api/v1/connect-api/v1/batches/3c2b1a09-8f7e-4d6c-b5a4-938271605f4e"
},
{
"resource": "restrictions",
"batchId": "9e8d7c6b-5a49-4382-a716-0f1e2d3c4b5a",
"poll": "/api/v1/connect-api/v1/batches/9e8d7c6b-5a49-4382-a716-0f1e2d3c4b5a"
}
]
}
}- nights
- How many nights you named.
- count.changedNights
- On how many nights the availability was set to 0.
- count.unchangedNights
- How many nights were at 0 already.
- ratePlans
- Every rate plan of the room type. For each one,
changedNightsis the number of nights on which its stop sell was switched on. - notReached
- What the close could not reach. Each item has a
reasonand amessage. - batches
- The updates this close made: one for availability and one for restrictions. Each one is a with its own
batchId. - lane
- Only when your updates were paused or a limit was used up. With
true, the close was accepted all the same.
Then check that it reached the OTAs
A close makes up to two updates. Check each batchId of batches with Check an update. The close is done when each one reads landed.
Common mistakes
- 400 VALIDATION
- A value has the wrong type or is missing. The message names it. A request with both
roomTypeIdandroomTypeRef, or with neither, is refused too. - 400 UNKNOWN_ROOM_TYPE
- No room type of this hotel has this
roomTypeIdor thisroomTypeRef. Nothing was saved. Read them again with Get room types and rate plans. - 409 CATALOG_CONFLICT
- Two room types of this hotel have the ref you sent, so it names no single one. Nothing was saved. Name the room type by its
roomTypeId. - 400 RANGE_INVALID
dateTois beforedateFrom. Or no night of the range is on one of thedaysyou named.- 400 HORIZON
- A date is in the past or too far ahead. You can send dates up to 500 days from today.
- 400 TOO_MANY_CELLS
- The range is too long. Each night counts once for the availability and once for each rate plan. One request can name up to 5,000 cells.
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
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-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.
- 403 WRITES_SUSPENDED
- ZimmerStack has suspended the updates of this integration. details.reason says why. Stop sending and write to ZimmerStack support. Reading and bookings still work.
- 409 ARI_NOT_AUTHORITATIVE
- The hotel is not live yet: your software is not its source of truth, so nothing was saved. GET /readiness says what is missing, and POST /go-live makes the switch. To send rates before that, add the header X-ZS-Before-Go-Live: true. It is the same for a company key and for a hotel's own key: a hotel key with ari:read or ari:write can be made before its hotel is live.
- 409 CHANNEL_MANAGER_DISABLED
- The hotel's channel manager is off, so nothing would be sent to an OTA. details.reason says why. not_on_channel_manager: the hotel was never put on it. With a company key, send its room types and rate plans (PUT /catalog/room-types, then PUT /catalog/rate-plans), or press Finish setup in the Channels app. Either puts it there. switched_off: the hotel's owner switched it off. Only the owner can switch it back on.
- 409 PROPERTY_UNAVAILABLE
- The hotel is deleted or is a demo. Or a test key was used on a real hotel, or a live key on a sandbox. Check which key you send. If the key is right, contact the hotel's owner.
- 503 SHIELD_UNAVAILABLE
- A problem on our side: the update could not be checked against the hotel's limits, so nothing was saved. Wait the seconds in Retry-After and send again.
- 503 WRITES_FROZEN
- ZimmerStack has paused the updates of every integration for now, never yours alone. Wait the seconds in Retry-After and send again. Reading and bookings still 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: close a room type
It starts with zsk_test_. It is kept in this browser tab only. Never paste a live key into a web page.
Go deeper
- Close and reopen a room type: Stop selling a room type on every OTA, and undo it.
- Test an update before you send it: See what an update would do. Nothing is saved.
Words on this page
- Availability
- How many rooms of one room type are free to sell on one night. Learn more
- 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.
- Stop sell
- A switch on a rate plan for one night. When it is on, that rate plan is not sold on that night.
- Rate plan
- One way to sell a room type, with its own price. For example Room only, or With breakfast.
- Ref
- Your own name or id for a room type or a rate plan. You choose it, and ZimmerStack remembers it.
- 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.
- Dry run
- A test of a request. ZimmerStack checks it and says what it would do, but saves nothing.
- OTA
- Online travel agency: a website that sells hotel rooms, like Booking.com, MakeMyTrip or Agoda. Learn more
- 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.
- Status code
- A number in every response. 200 to 299 means it worked. 400 and above means there is a problem.
- Batch
- One update you sent. It gets an id (batchId), so you can ask later if it reached the OTAs.
- Cell
- One night of one room type or rate plan. An update for 3 nights of 1 room type is 3 cells.
- 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.
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:29 UTC.