Skip to content

Tools

Build with an AI agent

A is an AI program that writes code for you. Before it writes a line for this API, give it our rules. There are two files: one with the rules, and one with the whole reference. Both are made from the live contract. So the limits in them are the limits the server really uses.

The idea, with one example

An agent that has never seen this API will guess. Here a guess costs money. A price sent through this API is on Booking.com and Expedia within a minute.

An example. You tell your agent: "Show our prices on a screen, and let the staff change them."

Without the rules
The agent may write a loop that sends the whole calendar again and again. That uses up the hotel's limit, and the integration gets paused.
With the rules
The agent sends only what a person changed. The rules file tells it what it may never do, in words it follows on every task.

What the rules tell the agent

The key
It stays on your . While you build, it is a key. It is never in code for the browser, in a or in a log.
How fast to send
The real limits: 120 requests and 30 changes a minute for each key, and 5,000 in one request. A change is a request that saves something. Then the habits that stay inside the limits. Send ranges of nights. Send only when something changed. Send one change at a time. Never ask again and again (never poll).
What it sends
Full values, never a difference. Prices in the currency's main unit, with the currency's own decimals, when it sends and when it reads. Dates as plain calendar text, like 2026-12-24. An on every change.
When the API says no
Wait after a 429, the answer for too many requests. Try again after a problem on our side. Never send any other refused request again. Never work around a pause.
Done means checked
A checklist for the end. The agent runs it and reports each line: no key in the browser code, tests on the sandbox, no timer that sends changes.

Three files

  • What it isThe rules, a list of the requests and the steps for a rate grid. It is short, so the agent can read it on every task.
    Use itCommit it to your repository as AGENTS.md.
  • What it isThe whole reference in one file. It has every request with its fields and samples, every limit and error code, the outer shape of a webhook, and the code of the rate grid.
    Use itTell the agent to read it when it starts a feature.
  • What it isThe list of this site's pages, in the llms.txt format.
    Use itFor tools that look for it by themselves.
All three are made from one contract that programs can read, the OpenAPI document at https://api.zimmerstack.com/api/v1/public/connect-api/contract.

Two names in this table. is the file of rules a coding agent reads. is a standard file that lists a site's pages for AI tools.

A helper your agent can call

The Node package carries a small helper for your coding agent. It is called an . Through it the agent can do three things:

  • read these rules;
  • look up any request, type, limit or error code;
  • try a call on your sandbox before it writes code.

It runs on your own computer. It works with a only, and refuses a .

Claude Code
claude mcp add zimmerstack -- npx -y @zimmerstack/connect mcp

See the twelve tools it gives the agent, and the setup for Cursor. One of the tools is the doctor. When a request is refused or a webhook does not arrive, the agent asks what is wrong. It does not guess.

Add the rules to your repository

Most coding agents read a file named AGENTS.md from the top folder of your repository, by themselves. Codex, Cursor, GitHub Copilot's agent and others do this. Claude Code reads CLAUDE.md, and that file can import AGENTS.md.

Pick the tab that fits your repository. Then run its commands in a , in the top folder of the repository.

AGENTS.md
Your repository has no AGENTS.md yet. The command downloads our file as AGENTS.md.
Claude Code
You use Claude Code. The commands download our file and add one line to CLAUDE.md that imports it.
Existing file
Your repository has its own AGENTS.md. The commands keep yours, put our file beside it as docs/zimmerstack.md, and add one line that points to it.
a repository without an AGENTS.md
# From your repository's root
curl -fsSL https://docs.zimmerstack.com/agents.md -o AGENTS.md

Then give the key a safe home, before the first request. Put it in a file named .env that git ignores. The agent cannot leak it from there.

the key
# .env  (git-ignored; the key never leaves your server)
ZIMMERSTACK_CONNECT_KEY=zsk_test_...

# .env.example  (committed: the name, never a value)
ZIMMERSTACK_CONNECT_KEY=

# .gitignore
.env

A first prompt

A is the text you give to your agent. Copy this one to start. It makes the agent plan inside the limits before it writes code. And it makes the agent prove the result at the end.

to your agent
Read AGENTS.md, then https://docs.zimmerstack.com/llms-full.txt, and follow both exactly.

Build a rate grid for our hotel staff inside this app: room types and their rate plans as rows,
the next 30 nights as columns, with prices and rooms to sell that staff can edit and save.

Before writing code, tell me:
1. which ZimmerStack routes each screen action calls, and how many requests it costs;
2. where the key lives and how you made sure it cannot reach the browser;
3. what the screen shows for each refusal the API can answer.

Use the sandbox key in ZIMMERSTACK_CONNECT_KEY. Start from the four files in the "Guide: build a rate grid"
section of llms-full.txt instead of writing a client from scratch. Finish with the checklist at
the end of AGENTS.md and show me the result of each line.

The file

This is /agents.md as it is served now. Read it before you commit it, as you would read any code. Your agent will follow what it says. It names two hosts only: this site and the API.

AGENTS.md
# ZimmerStack Connect API: rules for AI coding agents

You are writing software against the ZimmerStack Connect API. ZimmerStack is a hotel's channel manager: every price, room count and stay rule written through this API is sent to the hotel's online travel agents (Booking.com, MakeMyTrip, Agoda, Airbnb, Expedia and others), and guests book at what you wrote. A wrong write costs a real hotel real money within a minute. Follow this file exactly. Where it and your habits disagree, this file wins.

Source: https://docs.zimmerstack.com/agents.md, generated 2026-12-04 from the live API contract (ZimmerStack Connect API v1). The numbers below are the server's own; when https://docs.zimmerstack.com/changelog moves, download this file again.

## Where the truth is

- The whole reference in one file, written for you: https://docs.zimmerstack.com/llms-full.txt
- The OpenAPI 3.1 contract (schemas, a sample of every request, every limit and error code): https://api.zimmerstack.com/api/v1/public/connect-api/contract
- The pages people read: https://docs.zimmerstack.com
- Never invent a route, a field, a header, a scope or an id. If the contract does not have it, it does not exist. Room type and rate plan ids come from `GET /catalog` and nowhere else.

## The API on one screen

- Base URL: `https://api.zimmerstack.com/api/v1/connect-api/v1`
- Auth: `Authorization: Bearer $ZIMMERSTACK_CONNECT_KEY` on every request, and nowhere else (never in: query string, x-api-key, user-api-key).
- A key starts `zsk_test_` (a sandbox no channel sees) or `zsk_live_` (a real hotel). A hotel key is one property. A software vendor's company key names the hotel on every request: `X-ZS-Property: <id from GET /properties>`.
- No key yet? A hotel's owner makes one (Admin → Developers → API keys). A software company signs itself up, free, at https://www.zimmerstack.com/partners/pms-companies#join (its sandbox is made at sign-up) and makes test company keys in the partner portal, https://partner.zimmerstack.com/login (Developers).
- Every answer is `{ "statuscode", "message", "data" }`. Read `data`. On a refusal branch on `data.code`, which is stable; never on `message`, which is for people and may change.
- `GET /property` works on every key: the property's timezone and currency, the key's scopes, its own limits and how much of them it has used.

| Route | What it does | Scope |
|---|---|---|
| `GET /availability` | Availability as our record holds it | `ari:read` |
| `GET /batches/{batchId}` | One accepted write and whether it has landed | `ari:read` |
| `GET /billing` | Your bills at a glance: what is owed, your quota, money paid ahead (a software partner's company key) | `billing:read` |
| `GET /billing/invoices` | Your issued invoices, each before and after tax | `billing:read` |
| `GET /billing/next-invoice` | What your next monthly invoice is made of, hotel by hotel | `billing:read` |
| `GET /catalog` | Room types and rate plans with the numeric ids every write uses | any key |
| `GET /channel-bookings` | The OTA bookings the channel manager delivered, in the webhook's shape | `channel-bookings:read` |
| `GET /channel-bookings/{bookingId}` | One channel booking, the webhook's shape | `channel-bookings:read` |
| `GET /channels` | The connected channels and their open issues, from our record | `ari:read` |
| `GET /connect-links` | Your one-time connect links (a software partner's company key) | `channels:connect` |
| `GET /connect-links/{linkId}` | Where one connect link stands | `channels:connect` |
| `GET /direct-bookings` | The bookings guests made on the hotel's own website, in the webhook's shape | `direct-bookings:read` |
| `GET /direct-bookings/{bookingId}` | One website booking, the webhook's shape | `direct-bookings:read` |
| `GET /events` | The hotel's ordered event log | `channel-bookings:read` |
| `GET /explain` | Explain this night | `ari:read` |
| `GET /limits` | Every budget this key sits under, with what is left and when it refills | any key |
| `GET /properties` | The properties this key may act on | any key |
| `GET /properties/{propertyId}/channels/{channelId}/mapping` | One OTA connection's mapping: the booking site's rooms and rates beside the hotel's rate plans | `channels:connect` |
| `GET /properties/{propertyId}/keys` | The keys you made on a hotel (a software partner's company key) | `keys:manage` |
| `GET /property` | The property this key is for | any key |
| `GET /rates` | Rates as our record holds them (minor units) | `ari:read` |
| `GET /readiness` | Is this hotel ready for your software to be its source of truth? | any key |
| `GET /requests` | This key's own requests of the last 7 days | any key |
| `GET /restrictions` | Restrictions as our record holds them | `ari:read` |
| `GET /sandbox/bookings` | Simulated OTA bookings on the sandbox, newest first | `ari:read` |
| `GET /sandbox/faults` | Sandbox: the fault in force on the pretend channel | `ari:read` |
| `GET /status` | The components and the incidents that touch your hotels | any key |
| `GET /support-tickets` | Your support tickets, newest first (a software partner's company key) | `support:write` |
| `GET /support-tickets/{ticketId}` | One ticket: the thread and the diagnostic | `support:write` |
| `GET /sync` | Has what you sent reached the channels? | `ari:read` |
| `GET /webhook-endpoints` | Your company webhook endpoints (a software partner's company key) | `webhooks:manage` |
| `GET /webhook-endpoints/{endpointId}` | One company webhook endpoint, with its health | `webhooks:manage` |
| `GET /webhook-endpoints/{endpointId}/deliveries` | The delivery log, newest first | `webhooks:manage` |
| `GET /webhook-endpoints/{endpointId}/deliveries/{deliveryId}` | One delivery: the body as sent, guest contact masked, and every attempt | `webhooks:manage` |
| `PUT /availability` | Set absolute availability | `ari:write` |
| `POST /availability/close` | Close a room type on these nights, everywhere | `ari:write` |
| `POST /availability/reopen` | Reopen a room type that POST /availability/close closed | `ari:write` |
| `PUT /catalog/rate-plans` | Create or change rate plans by your own ref | `catalog:write` |
| `DELETE /catalog/rate-plans/{ratePlanId}` | Delete a rate plan: the channel manager's copy first, then ours | `catalog:write` |
| `PUT /catalog/room-types` | Create or change room types by your own ref | `catalog:write` |
| `DELETE /catalog/room-types/{roomTypeId}` | Delete a room type: the channel manager's copy first, then ours; its plans go with it | `catalog:write` |
| `POST /channels/{channelId}/full-sync` | Full sync of one OTA connection: send that OTA everything again | `ari:write` |
| `PUT /channels/{channelId}/modifier` | Set one channel's price modifier | `channel-modifiers:write` |
| `POST /connect-links` | Make a one-time connect link for one hotel and one booking site (the last step of connecting it) | `channels:connect` |
| `POST /connect-links/{linkId}/revoke` | Withdraw a connect link | `channels:connect` |
| `POST /direct-bookings/{bookingId}/cancel` | Cancel a website booking and refund it: per its policy, in full, or not at all | `direct-bookings:cancel` |
| `POST /full-sync` | Full sync of the hotel: send every OTA everything again | `ari:write` |
| `POST /go-live` | Make your software this hotel's source of truth | `ari:write` |
| `POST /properties` | Add a hotel (a software partner's company key) | `properties:write` |
| `DELETE /properties/{propertyId}` | Remove a hotel you added (a software partner's company key) | `properties:write` |
| `PATCH /properties/{propertyId}` | Change a hotel | `properties:write` |
| `POST /properties/{propertyId}/channel-console` | Open the channel console for one hotel (a 15-minute address, shown once) | `channels:connect` |
| `POST /properties/{propertyId}/channels/{channelId}/disconnect` | Disconnect one OTA connection of a hotel | `channels:connect` |
| `PUT /properties/{propertyId}/channels/{channelId}/mapping` | Save one OTA connection's mapping (re-map its rooms and rate plans) | `channels:connect` |
| `POST /properties/{propertyId}/keys` | Mint a key on a hotel | `keys:manage` |
| `POST /properties/{propertyId}/keys/{keyId}/revoke` | Revoke a key you made on a hotel | `keys:manage` |
| `POST /properties/{propertyId}/keys/{keyId}/rotate` | Rotate a key you made on a hotel | `keys:manage` |
| `PUT /rates` | Set nightly sell prices | `ari:write` |
| `POST /rates/resend` | Send the property's prices to the channels again | `ari:write` |
| `PUT /restrictions` | Set stay restrictions | `ari:write` |
| `POST /sandbox/bookings` | Simulate an OTA booking on the sandbox: the booking, the inventory, the real webhook | `ari:write` |
| `POST /sandbox/bookings/{bookingId}/cancel` | The channel cancels a simulated booking: availability back, the real cancelled webhook | `ari:write` |
| `POST /sandbox/bookings/{bookingId}/modify` | The channel sends a modified revision: new dates, length, rooms or guest; the real modified webhook | `ari:write` |
| `POST /sandbox/bookings/{bookingId}/no-show` | Sandbox: a website booking's no-show, or its undo (the real direct.booking.modified) | `ari:write` |
| `POST /sandbox/faults` | Sandbox: make the pretend channel refuse, throttle or go down | `ari:write` |
| `DELETE /sandbox/faults` | Sandbox: end the fault | `ari:write` |
| `POST /sandbox/sync-events` | Sandbox: a channel problem, or its end (the real channel.sync.alert / channel.sync.recovered) | `ari:write` |
| `POST /support-tickets` | Open a support ticket | `support:write` |
| `POST /support-tickets/{ticketId}/close` | Close your own ticket | `support:write` |
| `POST /support-tickets/{ticketId}/messages` | Reply on a ticket | `support:write` |
| `POST /webhook-endpoints` | Create a company webhook endpoint | `webhooks:manage` |
| `DELETE /webhook-endpoints/{endpointId}` | Delete an endpoint | `webhooks:manage` |
| `PATCH /webhook-endpoints/{endpointId}` | Change an endpoint: its address, event types, notify email or the guest-contact switch | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/deliveries/{deliveryId}/redeliver` | Send one delivery again | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/pause` | Pause an endpoint: its events are held, not dropped | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/recover` | Recover since: queue again what the endpoint missed | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/resume` | Resume an endpoint: what the pause held goes out, oldest first | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/rotate-secret` | Rotate the signing secret | `webhooks:manage` |
| `POST /webhook-endpoints/{endpointId}/test` | Send a test event of any type | `webhooks:manage` |
| `GET /bookings` | Bookings the API created on this property, newest first | `bookings:read` |
| `GET /bookings/{bookingId}` | One booking the API created | `bookings:read` |
| `POST /bookings` | Create a booking in the PMS from your own booking engine | `bookings:write` |
| `POST /bookings/{bookingId}/cancel` | Cancel a booking the API created; its nights re-open on the channels | `bookings:write` |

## On Node: use the official package, not hand-written requests

`npm install @zimmerstack/connect` (Node 20 or newer, zero dependencies, typed from this contract). `new ZimmerStack()` reads `ZIMMERSTACK_CONNECT_KEY`; make one per process and reuse it. Reference: https://docs.zimmerstack.com/guides/node-package

It keeps these rules by itself, so do not re-implement them and do not wrap its calls in your own retry, queue or pacing:

- The key stays on a server: Refuses to start in a browser or in React Native. Sends the key to ZimmerStack only, never follows a redirect with it, and never prints it: not in an error, not when the client is logged.
- Budgets per minute: Reads every budget in the RateLimit headers on every answer (the key's, the hotel's, your company's) and waits before one runs out, instead of earning a 429.
- Writes are never a burst: Sends one hotel's writes one at a time, in the order they were made. Under a company key each hotel has its own queue and its own pace, so one hotel's budget never holds up another. At most four requests at once.
- Retry only what passes with time: Sends a 429 again after its Retry-After, four attempts in all. Sends a 5xx or a network failure again only when that is safe: a read, or a write that carries an idempotency key. Any other refusal is thrown at once and never resent.
- Budgets per hour and per day: A wait of up to two minutes is waited out. A longer one is given back to you at once as a retryable error with retryAfterSeconds and freesAt, and calls that would only be refused again are not sent. A call that may wait passes maxWaitSeconds; the package then holds it and tells onEvent when it lands. zs.limits.get() answers every budget with what is left.
- A retry must not write twice: Gives every write an idempotency key and reuses it on its own retries. A write the server keeps no such record for is not resent when its outcome is unknown.
- A request has a size: Splits a write at 1,000 updates or 5,000 cells, and folds single nights into ranges (grid.save).
- A refused key is not retried: After API_KEY_INVALID, API_KEY_REVOKED or API_KEY_EXPIRED it stops calling, so an address is never locked out by a loop.
- A test must not touch a real hotel: Refuses to write with a zsk_live_ key under a test runner (NODE_ENV=test, Vitest, Jest, node --test).

- Its own rules file ships inside it: `node_modules/@zimmerstack/connect/AGENTS.md`. Read it; where it names a method, use that method.
- It carries an MCP server: `npx -y @zimmerstack/connect mcp`. If it is connected, look routes, types, limits and codes up with `zimmerstack_reference` and try a body on the sandbox with `zimmerstack_sandbox_write` before writing the code that sends it. It refuses a live key.
- The grid is `zs.grid.load(from, to)` and `zs.grid.save(edits)`; a channel's price is `zs.channels.list()`, `zs.channels.setModifier(channelId, steps)` and `zs.rates.resend()`; a webhook is `verifyWebhook(rawBody, headers, secret)`. The hotel's own website bookings (from @zimmerstack/connect 0.3.0): `isWebsiteBookingEvent(event)` and `zs.directBookings.all({ since })`; cancelling one with its refund (from 0.4.0): `zs.directBookings.cancel(bookingId, { refund })`.
- A refusal is a `ZimmerStackError`: branch on `err.code`, show `err.message`, and never resend unless `err.retryable`.
- Everything below still applies: what the package cannot decide for you is WHEN to write (on a person's own save, never on a timer) and WHERE the key lives.

## Rules you must not break

### 1. The key is a secret that moves money

- It lives in one server-side environment variable, `ZIMMERSTACK_CONNECT_KEY`. Never in browser or mobile code, never in a variable the build exposes to the client (`NEXT_PUBLIC_*`, `VITE_*`, `EXPO_PUBLIC_*`, `REACT_APP_*`), never in the repository, a log line, an error message, a URL or a prompt.
- The browser calls the integrator's own backend, and only that backend calls ZimmerStack. That backend route gets the integrator's own sign-in check: it can change a hotel's prices.
- Add `.env` to `.gitignore` before writing the key into it. Commit `.env.example` with the variable's name and no value.
- Build and test with a `zsk_test_` key. Never run tests, seed scripts, load tests, migrations or experiments with a `zsk_live_` key. If the only key you were given is live, stop and ask the person for a sandbox key.
- Print at most the first 12 characters of a key.
- Ask the hotel for the fewest scopes the feature needs, and for the server's public IP addresses on the key's allowlist. On a host without fixed addresses (Vercel, Netlify, Replit and most serverless platforms), leave the allowlist empty while you build. Before you go live, either set it to your server's fixed outgoing addresses, or route your calls through a fixed-egress proxy (a service that sends your requests out from one address that does not change) and set it to the proxy's address.

### 2. Pacing: the limits are enforced, and an integration that ignores them is paused

Per minute: 120 requests and 30 writes per key; 300 requests and 60 writes per hotel across all its keys; 240 requests per IP address. One request: at most 1,000 updates, 5,000 cells (a cell is one room type or rate plan on one night) and 1,048,576 bytes. Per hotel: at least 10,000 changed cells an hour and 30,000 a day. Writes reach from today to today + 500 days; a read spans at most 500 days.

- Do not race the limits. Every answer carries `RateLimit` (`r` = requests left, `t` = seconds until the window refills): slow down before `r` reaches 0. `GET /property` carries the hotel's own `limits` and `usage`.
- Write ranges, not nights. One update with `dateFrom` and `dateTo` (and `days` for a weekday pattern) per run of equal values. Never one request per night, per row or per cell.
- Write on change only. Send the cells the person changed. Never re-send a calendar on a timer, on page load, on start-up or "to be safe".
- One write at a time per hotel. No `Promise.all` over writes, no parallel workers writing the same hotel.
- Edits wait for an explicit Save (or two quiet seconds), then go as one `PUT` per resource.
- Three reads draw a whole grid window. Cache `GET /catalog` for ten minutes. Never read in a loop per night or per row. Do not poll the grid.
- Ask `GET /batches/{batchId}` or `GET /sync` at most every 15 seconds, and stop after about five minutes.
- Bookings arrive by webhook. `GET /channel-bookings` (OTA bookings) and `GET /direct-bookings` (website bookings) recover a missed delivery; they are not polling loops.
- `429`: wait the `Retry-After` seconds the answer names, then resend the same request with the same `x-idempotency-key`. If that wait is longer than two minutes (an hourly or daily budget, or a pause), stop, keep the unsent changes, and tell the person.
- `5xx` or a network error: retry after 1, 2, then 4 seconds, three retries at most, same idempotency key.
- Never retry any other `4xx`. It is a verdict on the request: fix the request. No retry without a cap, no retry inside a retry.

### 3. Writes

- Values are absolute. `available` is the number of rooms left to sell on that night, not a change to it.
- Money: one shape both ways. Send `rate` in MAJOR units, a number or a decimal string (4500.50 is four thousand five hundred rupees and fifty paise), with the property's `currency`; reads return `rate` as a decimal string (`"4500.50"`) beside `currency` and `decimals`. A price is kept exactly, to the currency's own decimals (ISO 4217: 2 for rupees, euros, dollars; 0 for yen; `decimals` on `GET /property`). Never round a price yourself, and never send more decimals than the currency has: a decimal string with too many is refused, a number is rounded and named in the answer's `rounded` list, which you show to the person.
- `rateMinor` and every other `…Minor` field is HUNDREDTHS of the major unit for every currency (450050 is 4500.50; 1500000 is 15000 yen). That is the ISO minor unit only where the currency has two decimals. Prefer the decimal string.
- A price is 1 to 21,474,836. `stopSell: true` through `PUT /restrictions` closes ONE rate plan on that night: the room type's other plans keep selling, and so does a rate a booking site derives on its own side. To stop selling a room type on a night everywhere, send its room count as 0 through `PUT /availability`. Never a price of 0 or a token price.
- A `202` means saved by ZimmerStack, not yet on the booking sites. Read the batch: `failed` with `parkedCells` means the channel manager refused values (send a corrected value, never the same one again); `unreachable` names a room type or plan that reaches no channel. Read `rejected` and `rounded` on the write's answer and show them.
- A price under 10% or over 1,000% of its plan's standing price is refused whole: `422 RATE_OUT_OF_BAND`, nothing written. Check input on the screen. Do not work around it by splitting or retrying.
- Dates are `YYYY-MM-DD` calendar days in the hotel's timezone (`GET /property`). Keep them as strings; do date arithmetic in UTC. Never build one from a local `Date`, never shift one by an offset. `dateFrom` and `dateTo` are both included.
- Every write carries `x-idempotency-key` (10 to 64 characters of `[A-Za-z0-9_-]`; a UUID fits): a new one per write, the same one on its retries. After a 4xx other than 429, the corrected request takes a new one.
- A write answers `202` with a `batchId`: the values are in ZimmerStack's record and travel to the channels on their own (availability in seconds, prices and rules within a minute or two, longer under load). Say "saved, syncing", never "live on Booking.com".
- A `202` may still list `rejected` groups and `warnings`. Show them; everything else in the request landed.
- Do not build "sync everything", "force push" or "reset calendar" buttons.

### 4. When ZimmerStack says stop, stop

- `403 WRITES_SUSPENDED`, `503 WRITES_FROZEN`, or `429` with `data.scope` `shield-pause`: stop writing, keep the person's changes, show the message. Do not rotate keys, change IP addresses, split requests or add retries to get around it. A write that only closes inventory (a lower count, `stopSell`) is still accepted while paused, so a hotel never oversells.
- `401`: the key is wrong, revoked or expired. Stop at once: a key that keeps failing is refused without being looked up, and 20 failed attempts a minute from one address cut that address off for every key that has not just worked from it.
- `403 IP_NOT_ALLOWED`: the server's address is not on the key's allowlist. The hotel's owner adds it.
- `403 SCOPE_MISSING`: `data.details.needed` names the scope to ask the owner for.

### 5. Webhooks: OTA bookings arriving

- Verify every delivery before trusting it: the Standard Webhooks headers (`webhook-id`, `webhook-timestamp`, `webhook-signature`), HMAC-SHA256 over `id.timestamp.rawBody` with the endpoint's secret, a constant-time compare, and no timestamp older than five minutes. Verify the RAW body, before any JSON parsing.
- Answer 2xx within 10 seconds and do the work afterwards. Deliveries are at-least-once: ignore an event `id` you have already processed.
- The endpoint's secret is a secret like the key.
- Book money from `finance`, reading `finance.amountBasis` first: `amounts.total` is the guest's price on some OTAs and the OTA's payout on others. `finance.netPayoutAmount` is before the OTA's own deductions, never the bank amount.
- Match a booking you already hold on `channel.otaName` with `channel.otaReservationCode`. Missed deliveries are recovered from `GET /channel-bookings`, never by guessing.

### 6. Website bookings: apply them before you push room counts

- **What they are.** A hotel that sells on its own website through the ZimmerStack booking engine takes bookings no OTA sent. They reach a PMS under their own names: the webhooks direct.booking.created, direct.booking.modified and direct.booking.cancelled, and GET /direct-bookings for the pull. The booking object is the one channel.booking.* carries, so one parser serves both families.
- **Tell them apart.** channel.source is DIRECT_WEB, channel.sourceGroup is DIRECT and channel.otaName is "Website". finance is null (no OTA, no commission); amounts.paymentCollect is "property"; amounts.paid is what the guest paid online, amounts.balanceDue what the desk collects.
- **Subscribe.** An endpoint receives them only when it lists the event types, each ticked on its own. An endpoint registered before a type existed receives none of it until its owner ticks it: direct.booking.modified was added on 21 Nov 2026, so an endpoint that listed created and cancelled before then still receives exactly those two.
- **Apply them first.** A website booking takes one room off the count the channels hold, at once. A PMS that pushes absolute room counts must apply the booking to its own calendar BEFORE its next PUT /availability, or that push puts the sold room back on sale. Read GET /direct-bookings before a full push to catch anything a webhook has not delivered yet. Never push a count that was worked out before the website bookings were applied.
- **Events.** created: a nightly or an hourly booking the guest confirmed. modified: the hotel recorded in ZimmerStack that the guest did not arrive (a no-show), or undid that. The booking is not cancelled, so status stays CONFIRMED and the payment is untouched; stayStatus and each room's status say NOSHOW (the nights are on sale again on every channel: free the room) or, after an undo, UPCOMING again (the nights are taken again: hold the room). changes names what moved ("stayStatus", "rooms[0].status") and previous carries the booking as it read before, stayStatus included. cancelled: the guest cancelled on the booking page, or the hotel cancelled or deleted the booking in ZimmerStack or through POST /direct-bookings/{bookingId}/cancel; cancellation.reason says which ("Cancelled by the guest" or "Cancelled by the hotel"). A cancel your own PMS made comes back to you as this event too: match it on the booking id and treat it as already applied.
- **What sends no event.** Anything else the hotel changes on a website booking in ZimmerStack afterwards (other dates, one room of several cancelled, a payment taken at the desk) sends no event yet; modified is a no-show and its undo only, and changes is how a later kind of change will say what it is. GET /direct-bookings lists that booking again, because since is on its last change: read it on a slow schedule too (once an hour is plenty), not only before a push. A modified or a cancelled event can also arrive for a booking whose created your endpoint never received (it ticked the types later): treat an unknown booking id as new and read it with GET /direct-bookings/{bookingId}.
- **The pull.** GET /direct-bookings takes the same since, status, limit and cursor as GET /channel-bookings and pages the same way. Scope direct-bookings:read, granted separately from channel-bookings:read. A booking deleted in ZimmerStack stays listed, as CANCELLED. The key needs `direct-bookings:read`, a scope of its own: `403 SCOPE_MISSING` names it; ask the owner, do not look for another route.
- **Not these.** OTA bookings (GET /channel-bookings), front-desk bookings and bookings a key created (GET /bookings) are never listed here.
- **Cancelling from the PMS.** POST /direct-bookings/{bookingId}/cancel cancels a whole website booking that is still UPCOMING and says what the guest gets back: refund "policy" (the default: what the booking's own cancellation policy gives now, exactly as if the guest cancelled on the booking page), "full" (everything paid online) or "none" (the hotel settles any money itself). The refund goes back to the guest's online payment, never more than it; the hotel's share of that payment is taken back first. The nights go back on sale on the channels, the guest gets the usual cancellation message, and direct.booking.cancelled says "Cancelled by the hotel". Scope direct-bookings:cancel, granted on its own and never by default. A checked-in, checked-out or no-show booking is 409 BOOKING_NOT_CANCELLABLE; an already-cancelled one answers 200 with replay: true and moves no money. Send x-idempotency-key: a retry with the same key gets the first answer back. Budgets: 10 per key per minute, 50 per property per rolling day.
- **Who decides the refund.** A person, on a screen: `POST /direct-bookings/{bookingId}/cancel` only from their own cancel button, with the refund they chose (`policy` when the guest asked, `full` when the hotel is at fault, `none` when the hotel settles the money itself). Never from a loop, a sync job, a migration or a test against a `zsk_live_` key; never `POST /bookings/{bookingId}/cancel` on a website booking (it cancels only the bookings the key created). Show the answer's `refund.amount` and `refund.status`.
- **Sandbox.** POST /sandbox/bookings with otaName "Website" simulates one and sends the real direct.booking.created; its cancel sends direct.booking.cancelled. Its modify is 409 BOOKING_NOT_MODIFIABLE. POST /direct-bookings/{bookingId}/cancel works on a sandbox website booking with a test key: the nights come back and the event says "Cancelled by the hotel", and no money moves (refund.status NONE).

### 7. Bookings and events: the webhook is the nudge, the log is the truth

- GET /events?after=&limit= is the hotel's ordered event log: every event a webhook can carry for it (OTA bookings, website bookings, channel alerts), once, oldest first. The webhooks are the nudge; the log is the truth.
- Each event of a hotel has a sequence, one higher than the hotel's last. Keep the last sequence you applied and ask for everything after it: after an outage, on a schedule, or whenever a webhook arrives whose sequence is not your next one. nextAfter is your new place; more: true means ask again at once. Nothing depends on a delivery having arrived or on the order deliveries arrived in.
- data.booking.version is our own counter of a booking's events: 1 on its first event, one more on each later one. A higher version is a later state, whatever order deliveries arrived in.
- Kept 90 days. earliestSequence is the lowest sequence still kept: when it is more than one above your after, the events in between are gone; reconcile with GET /channel-bookings and GET /direct-bookings, then carry on from nextAfter.
- Build the receiver so nothing depends on a delivery: verify it, answer `2xx`, then read `GET /events?after=<your place>` and apply each event, saving its `sequence` with what you applied. Run the same read on a schedule and at start-up. A type you do not know is skipped, never an error.

### 8. Guest contact

- A guest's phone and email are returned by the API until 30 days after checkout. After that guest.phone and guest.email are null and guest.contactWithheld says "retention", so you can tell withheld from a booking that never had one. The name, the stay and the money stay.
- Every read that returned contact is logged (the key, the partner behind it, when, which bookings) and the hotel's owner sees the list. If a read cannot be logged its answer goes out with contactWithheld "unavailable": ask again.
- An endpoint receives phone and email only while its owner has guest contact switched on; it can be switched at any time. A partner's company endpoint starts with it off.
- Copy the contact the application needs when the booking arrives. Never plan to read it back later, and never treat `null` as "the guest gave none" when `guest.contactWithheld` is set.

### 9. When something is wrong

- Run `npx @zimmerstack/connect doctor` before changing code. It reads only and never prints the key: the key's shape, whether it answers, hotels and scopes, every budget, the last day's refused requests by reason, the webhook endpoints, sync and drift, each with what to do. https://docs.zimmerstack.com/guides/doctor
- Every request made with a key is kept 7 days and read back with GET /requests: time, route, status, error code, address, duration and request id; never a body or a guest's data.
- A key reported as found in a public place (for example by GitHub secret scanning in a public repository) is revoked at once and its holder is emailed: requests on it answer 401 API_KEY_REVOKED. Mint a new key and keep it in your server's settings, never in code.
- A hotel's own key and a company key are made, rotated and revoked by a person, never by code. Three things with a secret ARE by API, each for a company key with its own scope: its webhook endpoints (`webhooks:manage`), the keys it made on a hotel (`keys:manage`) and one-time connect links (`channels:connect`). Each secret is in the answer that makes or rotates it, once.

### 10. See what a write will do, and read what it did not do

- Every answer of an ARI write, and every preview, may carry notices: one plain sentence each, with a stable code, what it is about (room type, rate plans, nights, channels) and what to do. Warnings first; at most 20, with noticesOmitted for the rest. Absent when there is nothing to say.
- Branch on code, show message and action to a person. A code you do not know is one added later: show it. Codes are never renamed and never change meaning. Show the warnings to the person who saved. A notice is never a refusal: the write was accepted.
- Two different things. Availability 0 is a COUNT of the room type: it closes the room on every rate plan and every channel, the rates an OTA links on its own side included, and it moves: an OTA cancellation puts a room back, your next count replaces it. A stop-sell is a SWITCH on ONE rate plan: it holds whatever the count does, and it stops that plan only, so the room keeps selling through its other plans and through any rate an OTA derives on its side. To close a room and keep it closed, do both: POST /availability/close.
- Add dryRun: true to the body of PUT /availability, PUT /rates or PUT /restrictions. The request is validated, coalesced and judged exactly as a real one, and stops before the first write. It answers 200 with a preview instead of 202. Charged like the write it previews against the budgets of a minute: one request and one write on the key and the property, and the same cells on the property's cells budget (x-zimmerstack.limitsTable). Never counted against the hour and day budgets of changed cells: it changes none. So a dry run is not a free read of the calendar; GET /availability, /rates and /restrictions are the reads. Never dry-run on a timer or to read a night.
- POST /availability/close closes one room type on a range of nights everywhere, in one call: it sets the room type's count to 0 and switches stop-sell on for every one of its rate plans (their per-OTA plans take it from them on the channel manager). You do not need to know the hotel's plans. Scope ari:write. Read `notReached` in the answer. POST /availability/reopen undoes exactly that close and nothing else: it lifts the stop-sell on the plans the close switched on (a plan that was already stop-sold before stays stopped) and puts back the count each night held before. Name available to set a count yourself instead: only your software knows how many rooms are free now. A night whose count was changed after the close is left as it is, and a night the close had not closed is skipped (skippedNights). Call both from a person's action or a rule a person set, never from a loop over all rooms.
- When a person asks why a night is not selling as sent: `GET /explain?roomTypeId=&date=`, and show its `summary`. Where we do not know, the answer says so: seenAt null means the night was never read back from the channel manager; lastSent null means the write is older than the ones we kept the values of (searched says how far we looked); channels.known false means the hotel's connections have not been read yet. We hold the channel manager's copy, not each OTA's: what an OTA shows is what the channel manager passed to it. Never loop it over a calendar.

### 11. Going live, connect links and values shown once (a software partner's company key)

- Going live makes your software the source of truth for a hotel: from then on every price, stay rule and room count you send is pushed to its booking sites. A hotel you add with POST /properties is live from the start. Any other hotel (one whose owner let you in by your code) goes live with POST /go-live, once GET /readiness says it is ready. Both name the hotel in X-ZS-Property. A hotel's own key follows the same rules: when its owner makes a key that holds ari:read or ari:write, a hotel whose record already matches its booking sites, with nothing waiting to be sent, is switched on there and then; any other hotel gets the key "not live yet" and goes live with POST /go-live on that key, or with the Go live button on the owner's API keys page. Nobody has to ask ZimmerStack support for the switch.
- To send a full year first: PUT /rates for every rate plan and night, each request carrying the header X-ZS-Before-Go-Live: true. Without the header a hotel that is not live answers 409 ARI_NOT_AUTHORITATIVE, as before. Prices and stay rules sent ahead are stored and wait (the answer says heldUntilGoLive: true). Room counts are different: until the hotel is live, a count that lowers what is on sale is sent to the booking sites at once (a held count would oversell a room), and a count that raises it is refused in the answer's rejected list, because the hotel's own people may still be running its counts. Send your room counts again right after going live.
- Never work around a refused room count before go-live, and never loop on it: send the room counts after `POST /go-live` answers. Call `POST /go-live` when a person decided to; `409 NOT_READY` names the checks that did not pass.
- A connect link ALONE DOES NOT CONNECT A BOOKING SITE, except Airbnb. It is the LAST step: every other booking site must first accept our connectivity partner for the hotel, at the booking site itself (hotelStep; no API call and no link does that step). Only Airbnb is connected from the link alone. The link is one-time, for ONE booking site of ONE hotel, without your partner portal. Your company key asks for it (POST /connect-links) and you send its url to the hotel once its step is done. On our hosted page that person types the hotel's id at the booking site (MakeMyTrip and Goibibo also the access token they give), confirms every room and rate match (the mapping) and presses Start selling. Nobody signs in to a booking site on the page, except on Airbnb: the host signs in on Airbnb's own page and allows the connection. You hear channel.connect.completed, or channel.connect.expired if the link ran out first. A connect link takes no booking-site detail (no hotel id there, no access token, no password) and no room or rate match, in any field: the create's body is the hotel, the booking site and three options, and an unknown field is 400 VALIDATION. The details and the first matching are given by a person, on the page. A matching is changed later by API (x-zimmerstack.channelConnections); a booking-site detail never is.
- Only Airbnb is connected from the link alone (the host signs in on Airbnb's own page). Every other OTA must first accept our connectivity partner for the hotel, in its extranet or through its support: send `hotelStep` to the hotel first, and the link's `url` only once the hotel has done that step.
- Never ask a hotel for an OTA sign-in, its hotel id at the OTA or an access token, never store one, and never build a screen that takes one: the link's page takes them.
- Once a booking site is connected, your company key manages that connection for the hotel without your partner portal: read and change which of the hotel's rate plans feeds each room and rate of the booking site (the mapping), disconnect one booking site, and open the channel console for the hotel. The hotel is propertyId in the path and the connection is channelId, as GET /channels gives it with X-ZS-Property naming the hotel. Each request does what the partner portal's own button does, and each is on the hotel's activity log, which the hotel's owner reads, with your key's name.
- A new matching sends no price by itself. After a save that changed something, send POST /channels/{channelId}/full-sync for that connection (X-ZS-Property naming the hotel): the newly matched rates then receive their prices and room counts.
- POST /properties/{propertyId}/channel-console answers the address of the channel console for that one hotel: every connection, its settings, its mapping and its messages, as the partner portal's Channel console shows it. Open it in a browser or an iframe. The address works once, for the time expiresInSeconds says (15 minutes), and is in this answer only: a replay of the request (the same x-idempotency-key) answers url: null, so ask again for each session. Never store it or send it to anyone outside your team: whoever opens it acts on the hotel's connections. No body.
- A company key lists, mints, rotates and revokes the keys you made on a hotel, without your partner portal: GET and POST /properties/{propertyId}/keys, POST …/keys/{keyId}/rotate and …/revoke. The hotel is in the path; X-ZS-Property is not read. The secret is in the answer that mints or rotates a key and nowhere else: we keep its hash. A replay of that request (the same x-idempotency-key) answers key: null.
- A value shown once (a hotel key, a connect link's `url`, a webhook signing secret) goes into the server's secret store in the same step that received it, and never into a log, an error report or a chat. A retry of the same request answers `null` in its place: never store an empty value; take the way back the answer names (rotate the key, make a new link, rotate the secret). With the package: `shownOnce(answer)` returns the value or throws with the way back, and `withoutShownOnce(answer)` is what you may log.

### 12. Billing, support and status (a software partner's company key)

- Nothing here pays, accepts a price or changes billing details: those stay with a person in the partner portal. No payment link is answered. Amounts are major units as decimal strings beside …Minor in hundredths, in the invoice's currency (x-zimmerstack.moneyByCurrency). The quota's pay-ahead figure, the onboarding fee and the at-cost lines are in US dollars.
- A hotel includes a number of room types and rate plans; past them the channel manager charges for each one. Our limits sit under what is included, so nothing is charged unless ZimmerStack raises a hotel's limit. When it does, what the hotel holds above the included number is recorded against you at the channel manager's own price, nothing added, and listed under atCost with its month, its hotel and whether it is on an invoice yet. An item whose `status` is `RECORDED` is on no invoice yet: show it as recorded, never as billed. It is added to an invoice by ZimmerStack's team, not by itself.
- The level follows from the hotels you name: many_hotels needs two or more propertyIds or allProperties true; one_hotel needs exactly one; question takes any or none. A ticket opened with a test key is about a sandbox and is always question. A level that does not fit is 400 VALIDATION, with the sentence saying which one does. When a ticket opens we attach what our own records show for the last 24 hours and return it with the ticket: your refused requests (request ids, routes, codes and counts), each named hotel's sync state (room counts waiting, prices waiting or refused, open channel problems, where it stands with the channel shield), your own standing and what you wrote, and your webhook endpoints' failures (delivery ids and counts). Up to 20 hotels are described one by one. Ids, counts, states and times only: never a guest's data, a key, a secret, a webhook body or the text of an error. So do not paste any of those into the message.
- Open a ticket from a person's action or from one alert, never from a loop or a retry.
- Before blaming your own code for a failure across hotels, read `GET /status`. An incident is opened, updated and resolved by ZimmerStack's staff, never by a machine on its own: operational means no person has reported a problem, not that a monitor measured none. During an incident keep what people changed and send it when it is resolved; do not resend everything.
- platform.incident.opened, .updated and .resolved are sent once per endpoint, not once per hotel: data.incident.properties names your affected hotels. A hotel's own endpoint hears the incidents that touch that hotel; a company endpoint the ones that touch a hotel it may act on. They carry no top-level property and no sequence, are not in GET /events, and Recover since does not replay them: GET /status is the read. List the three types on an endpoint to receive them. The support-ticket events are the same. Check an event's type before any code that reads `property`.

## Recipe: the rate grid

Rows are room types, each followed by its rate plans. Columns are nights. Rooms left to sell belong to the room type; the price and the stay rules belong to the rate plan.

1. `GET /catalog` gives the rows. Cache it for ten minutes; ids come from here and nowhere else.
2. Three reads give every cell of the window: `GET /availability`, `GET /rates` and `GET /restrictions`, each with `?from=YYYY-MM-DD&to=YYYY-MM-DD`. Draw 14 to 60 nights; load the next window when the person scrolls.
3. The person edits cells. Keep one pending edit per cell on the screen; send nothing while they type.
4. On Save, fold the edits into ranges (consecutive nights of one row with the same value become one `dateFrom`..`dateTo`) and send one `PUT` per resource, one after another.
5. Each `202` carries a `batchId`. Show "saved, syncing" and ask `GET /batches/{batchId}` at most every 15 seconds until it says `landed` (or `failed` with `lastError`).
6. Read the window again after a save, when a `channel.booking.*` or `direct.booking.*` webhook names those nights, and when the person asks. Never on a timer.

Working TypeScript for all of it (a client that paces itself and retries correctly, the grid read and write, the range folding, a minimal screen) is at https://docs.zimmerstack.com/guides/rate-grid and inside https://docs.zimmerstack.com/llms-full.txt. Copy it; do not rewrite it from memory.

## Recipe: prices that differ per channel

There is one grid per hotel: one price per rate plan per night, sent to every channel that plan is mapped to. What differs per channel is the channel's **modifier**: up to five ordered steps (raise or lower, by a percentage or a fixed amount in major units) applied to every price sent to that channel.

1. `GET /channels`: find the channel (channelId, kind) and read the steps it holds.
2. `PUT /channels/{channelId}/modifier` with the whole list of steps; [] removes the modifier.
3. Nothing else: the channel manager sends that channel every date again, so prices already there move within minutes.

- **When it applies.** Saving a modifier makes the channel manager send that channel every date again, so prices already on the channel move to the new rule within minutes. Print that sentence where the person saves a modifier.
- **Scope.** Setting one needs `channel-modifiers:write`, a scope apart from `ari:write`. A software partner's keys hold it by default (the partner portal ticks it); a hotel's own key holds it when the owner ticked it. Without it the route answers `403 SCOPE_MISSING`: make a key with it in the partner portal, or ask the hotel's owner; do not look for another way.
- **One call moves every price on that channel.** Call `PUT /channels/{channelId}/modifier` only when a person saved the setting. Never from a loop, a timer, a migration, a seed script or a test against a `zsk_live_` key.
- **The band.** The steps together must stay between 50% lower and 100% higher, or the answer is `422 MODIFIER_OUT_OF_BAND` and nothing changes. Check it on the screen first.
- **Budgets.** 6 modifier changes and 3 re-sends per hotel per day. A modifier needs no re-send: the channel manager sends that channel every date again by itself. `POST /rates/resend` is a rare, deliberate act by a person; never call it automatically, and never to "make sure".
- **Re-sending the same price through `PUT /rates` does nothing**: an unchanged value is dropped. The re-send is the only way a night already on a channel picks a new modifier up.
- **A shared connection.** `409 CHANNEL_SHARED`: the connection serves several hotels and its modifier is not yours to set. Show the message; do not retry.
- **In the grid.** GET /rates always answers the price before any modifier. What a channel is sent is that price with the channel's steps applied in order. Show the channel's price beside the base price; never write it back as the rate.
- **A rate plan per OTA** is the other way, for one OTA needing its own price on particular nights: a second plan (`PUT /catalog/rate-plans`) the hotel maps to that OTA in the ZimmerStack Channels app, priced with `PUT /rates` like any plan.
- **Sandbox.** A sandbox has three pretend channels (Booking.com, MakeMyTrip, Agoda) so the whole workflow can be tried with a test key; nothing leaves our record.

## Before you tell the person it is done

- Search the built client bundle and the repository history for `zsk_`: no match.
- `.env` is ignored by git; `.env.example` names `ZIMMERSTACK_CONNECT_KEY` with no value.
- Tests and scripts run on a `zsk_test_` key or on mocks.
- Every write sends ranges, carries an idempotency key, and runs one at a time.
- No timer, loop or page load writes to ZimmerStack. No polling faster than every 15 seconds.
- `429` waits for `Retry-After`; other `4xx` are shown to the person, not retried.
- Prices are sent and shown in major units with the currency's own decimals, a `…Minor` value is divided by 100 in one place if it is used at all, and dates never pass through a local `Date`.
- A channel's modifier is set only from a person's own save, and the re-send only from a person's own button.
- A PMS that pushes room counts applies every website booking (`direct.booking.*`, `GET /direct-bookings`) to its own calendar before each push.
- The screen says what was saved and what was refused, in the API's own words.

The numbers in it are read from the contract each time the file is served. Download it again when the changelog has a new entry.

After the agent is done

Check four things yourself.

  1. Read the changed code and look for the key. Search the code that goes to the browser, and the history, for zsk_.
  2. Watch one Save in the network tab of your browser. You should see at most three requests to your own server. You should see none from the browser to api.zimmerstack.com.
  3. Ask the hotel's owner to look at Admin → Developers. Every key shows its last use, and any address that was refused.
  4. Send GET /property. Its usage shows how much of the hourly and daily limits the integration has used. Its shield shows where the integration stands. A healthy integration is far below both limits.

Words on this page

Coding agent
An AI program that writes code for you when you tell it what to build, like Claude Code, Cursor or Codex. Learn more
AGENTS.md
A text file of rules in your project. A coding agent reads it before it writes code.
llms.txt
A standard text file that lists the pages of a site for AI tools.
MCP server
A small helper program that a coding agent connects to. It gives the agent extra tools. Learn more
Prompt
The text you type to tell an AI program what to do.
Repository
The folder that holds your project's code and its history. Many teams keep it on GitHub.
Terminal
A window where you type commands for your computer. Also called the command line.
Server
A computer that runs your software all the time and can be reached over the internet.
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.
Live key
A key that starts with zsk_live_. It works on real hotels.
Cell
One night of one room type or rate plan. An update for 3 nights of 1 room type is 3 cells.
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.

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