@zimmerstack/connect 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +11 -5
- package/README.md +37 -10
- package/dist/cjs/client.d.ts +4 -4
- package/dist/cjs/client.js +4 -4
- package/dist/cjs/generated.d.ts +95 -7
- package/dist/cjs/generated.js +4 -2
- package/dist/cjs/webhooks.d.ts +21 -11
- package/dist/cjs/webhooks.js +13 -6
- package/dist/esm/client.d.ts +4 -4
- package/dist/esm/client.js +4 -4
- package/dist/esm/generated.d.ts +95 -7
- package/dist/esm/generated.js +4 -2
- package/dist/esm/mcp/reference.generated.js +25 -23
- package/dist/esm/webhooks.d.ts +21 -11
- package/dist/esm/webhooks.js +13 -6
- package/package.json +6 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Do not edit: change the contract, then run `pnpm --dir apps/connect-sdk run generate`.
|
|
3
3
|
// What the package's MCP server (src/mcp) answers lookups from. It is not part of the client's own exports.
|
|
4
4
|
/** The rules file this package ships (AGENTS.md), for the zimmerstack_rules tool. */
|
|
5
|
-
export const RULES = "# Building on @zimmerstack/connect: rules for coding agents\n\nYou are writing code that calls the ZimmerStack Connect API through its official package. A write\nthrough it changes a real hotel's prices and rooms on every booking site it sells on. The package\nenforces most of the API's rules for you; this file is the rest. Keep it in the repository (as\nAGENTS.md or CLAUDE.md) and follow it. The whole API reference, in one file an agent can read:\nhttps://docs.zimmerstack.com/llms-full.txt\n\n## The key\n\n- It lives in the environment variable `ZIMMERSTACK_CONNECT_KEY` on a server. Never write it into a\n file that is committed, a log line, an error message, a URL, a test fixture or anything a browser\n or a mobile app receives. Never print it. `new ZimmerStack()` reads it by itself.\n- The package refuses to start in a browser or in React Native. Do not work around that: the\n person's own frontend calls their own server, and the server calls ZimmerStack. Never put the key in\n a variable a bundler sends to the browser (`VITE_`, `NEXT_PUBLIC_`, `REACT_APP_`, `EXPO_PUBLIC_`).\n An app with no server gets the smallest one: https://docs.zimmerstack.com/sdk#no-server. A plain\n `fetch` from a browser is refused too (\"Failed to fetch\"), on purpose.\n- `zsk_test_…` is a sandbox: nothing reaches a channel. Build and test with it. `zsk_live_…` is a real\n hotel. The package refuses to WRITE with a live key under a test runner; never switch that off to\n make a test pass.\n- A software vendor's company key acts on one hotel at a time: `zs.forProperty(propertyId)`\n (`zs.properties.list()` names them), or `ZIMMERSTACK_PROPERTY_ID` in the environment for an app that\n serves one hotel. A test company key that reaches one sandbox finds it by itself; with several,\n name one; a live key never guesses.\n- No key yet: a software company signs up, free, at https://www.zimmerstack.com/partners/pms-companies#join\n and makes test keys in the partner portal (Developers); a hotel's owner makes one in Admin →\n Developers → API keys.\n\n## Let the package pace; never work around it\n\n- It reads the `RateLimit` header and slows down before a budget runs out, sends writes one at a\n time, retries only what passes with time (429, 5xx, a network failure) under the same idempotency\n key, and gives up with a `ZimmerStackError` otherwise. Do not wrap its calls in your own retry\n loop, and never resend a 4xx other than 429: it is a verdict on the request. Fix the request.\n- Per minute: 120 requests and 30 writes per key; 300 and 60 for all of a hotel's keys together.\n A hotel also has budgets per hour and per day that count CHANGED cells (at least 10,000 an hour, 30,000\n a day). Hitting one is `error.code === \"RATE_LIMITED\"` with `error.retryAfterSeconds`: tell the\n person when to try again; do not sleep through an hour.\n- One instance per process (`new ZimmerStack()` once, in a module). Two instances do not share a pace.\n- Never write on a timer, in a loop over all nights, or \"to be safe\". Send what a person changed,\n when they changed it: `zs.grid.save(edits)` folds nights into ranges and splits a large save.\n- Do not poll faster than every 15 seconds (`zs.batches.wait` already does it right), and stop.\n\n## Money and dates\n\n- A price is SENT in major units (4500 = 4,500.00 of the hotel's own currency) with that currency, and READ in minor\n units (`rateMinor`). `zs.grid.load` gives major units; `zs.grid.save` takes them.\n- A date is a plain `YYYY-MM-DD` calendar day in the hotel's timezone. Never build one with\n `new Date()` arithmetic in local time; use `eachDate(from, to)`.\n- To close a night send `stopSell: true`. Never a zero price, never zero rooms as a substitute.\n- Writes may reach 365 days ahead. A write is accepted (202) when it is in ZimmerStack's record; it\n reaches the channels in seconds to minutes. `zs.sync.get()` says how far along it is.\n\n## Room types and rate plans\n\n- A hotel sells room types (\"Deluxe Room\") through rate plans (\"Bed and breakfast\"). Create or change\n one with `zs.roomTypes.save({ ref, name, roomCount, adults })` and\n `zs.ratePlans.save({ ref, roomTypeRef, name, mealPlan, defaultRate })`. `ref` is the person's own\n id for it: sending the same ref again changes that entity, it never makes a second one. Several in\n one request: `zs.catalog.upsertRoomTypes` and `zs.catalog.upsertRatePlans`. All need the scope\n `catalog:write`.\n- Every later write names ZimmerStack's numeric `id`, not the ref: room counts name a room type's\n id, prices and stay rules name a rate plan's id. `zs.roomTypes.list()` and `zs.ratePlans.list()`\n give them, and so does the answer of each `save`.\n- `zs.roomTypes.delete(idOrRef)` and `zs.ratePlans.delete(idOrRef)` delete for good, and a room\n type takes its rate plans with it. Call them only when a person chose to delete that one entity on\n a screen, after a confirmation that names it. Never from a loop, a sync job, a \"reset\" or a cleanup\n script, and never to repair a mismatch: send the entity again with `save` instead. A hotel may\n delete 60 entities a day.\n- `CATALOG_CONFLICT` or `CHANNEL_MANAGER_ERROR` on a delete means the hotel still uses it: a\n booking site still sells it, an upcoming stay holds one of its rooms, or rooms are still assigned\n to the room type. Nothing was deleted. Show the message and stop; do not try another way round.\n\n## Adding and removing a hotel (a software partner's company key)\n\n- Only a COMPANY key with the scope `properties:write` can do either; a hotel's own key cannot\n (`COMPANY_KEY_REQUIRED`). The person ticks \"Also add and remove hotels\" when making the key in the\n partner portal; only the account's owner or an Admin is offered that tick box. Neither call names a\n hotel with `forProperty`.\n- `zs.properties.create({ name, owner, address, roomTypes })` adds a hotel and answers with its `id`:\n act on it with `zs.forProperty(id)`. The owner gets the sign-in details by email, never the caller.\n It joins the partner's monthly invoice. With a `zsk_test_` key the same call makes a sandbox, which\n is never billed. A partner may add 20 hotels an hour.\n- After adding: the hotel is not on the channel manager yet. The first `zs.roomTypes.save` (or\n `zs.catalog.upsertRoomTypes`) with the same refs puts it there; then the rate plans, then room\n counts and prices.\n- `zs.properties.delete(propertyId, { confirm })` (also `zs.properties.remove`) removes a hotel the\n partner added, FOR GOOD: its booking sites are disconnected, its rate plans and then its room types\n are removed from the channel manager, the hotel is closed and it comes off the invoice from the next\n 1st. `confirm` is the hotel's exact name from `zs.properties.list()`. There is no undo, and a\n removed hotel cannot be added again by API.\n- Call `delete` only when a person chose to remove that one hotel on a screen, after typing or\n confirming its name. Never from a loop, a timer, a sync job, a \"reset\", a cleanup or a test against\n a live key, and never to fix a hotel that looks wrong. A partner may remove\n 10 hotels a day.\n- The answer's `channelManager.state` is `REMOVED`, or `RETRYING` when one step is still finishing:\n that is success, ZimmerStack retries it, do not call again in a loop. `PROPERTY_NOT_REMOVABLE` means\n this key may not remove that hotel (its owner let the partner in, or it uses more than the channel\n manager): show the message and stop.\n- Both calls take longer than the others (a removal disconnects the booking sites one after another),\n so the client waits up to 95 seconds for them whatever `timeoutMs` is. If `delete` ends in\n `TIMEOUT` or `NETWORK_ERROR`, the person may press Remove again: a hotel already gone answers\n `replay: true`, one still being removed answers `PROPERTY_BUSY`. Never retry it in a loop.\n\n## A channel's price modifier\n\n- `zs.channels.setModifier(channelId, steps)` moves EVERY price sent to that channel from then on.\n Call it only when a person saved that setting on a screen. Never from a loop, a timer, a seed\n script or a test against a live key. A hotel may change modifiers 6 times a day.\n- A modifier applies to prices sent to the channel after the change. Prices already on the channel stay as they are until those nights are sent again.\n Show that sentence where the person saves (`MODIFIER_TAKES_EFFECT`), and offer\n `zs.rates.resend()` as a separate, deliberate button (\"Apply to nights already on sale\"): 3 a day\n per hotel, never automatic.\n- Keep the grid on the price before any modifier; show a channel's price beside it with\n `channelPrice(rate, steps)`.\n\n## Website bookings: apply them before you push room counts\n\n- When the hotel also sells on its own website through ZimmerStack's booking engine, those bookings\n reach you as the webhooks `direct.booking.created` and `direct.booking.cancelled` (the endpoint must\n list those two types) and by `zs.directBookings.all({ since })` (scope `direct-bookings:read`). They\n are not OTA bookings: `isWebsiteBookingEvent(event)` tells them apart, `channel.otaName` is `\"Website\"`\n and `finance` is null. There is no modified event.\n- A website booking takes one room off the count the channels hold, at once. A PMS that pushes absolute\n room counts must apply the booking to its own calendar BEFORE its next `zs.availability.set` or\n `zs.grid.save`, or that push puts the sold room back on sale. Read `zs.directBookings.all` before a\n full push. Nothing on our side stops the count from going up.\n- `zs.directBookings.cancel(bookingId, { refund, reason })` cancels a whole website booking that is\n still UPCOMING, and moves the guest's money (scope `direct-bookings:cancel`, granted on its own).\n `refund` is `\"policy\"` (the default: what the booking's own cancellation policy gives back, as if the\n guest cancelled), `\"full\"` (everything paid online: the hotel is at fault, an overbooking) or\n `\"none\"` (the hotel settles the money itself). Call it only from a person's own cancel button, with\n the refund they chose on the screen; never from a loop, a sync job or a test against a live key.\n Show `refund.amount` and `refund.status` from the answer. `BOOKING_NOT_CANCELLABLE` (checked in,\n checked out, a no-show) goes to the hotel's desk; do not retry it. `replay: true` means it was\n already cancelled and no money moved. Your own cancel comes back as `direct.booking.cancelled`\n (\"Cancelled by the hotel\"): match it on the booking id and treat it as already applied.\n\n## Errors\n\n```ts\nimport { ZimmerStack, ZimmerStackError } from \"@zimmerstack/connect\";\n\ntry {\n await zs.rates.set(updates);\n} catch (err) {\n if (err instanceof ZimmerStackError) {\n // err.code is stable (RATE_LIMITED, RATE_OUT_OF_BAND, SCOPE_MISSING, …); err.message is for people.\n // Show err.message to the person; branch on err.code; never retry unless err.retryable.\n }\n throw err;\n}\n```\n\n- `SCOPE_MISSING`: the key was not given that permission. Say which one is missing; the hotel's\n owner grants it (Admin → Developers → API keys). Do not look for another route.\n- `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`: stop. The client refuses every later call\n by itself; repeated bad calls get the server's address refused.\n- `RATE_OUT_OF_BAND`, `MODIFIER_OUT_OF_BAND`: the value is outside what the hotel allows. It is a\n guard against a typing slip; show the message, never split the change into smaller steps to pass.\n\n## The MCP server\n\nThe package carries an MCP server for you, the agent: `npx -y @zimmerstack/connect mcp`. If it is\nconnected, use it instead of guessing: `zimmerstack_reference` looks up any operation, type, limit\nor error code from the API's own contract, and `zimmerstack_sandbox_read` /\n`zimmerstack_sandbox_write` make one call on the sandbox so you can see real ids and try a body\nbefore you write the code that sends it. It works with a `zsk_test_` key only and refuses a live\none. It is for building; the application you write calls the API through the client, never through\nthese tools.\n\n## Before you call the work done\n\n- [ ] The key is read from the environment, on a server, and appears in no committed file or log.\n- [ ] Every screen that writes sends only what the person changed, once, on their action.\n- [ ] No retry loop, no timer and no polling faster than 15 seconds around a call of this package.\n- [ ] Errors show `err.message` to the person and branch on `err.code`.\n- [ ] Tests run against a `zsk_test_` key or a fake `fetch`; none needs a live key.\n- [ ] Where a modifier is saved, the screen says when it takes effect, and the re-send is its own button.\n- [ ] A PMS that pushes room counts applies every website booking to its own calendar before it pushes.\n- [ ] A website booking is cancelled only from a person's own action, with the refund they chose.\n- [ ] A room type or a rate plan is deleted only from a person's own action, after a confirmation that names it.\n";
|
|
5
|
+
export const RULES = "# Building on @zimmerstack/connect: rules for coding agents\n\nYou are writing code that calls the ZimmerStack Connect API through its official package. A write\nthrough it changes a real hotel's prices and rooms on every booking site it sells on. The package\nenforces most of the API's rules for you; this file is the rest. Keep it in the repository (as\nAGENTS.md or CLAUDE.md) and follow it. The whole API reference, in one file an agent can read:\nhttps://docs.zimmerstack.com/llms-full.txt\n\n## The key\n\n- It lives in the environment variable `ZIMMERSTACK_CONNECT_KEY` on a server. Never write it into a\n file that is committed, a log line, an error message, a URL, a test fixture or anything a browser\n or a mobile app receives. Never print it. `new ZimmerStack()` reads it by itself.\n- The package refuses to start in a browser or in React Native. Do not work around that: the\n person's own frontend calls their own server, and the server calls ZimmerStack. Never put the key in\n a variable a bundler sends to the browser (`VITE_`, `NEXT_PUBLIC_`, `REACT_APP_`, `EXPO_PUBLIC_`).\n An app with no server gets the smallest one: https://docs.zimmerstack.com/sdk#no-server. A plain\n `fetch` from a browser is refused too (\"Failed to fetch\"), on purpose.\n- `zsk_test_…` is a sandbox: nothing reaches a channel. Build and test with it. `zsk_live_…` is a real\n hotel. The package refuses to WRITE with a live key under a test runner; never switch that off to\n make a test pass.\n- A software vendor's company key acts on one hotel at a time: `zs.forProperty(propertyId)`\n (`zs.properties.list()` names them), or `ZIMMERSTACK_PROPERTY_ID` in the environment for an app that\n serves one hotel. A test company key that reaches one sandbox finds it by itself; with several,\n name one; a live key never guesses.\n- No key yet: a software company signs up, free, at https://www.zimmerstack.com/partners/pms-companies#join\n and makes test keys in the partner portal (Developers); a hotel's owner makes one in Admin →\n Developers → API keys.\n\n## Let the package pace; never work around it\n\n- It reads the `RateLimit` header and slows down before a budget runs out, sends writes one at a\n time, retries only what passes with time (429, 5xx, a network failure) under the same idempotency\n key, and gives up with a `ZimmerStackError` otherwise. Do not wrap its calls in your own retry\n loop, and never resend a 4xx other than 429: it is a verdict on the request. Fix the request.\n- Per minute: 120 requests and 30 writes per key; 300 and 60 for all of a hotel's keys together.\n A hotel also has budgets per hour and per day that count CHANGED cells (at least 10,000 an hour, 30,000\n a day). Hitting one is `error.code === \"RATE_LIMITED\"` with `error.retryAfterSeconds`: tell the\n person when to try again; do not sleep through an hour.\n- One instance per process (`new ZimmerStack()` once, in a module). Two instances do not share a pace.\n- Never write on a timer, in a loop over all nights, or \"to be safe\". Send what a person changed,\n when they changed it: `zs.grid.save(edits)` folds nights into ranges and splits a large save.\n- Do not poll faster than every 15 seconds (`zs.batches.wait` already does it right), and stop.\n\n## Money and dates\n\n- A price is SENT in major units (4500 = 4,500.00 of the hotel's own currency) with that currency, and READ in minor\n units (`rateMinor`). `zs.grid.load` gives major units; `zs.grid.save` takes them.\n- A date is a plain `YYYY-MM-DD` calendar day in the hotel's timezone. Never build one with\n `new Date()` arithmetic in local time; use `eachDate(from, to)`.\n- To close a night send `stopSell: true`. Never a zero price, never zero rooms as a substitute.\n- Writes may reach 365 days ahead. A write is accepted (202) when it is in ZimmerStack's record; it\n reaches the channels in seconds to minutes. `zs.sync.get()` says how far along it is.\n\n## Room types and rate plans\n\n- A hotel sells room types (\"Deluxe Room\") through rate plans (\"Bed and breakfast\"). Create or change\n one with `zs.roomTypes.save({ ref, name, roomCount, adults })` and\n `zs.ratePlans.save({ ref, roomTypeRef, name, mealPlan, defaultRate })`. `ref` is the person's own\n id for it: sending the same ref again changes that entity, it never makes a second one. Several in\n one request: `zs.catalog.upsertRoomTypes` and `zs.catalog.upsertRatePlans`. All need the scope\n `catalog:write`.\n- Every later write names ZimmerStack's numeric `id`, not the ref: room counts name a room type's\n id, prices and stay rules name a rate plan's id. `zs.roomTypes.list()` and `zs.ratePlans.list()`\n give them, and so does the answer of each `save`.\n- `zs.roomTypes.delete(idOrRef)` and `zs.ratePlans.delete(idOrRef)` delete for good, and a room\n type takes its rate plans with it. Call them only when a person chose to delete that one entity on\n a screen, after a confirmation that names it. Never from a loop, a sync job, a \"reset\" or a cleanup\n script, and never to repair a mismatch: send the entity again with `save` instead. A hotel may\n delete 60 entities a day.\n- `CATALOG_CONFLICT` or `CHANNEL_MANAGER_ERROR` on a delete means the hotel still uses it: a\n booking site still sells it, an upcoming stay holds one of its rooms, or rooms are still assigned\n to the room type. Nothing was deleted. Show the message and stop; do not try another way round.\n\n## Adding and removing a hotel (a software partner's company key)\n\n- Only a COMPANY key with the scope `properties:write` can do either; a hotel's own key cannot\n (`COMPANY_KEY_REQUIRED`). The person ticks \"Also add and remove hotels\" when making the key in the\n partner portal; only the account's owner or an Admin is offered that tick box. Neither call names a\n hotel with `forProperty`.\n- `zs.properties.create({ name, owner, address, roomTypes })` adds a hotel and answers with its `id`:\n act on it with `zs.forProperty(id)`. The owner gets the sign-in details by email, never the caller.\n It joins the partner's monthly invoice. With a `zsk_test_` key the same call makes a sandbox, which\n is never billed. A partner may add 20 hotels an hour.\n- After adding: the hotel is not on the channel manager yet. The first `zs.roomTypes.save` (or\n `zs.catalog.upsertRoomTypes`) with the same refs puts it there; then the rate plans, then room\n counts and prices.\n- `zs.properties.delete(propertyId, { confirm })` (also `zs.properties.remove`) removes a hotel the\n partner added, FOR GOOD: its booking sites are disconnected, its rate plans and then its room types\n are removed from the channel manager, the hotel is closed and it comes off the invoice from the next\n 1st. `confirm` is the hotel's exact name from `zs.properties.list()`. There is no undo, and a\n removed hotel cannot be added again by API.\n- Call `delete` only when a person chose to remove that one hotel on a screen, after typing or\n confirming its name. Never from a loop, a timer, a sync job, a \"reset\", a cleanup or a test against\n a live key, and never to fix a hotel that looks wrong. A partner may remove\n 10 hotels a day.\n- The answer's `channelManager.state` is `REMOVED`, or `RETRYING` when one step is still finishing:\n that is success, ZimmerStack retries it, do not call again in a loop. `PROPERTY_NOT_REMOVABLE` means\n this key may not remove that hotel (its owner let the partner in, or it uses more than the channel\n manager): show the message and stop.\n- Both calls take longer than the others (a removal disconnects the booking sites one after another),\n so the client waits up to 95 seconds for them whatever `timeoutMs` is. If `delete` ends in\n `TIMEOUT` or `NETWORK_ERROR`, the person may press Remove again: a hotel already gone answers\n `replay: true`, one still being removed answers `PROPERTY_BUSY`. Never retry it in a loop.\n\n## A channel's price modifier\n\n- `zs.channels.setModifier(channelId, steps)` moves EVERY price sent to that channel from then on.\n Call it only when a person saved that setting on a screen. Never from a loop, a timer, a seed\n script or a test against a live key. A hotel may change modifiers 6 times a day.\n- 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.\n Show that sentence where the person saves (`MODIFIER_TAKES_EFFECT`), and offer\n `zs.rates.resend()` as a separate, deliberate button (\"Apply to nights already on sale\"): 3 a day\n per hotel, never automatic.\n- Keep the grid on the price before any modifier; show a channel's price beside it with\n `channelPrice(rate, steps)`.\n\n## Website bookings: apply them before you push room counts\n\n- When the hotel also sells on its own website through ZimmerStack's booking engine, those bookings\n reach you as the webhooks `direct.booking.created`, `direct.booking.modified` and\n `direct.booking.cancelled` (the endpoint receives each only when it lists that type) and by\n `zs.directBookings.all({ since })` (scope `direct-bookings:read`). They are not OTA bookings:\n `isWebsiteBookingEvent(event)` tells them apart, `channel.otaName` is `\"Website\"` and `finance` is null.\n- `direct.booking.modified` is a no-show and its undo, nothing else yet: the hotel recorded that the guest\n did not arrive, or undid that. It is NOT a cancellation: `status` stays CONFIRMED and the payment is\n untouched, so never refund on it. Read `stayStatus` and each room's `status`: NOSHOW gives the nights\n back (they are on sale again on every channel), UPCOMING again holds them. `changes` names what moved\n (`\"stayStatus\"`, `\"rooms[0].status\"`); `previous` is the booking as it read before, `stayStatus`\n included. The sandbox does not simulate one: the endpoint's Test button sends the sample.\n- A website booking takes one room off the count the channels hold, at once. A PMS that pushes absolute\n room counts must apply the booking to its own calendar BEFORE its next `zs.availability.set` or\n `zs.grid.save`, or that push puts the sold room back on sale. Read `zs.directBookings.all` before a\n full push. Nothing on our side stops the count from going up.\n- `zs.directBookings.cancel(bookingId, { refund, reason })` cancels a whole website booking that is\n still UPCOMING, and moves the guest's money (scope `direct-bookings:cancel`, granted on its own).\n `refund` is `\"policy\"` (the default: what the booking's own cancellation policy gives back, as if the\n guest cancelled), `\"full\"` (everything paid online: the hotel is at fault, an overbooking) or\n `\"none\"` (the hotel settles the money itself). Call it only from a person's own cancel button, with\n the refund they chose on the screen; never from a loop, a sync job or a test against a live key.\n Show `refund.amount` and `refund.status` from the answer. `BOOKING_NOT_CANCELLABLE` (checked in,\n checked out, a no-show) goes to the hotel's desk; do not retry it. `replay: true` means it was\n already cancelled and no money moved. Your own cancel comes back as `direct.booking.cancelled`\n (\"Cancelled by the hotel\"): match it on the booking id and treat it as already applied.\n\n## Errors\n\n```ts\nimport { ZimmerStack, ZimmerStackError } from \"@zimmerstack/connect\";\n\ntry {\n await zs.rates.set(updates);\n} catch (err) {\n if (err instanceof ZimmerStackError) {\n // err.code is stable (RATE_LIMITED, RATE_OUT_OF_BAND, SCOPE_MISSING, …); err.message is for people.\n // Show err.message to the person; branch on err.code; never retry unless err.retryable.\n }\n throw err;\n}\n```\n\n- `SCOPE_MISSING`: the key was not given that permission. Say which one is missing; the hotel's\n owner grants it (Admin → Developers → API keys). Do not look for another route.\n- `API_KEY_INVALID`, `API_KEY_REVOKED`, `API_KEY_EXPIRED`: stop. The client refuses every later call\n by itself; repeated bad calls get the server's address refused.\n- `RATE_OUT_OF_BAND`, `MODIFIER_OUT_OF_BAND`: the value is outside what the hotel allows. It is a\n guard against a typing slip; show the message, never split the change into smaller steps to pass.\n\n## The MCP server\n\nThe package carries an MCP server for you, the agent: `npx -y @zimmerstack/connect mcp`. If it is\nconnected, use it instead of guessing: `zimmerstack_reference` looks up any operation, type, limit\nor error code from the API's own contract, and `zimmerstack_sandbox_read` /\n`zimmerstack_sandbox_write` make one call on the sandbox so you can see real ids and try a body\nbefore you write the code that sends it. It works with a `zsk_test_` key only and refuses a live\none. It is for building; the application you write calls the API through the client, never through\nthese tools.\n\n## Before you call the work done\n\n- [ ] The key is read from the environment, on a server, and appears in no committed file or log.\n- [ ] Every screen that writes sends only what the person changed, once, on their action.\n- [ ] No retry loop, no timer and no polling faster than 15 seconds around a call of this package.\n- [ ] Errors show `err.message` to the person and branch on `err.code`.\n- [ ] Tests run against a `zsk_test_` key or a fake `fetch`; none needs a live key.\n- [ ] Where a modifier is saved, the screen says when it takes effect, and the re-send is its own button.\n- [ ] A PMS that pushes room counts applies every website booking to its own calendar before it pushes.\n- [ ] A website booking is cancelled only from a person's own action, with the refund they chose.\n- [ ] A room type or a rate plan is deleted only from a person's own action, after a confirmation that names it.\n";
|
|
6
6
|
export const REFERENCE = {
|
|
7
7
|
"api": "ZimmerStack Connect API v1",
|
|
8
8
|
"base": "https://api.zimmerstack.com/api/v1/connect-api/v1",
|
|
@@ -411,7 +411,7 @@ export const REFERENCE = {
|
|
|
411
411
|
{
|
|
412
412
|
"key": "PUT /catalog/room-types",
|
|
413
413
|
"summary": "Create or change room types by your own ref",
|
|
414
|
-
"description": "Scope catalog:write. Up to 50 per request, each ref once. A ref seen before is updated where the fields differ; a new ref whose name the owner already used (with no ref) adopts that room type; anything else is created here and on the channel manager at once. roomCount is
|
|
414
|
+
"description": "Scope catalog:write. Up to 50 per request, each ref once. A ref seen before is updated where the fields differ; a new ref whose name the owner already used (with no ref) adopts that room type; anything else is created here and on the channel manager at once. roomCount is written at creation, and on a channel-manager-only hotel whenever it changes. The answer lists our id, the action and the sync status per entity, and where the property's channel manager stands.",
|
|
415
415
|
"scope": "catalog:write",
|
|
416
416
|
"call": "zs.catalog.upsertRoomTypes(body)",
|
|
417
417
|
"also": [
|
|
@@ -1349,7 +1349,7 @@ export const REFERENCE = {
|
|
|
1349
1349
|
},
|
|
1350
1350
|
{
|
|
1351
1351
|
"status": 409,
|
|
1352
|
-
"description": "NO_AVAILABILITY (the night and the count are in details; nothing was written), EXTERNAL_REFERENCE_REUSED (another key's reference on this property, or your own cancelled booking's: send a new reference), PROPERTY_UNAVAILABLE, PMS_NOT_AVAILABLE"
|
|
1352
|
+
"description": "NO_AVAILABILITY (the night and the count are in details; nothing was written), EXTERNAL_REFERENCE_REUSED (another key's reference on this property, or your own cancelled booking's: send a new reference), TAXES_NOT_CONFIGURED (nightlyRateIncludesTaxes false at a hotel with no confirmed tax lines) or TAXES_INSIDE_RATES (false at a hotel whose taxes all sit inside its prices): send the rate as the guest pays it, under a new x-idempotency-key (a refusal is kept against its key for 7 days), PROPERTY_UNAVAILABLE, PMS_NOT_AVAILABLE"
|
|
1353
1353
|
},
|
|
1354
1354
|
{
|
|
1355
1355
|
"status": 413,
|
|
@@ -1571,7 +1571,7 @@ export const REFERENCE = {
|
|
|
1571
1571
|
{
|
|
1572
1572
|
"key": "PUT /channels/{channelId}/modifier",
|
|
1573
1573
|
"summary": "Set one channel's price modifier",
|
|
1574
|
-
"description": "Scope channel-modifiers:write. Replaces the channel's steps with the list sent ([] removes them). Applied to the channel manager while the request runs, read back, then answered: 200 means the channel holds them.
|
|
1574
|
+
"description": "Scope channel-modifiers:write. Replaces the channel's steps with the list sent ([] removes them). Applied to the channel manager while the request runs, read back, then answered: 200 means the channel holds them. The channel manager then sends that channel every date again, so prices already there move within minutes; no re-send is needed. Steps the channel already holds answer changed: false and cost nothing.",
|
|
1575
1575
|
"scope": "channel-modifiers:write",
|
|
1576
1576
|
"call": "zs.channels.setModifier(channelId, steps)",
|
|
1577
1577
|
"also": [],
|
|
@@ -1616,7 +1616,7 @@ export const REFERENCE = {
|
|
|
1616
1616
|
}
|
|
1617
1617
|
],
|
|
1618
1618
|
"changed": true,
|
|
1619
|
-
"notice": "
|
|
1619
|
+
"notice": "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."
|
|
1620
1620
|
},
|
|
1621
1621
|
"refusals": [
|
|
1622
1622
|
{
|
|
@@ -1660,7 +1660,7 @@ export const REFERENCE = {
|
|
|
1660
1660
|
{
|
|
1661
1661
|
"key": "POST /rates/resend",
|
|
1662
1662
|
"summary": "Send the property's prices to the channels again",
|
|
1663
|
-
"description": "Scope ari:write. Marks every rate-plan night of the writable horizon to be sent again, unchanged
|
|
1663
|
+
"description": "Scope ari:write. Marks every rate-plan night of the writable horizon to be sent again, unchanged. The nights travel like any write: paced, coalesced, never lost. Not needed after a modifier change (the channel manager re-sends that channel every date itself); it is limited per property per day (data.scope rate-resends-day). No body.",
|
|
1664
1664
|
"scope": "ari:write",
|
|
1665
1665
|
"call": "zs.rates.resend()",
|
|
1666
1666
|
"also": [],
|
|
@@ -2588,14 +2588,14 @@ export const REFERENCE = {
|
|
|
2588
2588
|
}
|
|
2589
2589
|
],
|
|
2590
2590
|
"types": {
|
|
2591
|
-
"Error": "export interface Error {\n statuscode: number;\n /** Human-readable, may change; branch on data.code */\n message: string;\n data: {\n code: \"API_KEY_INVALID\" | \"API_KEY_REVOKED\" | \"API_KEY_EXPIRED\" | \"CONNECT_API_NOT_CONFIGURED\" | \"IP_NOT_ALLOWED\" | \"SCOPE_MISSING\" | \"PROPERTY_UNAVAILABLE\" | \"CHANNEL_MANAGER_DISABLED\" | \"PMS_NOT_AVAILABLE\" | \"VALIDATION\" | \"RANGE_INVALID\" | \"HORIZON\" | \"TOO_MANY_UPDATES\" | \"TOO_MANY_CELLS\" | \"UNKNOWN_ROOM_TYPE\" | \"UNKNOWN_RATE_PLAN\" | \"CURRENCY_MISMATCH\" | \"RATE_LIMITED\" | \"NOTHING_ACCEPTED\" | \"BATCH_NOT_FOUND\" | \"IDEMPOTENCY_KEY_INVALID\" | \"IDEMPOTENCY_KEY_REUSED\" | \"IDEMPOTENCY_IN_FLIGHT\" | \"STAY_INVALID\" | \"UNKNOWN_ROOM_TYPE_FOR_PLAN\" | \"OCCUPANCY_EXCEEDED\" | \"NO_AVAILABILITY\" | \"EXTERNAL_REFERENCE_REUSED\" | \"PAYMENT_NOT_ALLOWED\" | \"PAYMENT_EXCEEDS_TOTAL\" | \"BOOKING_NOT_FOUND\" | \"BOOKING_NOT_CANCELLABLE\" | \"MODULE_NOT_ENTITLED\" | \"SANDBOX_ONLY\" | \"ROOM_TYPE_NOT_FOUND\" | \"RATE_PLAN_NOT_FOUND\" | \"CATALOG_CONFLICT\" | \"CATALOG_BUSY\" | \"CHANNEL_MANAGER_ERROR\" | \"PROPERTY_REQUIRED\" | \"PROPERTY_NOT_FOUND\" | \"ARI_NOT_AUTHORITATIVE\" | \"ROUTE_NOT_FOUND\" | \"PAYLOAD_TOO_LARGE\" | \"AUTH_BACKEND_UNAVAILABLE\" | \"BOOKING_NOT_MODIFIABLE\" | \"SANDBOX_NOT_FOUND\" | \"SANDBOX_INCOMPLETE\" | \"WRITES_FROZEN\" | \"WRITES_SUSPENDED\" | \"SHIELD_UNAVAILABLE\" | \"CATALOG_LIMIT_REACHED\" | \"TOO_MANY_NEW_ENTITIES\" | \"RATE_OUT_OF_BAND\" | \"CHANNEL_NOT_FOUND\" | \"CHANNEL_SHARED\" | \"MODIFIER_OUT_OF_BAND\" | \"COMPANY_KEY_REQUIRED\" | \"BILLING_SETUP_REQUIRED\" | \"OWNER_HAS_ACCOUNT\" | \"SANDBOX_LIMIT\" | \"CONFIRMATION_MISMATCH\" | \"PROPERTY_NOT_REMOVABLE\" | \"PROPERTY_BUSY\" | \"PRICE_UNAVAILABLE\";\n details?: unknown;\n };\n}",
|
|
2591
|
+
"Error": "export interface Error {\n statuscode: number;\n /** Human-readable, may change; branch on data.code */\n message: string;\n data: {\n code: \"API_KEY_INVALID\" | \"API_KEY_REVOKED\" | \"API_KEY_EXPIRED\" | \"CONNECT_API_NOT_CONFIGURED\" | \"IP_NOT_ALLOWED\" | \"SCOPE_MISSING\" | \"PROPERTY_UNAVAILABLE\" | \"CHANNEL_MANAGER_DISABLED\" | \"PMS_NOT_AVAILABLE\" | \"VALIDATION\" | \"RANGE_INVALID\" | \"HORIZON\" | \"TOO_MANY_UPDATES\" | \"TOO_MANY_CELLS\" | \"UNKNOWN_ROOM_TYPE\" | \"UNKNOWN_RATE_PLAN\" | \"CURRENCY_MISMATCH\" | \"RATE_LIMITED\" | \"NOTHING_ACCEPTED\" | \"BATCH_NOT_FOUND\" | \"IDEMPOTENCY_KEY_INVALID\" | \"IDEMPOTENCY_KEY_REUSED\" | \"IDEMPOTENCY_IN_FLIGHT\" | \"STAY_INVALID\" | \"UNKNOWN_ROOM_TYPE_FOR_PLAN\" | \"OCCUPANCY_EXCEEDED\" | \"NO_AVAILABILITY\" | \"EXTERNAL_REFERENCE_REUSED\" | \"PAYMENT_NOT_ALLOWED\" | \"PAYMENT_EXCEEDS_TOTAL\" | \"TAXES_NOT_CONFIGURED\" | \"TAXES_INSIDE_RATES\" | \"BOOKING_NOT_FOUND\" | \"BOOKING_NOT_CANCELLABLE\" | \"MODULE_NOT_ENTITLED\" | \"SANDBOX_ONLY\" | \"ROOM_TYPE_NOT_FOUND\" | \"RATE_PLAN_NOT_FOUND\" | \"CATALOG_CONFLICT\" | \"CATALOG_BUSY\" | \"CHANNEL_MANAGER_ERROR\" | \"PROPERTY_REQUIRED\" | \"PROPERTY_NOT_FOUND\" | \"ARI_NOT_AUTHORITATIVE\" | \"ROUTE_NOT_FOUND\" | \"PAYLOAD_TOO_LARGE\" | \"AUTH_BACKEND_UNAVAILABLE\" | \"BOOKING_NOT_MODIFIABLE\" | \"SANDBOX_NOT_FOUND\" | \"SANDBOX_INCOMPLETE\" | \"WRITES_FROZEN\" | \"WRITES_SUSPENDED\" | \"SHIELD_UNAVAILABLE\" | \"CATALOG_LIMIT_REACHED\" | \"TOO_MANY_NEW_ENTITIES\" | \"RATE_OUT_OF_BAND\" | \"CHANNEL_NOT_FOUND\" | \"CHANNEL_SHARED\" | \"MODIFIER_OUT_OF_BAND\" | \"COMPANY_KEY_REQUIRED\" | \"BILLING_SETUP_REQUIRED\" | \"OWNER_HAS_ACCOUNT\" | \"SANDBOX_LIMIT\" | \"CONFIRMATION_MISMATCH\" | \"PROPERTY_NOT_REMOVABLE\" | \"PROPERTY_BUSY\" | \"PRICE_UNAVAILABLE\";\n details?: unknown;\n };\n}",
|
|
2592
2592
|
"Property": "export interface Property {\n id: number;\n name: string;\n /** IANA; every date in this API is a calendar date in this zone */\n timezone: string;\n /** ISO 4217; every rate must be sent in it */\n currency: string;\n inventoryScope: \"PMS_CM\" | \"CM_ONLY\" | \"PMS_CUTOVER\" | \"OWNER_SITE\";\n /** true when this key is a zsk_test_ key on the owner's sandbox: nothing you send reaches a channel, and POST /sandbox/bookings simulates an OTA booking */\n sandbox: boolean;\n /** last writable night = today + horizonDays */\n horizonDays: number;\n ariAuthoritative: boolean;\n /** what THIS key may do: ari:read · ari:write · bookings:read · bookings:write · bookings:payments */\n scopes: Array<string>;\n products: {\n /** the ARI routes need it */\n channelManager: boolean;\n /** the booking routes need it */\n pms: boolean;\n };\n limits: {\n requestsPerMinute: number;\n writesPerMinute: number;\n maxUpdatesPerRequest: number;\n maxCellsPerRequest: number;\n bookingsPerMinute: number;\n /** Changed cells this property may take per clock hour (UTC), all its keys together. A cell that already holds the value sent is not counted */\n cellsPerHour: number;\n /** Changed cells this property may take per rolling 24 hours */\n cellsPerDay: number;\n /** Room types this property may hold */\n maxRoomTypes: number;\n /** Rate plans this property may hold */\n maxRatePlans: number;\n /** A vacation rental: rate plans this property may hold per room type, counted over the whole property. null on a hotel, where maxRatePlans is the rule */\n ratePlansPerRoomType: number | null;\n /** New room types or rate plans one request, and one minute, may create */\n newEntitiesPerMinute: number;\n };\n /** What this property has used of its long budgets (§6.6) */\n usage: {\n /** Changed cells counted against cellsPerHour so far this clock hour */\n cellsThisHour: number;\n /** Changed cells counted against cellsPerDay over the last 24 hours */\n cellsLast24h: number;\n };\n /** Where this integration stands with the channel shield. Reads and bookings are never affected */\n shield: {\n /** CLEAR nothing held against the integration · WATCH noted, nothing refused · PAUSED only writes that close inventory are accepted · SUSPENDED every write refused until ZimmerStack releases it */\n level: \"CLEAR\" | \"WATCH\" | \"PAUSED\" | \"SUSPENDED\";\n /** Why, when the level is not CLEAR */\n reason: string | null;\n /** When a pause ends on its own (ISO instant); null = until released, or not paused */\n until: string | null;\n };\n sync: {\n state: \"IN_SYNC\" | \"PENDING\" | \"OUT_OF_SYNC\" | \"DISABLED\";\n pendingCells: number;\n };\n}",
|
|
2593
2593
|
"Catalog": "export interface Catalog {\n /** ISO 4217; the property's, and the one every rate and booking is sent in */\n currency: string;\n /** Every room type on the property, stable ids, in the order they were created */\n roomTypes: Array<{\n /** The number every availability write and every booking room names as roomTypeId */\n id: number;\n /** Your own id for it, when your system wrote it through PUT /catalog/room-types; null otherwise */\n ref: string | null;\n /** As the owner named it in ZimmerStack */\n name: string;\n /** Most adults one room takes; null = not set */\n maxAdults: number | null;\n /** Most children one room takes; null = not set */\n maxChildren: number | null;\n /** \"room\" unless the owner chose another kind of unit */\n roomKind: string;\n /** IN_SYNC the channel manager has it · PENDING / SENDING on its way · FAILED stopped retrying (the owner's screen offers Retry) · DRIFTED someone changed it inside the channel manager · NOT_LINKED saved here, never added there · DISABLED the property is not connected */\n sync: \"IN_SYNC\" | \"PENDING\" | \"SENDING\" | \"FAILED\" | \"DRIFTED\" | \"NOT_LINKED\" | \"DISABLED\";\n }>;\n /** Every rate plan, each under one room type */\n ratePlans: Array<{\n /** The number rate and restriction writes name as ratePlanId; optional on a booking room */\n id: number;\n /** Your own id for it, when your system wrote it through PUT /catalog/rate-plans; null otherwise */\n ref: string | null;\n /** The room type this plan sells; a booking may only pair the two */\n roomTypeId: number;\n /** As the owner named it */\n name: string;\n /** EP room only · CP breakfast · MAP half board · AP full board; null = not set */\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\" | null;\n /** The occupancy this plan is priced for; null = any */\n occupancy: number | null;\n currency: string;\n /** false = a non-refundable plan */\n refundable: boolean;\n /** IN_SYNC the channel manager has it · PENDING / SENDING on its way · FAILED stopped retrying (the owner's screen offers Retry) · DRIFTED someone changed it inside the channel manager · NOT_LINKED saved here, never added there · DISABLED the property is not connected */\n sync: \"IN_SYNC\" | \"PENDING\" | \"SENDING\" | \"FAILED\" | \"DRIFTED\" | \"NOT_LINKED\" | \"DISABLED\";\n }>;\n}",
|
|
2594
2594
|
"Properties": "export interface Properties {\n /** company: a software vendor's key, the hotel named in X-ZS-Property on every request. property: one hotel's own key, no header needed. */\n keyKind: \"company\" | \"property\";\n /** A company key: every property it may act on. A hotel key: its one property. */\n properties: Array<{\n /** The id a company key names in the X-ZS-Property header */\n id: number;\n name: string;\n timezone: string;\n currency: string;\n /** The property publishes to its channels */\n channelManager: boolean;\n /** A sandbox: everything lands locally, nothing reaches a channel */\n sandbox: boolean;\n }>;\n}",
|
|
2595
2595
|
"PropertyCreate": "export interface PropertyCreate {\n /** The hotel's name, as its guests know it */\n name: string;\n /** The person who owns the hotel's account */\n owner: {\n name: string;\n /** The owner's own address. The sign-in details are sent here, never to you */\n email: string;\n /** Digits, with an optional + and spaces, dots, dashes or brackets */\n phone: string;\n };\n address: {\n line1: string;\n city: string;\n state?: string;\n postalCode?: string;\n /** ISO 3166-1 alpha-2, for example IN, LK, PT */\n country: string;\n };\n /** ISO 4217: what the hotel sells in. Default: the country's own currency. A hotel in India sells in INR */\n currency?: string;\n /** An IANA zone of the hotel's country. Default: the country's main zone */\n timezone?: string;\n /** India only: the hotel's GSTIN when it is registered under GST. Leave it out when it is not, and for a hotel in any other country */\n taxId?: string;\n /** At least one. Each is born with one room-only rate plan at its defaultRate */\n roomTypes: Array<{\n /** Your own id for this room type. Send the same ref to PUT /catalog/room-types later and it updates this one instead of making a second */\n ref?: string;\n /** Shown to the owner and sent to the channel manager as the title; each name once per request */\n name: string;\n /** Sellable rooms of this type */\n roomCount: number;\n /** Most adults one room takes; default 2 */\n adults?: number;\n /** The nightly price new dates open at, in MAJOR units of the hotel's currency (e.g. 4500 or \"4500.00\") */\n defaultRate: number | string;\n }>;\n}",
|
|
2596
2596
|
"PropertyCreated": "export interface PropertyCreated {\n /** The id your company key names in the X-ZS-Property header from now on */\n id: number;\n /** As stored. A sandbox's name ends in (sandbox) and is at most 60 characters */\n name: string;\n timezone: string;\n currency: string;\n /** The property publishes to its channels. false for a new hotel until your first PUT /catalog/room-types puts it on the channel manager; always true for a sandbox */\n channelManager: boolean;\n /** true when a test key made it: everything lands locally, nothing reaches a channel and nothing is billed */\n sandbox: boolean;\n billing: {\n /** ACTIVE: its billing has started, it is on your next monthly invoice · WAITING: the hotel is live, its billing has not started yet · NOT_BILLED: a sandbox */\n state: \"ACTIVE\" | \"WAITING\" | \"NOT_BILLED\";\n /** Why billing waits; null otherwise. SETUP: your billing setup is not complete · OVERDUE: one of your invoices is overdue · UNPAID_LIMIT: you have added as many hotels as you may before your first paid invoice · REVIEW: ZimmerStack starts it */\n reason: \"SETUP\" | \"OVERDUE\" | \"UNPAID_LIMIT\" | \"REVIEW\" | null;\n /** The same in one sentence, with what to do next; may change, branch on state and reason */\n message: string;\n };\n /** true: an earlier request with this X-Idempotency-Key already added this hotel; nothing new was made */\n replay: boolean;\n}",
|
|
2597
2597
|
"PropertyRemoved": "export interface PropertyRemoved {\n id: number;\n /** The hotel's name; null only for a sandbox removed before its name was recorded */\n name: string | null;\n removed: true;\n /** true: it was already removed before this request; the rest of the answer is where it stands now */\n replay: boolean;\n sandbox: boolean;\n /** Nobody signs in to the hotel's account any more and no key reaches it */\n access: \"CLOSED\";\n billing: {\n /** CANCELLED: the hotel's subscription is cancelled · NOT_BILLED: a sandbox, never billed */\n state: \"CANCELLED\" | \"NOT_BILLED\";\n /** ISO 8601 instant the subscription was cancelled; null for a sandbox */\n cancelledAt: string | null;\n };\n channelManager: {\n /** REMOVED: its channel connections, rate plans, room types and listing are gone from the channel manager · RETRYING: a step is still pending; ZimmerStack retries it and nothing is needed from you · NOT_CONNECTED: it was never on the channel manager */\n state: \"REMOVED\" | \"RETRYING\" | \"NOT_CONNECTED\";\n /** While RETRYING, the step that is pending, in the order they run: the channel connections, then the rate plans, then the room types, then the property. null otherwise, and on a replay */\n step: \"CHANNELS\" | \"RATE_PLANS\" | \"ROOM_TYPES\" | \"PROPERTY\" | null;\n /** While RETRYING, what was still on the channel manager when this request ended; null otherwise, and on a replay */\n stillConnected: {\n channels: number;\n ratePlans: number | null;\n roomTypes: number | null;\n property: boolean;\n } | null;\n };\n}",
|
|
2598
|
-
"RoomTypesUpsert": "export interface RoomTypesUpsert {\n /** Each ref once per request */\n roomTypes: Array<{\n /** Your own id for this entity: the upsert key, stable across sends (1–64 of A–Z a–z 0–9 . _ : -) */\n ref: string;\n /** Shown to the owner and sent to the channel manager as the title */\n name: string;\n /** Sellable rooms of this type. On a channel-manager-only hotel a later change is written too, to the channel manager first
|
|
2598
|
+
"RoomTypesUpsert": "export interface RoomTypesUpsert {\n /** Each ref once per request */\n roomTypes: Array<{\n /** Your own id for this entity: the upsert key, stable across sends (1–64 of A–Z a–z 0–9 . _ : -) */\n ref: string;\n /** Shown to the owner and sent to the channel manager as the title */\n name: string;\n /** Sellable rooms of this type. On a channel-manager-only hotel a later change is written too, to the channel manager first; a count below the rooms holding upcoming stays is refused. The count does not cap a night: an availability above it is accepted with a warning, reaches the booking sites, and is what a price by rooms counts for that month. On a hotel that runs our PMS the count comes from its room list and a different value is not written (the answer's notice says so) */\n roomCount: number;\n /** Most adults one room takes */\n adults: number;\n /** Most children one room takes; default 0 */\n children?: number;\n }>;\n}",
|
|
2599
2599
|
"RatePlansUpsert": "export interface RatePlansUpsert {\n /** Each ref once per request */\n ratePlans: Array<{\n /** Your own id for this entity: the upsert key, stable across sends (1–64 of A–Z a–z 0–9 . _ : -) */\n ref: string;\n /** The room type this plan sells (GET /catalog); or name it by roomTypeRef */\n roomTypeId?: number;\n /** The room type by the ref you gave it, in this request or an earlier one */\n roomTypeRef?: string;\n /** Shown to the owner and sent to the channel manager as the title */\n name: string;\n /** EP room only · CP breakfast · MAP half board · AP full board; null = not set */\n mealPlan?: \"EP\" | \"CP\" | \"MAP\" | \"AP\" | null;\n /** The occupancy this plan is priced for; null = the room type's default */\n occupancy?: number | null;\n /** false = a non-refundable plan; default true */\n refundable?: boolean;\n /** The plan's standing price in MAJOR units (e.g. 4500 or \"4500.00\"), like every rate here: what new dates open at, mirrored to the channel manager. Omit to leave it; null = follow the room type's base rate */\n defaultRate?: number | string | null;\n /** Deprecated: the same standing price in MINOR units (paise). Send defaultRate instead; never both */\n defaultRateMinor?: number | null;\n }>;\n}",
|
|
2600
2600
|
"CatalogUpsertResult": "export interface CatalogUpsertResult {\n /** One per entity sent, in the order sent */\n items: Array<{\n ref: string;\n /** The ZimmerStack id: what every availability, rate and booking write names from now on */\n id: number;\n /** created: new here and on the channel manager · updated: fields changed · adopted: an entity the owner had already made with this name is now yours by ref · unchanged: nothing differed */\n action: \"created\" | \"updated\" | \"adopted\" | \"unchanged\";\n /** IN_SYNC the channel manager has it · PENDING / SENDING on its way · FAILED stopped retrying (the owner's screen offers Retry) · DRIFTED someone changed it inside the channel manager · NOT_LINKED saved here, never added there · DISABLED the property is not connected */\n sync: \"IN_SYNC\" | \"PENDING\" | \"SENDING\" | \"FAILED\" | \"DRIFTED\" | \"NOT_LINKED\" | \"DISABLED\";\n /** Saved, but something to know (for example the property is not on the channel manager yet); null when nothing */\n notice: string | null;\n }>;\n /** Where the property stands after this write; a sandbox always says enabled */\n channelManager: {\n /** The property publishes to its channels */\n enabled: boolean;\n /** Why not, when enabled is false (for example: a room type still has no rate plan) */\n reason: string | null;\n };\n}",
|
|
2601
2601
|
"CatalogDeleteResult": "export interface CatalogDeleteResult {\n id: number;\n deleted: true;\n /** The channel manager's copy is gone too (a sandbox has none) */\n channelManagerDeleted: boolean;\n /** For a room type: the plans that went with it */\n deletedRatePlanIds: Array<number>;\n}",
|
|
@@ -2603,45 +2603,47 @@ export const REFERENCE = {
|
|
|
2603
2603
|
"AvailabilityRead": "export interface AvailabilityRead {\n /** Hotel-local calendar date, YYYY-MM-DD */\n from: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n to: string;\n cells: Array<{\n roomTypeId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n date: string;\n available: number;\n }>;\n}",
|
|
2604
2604
|
"AvailabilityWrite": "export interface AvailabilityWrite {\n updates: Array<{\n /** ZimmerStack room type id (GET /catalog) */\n roomTypeId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateFrom: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateTo: string;\n /** ABSOLUTE count of rooms of this type for sale on each night of the range */\n available: number;\n }>;\n}",
|
|
2605
2605
|
"RatesRead": "export interface RatesRead {\n /** Hotel-local calendar date, YYYY-MM-DD */\n from: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n to: string;\n currency: string;\n cells: Array<{\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n date: string;\n /** MINOR units (paise, cents) */\n rateMinor: number;\n source: \"MANUAL\" | \"BASE\" | \"ENGINE\" | \"CHANNEX_SEED\" | \"PLAN_DEFAULT\" | \"STANDING\";\n }>;\n}",
|
|
2606
|
-
"RatesWrite": "export interface RatesWrite {\n updates: Array<{\n /** ZimmerStack rate plan id (GET /catalog) */\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateFrom: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateTo: string;\n days?: Array<\"mo\" | \"tu\" | \"we\" | \"th\" | \"fr\" | \"sa\" | \"su\">;\n /** Nightly sell price in MAJOR units (e.g. 4500 or \"4500.00\"), 1 to 21474836; rounded to a whole major unit */\n rate: number | string;\n /** ISO 4217; must equal the property's currency (GET /property) */\n currency: string;\n }>;\n}",
|
|
2606
|
+
"RatesWrite": "export interface RatesWrite {\n updates: Array<{\n /** ZimmerStack rate plan id (GET /catalog) */\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateFrom: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateTo: string;\n days?: Array<\"mo\" | \"tu\" | \"we\" | \"th\" | \"fr\" | \"sa\" | \"su\">;\n /** Nightly sell price in MAJOR units (e.g. 4500 or \"4500.00\"), 1 to 21474836; rounded to a whole major unit for a property selling in rupees or in a currency without cents, kept to the cent otherwise (e.g. \"89.50\" in euros) */\n rate: number | string;\n /** ISO 4217; must equal the property's currency (GET /property) */\n currency: string;\n }>;\n}",
|
|
2607
2607
|
"RestrictionsRead": "export interface RestrictionsRead {\n /** Hotel-local calendar date, YYYY-MM-DD */\n from: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n to: string;\n cells: Array<{\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n date: string;\n stopSell: boolean | null;\n closedToArrival: boolean | null;\n closedToDeparture: boolean | null;\n minStayArrival: number | null;\n minStayThrough: number | null;\n maxStay: number | null;\n }>;\n}",
|
|
2608
2608
|
"RestrictionsWrite": "export interface RestrictionsWrite {\n updates: Array<{\n /** ZimmerStack rate plan id (GET /catalog) */\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateFrom: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n dateTo: string;\n days?: Array<\"mo\" | \"tu\" | \"we\" | \"th\" | \"fr\" | \"sa\" | \"su\">;\n stopSell?: boolean;\n closedToArrival?: boolean;\n closedToDeparture?: boolean;\n minStayArrival?: number;\n minStayThrough?: number;\n maxStay?: number;\n }>;\n}",
|
|
2609
2609
|
"WriteAccepted": "export interface WriteAccepted {\n batchId: string;\n resource: \"availability\" | \"rates\" | \"restrictions\";\n /** distinct cells after per-request coalescing (last write wins) */\n requestedCells: number;\n /** cells that differed from our record and were written; they will be pushed */\n acceptedCells: number;\n /** cells that already held the requested value; nothing written, nothing pushed */\n noopCells: number;\n /** groups our record refused (e.g. a plan whose policy forbids exceptions) */\n rejected: Array<{\n cells: number;\n error: string;\n }>;\n pushedBy: \"inventory-drain\" | \"ari-projector\";\n /** GET path to watch this batch land */\n poll: string;\n /** Accepted, but worth a look: an availability above the room type's room count (an oversell the channels will sell). Absent when there is nothing to say */\n warnings?: Array<{\n roomTypeId: number;\n /** Rooms of this type in our record */\n units: number;\n /** The highest count this request set for it */\n requested: number;\n message: string;\n }>;\n /** Accepted, but far outside the plan's standing price, on a property whose price band only warns (§6.6). At most 20; absent when there is nothing to say */\n priceWarnings?: Array<{\n ratePlanId: number;\n /** Hotel-local calendar date, YYYY-MM-DD */\n date: string;\n /** The price this request set, MINOR units */\n rateMinor: number;\n /** The plan's standing price, MINOR units */\n standingMinor: number;\n message: string;\n }>;\n /** true when the write was taken through the safety lane: the integration is paused or over a budget, and this write only closed inventory (§6.6) */\n lane?: boolean;\n}",
|
|
2610
2610
|
"BatchStatus": "export interface BatchStatus {\n batchId: string;\n resource: \"availability\" | \"rates\" | \"restrictions\";\n createdAt: string;\n requestedCells: number;\n acceptedCells: number;\n noopCells: number;\n rejected: Array<{\n cells: number;\n error: string;\n }>;\n status: \"landed\" | \"pending\" | \"failed\";\n pendingCells: number;\n /** Cells of this batch the channel manager refused: held, not re-sent (§6.6). More than 0 reads failed */\n parkedCells: number;\n lastError: string | null;\n}",
|
|
2611
2611
|
"SyncStatus": "export interface SyncStatus {\n propertyId: number;\n /** true on a sandbox property (a zsk_test_ key): pushes land in our record and stop there, so IN_SYNC means recorded */\n sandbox: boolean;\n /** false = nothing is pushed; ask ZimmerStack support */\n ariAuthoritative: boolean;\n inventory: {\n state: \"IN_SYNC\" | \"PENDING\" | \"OUT_OF_SYNC\" | \"DISABLED\";\n pendingCells: number;\n lastOkAt: string | null;\n lastError: string | null;\n outOfSyncSince: string | null;\n };\n rates: {\n /** rate/restriction cells waiting for the projector */\n dirtyCells: number;\n /** rate/restriction cells the channel manager refused: held, no longer re-sent, their batch reads failed. Send a corrected value for those nights (§6.6) */\n parkedCells: number;\n lastPushAt: string | null;\n lastErrorAt: string | null;\n lastError: string | null;\n };\n /** Where this integration stands with the channel shield. Reads and bookings are never affected */\n shield: {\n /** CLEAR nothing held against the integration · WATCH noted, nothing refused · PAUSED only writes that close inventory are accepted · SUSPENDED every write refused until ZimmerStack releases it */\n level: \"CLEAR\" | \"WATCH\" | \"PAUSED\" | \"SUSPENDED\";\n /** Why, when the level is not CLEAR */\n reason: string | null;\n /** When a pause ends on its own (ISO instant); null = until released, or not paused */\n until: string | null;\n };\n newestPendingBatch: {\n batchId: string;\n resource: \"availability\" | \"rates\" | \"restrictions\";\n createdAt: string;\n requestedCells: number;\n acceptedCells: number;\n noopCells: number;\n rejected: Array<{\n cells: number;\n error: string;\n }>;\n status: \"landed\" | \"pending\" | \"failed\";\n pendingCells: number;\n /** Cells of this batch the channel manager refused: held, not re-sent (§6.6). More than 0 reads failed */\n parkedCells: number;\n lastError: string | null;\n } | null;\n}",
|
|
2612
|
-
"BookingCreate": "export interface BookingCreate {\n /** Your own reservation id; unique per property. A retried POST with the same value returns the same booking while it is live and yours; after a cancel, a new stay needs a new reference (409 EXTERNAL_REFERENCE_REUSED otherwise) */\n externalReference: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Exclusive: the checkout day is not a night */\n checkOut: string;\n /** ISO 4217; must equal the property's (GET /property) */\n currency: string;\n /** Who booked; found or created in the PMS by phone */\n guest: {\n /** Full name as the guest typed it */\n name: string;\n /** Guest phone, digits with an optional leading + */\n phone: string & string;\n /** Guest email, when you have it; we write to it only if the owner switches our confirmation on */\n email?: string;\n /** Special requests for the desk; shown in the PMS, never sent anywhere */\n notes?: string;\n };\n /** One entry per ROOM; two rooms of the same type are two entries */\n rooms: Array<{\n /** ZimmerStack room type id: roomTypes[].id from GET /catalog, never guessed */\n roomTypeId: number;\n /** Optional: the plan the guest booked, ratePlans[].id from GET /catalog; must belong to roomTypeId. Decides the meal plan; omitted = room only (EP) */\n ratePlanId?: number;\n /** Adults in this room; at most the room type's maxAdults */\n adults: number;\n /** Children in this room; default 0; at most the room type's maxChildren */\n children?: number;\n /** The nightly price YOU charged for this room, MAJOR units (e.g. 4500 or \"4500.00\"), 1 to 21474836, taxes as you sold them */\n nightlyRate: number | string;\n }>;\n /** Omit when nothing was collected; an amount above 0 needs the bookings:payments scope */\n payment?: {\n /** What you collected so far, MAJOR units; 0 = nothing collected (pay at hotel); never more than the stay's total */\n amount: number | string;\n /** How you collected it */\n method: \"ONLINE\" | \"CARD\" | \"UPI\" | \"NETBANKING\" | \"CASH\";\n /** Your gateway's payment or transaction id */\n reference?: string;\n };\n /** Booking-level remarks for the desk (promo code, source page) */\n notes?: string;\n}",
|
|
2612
|
+
"BookingCreate": "export interface BookingCreate {\n /** Your own reservation id; unique per property. A retried POST with the same value returns the same booking while it is live and yours; after a cancel, a new stay needs a new reference (409 EXTERNAL_REFERENCE_REUSED otherwise) */\n externalReference: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Exclusive: the checkout day is not a night */\n checkOut: string;\n /** ISO 4217; must equal the property's (GET /property) */\n currency: string;\n /** Who booked; found or created in the PMS by phone */\n guest: {\n /** Full name as the guest typed it */\n name: string;\n /** Guest phone, digits with an optional leading + */\n phone: string & string;\n /** Guest email, when you have it; we write to it only if the owner switches our confirmation on */\n email?: string;\n /** Special requests for the desk; shown in the PMS, never sent anywhere */\n notes?: string;\n };\n /** One entry per ROOM; two rooms of the same type are two entries */\n rooms: Array<{\n /** ZimmerStack room type id: roomTypes[].id from GET /catalog, never guessed */\n roomTypeId: number;\n /** Optional: the plan the guest booked, ratePlans[].id from GET /catalog; must belong to roomTypeId. Decides the meal plan; omitted = room only (EP) */\n ratePlanId?: number;\n /** Adults in this room; at most the room type's maxAdults */\n adults: number;\n /** Children in this room; default 0; at most the room type's maxChildren */\n children?: number;\n /** The nightly price YOU charged for this room, MAJOR units (e.g. 4500 or \"4500.00\"), 1 to 21474836, taxes as you sold them */\n nightlyRate: number | string;\n }>;\n /** How to read nightlyRate at a hotel outside India that has confirmed its tax lines. true (the default): the rate is what the guest paid online; it is split into the hotel's lines and totalAmount does not move, except for a line the hotel collects at the property itself (a city tax per person), which is added and paid at the hotel. false: the rate is as the hotel sells it at its desk; the lines the hotel adds on top are added and totalAmount grows, while lines the hotel keeps inside its prices stay inside. Read totalAmount and taxes in the answer. false is refused with 409 TAXES_NOT_CONFIGURED at a hotel with no confirmed lines (every hotel in India) and with 409 TAXES_INSIDE_RATES at a hotel that adds nothing on top; true, or omitting the field, changes nothing at a hotel with no confirmed lines */\n nightlyRateIncludesTaxes?: boolean;\n /** Omit when nothing was collected; an amount above 0 needs the bookings:payments scope */\n payment?: {\n /** What you collected so far, MAJOR units; 0 = nothing collected (pay at hotel); never more than the stay's total */\n amount: number | string;\n /** How you collected it */\n method: \"ONLINE\" | \"CARD\" | \"UPI\" | \"NETBANKING\" | \"CASH\";\n /** Your gateway's payment or transaction id */\n reference?: string;\n };\n /** Booking-level remarks for the desk (promo code, source page) */\n notes?: string;\n}",
|
|
2613
2613
|
"BookingCancel": "export interface BookingCancel {\n /** Why; kept on the booking's activity log */\n reason?: string;\n}",
|
|
2614
2614
|
"BookingsQuery": "export interface BookingsQuery {\n /** Created on or after this instant (ISO 8601); default: the last 7 days */\n since?: string;\n /** Your own reservation id; unique per property. A retried POST with the same value returns the same booking while it is live and yours; after a cancel, a new stay needs a new reference (409 EXTERNAL_REFERENCE_REUSED otherwise) */\n externalReference?: string;\n /** 1 to 100; default 50 */\n limit?: number;\n}",
|
|
2615
|
-
"Booking": "export interface Booking {\n bookingId: number;\n reference: string;\n externalReference: string | null;\n status: \"UPCOMING\" | \"INHOUSE\" | \"COMPLETED\" | \"CANCELLED\" | \"NOSHOW\";\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkOut: string;\n nights: number;\n currency: string;\n /** MAJOR units, two decimals: the whole stay */\n totalAmount: string;\n /** MAJOR units, two decimals: collected so far */\n totalPaid: string;\n /** MAJOR units, two decimals: owed at the hotel */\n balanceDue: string;\n guest: {\n name: string;\n phone: string;\n email: string | null;\n };\n rooms: Array<{\n bookingRoomId: number;\n roomTypeId: number;\n ratePlanId: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n /** MAJOR units, two decimals */\n nightlyRate: string;\n status: \"UPCOMING\" | \"CHECKEDIN\" | \"CHECKEDOUT\" | \"CANCELLED\" | \"NOSHOW\";\n }>;\n inventory: {\n eventRecorded: boolean;\n /** false = this property has no channel manager; nothing is pushed */\n channelManager: boolean;\n pushedBy: \"inventory-drain\";\n };\n replay: boolean;\n createdAt: string;\n cancelledAt: string | null;\n}",
|
|
2616
|
-
"BookingsList": "export interface BookingsList {\n since: string;\n items: Array<{\n bookingId: number;\n reference: string;\n externalReference: string | null;\n status: \"UPCOMING\" | \"INHOUSE\" | \"COMPLETED\" | \"CANCELLED\" | \"NOSHOW\";\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkOut: string;\n nights: number;\n currency: string;\n /** MAJOR units, two decimals: the whole stay */\n totalAmount: string;\n /** MAJOR units, two decimals: collected so far */\n totalPaid: string;\n /** MAJOR units, two decimals: owed at the hotel */\n balanceDue: string;\n guest: {\n name: string;\n phone: string;\n email: string | null;\n };\n rooms: Array<{\n bookingRoomId: number;\n roomTypeId: number;\n ratePlanId: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n /** MAJOR units, two decimals */\n nightlyRate: string;\n status: \"UPCOMING\" | \"CHECKEDIN\" | \"CHECKEDOUT\" | \"CANCELLED\" | \"NOSHOW\";\n }>;\n inventory: {\n eventRecorded: boolean;\n /** false = this property has no channel manager; nothing is pushed */\n channelManager: boolean;\n pushedBy: \"inventory-drain\";\n };\n replay: boolean;\n createdAt: string;\n cancelledAt: string | null;\n }>;\n}",
|
|
2615
|
+
"Booking": "export interface Booking {\n bookingId: number;\n reference: string;\n externalReference: string | null;\n status: \"UPCOMING\" | \"INHOUSE\" | \"COMPLETED\" | \"CANCELLED\" | \"NOSHOW\";\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkOut: string;\n nights: number;\n currency: string;\n /** MAJOR units, two decimals: the whole stay */\n totalAmount: string;\n /** MAJOR units, two decimals: collected so far */\n totalPaid: string;\n /** MAJOR units, two decimals: owed at the hotel */\n balanceDue: string;\n guest: {\n name: string;\n phone: string;\n email: string | null;\n };\n rooms: Array<{\n bookingRoomId: number;\n roomTypeId: number;\n ratePlanId: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n /** MAJOR units, two decimals */\n nightlyRate: string;\n status: \"UPCOMING\" | \"CHECKEDIN\" | \"CHECKEDOUT\" | \"CANCELLED\" | \"NOSHOW\";\n }>;\n inventory: {\n eventRecorded: boolean;\n /** false = this property has no channel manager; nothing is pushed */\n channelManager: boolean;\n pushedBy: \"inventory-drain\";\n };\n replay: boolean;\n createdAt: string;\n cancelledAt: string | null;\n /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed them (outside India); absent on every other booking */\n taxes?: {\n /** How the nightly rate was read when the booking was made: true = it was split into the lines; false = lines the hotel adds on top were added to the total */\n nightlyRateIncludesTaxes: boolean;\n /** The hotel's own tax lines on this booking, in the order the hotel applies them */\n lines: Array<{\n /** The line's filing code as the hotel set it up (for example TH-VAT) */\n code: string;\n /** The line's name as the hotel's bill prints it */\n name: string;\n /** TAX is owed to an authority; FEE is the hotel's own charge (a service charge); PASS_THROUGH is held for someone else */\n kind: \"TAX\" | \"FEE\" | \"PASS_THROUGH\";\n /** true: inside the nightly rate; false: added on top of it */\n includedInRate: boolean;\n /** MAJOR units, two decimals, for the whole stay; 0.00 when the desk waived the line */\n amount: string;\n }>;\n /** MAJOR units, two decimals: the part of the lines that sits inside the nightly rates */\n includedInRates: string;\n /** MAJOR units, two decimals: the part of the lines added on top; already inside totalAmount */\n addedToTotal: string;\n };\n}",
|
|
2616
|
+
"BookingsList": "export interface BookingsList {\n since: string;\n items: Array<{\n bookingId: number;\n reference: string;\n externalReference: string | null;\n status: \"UPCOMING\" | \"INHOUSE\" | \"COMPLETED\" | \"CANCELLED\" | \"NOSHOW\";\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkIn: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n checkOut: string;\n nights: number;\n currency: string;\n /** MAJOR units, two decimals: the whole stay */\n totalAmount: string;\n /** MAJOR units, two decimals: collected so far */\n totalPaid: string;\n /** MAJOR units, two decimals: owed at the hotel */\n balanceDue: string;\n guest: {\n name: string;\n phone: string;\n email: string | null;\n };\n rooms: Array<{\n bookingRoomId: number;\n roomTypeId: number;\n ratePlanId: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n /** MAJOR units, two decimals */\n nightlyRate: string;\n status: \"UPCOMING\" | \"CHECKEDIN\" | \"CHECKEDOUT\" | \"CANCELLED\" | \"NOSHOW\";\n }>;\n inventory: {\n eventRecorded: boolean;\n /** false = this property has no channel manager; nothing is pushed */\n channelManager: boolean;\n pushedBy: \"inventory-drain\";\n };\n replay: boolean;\n createdAt: string;\n cancelledAt: string | null;\n /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed them (outside India); absent on every other booking */\n taxes?: {\n /** How the nightly rate was read when the booking was made: true = it was split into the lines; false = lines the hotel adds on top were added to the total */\n nightlyRateIncludesTaxes: boolean;\n /** The hotel's own tax lines on this booking, in the order the hotel applies them */\n lines: Array<{\n /** The line's filing code as the hotel set it up (for example TH-VAT) */\n code: string;\n /** The line's name as the hotel's bill prints it */\n name: string;\n /** TAX is owed to an authority; FEE is the hotel's own charge (a service charge); PASS_THROUGH is held for someone else */\n kind: \"TAX\" | \"FEE\" | \"PASS_THROUGH\";\n /** true: inside the nightly rate; false: added on top of it */\n includedInRate: boolean;\n /** MAJOR units, two decimals, for the whole stay; 0.00 when the desk waived the line */\n amount: string;\n }>;\n /** MAJOR units, two decimals: the part of the lines that sits inside the nightly rates */\n includedInRates: string;\n /** MAJOR units, two decimals: the part of the lines added on top; already inside totalAmount */\n addedToTotal: string;\n };\n }>;\n}",
|
|
2617
2617
|
"SandboxBookingCreate": "export interface SandboxBookingCreate {\n /** A room type of the sandbox (GET /catalog) */\n roomTypeId: number;\n /** Arrival, YYYY-MM-DD in the property's timezone; today or later, within the horizon */\n checkIn: string;\n /** 1–30; checkout = checkIn + nights */\n nights: number;\n /** Rooms of this type the guest books (1–5); default 1 */\n rooms?: number;\n /** Adults per room; default 2 */\n adults?: number;\n /** The guest's name; default a fictional one */\n guestName?: string;\n /** The channel the booking pretends to arrive from; default Booking.com. \"Website\" simulates a booking on the hotel's own website (our booking engine): it sends direct.booking.created and is listed by GET /direct-bookings, not GET /channel-bookings */\n otaName?: \"Booking.com\" | \"Expedia\" | \"Agoda\" | \"Airbnb\" | \"MakeMyTrip\" | \"Goibibo\" | \"Website\";\n /** true = the channel collected the money (for Website: the guest paid online), so totalPaid equals the total; default false (pay at the property) */\n paidByOta?: boolean;\n}",
|
|
2618
2618
|
"SandboxBookingModify": "export interface SandboxBookingModify {\n /** New arrival, YYYY-MM-DD in the property's timezone; today or later */\n checkIn?: string;\n /** New length of stay, 1–30 */\n nights?: number;\n /** New number of rooms, 1–5 */\n rooms?: number;\n /** New adults per room */\n adults?: number;\n /** The guest renamed, as a channel sometimes does */\n guestName?: string;\n}",
|
|
2619
2619
|
"Channels": "export interface Channels {\n /** When the connection list was last captured; null when never */\n asOf: string | null;\n channels: Array<{\n /** The channel manager's id for this connection */\n channelId: string;\n /** The channel: BookingCom, Expedia, Agoda, Airbnb, GoMMT, … */\n kind: string;\n /** The connection's title in the channel manager */\n title: string | null;\n /** When our record last saw this connection (the nightly settings sweep) */\n seenAt: string;\n /** Unresolved problems the channel manager reported for this connection */\n openIssues: Array<{\n /** sync_error · rate_error · disconnect_channel · inventory_out_of_sync · … */\n event: string;\n raisedAt: string;\n }>;\n /** This channel's price modifier (§2.8): the steps the channel manager applies, in order, to every price it sends this channel. [] = prices go as they are. null = the channel holds a rule set by hand in the channel manager that this API cannot express; PUT /channels/{channelId}/modifier replaces it */\n modifier: Array<{\n /** Raise or lower what this channel is sent */\n action: \"increase\" | \"decrease\";\n /** percent of the price, or a fixed amount in MAJOR units of the property's currency */\n type: \"percent\" | \"fixed\";\n /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */\n value: number;\n }> | null;\n /** A separate adjustment the owner set for this channel in the ZimmerStack Channels app, applied before the modifier. Read-only here; null = none */\n markupPlan: {\n /** markup: this channel sells a copy of each plan priced a fixed step from it · manual: this channel has prices of its own for some nights */\n mode: \"markup\" | \"manual\";\n direction: \"increase\" | \"decrease\";\n /** Percent of the price, when the step is a percentage */\n percent: number | null;\n /** MAJOR units, when the step is a fixed amount */\n amount: number | null;\n } | null;\n }>;\n /** Unresolved problems not tied to one connection (for example the inventory pipe out of sync) */\n propertyIssues: Array<{\n event: string;\n raisedAt: string;\n }>;\n}",
|
|
2620
2620
|
"ModifierWrite": "export interface ModifierWrite {\n /** The whole modifier, in the order it is applied; replaces what the channel holds. At most 5 steps. An empty list removes it: prices go to the channel as they are */\n steps: Array<{\n /** Raise or lower what this channel is sent */\n action: \"increase\" | \"decrease\";\n /** percent of the price, or a fixed amount in MAJOR units of the property's currency */\n type: \"percent\" | \"fixed\";\n /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */\n value: number;\n }>;\n}",
|
|
2621
|
-
"ModifierResult": "export interface ModifierResult {\n channelId: string;\n /** The channel: BookingCom, Expedia, Agoda, Airbnb, GoMMT, … */\n kind: string;\n title: string | null;\n /** What the channel holds now */\n modifier: Array<{\n /** Raise or lower what this channel is sent */\n action: \"increase\" | \"decrease\";\n /** percent of the price, or a fixed amount in MAJOR units of the property's currency */\n type: \"percent\" | \"fixed\";\n /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */\n value: number;\n }>;\n /** false when the channel already held exactly these steps: nothing was sent to the channel manager and nothing was counted */\n changed: boolean;\n /** When it takes effect. Always: \"
|
|
2621
|
+
"ModifierResult": "export interface ModifierResult {\n channelId: string;\n /** The channel: BookingCom, Expedia, Agoda, Airbnb, GoMMT, … */\n kind: string;\n title: string | null;\n /** What the channel holds now */\n modifier: Array<{\n /** Raise or lower what this channel is sent */\n action: \"increase\" | \"decrease\";\n /** percent of the price, or a fixed amount in MAJOR units of the property's currency */\n type: \"percent\" | \"fixed\";\n /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */\n value: number;\n }>;\n /** false when the channel already held exactly these steps: nothing was sent to the channel manager and nothing was counted */\n changed: boolean;\n /** When it takes effect. Always: \"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.\" */\n notice: string;\n}",
|
|
2622
2622
|
"RatesResendAccepted": "export interface RatesResendAccepted {\n /** Hotel-local calendar date, YYYY-MM-DD */\n from: string;\n /** Hotel-local calendar date, YYYY-MM-DD */\n to: string;\n /** Rate-plan nights marked to be sent again. They travel like any write: watch rates.dirtyCells on GET /sync fall to 0 */\n cells: number;\n /** Nights left out because the channel manager refused their value earlier (rates.parkedCells on GET /sync): send a corrected value for those */\n parkedLeft: number;\n /** GET path that says when it has landed */\n watch: string;\n notice: string;\n}",
|
|
2623
2623
|
"ChannelBookingsQuery": "export interface ChannelBookingsQuery {\n /** Changed (created, modified or cancelled) on or after this instant (ISO 8601); default: the last 7 days */\n since?: string;\n /** Only confirmed (live) or only cancelled bookings; default both */\n status?: \"CONFIRMED\" | \"CANCELLED\";\n /** 1 to 100; default 50 */\n limit?: number;\n /** The previous page's nextCursor: resume exactly after its last item, even when many bookings changed in the same instant. Takes precedence over since */\n cursor?: string;\n}",
|
|
2624
|
-
"ChannelBookingsList": "export interface ChannelBookingsList {\n /** The instant the list starts at, echoed */\n since: string;\n /** Oldest change first — exactly the booking object the webhooks carry */\n items: Array<{\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n }>;\n /** More rows matched than limit: ask again with cursor = nextCursor */\n more: boolean;\n /** Pass as cursor for the next page; null when there is no more */\n nextCursor: string | null;\n}",
|
|
2625
|
-
"ChannelBooking": "export interface ChannelBooking {\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n}",
|
|
2624
|
+
"ChannelBookingsList": "export interface ChannelBookingsList {\n /** The instant the list starts at, echoed */\n since: string;\n /** Oldest change first — exactly the booking object the webhooks carry */\n items: Array<{\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */\n receivedCurrency?: string;\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */\n taxes?: {\n lines: Array<{\n code: string;\n name: string;\n kind: \"TAX\" | \"FEE\" | \"PASS_THROUGH\";\n includedInRate: boolean;\n amount: number;\n }>;\n includedInRates: number;\n addedToTotal: number;\n };\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n }>;\n /** More rows matched than limit: ask again with cursor = nextCursor */\n more: boolean;\n /** Pass as cursor for the next page; null when there is no more */\n nextCursor: string | null;\n}",
|
|
2625
|
+
"ChannelBooking": "export interface ChannelBooking {\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */\n receivedCurrency?: string;\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */\n taxes?: {\n lines: Array<{\n code: string;\n name: string;\n kind: \"TAX\" | \"FEE\" | \"PASS_THROUGH\";\n includedInRate: boolean;\n amount: number;\n }>;\n includedInRates: number;\n addedToTotal: number;\n };\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n}",
|
|
2626
2626
|
"DirectBookingCancel": "export interface DirectBookingCancel {\n /** policy (the default): what the booking's own cancellation policy gives back now, the same as the guest cancelling on the booking page. full: everything the guest paid online. none: nothing; the hotel settles any money itself. */\n refund?: \"policy\" | \"full\" | \"none\";\n /** Why; kept on the booking's activity log in ZimmerStack */\n reason?: string;\n}",
|
|
2627
|
-
"DirectBookingCancelResult": "export interface DirectBookingCancelResult {\n /** The booking after the cancel, the webhook's shape: status CANCELLED, every room CANCELLED */\n booking: {\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n };\n refund: {\n /** The refund this call asked for; null on a replay */\n requested: \"policy\" | \"full\" | \"none\" | null;\n /** What the guest gets back, in currency's major units (1998.5 = ₹1,998.50); 0 when nothing is owed */\n amount: number;\n /** ISO 4217, the property's currency */\n currency: string;\n /** NONE: nothing owed. PROCESSED: the payment gateway accepted the refund. PENDING: the refund is recorded and on its way (the gateway is processing it, or ZimmerStack issues it by hand). MANUAL: money is owed but there is no online payment to refund against; the hotel settles it. */\n status: \"NONE\" | \"PENDING\" | \"PROCESSED\" | \"MANUAL\";\n };\n /** true: the booking was already cancelled; nothing changed and no money moved */\n replay: boolean;\n}",
|
|
2627
|
+
"DirectBookingCancelResult": "export interface DirectBookingCancelResult {\n /** The booking after the cancel, the webhook's shape: status CANCELLED, every room CANCELLED */\n booking: {\n id: number;\n reference: string;\n status: \"CONFIRMED\" | \"CANCELLED\";\n stayStatus: string;\n channel: {\n otaName: string;\n otaReservationCode: string;\n source: string;\n sourceGroup: string;\n };\n stay: {\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n };\n guest: {\n fullName: string;\n firstName: string | null;\n lastName: string | null;\n phone?: string | null;\n email?: string | null;\n country: string | null;\n language: string | null;\n };\n guestNotes: string | null;\n occupancy: {\n adults: number;\n children: number;\n };\n rooms: Array<{\n roomTypeId: number;\n roomTypeName: string;\n ratePlanId?: number | null;\n mealPlan: \"EP\" | \"CP\" | \"MAP\" | \"AP\";\n adults: number;\n children: number;\n checkIn: string;\n checkOut: string;\n nights: number;\n dayUse: boolean;\n ratePerNight: number;\n amount: number;\n status: string;\n }>;\n amounts: {\n currency: string;\n total: number;\n paid: number;\n balanceDue: number;\n paymentCollect: \"ota\" | \"property\" | \"unknown\";\n /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */\n receivedCurrency?: string;\n };\n finance: {\n otaName: string;\n amountBasis: string;\n currency: string | null;\n grossAmount: number | null;\n commissionAmount: number | null;\n taxAmount: number | null;\n netPayoutAmount: number | null;\n } | null;\n /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */\n taxes?: {\n lines: Array<{\n code: string;\n name: string;\n kind: \"TAX\" | \"FEE\" | \"PASS_THROUGH\";\n includedInRate: boolean;\n amount: number;\n }>;\n includedInRates: number;\n addedToTotal: number;\n };\n cancellation: {\n at: string;\n reason: string | null;\n } | null;\n createdAt: string;\n updatedAt: string;\n };\n refund: {\n /** The refund this call asked for; null on a replay */\n requested: \"policy\" | \"full\" | \"none\" | null;\n /** What the guest gets back, in currency's major units (1998.5 = ₹1,998.50); 0 when nothing is owed */\n amount: number;\n /** ISO 4217, the property's currency */\n currency: string;\n /** NONE: nothing owed. PROCESSED: the payment gateway accepted the refund. PENDING: the refund is recorded and on its way (the gateway is processing it, or ZimmerStack issues it by hand). MANUAL: money is owed but there is no online payment to refund against; the hotel settles it. */\n status: \"NONE\" | \"PENDING\" | \"PROCESSED\" | \"MANUAL\";\n };\n /** true: the booking was already cancelled; nothing changed and no money moved */\n replay: boolean;\n}",
|
|
2628
2628
|
"SandboxBooking": "export interface SandboxBooking {\n /** The PMS booking id, the one the webhook carries */\n bookingId: number;\n /** The booking reference, SBX-… — the webhook's booking.reference */\n reference: string;\n /** The pretend channel-side id */\n channelBookingId: string;\n otaName: string;\n /** The stay's state. GET /channel-bookings reads the same booking as status CONFIRMED (or CANCELLED) with stayStatus UPCOMING */\n status: \"UPCOMING\" | \"CANCELLED\";\n guestName: string;\n checkIn: string;\n checkOut: string;\n nights: number;\n rooms: number;\n roomTypeId: number;\n /** Major units, per room per night: the average when the nights differ. Each night is priced from the sandbox's own record, what GET /rates gives for the room type's first rate plan */\n nightlyRate: number;\n /** Major units: every night's price × rooms */\n total: number;\n currency: string;\n paidByOta: boolean;\n /** true when a night had no sandbox availability left — the booking lands anyway, as an OTA booking would */\n oversold: boolean;\n createdAt: string;\n /** What this call put on the wire for the sandbox's webhook endpoints */\n webhook: {\n eventType: \"channel.booking.created\" | \"channel.booking.modified\" | \"channel.booking.cancelled\" | \"direct.booking.created\" | \"direct.booking.cancelled\";\n /** The event is in the outbox; every active endpoint on the sandbox receives it within seconds */\n queued: boolean;\n };\n}",
|
|
2629
2629
|
"SandboxBookingsList": "export interface SandboxBookingsList {\n /** Simulated bookings on the sandbox (OTA and website), newest first */\n bookings: Array<{\n /** The PMS booking id, the one the webhook carries */\n bookingId: number;\n /** The booking reference, SBX-… — the webhook's booking.reference */\n reference: string;\n /** The pretend channel-side id */\n channelBookingId: string;\n otaName: string;\n /** The stay's state. GET /channel-bookings reads the same booking as status CONFIRMED (or CANCELLED) with stayStatus UPCOMING */\n status: \"UPCOMING\" | \"CANCELLED\";\n guestName: string;\n checkIn: string;\n checkOut: string;\n nights: number;\n rooms: number;\n roomTypeId: number;\n /** Major units, per room per night: the average when the nights differ. Each night is priced from the sandbox's own record, what GET /rates gives for the room type's first rate plan */\n nightlyRate: number;\n /** Major units: every night's price × rooms */\n total: number;\n currency: string;\n paidByOta: boolean;\n /** true when a night had no sandbox availability left — the booking lands anyway, as an OTA booking would */\n oversold: boolean;\n createdAt: string;\n /** What this call put on the wire for the sandbox's webhook endpoints */\n webhook: {\n eventType: \"channel.booking.created\" | \"channel.booking.modified\" | \"channel.booking.cancelled\" | \"direct.booking.created\" | \"direct.booking.cancelled\";\n /** The event is in the outbox; every active endpoint on the sandbox receives it within seconds */\n queued: boolean;\n };\n }>;\n}"
|
|
2630
2630
|
},
|
|
2631
2631
|
"topics": {
|
|
2632
2632
|
"keys": "## auth\nscheme: Authorization: Bearer zsk_live_… (zsk_test_… on a sandbox)\nkeyShape: zsk_live_ (or zsk_test_ on a sandbox) + 43 base64url characters; shown once at creation; a hotel key = one property, a company key = a software vendor's hotels\nnever:\n - query string\n - x-api-key\n - user-api-key\nexpiry: The owner may give a key an end of life (expiresAt); past it every request is 401 API_KEY_EXPIRED, like a revocation. A rotation keeps the life.\nscopes:\n - scope: ari:read · does: Read availability, rates, restrictions and sync state from our record\n - scope: ari:write · does: Set availability, rates and restrictions (pushed to every connected channel)\n - scope: catalog:write · does: Create and change room types and rate plans (created on the channel manager and mirrored there)\n - scope: channel-modifiers:write · does: Set a channel's price modifier: one change moves every price sent to that channel from then on\n - scope: channel-bookings:read · does: Read the OTA bookings the channel manager delivered to this property, in the webhook's shape\n - scope: direct-bookings:read · does: Read the bookings guests made on the hotel's own website (our booking engine), in the webhook's shape\n - scope: direct-bookings:cancel · does: Cancel a booking guests made on the hotel's own website and refund it: per the booking's policy, in full, or not at all\n - scope: bookings:read · does: Read bookings this key created\n - scope: bookings:write · does: Create and cancel bookings in the PMS (inventory updates and reaches the channels)\n - scope: bookings:payments · does: Record a payment on a booking it creates (needs bookings:write)\n - scope: properties:write · does: Add a hotel, and remove a hotel you added (a software partner's company key only)\nscopeRule: A key holds the scopes the owner granted at creation (editable later without rotating). Every route names the one scope it needs; a key without it is 403 SCOPE_MISSING. bookings:payments needs bookings:write. GET /property echoes this key's scopes.\nallowlist: Optional per key: up to 20 IPv4/IPv6 addresses or CIDR ranges. Set it to your servers' egress addresses: a request from anywhere else is 403 IP_NOT_ALLOWED, counts against the address's authentication budget, and is shown to the owner.\nwhichKey: Two kinds of key, one API. A HOTEL KEY is bound to one property: the property is implicit and needs no header (an X-ZS-Property naming another property is 404 PROPERTY_NOT_FOUND). A COMPANY KEY belongs to a software vendor and reaches every hotel the vendor may act on: name the hotel on every request with the X-ZS-Property header, its id from GET /properties. GET /properties says which kind you hold (keyKind). Routes, bodies and answers are the same for both.\ncompanyKey:\n header: X-ZS-Property: <property id from GET /properties>\n missingHeader: 400 PROPERTY_REQUIRED (the routes about your own list of hotels need no header and read none: GET /properties, POST /properties, DELETE /properties/{propertyId})\n notReachable: 404 PROPERTY_NOT_FOUND for a property the key may not act on, whether or not it exists\n reach: A live company key reaches the hotels the vendor enrolled and any hotel whose owner allowed the vendor (Integrations → Software vendors, by the vendor code); the owner can revoke that any time and the key stops reaching the hotel at once. A test company key reaches the vendor's own sandboxes only.\n scopes: The channel-manager scopes (ari:read, ari:write, catalog:write, channel-modifiers:write, channel-bookings:read, direct-bookings:read, direct-bookings:cancel) and properties:write, which only a company key can hold and which is never ticked by default. A hotel's PMS bookings (bookings:*) need that hotel's own key.\n properties: With properties:write a company key adds a hotel (POST /properties) and removes a hotel it added (DELETE /properties/{propertyId}): x-zimmerstack.properties. A key that holds only properties:write acts on no hotel (403 SCOPE_MISSING when it names one). In the partner portal a key with this scope is made by the account owner or an Admin, the people who may add a hotel there; a Developer makes every other company key.\n budgets: Each hotel keeps its own per-key and per-property budgets; the company key also has one budget across all its hotels (x-zimmerstack.limits.companyRequestsPerMinute).\n writes: An ARI write to a hotel whose local rates and availability are not the channels' source of truth is 409 ARI_NOT_AUTHORITATIVE (a hotel a vendor enrols is born the source of truth).\n minted: In the ZimmerStack partner portal (Developers), shown once, revoked there.\n webhooks: One company webhook endpoint (partner portal, Developers) receives the booking and sync events of every hotel a live company key reaches; each event names its hotel in property.id. A sandbox endpoint receives the vendor's sandbox. A pause holds events: they are kept (up to 90 days) and sent in order on resume. A suspension (72 hours of failures) drops them; Recover since in the portal replays them, for a hotels endpoint only from hotels that allowed the vendor when the event happened and still do.\n\n",
|
|
2633
|
-
"money-and-dates": "## dates\nYYYY-MM-DD, calendar dates in the property's timezone (GET /property); a stay occupies [checkIn, checkOut) — the checkout day is not a night\n\n## money\nrates are SENT in major units with the property's currency and RETURNED in minor units (rateMinor); stored as whole major units\n\n## writes\nabsolute values, last write wins within a request, unchanged cells are dropped before anything is written\n\n## idempotency\nheader: x-idempotency-key\nretentionDays: 7\n\n",
|
|
2633
|
+
"money-and-dates": "## dates\nYYYY-MM-DD, calendar dates in the property's timezone (GET /property); a stay occupies [checkIn, checkOut) — the checkout day is not a night\n\n## money\nrates are SENT in major units with the property's currency and RETURNED in minor units (rateMinor); stored as whole major units for a property selling in rupees or in a currency without cents, with their cents for any other currency (x-zimmerstack.moneyByCurrency)\n\n## writes\nabsolute values, last write wins within a request, unchanged cells are dropped before anything is written\n\n## idempotency\nheader: x-idempotency-key\nretentionDays: 7\n\n",
|
|
2634
|
+
"moneyByCurrency": "## moneyByCurrency\nunits: A minor unit is one hundredth of the currency's unit in EVERY currency, also one without cents: a rate of 15000 yen reads rateMinor 1500000, a rate of 1850000 rupiah reads 185000000. Divide by 100, always.\ndecimals: A property selling in rupees stores a rate as a whole rupee (4500.50 is stored as 4501). A currency with cents keeps them (89.50 euros is stored as 89.50). A currency without cents (yen, dong) is stored whole. GET /rates returns what was stored.\nlimits: A rate may be 1 to 21474836 in any currency. A rate plan's standing price and a modifier's fixed step are limited to 1000000 for a property selling in rupees, and to 21474836 for any other currency.\ntaxes: A hotel outside India that has confirmed its own tax lines gets them on a booking: POST /bookings reads nightlyRateIncludesTaxes. Default true: the rate is what the guest paid online; it is split into the lines and totalAmount does not move, except for a line the hotel collects at the property itself (a city tax per person a night), which is added and paid at the hotel. false: the rate is as the hotel sells it at its desk; lines the hotel adds on top are added, lines it keeps inside its prices stay inside. The booking answers carry taxes; always read totalAmount from the answer. A hotel in India, or one with no confirmed lines, has no taxes block and refuses false with TAXES_NOT_CONFIGURED; a hotel whose taxes all sit inside its prices refuses false with TAXES_INSIDE_RATES.\nchannelBookings: An OTA may send a booking in another currency than the property's. Nothing is converted: amounts.receivedCurrency names the currency the amounts are in, and is absent on every other booking. A booking's taxes block carries the hotel's own lines once it is assessed.\n\n",
|
|
2635
|
+
"samplesByPlace": "## samplesByPlace\nlisbon:\n about: A guest house in Lisbon. It sells in euros, so a price keeps its cents (89.50 stays 89.50), and it has confirmed Portugal's accommodation VAT, which sits inside its prices and is worked out night by night.\n property:\n id: 204\n name: Casa do Miradouro\n timezone: Europe/Lisbon\n currency: EUR\n catalog:\n currency: EUR\n roomTypes:\n - id: 731 · ref: rt-double · name: Double Room, River View · maxAdults: 2 · maxChildren: 1 · roomKind: room · sync: IN_SYNC\n ratePlans:\n - id: 1502 · ref: rp-bb · roomTypeId: 731 · name: Bed and breakfast · mealPlan: CP · occupancy: 2 · currency: EUR · refundable: true · sync: IN_SYNC\n ratesWrite:\n updates:\n - ratePlanId: 1502 · dateFrom: 2026-11-01 · dateTo: 2027-03-31 · rate: 89.50 · currency: EUR\n - ratePlanId: 1502 · dateFrom: 2026-11-01 · dateTo: 2027-03-31 · days: [\"fr\",\"sa\"] · rate: 112 · currency: EUR\n ratePlansUpsert:\n ratePlans:\n - ref: rp-bb · roomTypeRef: rt-double · name: Bed and breakfast · mealPlan: CP · occupancy: 2 · refundable: true · defaultRate: 89.50\n bookingCreate:\n externalReference: WEB-2026-LX-0412\n checkIn: 2026-12-20\n checkOut: 2026-12-23\n currency: EUR\n guest:\n name: Inês Carvalho\n phone: +351912345678\n email: ines@example.com\n notes: Arriving by train, around 21:00\n rooms:\n - roomTypeId: 731 · ratePlanId: 1502 · adults: 2 · nightlyRate: 89.50\n payment:\n amount: 89.50\n method: CARD\n reference: pay_LxQ81n4\n bookingView:\n bookingId: 61877\n reference: CM-4TQ8ZK2P\n externalReference: WEB-2026-LX-0412\n status: UPCOMING\n checkIn: 2026-12-20\n checkOut: 2026-12-23\n nights: 3\n currency: EUR\n totalAmount: 268.50\n totalPaid: 89.50\n balanceDue: 179.00\n guest:\n name: Inês Carvalho\n phone: +351912345678\n email: ines@example.com\n rooms:\n - bookingRoomId: 120441 · roomTypeId: 731 · ratePlanId: 1502 · mealPlan: CP · adults: 2 · children: 0 · nightlyRate: 89.50 · status: UPCOMING\n inventory:\n eventRecorded: true\n channelManager: true\n pushedBy: inventory-drain\n replay: false\n createdAt: 2026-11-17T10:02:44.118Z\n cancelledAt: null\n taxes:\n nightlyRateIncludesTaxes: true\n lines:\n - code: PT-VAT-ACCOMMODATION · name: VAT 6% · kind: TAX · includedInRate: true · amount: 15.21\n includedInRates: 15.21\n addedToTotal: 0.00\nbali:\n about: A villa in Ubud, Bali. It sells in rupiah: a nightly price is seven digits and has no cents in practice. It has confirmed a 10% service charge and the 10% hotel tax (PBJT) on the room plus service, both added on top, and its booking engine sends prices before taxes.\n property:\n id: 318\n name: Villa Sawah Ubud\n timezone: Asia/Makassar\n currency: IDR\n catalog:\n currency: IDR\n roomTypes:\n - id: 902 · ref: rt-villa · name: One-Bedroom Pool Villa · maxAdults: 2 · maxChildren: 1 · roomKind: room · sync: IN_SYNC\n ratePlans:\n - id: 2210 · ref: rp-ro · roomTypeId: 902 · name: Room only · mealPlan: EP · occupancy: 2 · currency: IDR · refundable: true · sync: IN_SYNC\n ratesWrite:\n updates:\n - ratePlanId: 2210 · dateFrom: 2026-11-01 · dateTo: 2027-03-31 · rate: 1850000 · currency: IDR\n - ratePlanId: 2210 · dateFrom: 2026-12-24 · dateTo: 2027-01-02 · rate: 2400000 · currency: IDR\n ratePlansUpsert:\n ratePlans:\n - ref: rp-ro · roomTypeRef: rt-villa · name: Room only · mealPlan: EP · occupancy: 2 · refundable: true · defaultRate: 1850000\n bookingCreate:\n externalReference: WEB-2026-UBD-0077\n checkIn: 2026-12-10\n checkOut: 2026-12-12\n currency: IDR\n nightlyRateIncludesTaxes: false\n guest:\n name: Made Wirawan\n phone: +6281234567890\n email: made@example.com\n rooms:\n - roomTypeId: 902 · ratePlanId: 2210 · adults: 2 · nightlyRate: 1850000\n bookingView:\n bookingId: 70312\n reference: CM-9HX3PW7N\n externalReference: WEB-2026-UBD-0077\n status: UPCOMING\n checkIn: 2026-12-10\n checkOut: 2026-12-12\n nights: 2\n currency: IDR\n totalAmount: 4477000.00\n totalPaid: 0.00\n balanceDue: 4477000.00\n guest:\n name: Made Wirawan\n phone: +6281234567890\n email: made@example.com\n rooms:\n - bookingRoomId: 131907 · roomTypeId: 902 · ratePlanId: 2210 · mealPlan: EP · adults: 2 · children: 0 · nightlyRate: 1850000.00 · status: UPCOMING\n inventory:\n eventRecorded: true\n channelManager: true\n pushedBy: inventory-drain\n replay: false\n createdAt: 2026-11-17T03:40:09.552Z\n cancelledAt: null\n taxes:\n nightlyRateIncludesTaxes: false\n lines:\n - code: SERVICE_CHARGE · name: Service charge 10% · kind: FEE · includedInRate: false · amount: 370000.00\n - code: ID-PBJT-PERHOTELAN · name: Hotel tax (PBJT) 10% · kind: TAX · includedInRate: false · amount: 407000.00\n includedInRates: 0.00\n addedToTotal: 777000.00\n\n",
|
|
2634
2636
|
"limits": "## limits\nrequestsPerMinute: 120\nwritesPerMinute: 30\npropertyRequestsPerMinute: 300\npropertyWritesPerMinute: 60\npropertyCellsPerMinute: 20000\nipRequestsPerMinute: 240\nmaxUpdatesPerRequest: 1000\nmaxCellsPerRequest: 5000\nmaxBodyBytes: 1048576\nhorizonDays: 365\nbookingsPerMinute: 20\npropertyBookingsPerMinute: 40\npropertyBookingsPerDay: 500\ndirectCancelsPerMinute: 10\npropertyDirectCancelsPerDay: 50\ncompanyRequestsPerMinute: 1200\nmaxNightsPerBooking: 90\n\n## rateLimits\nwindow: 60 s sliding, shared by every API machine; counters are exact, not per machine\nscopes:\n - scope: ip · perMinute: 240 · counts: every request from one address, checked before the key is read\n - scope: ip-auth · perMinute: 20 · counts: 401 answers to one address; after that the address is refused before any lookup\n - scope: requests · perMinute: 120 · counts: every request on one key\n - scope: writes · perMinute: 30 · counts: PUT requests on one key\n - scope: property · perMinute: 300 · counts: every request on all of a property's keys together (five keys are not five budgets)\n - scope: property-writes · perMinute: 60 · counts: PUT requests on all of a property's keys together\n - scope: cells · perMinute: 20000 · counts: cells a property's writes name after range expansion, charged before anything is read or written\n - scope: bookings · perMinute: 20 · counts: POST /bookings on one key\n - scope: property-bookings · perMinute: 40 · counts: POST /bookings on all of a property's keys together\n - scope: property-bookings-day · perMinute: 500 · counts: POST /bookings per property per ROLLING 24 HOURS (not per minute); the owner can raise it per property\n - scope: direct-cancels · perMinute: 10 · counts: POST /direct-bookings/{bookingId}/cancel on one key (a replay is not counted)\n - scope: property-direct-cancels-day · perMinute: 50 · counts: POST /direct-bookings/{bookingId}/cancel per property per ROLLING 24 HOURS (not per minute)\n - scope: company · perMinute: 1200 · counts: every request on one company key, across all its hotels (each hotel keeps its own key and property budgets too)\n - scope: global · perMinute: 3000 · counts: every request on the Connect API, all keys and addresses\nheaders:\n RateLimit-Policy: on every answer, one quoted policy per key scope — \"key\";q=120;w=60, \"key-writes\";q=30;w=60\n RateLimit: on every answer, what is left and when it refills — \"key\";r=117;t=42, \"key-writes\";r=29;t=42\n Retry-After: on every 429, whole seconds to wait; the body's data.scope says which budget refused\nonRefusal: 429 RATE_LIMITED. Wait Retry-After, then resend the same request. Never retry in a tight loop; never retry any other 4xx.\ntooLarge: 413 when the JSON body exceeds 1048576 bytes; split the updates array\npace:\n - Batch: one PUT per resource carrying ranges (dateFrom..dateTo, optional days) — a 365-night calendar for three plans is a handful of updates, not a thousand\n - Send on change, not on a timer: unchanged cells are dropped and cost nothing, but they still spend your request budget\n - Read RateLimit on every answer and slow down when r approaches 0, instead of waiting for a 429\n - Reuse x-idempotency-key on a retry so a timed-out request can never land twice\n - Poll GET /batches/{batchId} and GET /sync no more than every 15 s; the push to the channels is asynchronous and bounded by the channel manager's own budget\nchannelManager:\n whyAsynchronous: Your 202 means the cells are in our record. Pushing them to the channel manager is paced by its budget — ten rate/restriction reads a minute for the whole account and a per-property write budget — so a full calendar takes minutes, never seconds, and is never lost.\n whatWeDo: We coalesce your cells into the fewest channel-manager calls, drop what did not change, pace every call, stop before the channel manager's last token, and back off on its Retry-After — you never have to think about its limits, only about ours.\n\n",
|
|
2635
2637
|
"bookings": "## bookings\nwho: Hotels that run the ZimmerStack PMS and their OWN booking engine: hand us the reservation your website sold and it lands in the PMS exactly as a front-desk booking — guest, folio, inventory, channels.\npricing: You price the stay. Send the nightly rate you charged per room; we store it and never re-quote. currency must equal the property's.\ninventory: Availability is checked inside the booking transaction under the property's inventory lock (a sold-out night is 409 NO_AVAILABILITY, nothing written). The inventory event commits with the booking; the drain pushes the new counts to every connected channel within seconds.\nidempotency: externalReference is YOUR reservation id and is unique per property: the same value again from the same key (or the key it was rotated from), while that booking is live, returns the same booking with HTTP 200 and replay: true. Use it on every retry. A reference another key already used on this property, or one that belongs to a booking you cancelled, is 409 EXTERNAL_REFERENCE_REUSED: after a cancel, the new stay needs a new reference.\npayments: A payment is recorded only when the key holds bookings:payments and never above the stay total. Nothing collected = omit payment; the desk collects at check-in.\nguest: By default the guest hears from YOUR site only; the owner can switch on our confirmation per property (admin → Developers → Settings).\ncancel: POST /bookings/{bookingId}/cancel cancels the whole booking and re-opens its nights on the channels; a booking already checked in is 409 BOOKING_NOT_CANCELLABLE. Date or room changes: cancel and re-create under a NEW externalReference (a modify endpoint is planned).\nscope: A key reads and cancels only the bookings it (or the key it was rotated from) created on its property; another key's, front-desk and OTA bookings are never visible (BOOKING_NOT_FOUND).\n\n",
|
|
2636
2638
|
"budgets-and-standing": "## shield\nwhat: On top of the per-minute budgets, every property has budgets over an hour and a day, hard limits on its structure, and a standing ZimmerStack can change. They exist because every changed cell is forwarded by the channel manager to every connected channel: an integration that re-sends, flaps or loops is the hotel's and the channels' problem within a minute. GET /property carries this property's own figures (limits), what it has used (usage) and where it stands (shield).\ncounted: A budget counts CHANGED cells: cells whose value differs from our record. Re-sending a calendar we already hold costs nothing here. So send on change, in ranges.\ncalendar:\n what: One full calendar of a property is (2 × its rate plans + its room types) × 365 nights: a price and a stay-rule cell for every plan night, an availability cell for every room-type night. The figures in the table are the least any property gets; a larger one gets whole calendars.\n horizonDays: 365\n perHour: 2\n perDay: 6\n vendorPerDayBase: 150000\n vendorPerDayPerHotel: 15000\n perProperty: Every key on a property spends the same budget: a second key, or a company key beside a hotel key, is not a second budget.\nbudgets:\n - scope: cells-hour · window: one clock hour (UTC) · floor: 10000 · counts: changed cells, all of a property's keys together. At least this many; a larger property gets two of its own full calendars an hour\n - scope: cells-day · window: rolling 24 hours · floor: 30000 · counts: changed cells, all of a property's keys together. At least this many; a larger property gets six of its own full calendars a day\n - scope: vendor-cells-day · window: rolling 24 hours · floor: 150000 · counts: a software vendor's changed cells across all its hotels (company keys and keys it minted). At least this many, plus 15,000 for each hotel it serves; a sandbox is never counted here\n - scope: structure-creates · window: 60 s sliding · floor: 20 · counts: new room types and rate plans per property; a row already here that the write puts on the channel manager counts when it gets there, never when the answer's notice says it could not; also the most one request may create (TOO_MANY_NEW_ENTITIES)\n - scope: structure-creates-day · window: rolling 24 hours · floor: 300 · counts: new room types and rate plans per property\n - scope: structure-edits-day · window: rolling 24 hours · floor: 300 · counts: changed room types and rate plans per property\n - scope: structure-deletes-day · window: rolling 24 hours · floor: 60 · counts: deleted room types and rate plans per property\n - scope: vendor-structure-creates-day · window: rolling 24 hours · floor: 500 · counts: a software vendor's new room types and rate plans across all its hotels\n - scope: vendor-remote-properties-day · window: rolling 24 hours · floor: 10 · counts: hotels a software vendor puts on the channel manager for the first time\n - scope: vendor-property-removals-day · window: rolling 24 hours · floor: 10 · counts: hotels a software partner removes (DELETE /properties/{propertyId}, and Remove hotel in the partner portal); a sandbox is never counted\n - scope: partner-new-properties-hour · window: one hour · floor: 20 · counts: hotels a partner adds, POST /properties and the partner portal's form together; a sandbox is never counted\n - scope: partner-new-sandboxes-hour · window: rolling hour · floor: 30 · counts: sandboxes a partner makes with a test key (POST /properties), counted when one is made; the partner portal's own sandbox button is not counted\n - scope: modifier-changes-day · window: rolling 24 hours · floor: 6 · counts: changes to a channel's price modifier per property (PUT /channels/{channelId}/modifier); steps the channel already holds are not counted\n - scope: rate-resends-day · window: rolling 24 hours · floor: 3 · counts: times a property's prices are sent to the channels again (POST /rates/resend)\ncaps:\n maxRoomTypes: 18\n maxRatePlans: 180\n why: Each cap sits a tenth under what the channel manager includes for that kind of property before it bills extra, so an integration never runs a hotel into overage. GET /property carries this property's own caps.\n byCategory:\n - category: hotel · maxRoomTypes: 18 · maxRatePlans: 180 · ratePlansPerRoomType: null\n - category: vacation rental · maxRoomTypes: 45 · maxRatePlans: 405 · ratePlansPerRoomType: 9\n onRefusal: 409 CATALOG_LIMIT_REACHED (details.limit, details.current, details.requested). Delete what is unused, or ask ZimmerStack support.\nonRefusal: 429 RATE_LIMITED with data.scope naming the budget and Retry-After in whole seconds: to the next clock hour for cells-hour, until enough of the day has aged out for a rolling day. Nothing was written. Wait, then send what still needs to change.\nsafetyLane: A hotel must not oversell because its integration ran out of budget or was paused. A write that only CLOSES inventory (a lower availability count or 0, or stopSell / closedToArrival / closedToDeparture switched on, and nothing else in the request) is still accepted in both cases, against its own hourly allowance (at least 500 cells); its 202 carries lane: true. A write that opens inventory or changes a price waits.\npriceBand:\n what: PUT /rates takes prices in MAJOR units; reads answer in MINOR units. A price below a tenth or above ten times its plan's standing price (the plan's defaultRate, or its room type's base rate) is not taken on trust: the whole request is 422 RATE_OUT_OF_BAND and nothing is written. A plan with no standing price is never judged.\n minPct: 10\n maxPct: 1000\n wayOut: If the price is meant, move the plan's standing price first (PUT /catalog/rate-plans defaultRate): the band moves with it. ZimmerStack support can set a property to warn only (the 202 then carries priceWarnings) or switch its band off; the hotel's owner asks for it.\nstanding:\n levels:\n CLEAR: Nothing held against the integration.\n WATCH: Something notable happened (a budget was used up). Nothing is refused.\n PAUSED: Only writes that close inventory are accepted (the safety lane); anything else is 429 RATE_LIMITED with data.scope shield-pause and a Retry-After that ends with the pause. Set automatically for a while when the channel manager refuses the integration's values or it uses up a budget on two of three days (15 minutes, then 1 hour, 6 hours, a day), or by ZimmerStack support until released.\n SUSPENDED: Every write is 403 WRITES_SUSPENDED until ZimmerStack support releases it.\n frozen: 503 WRITES_FROZEN with Retry-After: ZimmerStack has paused every integration's writes at once. Rare, short, and never your integration alone.\n never: Reads, GET /channel-bookings, webhooks and POST /bookings are never refused by any of this: a guest's reservation and its news always travel.\nrejectedValues: A rate or restriction value the channel manager itself refuses is held, not re-sent: GET /sync counts it (rates.parkedCells), its batch reads failed with the reason, and the property's other cells keep landing. Send a corrected value for those nights.\nsandbox: A sandbox meets the same budgets, limits and band on its own property, so you learn them before going live. It is never frozen and never counts against your company's budgets.\n\n",
|
|
2637
2639
|
"properties": "## properties\nwhat: A software partner's company key adds a hotel and removes a hotel it added, without the partner portal: POST /properties and DELETE /properties/{propertyId}. Scope properties:write, which only a company key can hold; a hotel's own key is 403 COMPANY_KEY_REQUIRED. Neither route reads X-ZS-Property.\nadd: POST /properties makes what the partner portal's \"Add a hotel\" form makes: a channel-manager hotel with its own owner account, its room types (1 to 20, each with one room-only rate plan at its defaultRate), on your invoice at your price. The owner gets their sign-in details by email; you never see them. The answer is the hotel in GET /properties' shape: name its id in X-ZS-Property from then on.\nafterAdding: The new hotel is not on the channel manager yet (channelManager: false). Your first PUT /catalog/room-types puts it there: send the same refs you gave here, or the same names, and they become those room types instead of a second set. Then send your rate plans, and your availability and rates.\nidempotency: POST /properties needs x-idempotency-key (400 IDEMPOTENCY_KEY_INVALID without one): the same key never makes a second hotel, even when the first answer was lost. A test key and a live key never share a key's answer. A 4xx answer is kept under its key for 7 days, like every verdict: once you have changed what it asked for (your billing setup done, a sandbox removed), send the request under a new key. A 429 or a 503 is never kept: send the same request, with the same key, after Retry-After.\nbilling: billing.state says where the new hotel's billing stands. ACTIVE: its billing has started and it is on your next monthly invoice (under the public price list your live hotels are counted on the 1st of each month, so the days before the next 1st are free). WAITING: the hotel is live and its billing has not started; billing.reason says why (SETUP, OVERDUE, UNPAID_LIMIT or REVIEW) and billing.message what to do. Before your first hotel, accept the price list and add your billing details in the partner portal (409 BILLING_SETUP_REQUIRED until then).\nowner: One owner account per email address. An address that already has an account is 409 OWNER_HAS_ACCOUNT: a hotel that exists already joins you when its owner enters your vendor code under Integrations.\nremove: DELETE /properties/{propertyId}?confirm=<the hotel's exact name> removes a hotel for good, in one call: its subscription is cancelled, then its channel connections, its rate plans, its room types and its listing are taken off the channel manager, your keys stop reaching it and nobody signs in to it any more. Its bookings and bills are kept. 200 when nothing is left on the channel manager; 202 when a step there is still pending, which ZimmerStack retries by itself (channelManager.state RETRYING, with the step and what is still connected). Call it again any time: once the hotel is gone the answer is 200 with replay: true and where it stands, and no confirm is needed.\nwhichHotels: Only a hotel you added and pay for, that runs the channel manager alone and is the one property of its owner's account. Anything else is 409 PROPERTY_NOT_REMOVABLE, and data.details.reason says who can do it: OWNER_ALLOWED (its owner let you in: the owner removes your access) · NOT_BILLED_TO_YOU, OTHER_PRODUCTS, SHARES_ACCOUNT (ZimmerStack removes it: write to support). A hotel you cannot reach is 404 PROPERTY_NOT_FOUND.\nrefusals: 400 CONFIRMATION_MISMATCH: confirm is not the hotel's exact name. 503 PROPERTY_BUSY: a hotel of yours is being added or removed right now, one at a time; retry after Retry-After. 503 PROPERTY_BUSY with a Retry-After of an hour on a removal: it has started and could not finish, ZimmerStack has been told and finishes it, and nothing is needed from you; call again later for where it stands. 429 RATE_LIMITED with data.scope vendor-property-removals-day: the most hotels your company may remove in a day (10; a removal that had already started is finished whatever the day's count), partner-new-properties-hour: the most it may add in an hour (20), or partner-new-sandboxes-hour: the most sandboxes a test key may make in an hour (30). 503 PRICE_UNAVAILABLE: the hotel could not be priced just now; retry. 400 VALIDATION whose message says the request is held (data.details.reason): the hotel could not be created from a request already on file, so sending it again, under this key or a new one, will not help; write to ZimmerStack support.\nsandbox: With a test key (zsk_test_) the same two calls make and delete one of your sandboxes (up to 5 at once; 409 SANDBOX_LIMIT beyond, and at most 30 made in any hour; 429 RATE_LIMITED with data.scope partner-new-sandboxes-hour beyond): the body is checked exactly as a live one, the sandbox takes its room types, and nothing is billed or reaches a channel. Its name ends in (sandbox) and is at most 60 characters: confirm a delete with the name the answer returned.\n\n",
|
|
2638
2640
|
"room-types-and-rate-plans": "## structure\nwhat: PUT /catalog/room-types and PUT /catalog/rate-plans (scope catalog:write) let the PMS own the hotel's structure: an upsert by ref, your own id. A new entity is created on the channel manager at once; every later change mirrors there with retries and a nightly drift check; the answer names our id, the action and the sync status per entity. GET /catalog carries ref and sync from now on.\nadoption: A room type the owner already made with the same name (and no ref) becomes yours by ref (action: adopted); a plan likewise under the same room type. A plan never moves between room types (409 CATALOG_CONFLICT): delete it and send it again.\nswitchOn: A channel-manager-only hotel with no channel-manager property yet gets one on the first write, and the channel manager is switched on once a room type and a plan are mapped; channelManager.enabled in the answer says where it stands, reason why not.\nidempotent: Twice over: ref is the upsert key here, and the channel-manager create adopts an existing entity with the same title instead of creating it again, so a retry never duplicates on either side. Send x-idempotency-key on retries as on every write.\nnotHere: A room count after creation (it lives on the channel manager), photos, descriptions, amenities, cancellation policies and stay rules: the owner's Rooms & rates screen, or the restrictions routes.\nsandbox: On a sandbox everything lands locally and reads IN_SYNC, through the same code path.\n\n",
|
|
2639
2641
|
"ota-bookings": "## channelBookings\nwhat: GET /channel-bookings lists the OTA bookings the channel manager delivered to the property — the SAME booking object the webhooks carry, so one parser serves both. Scope channel-bookings:read, granted separately from the ARI pair.\nsince: since is on the booking's last change (created, modified or cancelled), default the last 7 days; page with limit (≤100) and repeat with since = the last item's updatedAt while more is true.\nwhy: Recover a missed webhook, or poll instead of receiving: the webhooks remain the push path, this is the pull path over the same shape.\nnever: Front-desk, booking-engine and Connect API bookings are never listed here; they are not channel bookings. The booking engine's are GET /direct-bookings.\n\n",
|
|
2640
|
-
"website-bookings": "## directBookings\nwhat: 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 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.\ntellApart: 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.\nsubscribe: An endpoint receives them only when it lists the
|
|
2641
|
-
"channels-and-modifiers": "## channels\nwhat: GET /channels lists the connections the channel manager holds for the property, from our record (the nightly settings sweep), with every unresolved problem the channel manager reported (rate_error, sync_error, disconnect_channel, the inventory pipe out of sync).\nfreshness: asOf says when the list was captured; a channel connected today appears after the next sweep. Problems are live.\npushed: The same problems are pushed as webhooks: channel.sync.alert when one is raised, channel.sync.recovered when the inventory pipe recovers (docs/webhooks).\n\n## modifiers\nwhat: One price per rate plan per night goes to every channel the plan is mapped to. A channel's modifier is the one thing that differs per channel: up to five ordered steps (raise or lower, by a percentage or a fixed amount in major units) the channel manager applies to every price it sends that channel. GET /channels shows each channel's steps; PUT /channels/{channelId}/modifier replaces them (scope channel-modifiers:write
|
|
2642
|
-
"sandbox": "## sandbox\nwhat: The owner creates a sandbox from a real property (admin → Developers → API keys, Channels → Integrations): a copy of its room types and rate plans that no channel ever sees. Keys minted there start with zsk_test_ and work ONLY there; a live key never reaches it.\npushes: Every route behaves as in production. A push lands in our record and stops: GET /sync reports IN_SYNC and GET /batches/{batchId} reports landed within a minute, through the same code path as a live property. GET /property says sandbox: true.\nmodify: POST /sandbox/bookings/{bookingId}/modify sends a modified revision — new dates, length, rooms or guest — and the REAL channel.booking.modified webhook with changes and previous, the old nights back on availability and the new ones off.\nbookings: POST /sandbox/bookings simulates an OTA booking end to end — the booking, the sandbox's availability moved down, the inventory event, and the REAL channel.booking.created webhook to every endpoint registered on the sandbox. POST /sandbox/bookings/{bookingId}/cancel does the same for a cancellation. With otaName \"Website\" the booking is one made on the hotel's own website instead, and the events are direct.booking.created and direct.booking.cancelled (x-zimmerstack.directBookings). A live key gets 403 SANDBOX_ONLY.\nlimits: The same budgets as production (one sandbox per owner, up to five per software partner, at most five keys on each). Nothing you do there is billed or pushed to a channel.\ngoLive: Ask the owner for a zsk_live_ key on the real property, swap the key, keep the code.\n\n",
|
|
2643
|
-
"errors": "Every refusal is { statuscode, message, data: { code, … } }. Branch on data.code (the client: err.code): it is stable. message is for a person and may change.\nRetry only 429, 5xx and IDEMPOTENCY_IN_FLIGHT, after Retry-After; every other code is a verdict on the request. The client does this by itself.\n\n- API_KEY_INVALID (401): \"Unauthorized\"\n- API_KEY_REVOKED (401): \"Unauthorized\"\n- API_KEY_EXPIRED (401): \"Unauthorized\" [POST /properties, DELETE /properties/{propertyId}]\n- CONNECT_API_NOT_CONFIGURED\n- IP_NOT_ALLOWED (403): \"This API key may not be used from this address. The property owner restricts it to an allowlist.\"\n- SCOPE_MISSING (403): \"This API key does not have the bookings:write scope. The property owner grants scopes when creating or editing a key.\"\n- PROPERTY_UNAVAILABLE (409): \"This property is not available to the API any more. Contact the property owner.\"\n- CHANNEL_MANAGER_DISABLED (409): \"This property's channel manager is switched off, so writes would not reach any channel. Contact the property owner.\"\n- PMS_NOT_AVAILABLE (409): \"This property runs the channel manager only; there is no PMS to put a booking in.\"\n- VALIDATION (400): \"updates[0].available: Expected number, received string\"\n- RANGE_INVALID (400)\n- HORIZON (400): \"updates[0]: 2028-01-01 is beyond the horizon (last writable night is 2027-10-12, today + 365 days)\" [PUT /availability, PUT /rates, PUT /restrictions]\n- TOO_MANY_UPDATES (400) [PUT /availability, PUT /rates, PUT /restrictions]\n- TOO_MANY_CELLS (400): \"a request may name at most 5000 cells (entity × night); split the calendar into several requests\" [PUT /availability, PUT /rates, PUT /restrictions]\n- UNKNOWN_ROOM_TYPE (400) [PUT /catalog/rate-plans, PUT /availability, POST /bookings, POST /sandbox/bookings]\n- UNKNOWN_RATE_PLAN (400): \"rate plan(s) 77 do not belong to this property (see GET /catalog)\" [PUT /rates, PUT /restrictions, POST /bookings]\n- CURRENCY_MISMATCH (400): \"rates must be sent in INR (got EUR)\" [PUT /rates, POST /bookings]\n- RATE_LIMITED (429): \"Too many requests on this API key. Slow down and retry after the Retry-After interval.\"\n- NOTHING_ACCEPTED (422): \"exceptions are switched off for this property — move the base rate instead\" [PUT /availability, PUT /rates, PUT /restrictions]\n- BATCH_NOT_FOUND (404): \"Batch not found.\"\n- IDEMPOTENCY_KEY_INVALID (400) [POST /properties]\n- IDEMPOTENCY_KEY_REUSED (409): \"This idempotency key was already used with a different request body.\" [POST /properties]\n- IDEMPOTENCY_IN_FLIGHT (409) [POST /properties]\n- STAY_INVALID (400): \"checkIn 2026-10-01 is in the past (today at the property is 2026-10-20)\" [POST /bookings, POST /sandbox/bookings, POST /sandbox/bookings/{bookingId}/modify]\n- UNKNOWN_ROOM_TYPE_FOR_PLAN (400) [POST /bookings]\n- OCCUPANCY_EXCEEDED (400): \"rooms[0]: Deluxe takes at most 3 adults (got 4)\" [POST /bookings]\n- NO_AVAILABILITY (409): \"room type 412 has 0 left on 2026-12-21; 1 requested\" [POST /bookings]\n- EXTERNAL_REFERENCE_REUSED (409) [POST /bookings]\n- PAYMENT_NOT_ALLOWED (403): \"This API key may not record payments. The property owner grants the bookings:payments scope.\" [POST /bookings]\n- PAYMENT_EXCEEDS_TOTAL (400): \"payment.amount 30000.00 exceeds the stay total 27000.00\" [POST /bookings]\n- BOOKING_NOT_FOUND (404): \"Booking not found.\"\n- BOOKING_NOT_CANCELLABLE (409): \"Booking already checked in. Ask the hotel to handle it at the desk.\"\n- MODULE_NOT_ENTITLED (402): \"This property's plan does not include the PMS.\"\n- SANDBOX_ONLY (403): \"The sandbox routes answer only to a test key (zsk_test_…) on a sandbox property. This key is a live key.\" [POST /sandbox/bookings, POST /sandbox/bookings/{bookingId}/cancel, POST /sandbox/bookings/{bookingId}/modify]\n- ROOM_TYPE_NOT_FOUND (404): \"That room type doesn't exist.\"\n- RATE_PLAN_NOT_FOUND (404): \"That rate plan doesn't exist.\"\n- CATALOG_CONFLICT (409): \"A room type with this name already exists.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- CATALOG_BUSY (409): \"Another room-type or rate-plan write for this property is still running. Retry in a few seconds.\"\n- CHANNEL_MANAGER_ERROR (502): \"The channel manager refused the delete. Nothing changed here; try again in a moment.\"\n- PROPERTY_REQUIRED (400): \"This is a company key: name the hotel in the X-ZS-Property header, with its id from GET /properties.\"\n- PROPERTY_NOT_FOUND (404): \"No property with this id that this key may act on (see GET /properties).\"\n- ARI_NOT_AUTHORITATIVE (409): \"This property's local rates and availability are not the channels' source of truth yet, so API writes would never be pushed. Contact ZimmerStack support.\"\n- ROUTE_NOT_FOUND (404): \"No GET /api/v1/connect-api/v1/nope in the Connect API; the contract lists every route.\"\n- PAYLOAD_TOO_LARGE (413): \"The request body is larger than the API accepts. Split the updates array across requests.\"\n- AUTH_BACKEND_UNAVAILABLE\n- BOOKING_NOT_MODIFIABLE (409): \"A cancelled booking cannot be modified from the sandbox.\"\n- SANDBOX_NOT_FOUND\n- SANDBOX_INCOMPLETE\n- WRITES_FROZEN (503): \"ZimmerStack has paused every write to the channel manager for now. Nothing was written. Retry after the Retry-After interval; reads and bookings are not affected.\"\n- WRITES_SUSPENDED (403): \"ZimmerStack has suspended writes for this integration: it kept sending after repeated notices. Reads and bookings still work. Contact ZimmerStack support to have it released.\"\n- SHIELD_UNAVAILABLE (503): \"The write could not be checked against this property's budgets right now. Nothing was written. Retry after the Retry-After interval.\"\n- CATALOG_LIMIT_REACHED (409): \"This property holds 298 rate plans and may hold 300; this request would add 6. Delete what is unused, or ask ZimmerStack support to raise the limit.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- TOO_MANY_NEW_ENTITIES (400): \"This request would create 34 new room types or rate plans; one request may create at most 20. Entities that already exist do not count. Split the new ones across requests.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- RATE_OUT_OF_BAND (422): \"rate plan 901 on 2026-12-01: 45 INR is below the band around this plan's standing price 4500 INR (lowest accepted 450) (and 29 more cells). Rates are sent in major units (4500, not 450000). If the price is meant, change the plan's standing price first (PUT /catalog/rate-plans defaultRate), or ask ZimmerStack support to lift the band for this property.\" [PUT /availability, PUT /rates, PUT /restrictions]\n- CHANNEL_NOT_FOUND (404): \"No connected channel with this id on this property. GET /channels lists them.\" [PUT /channels/{channelId}/modifier]\n- CHANNEL_SHARED (409): \"This connection serves more than one property, so its modifier would move another hotel's prices too. It is set by the hotels' owner in ZimmerStack, not through this API. Nothing was changed.\" [PUT /channels/{channelId}/modifier]\n- MODIFIER_OUT_OF_BAND (422): \"These steps would change what the channel is sent by +180%; a channel's modifier must stay between 50% lower and 100% higher. Nothing was changed.\"\n- COMPANY_KEY_REQUIRED (403): \"Hotels are added and removed with your company key. This key belongs to one hotel.\" [POST /properties, DELETE /properties/{propertyId}]\n- BILLING_SETUP_REQUIRED (409): \"Accept the price list and add your billing details on the Billing page of the partner portal first. Then send the request again under a new idempotency key.\" [POST /properties]\n- OWNER_HAS_ACCOUNT (409): \"This owner already has an account you did not create. Ask them to enter your vendor code under Integrations.\" [POST /properties]\n- SANDBOX_LIMIT (409): \"You hold 5 sandboxes, the most one company may have. Remove one first. Then send the request again under a new idempotency key.\" [POST /properties]\n- CONFIRMATION_MISMATCH (400): \"Send confirm= with the hotel's exact name, as GET /properties prints it.\"\n- PROPERTY_NOT_REMOVABLE (409): \"You did not add this hotel: its owner let you in. Ask the owner to remove your access under Integrations.\"\n- PROPERTY_BUSY (503): \"This hotel, or another of yours, is still being added or removed. Retry shortly.\" [POST /properties, DELETE /properties/{propertyId}]\n- PRICE_UNAVAILABLE (503): \"This hotel cannot be priced right now. Retry in a few minutes.\" [POST /properties]\n",
|
|
2644
|
-
"webhooks": "ZimmerStack POSTs a signed JSON event to the endpoint the hotel's owner (or a software vendor) registered.\n- Events: channel.booking.created, channel.booking.modified, channel.booking.cancelled (an OTA booking arrived, changed, was cancelled); direct.booking.created, direct.booking.cancelled (a guest booked
|
|
2645
|
-
"the-package": "@zimmerstack/connect 0.
|
|
2642
|
+
"website-bookings": "## directBookings\nwhat: 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.\ntellApart: 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.\nsubscribe: 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.\napplyFirst: 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.\nevents: 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.\nafterwards: 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}.\npull: 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.\nnever: OTA bookings (GET /channel-bookings), front-desk bookings and bookings a key created (GET /bookings) are never listed here.\ncancel: 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.\nsandbox: 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).\n\n",
|
|
2643
|
+
"channels-and-modifiers": "## channels\nwhat: GET /channels lists the connections the channel manager holds for the property, from our record (the nightly settings sweep), with every unresolved problem the channel manager reported (rate_error, sync_error, disconnect_channel, the inventory pipe out of sync).\nfreshness: asOf says when the list was captured; a channel connected today appears after the next sweep. Problems are live.\npushed: The same problems are pushed as webhooks: channel.sync.alert when one is raised, channel.sync.recovered when the inventory pipe recovers (docs/webhooks).\n\n## modifiers\nwhat: One price per rate plan per night goes to every channel the plan is mapped to. A channel's modifier is the one thing that differs per channel: up to five ordered steps (raise or lower, by a percentage or a fixed amount in major units) the channel manager applies to every price it sends that channel. GET /channels shows each channel's steps; PUT /channels/{channelId}/modifier replaces them (scope channel-modifiers:write: one call moves every price on that channel. A software partner's keys hold it by default; a hotel's own key holds it when the owner ticked it).\ntakesEffect: 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.\nresend: Not needed after a modifier: the channel manager re-sends that channel every date itself. POST /rates/resend (scope ari:write) is for the rare case where the channel should get our record's prices and stay rules again, unchanged; re-sending the same price through PUT /rates does nothing, because a value our record already holds is dropped before anything is sent. A hotel may ask for it only a few times a day (data.scope rate-resends-day).\nworkflow:\n - GET /channels: find the channel (channelId, kind) and read the steps it holds\n - PUT /channels/{channelId}/modifier with the whole list of steps; [] removes the modifier\n - Nothing else: the channel manager sends that channel every date again, so prices already there move within minutes\nband:\n maxDecreasePct: 50\n maxIncreasePct: 100\nbandRule: The steps together may not lower a price by more or raise it by more than the band: 422 MODIFIER_OUT_OF_BAND, nothing changed. A fixed amount is judged at the property's lowest and highest standing price.\nshared: A connection that serves more than one property (one Airbnb or Booking.com account for sister hotels) is refused, 409 CHANNEL_SHARED: its modifier would move another hotel's prices. The hotels' owner sets it in ZimmerStack.\ngrid: 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.\nmarkupPlan: markupPlan on GET /channels is a separate adjustment the owner may have set in the ZimmerStack Channels app; it applies before the modifier and is read-only here.\nsandbox: 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.\n\n",
|
|
2644
|
+
"sandbox": "## sandbox\nwhat: The owner creates a sandbox from a real property (admin → Developers → API keys, Channels → Integrations): a copy of its room types and rate plans that no channel ever sees. Keys minted there start with zsk_test_ and work ONLY there; a live key never reaches it.\npushes: Every route behaves as in production. A push lands in our record and stops: GET /sync reports IN_SYNC and GET /batches/{batchId} reports landed within a minute, through the same code path as a live property. GET /property says sandbox: true.\nmodify: POST /sandbox/bookings/{bookingId}/modify sends a modified revision — new dates, length, rooms or guest — and the REAL channel.booking.modified webhook with changes and previous, the old nights back on availability and the new ones off.\nbookings: POST /sandbox/bookings simulates an OTA booking end to end — the booking, the sandbox's availability moved down, the inventory event, and the REAL channel.booking.created webhook to every endpoint registered on the sandbox. POST /sandbox/bookings/{bookingId}/cancel does the same for a cancellation. With otaName \"Website\" the booking is one made on the hotel's own website instead, and the events are direct.booking.created and direct.booking.cancelled (x-zimmerstack.directBookings); a no-show is not simulated, so direct.booking.modified is tried with the endpoint's Test button, which sends its sample. A live key gets 403 SANDBOX_ONLY.\nlimits: The same budgets as production (one sandbox per owner, up to five per software partner, at most five keys on each). Nothing you do there is billed or pushed to a channel.\ngoLive: Ask the owner for a zsk_live_ key on the real property, swap the key, keep the code.\n\n",
|
|
2645
|
+
"errors": "Every refusal is { statuscode, message, data: { code, … } }. Branch on data.code (the client: err.code): it is stable. message is for a person and may change.\nRetry only 429, 5xx and IDEMPOTENCY_IN_FLIGHT, after Retry-After; every other code is a verdict on the request. The client does this by itself.\n\n- API_KEY_INVALID (401): \"Unauthorized\"\n- API_KEY_REVOKED (401): \"Unauthorized\"\n- API_KEY_EXPIRED (401): \"Unauthorized\" [POST /properties, DELETE /properties/{propertyId}]\n- CONNECT_API_NOT_CONFIGURED\n- IP_NOT_ALLOWED (403): \"This API key may not be used from this address. The property owner restricts it to an allowlist.\"\n- SCOPE_MISSING (403): \"This API key does not have the bookings:write scope. The property owner grants scopes when creating or editing a key.\"\n- PROPERTY_UNAVAILABLE (409): \"This property is not available to the API any more. Contact the property owner.\"\n- CHANNEL_MANAGER_DISABLED (409): \"This property's channel manager is switched off, so writes would not reach any channel. Contact the property owner.\"\n- PMS_NOT_AVAILABLE (409): \"This property runs the channel manager only; there is no PMS to put a booking in.\"\n- VALIDATION (400): \"updates[0].available: Expected number, received string\"\n- RANGE_INVALID (400)\n- HORIZON (400): \"updates[0]: 2028-01-01 is beyond the horizon (last writable night is 2027-10-12, today + 365 days)\" [PUT /availability, PUT /rates, PUT /restrictions]\n- TOO_MANY_UPDATES (400) [PUT /availability, PUT /rates, PUT /restrictions]\n- TOO_MANY_CELLS (400): \"a request may name at most 5000 cells (entity × night); split the calendar into several requests\" [PUT /availability, PUT /rates, PUT /restrictions]\n- UNKNOWN_ROOM_TYPE (400) [PUT /catalog/rate-plans, PUT /availability, POST /bookings, POST /sandbox/bookings]\n- UNKNOWN_RATE_PLAN (400): \"rate plan(s) 77 do not belong to this property (see GET /catalog)\" [PUT /rates, PUT /restrictions, POST /bookings]\n- CURRENCY_MISMATCH (400): \"rates must be sent in INR (got EUR)\" [PUT /rates, POST /bookings]\n- RATE_LIMITED (429): \"Too many requests on this API key. Slow down and retry after the Retry-After interval.\"\n- NOTHING_ACCEPTED (422): \"exceptions are switched off for this property — move the base rate instead\" [PUT /availability, PUT /rates, PUT /restrictions]\n- BATCH_NOT_FOUND (404): \"Batch not found.\"\n- IDEMPOTENCY_KEY_INVALID (400) [POST /properties]\n- IDEMPOTENCY_KEY_REUSED (409): \"This idempotency key was already used with a different request body.\" [POST /properties]\n- IDEMPOTENCY_IN_FLIGHT (409) [POST /properties]\n- STAY_INVALID (400): \"checkIn 2026-10-01 is in the past (today at the property is 2026-10-20)\" [POST /bookings, POST /sandbox/bookings, POST /sandbox/bookings/{bookingId}/modify]\n- UNKNOWN_ROOM_TYPE_FOR_PLAN (400) [POST /bookings]\n- OCCUPANCY_EXCEEDED (400): \"rooms[0]: Deluxe takes at most 3 adults (got 4)\" [POST /bookings]\n- NO_AVAILABILITY (409): \"room type 412 has 0 left on 2026-12-21; 1 requested\" [POST /bookings]\n- EXTERNAL_REFERENCE_REUSED (409) [POST /bookings]\n- PAYMENT_NOT_ALLOWED (403): \"This API key may not record payments. The property owner grants the bookings:payments scope.\" [POST /bookings]\n- PAYMENT_EXCEEDS_TOTAL (400): \"payment.amount 30000.00 exceeds the stay total 27000.00\" [POST /bookings]\n- TAXES_NOT_CONFIGURED (409): \"This property has no confirmed tax lines, so a rate before taxes cannot be completed. Send nightlyRate as the guest pays it (leave nightlyRateIncludesTaxes out), or ask the hotel to confirm its taxes in admin, Policies, Taxes. Either way send the booking again with a new x-idempotency-key.\" [POST /bookings]\n- TAXES_INSIDE_RATES (409): \"This property's taxes are inside its prices, so there is nothing to add to a rate before taxes. Send nightlyRate as the guest pays it (leave nightlyRateIncludesTaxes out), with a new x-idempotency-key.\" [POST /bookings]\n- BOOKING_NOT_FOUND (404): \"Booking not found.\"\n- BOOKING_NOT_CANCELLABLE (409): \"Booking already checked in. Ask the hotel to handle it at the desk.\"\n- MODULE_NOT_ENTITLED (402): \"This property's plan does not include the PMS.\"\n- SANDBOX_ONLY (403): \"The sandbox routes answer only to a test key (zsk_test_…) on a sandbox property. This key is a live key.\" [POST /sandbox/bookings, POST /sandbox/bookings/{bookingId}/cancel, POST /sandbox/bookings/{bookingId}/modify]\n- ROOM_TYPE_NOT_FOUND (404): \"That room type doesn't exist.\"\n- RATE_PLAN_NOT_FOUND (404): \"That rate plan doesn't exist.\"\n- CATALOG_CONFLICT (409): \"A room type with this name already exists.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- CATALOG_BUSY (409): \"Another room-type or rate-plan write for this property is still running. Retry in a few seconds.\"\n- CHANNEL_MANAGER_ERROR (502): \"The channel manager refused the delete. Nothing changed here; try again in a moment.\"\n- PROPERTY_REQUIRED (400): \"This is a company key: name the hotel in the X-ZS-Property header, with its id from GET /properties.\"\n- PROPERTY_NOT_FOUND (404): \"No property with this id that this key may act on (see GET /properties).\"\n- ARI_NOT_AUTHORITATIVE (409): \"This property's local rates and availability are not the channels' source of truth yet, so API writes would never be pushed. Contact ZimmerStack support.\"\n- ROUTE_NOT_FOUND (404): \"No GET /api/v1/connect-api/v1/nope in the Connect API; the contract lists every route.\"\n- PAYLOAD_TOO_LARGE (413): \"The request body is larger than the API accepts. Split the updates array across requests.\"\n- AUTH_BACKEND_UNAVAILABLE\n- BOOKING_NOT_MODIFIABLE (409): \"A cancelled booking cannot be modified from the sandbox.\"\n- SANDBOX_NOT_FOUND\n- SANDBOX_INCOMPLETE\n- WRITES_FROZEN (503): \"ZimmerStack has paused every write to the channel manager for now. Nothing was written. Retry after the Retry-After interval; reads and bookings are not affected.\"\n- WRITES_SUSPENDED (403): \"ZimmerStack has suspended writes for this integration: it kept sending after repeated notices. Reads and bookings still work. Contact ZimmerStack support to have it released.\"\n- SHIELD_UNAVAILABLE (503): \"The write could not be checked against this property's budgets right now. Nothing was written. Retry after the Retry-After interval.\"\n- CATALOG_LIMIT_REACHED (409): \"This property holds 298 rate plans and may hold 300; this request would add 6. Delete what is unused, or ask ZimmerStack support to raise the limit.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- TOO_MANY_NEW_ENTITIES (400): \"This request would create 34 new room types or rate plans; one request may create at most 20. Entities that already exist do not count. Split the new ones across requests.\" [PUT /catalog/room-types, PUT /catalog/rate-plans]\n- RATE_OUT_OF_BAND (422): \"rate plan 901 on 2026-12-01: 45 INR is below the band around this plan's standing price 4500 INR (lowest accepted 450) (and 29 more cells). Rates are sent in major units (4500, not 450000). If the price is meant, change the plan's standing price first (PUT /catalog/rate-plans defaultRate), or ask ZimmerStack support to lift the band for this property.\" [PUT /availability, PUT /rates, PUT /restrictions]\n- CHANNEL_NOT_FOUND (404): \"No connected channel with this id on this property. GET /channels lists them.\" [PUT /channels/{channelId}/modifier]\n- CHANNEL_SHARED (409): \"This connection serves more than one property, so its modifier would move another hotel's prices too. It is set by the hotels' owner in ZimmerStack, not through this API. Nothing was changed.\" [PUT /channels/{channelId}/modifier]\n- MODIFIER_OUT_OF_BAND (422): \"These steps would change what the channel is sent by +180%; a channel's modifier must stay between 50% lower and 100% higher. Nothing was changed.\"\n- COMPANY_KEY_REQUIRED (403): \"Hotels are added and removed with your company key. This key belongs to one hotel.\" [POST /properties, DELETE /properties/{propertyId}]\n- BILLING_SETUP_REQUIRED (409): \"Accept the price list and add your billing details on the Billing page of the partner portal first. Then send the request again under a new idempotency key.\" [POST /properties]\n- OWNER_HAS_ACCOUNT (409): \"This owner already has an account you did not create. Ask them to enter your vendor code under Integrations.\" [POST /properties]\n- SANDBOX_LIMIT (409): \"You hold 5 sandboxes, the most one company may have. Remove one first. Then send the request again under a new idempotency key.\" [POST /properties]\n- CONFIRMATION_MISMATCH (400): \"Send confirm= with the hotel's exact name, as GET /properties prints it.\"\n- PROPERTY_NOT_REMOVABLE (409): \"You did not add this hotel: its owner let you in. Ask the owner to remove your access under Integrations.\"\n- PROPERTY_BUSY (503): \"This hotel, or another of yours, is still being added or removed. Retry shortly.\" [POST /properties, DELETE /properties/{propertyId}]\n- PRICE_UNAVAILABLE (503): \"This hotel cannot be priced right now. Retry in a few minutes.\" [POST /properties]\n",
|
|
2646
|
+
"webhooks": "ZimmerStack POSTs a signed JSON event to the endpoint the hotel's owner (or a software vendor) registered.\n- Events: channel.booking.created, channel.booking.modified, channel.booking.cancelled (an OTA booking arrived, changed, was cancelled); direct.booking.created, direct.booking.modified, direct.booking.cancelled (a guest booked on the hotel's own website through ZimmerStack's booking engine, the hotel recorded that the guest did not arrive or undid that, or the booking was cancelled: topic website-bookings; an endpoint gets each only when it lists that type); channel.sync.* (a connection's health); zimmerstack.ping (a test).\n- Envelope: { id, type, apiVersion, occurredAt, mode: \"live\" | \"test\", property: { id, name, currency, timezone }, data: { booking }, changes, previous }.\n- Signature (Standard Webhooks): headers webhook-id, webhook-timestamp, webhook-signature. The signature is \"v1,\" + base64(HMAC-SHA256(secret, id + \".\" + timestamp + \".\" + rawBody)); the secret is whsec_ + base64. During a rotation the header carries two, space-separated.\n- Verify the RAW body before parsing it, compare in constant time, and refuse a timestamp more than five minutes old. With this package: const event = await verifyWebhook(rawBody, headers, secret); it throws ZimmerStackWebhookError otherwise.\n- Deliveries are at-least-once and may arrive out of order: dedupe on event.id, order on occurredAt. Answer 2xx within seconds and do slow work afterwards.\n- GET /channel-bookings (zs.channelBookings.all({ since })) and GET /direct-bookings (zs.directBookings.all({ since })) recover what an endpoint missed. They are not polling loops.\n- isWebsiteBookingEvent(event) says an event is a website booking (direct.booking.*); isOtaBookingEvent(event) says it is an OTA booking (channel.booking.*). The booking object is the same in both.\n- direct.booking.modified is a no-show or its undo, not a cancellation: status stays CONFIRMED, the payment is untouched, and data.booking.stayStatus says NOSHOW (free the room) or UPCOMING again (hold it). changes and previous are set on it, as on channel.booking.modified.\n",
|
|
2647
|
+
"the-package": "@zimmerstack/connect 0.7.0: npm install @zimmerstack/connect. Node 20 or newer, on a server only, zero dependencies.\n\nconst zs = new ZimmerStack(); // reads ZIMMERSTACK_CONNECT_KEY; make one per process and reuse it\n\nEvery operation has a method: each operation's lookup names it (\"With the package\"). On top of those:\n- zs.grid.load(from, to): the whole rate grid for a window, ready for a screen. Rows are room types with their rate plans, columns are nights; prices in MAJOR units. Three reads (four the first time; the catalog is kept ten minutes).\n- zs.grid.save(edits): what a person changed, as single nights { availability?, rates?, restrictions? }. Folds nights into ranges, fills in the currency, splits a large save, sends one request per resource in turn. Returns the accepted answers, each with a batchId.\n- zs.batches.wait(batchId): asks every 15 seconds at the fastest, for at most five minutes; returns the last status (\"landed\", \"failed\", or still \"pending\").\n- zs.channelBookings.all({ since }): an async iterator over every OTA booking changed since then, following the cursor.\n- zs.directBookings.all({ since }): the same for the bookings guests made on the hotel's own website (scope direct-bookings:read). Read it before a full availability push.\n- zs.roomTypes.list(), zs.roomTypes.save(roomType), zs.roomTypes.delete(idOrRef) and zs.ratePlans.list(), zs.ratePlans.save(ratePlan), zs.ratePlans.delete(idOrRef): a hotel's room types and rate plans one at a time. save creates one, or changes it when that ref was sent before, and answers with its id. delete takes ZimmerStack's id (a number) or your own ref (a string), deletes for good, and a room type takes its rate plans with it. Scope catalog:write.\n- zs.properties.create(hotel) and zs.properties.delete(propertyId, { confirm }) (also zs.properties.remove): a software partner's company key adds a hotel and removes one it added, for good. Scope properties:write, a company key only. confirm is the hotel's exact name. With a test key they make and delete a sandbox.\n- zs.forProperty(propertyId): a software vendor's company key acting on one hotel; shares the pace of the client it came from.\n- zs.request(\"GET /sync\"): any operation by its contract name, typed.\n- Pure helpers: eachDate(from, to), addDays(date, n), toRanges(cells), chunk(updates), buildGrid(parts), channelPrice(rate, steps).\n- verifyWebhook(rawBody, headers, secret): returns the event or throws ZimmerStackWebhookError.\n- isWebsiteBookingEvent(event), isOtaBookingEvent(event): tell the two booking families apart; BOOKING_EVENT_TYPES lists every type of both.\n- MODIFIER_TAKES_EFFECT: the sentence to show where a person saves a channel's modifier. LIMITS, ERROR_CODES, SCOPES: the contract's own.\n\nA refusal is a ZimmerStackError: code (stable; branch on it), message (for a person; show it), status, retryable (false = fix the request, never resend), retryAfterSeconds, scope (which budget), details, operation.\n\nOptions: apiKey, propertyId, timeoutMs (30 s), maxRetries (3), maxWaitSeconds (120), onEvent (every answer, wait and retry, for logs; never the key), fetch (a stand-in for tests), allowLiveWritesInTests.\n\nWhat it keeps by itself, so do not re-implement it or wrap its calls in a retry loop:\n- Server only: it refuses a browser and React Native, sends the key to ZimmerStack only, never follows a redirect with it and never prints it.\n- Reads the RateLimit header and waits before a budget runs out. Writes go one at a time, in order; at most four reads at once.\n- Retries 429, 5xx and a network failure (four attempts, a growing wait, the same idempotency key); throws anything else at once. A wait over two minutes is handed back.\n- A write the server keeps no idempotency record for is not resent when its outcome is unknown.\n- Splits a write at 1,000 updates or 5,000 cells.\n- After API_KEY_INVALID, API_KEY_REVOKED or API_KEY_EXPIRED it stops calling.\n- A zsk_live_ key under a test runner may read but not write.\n"
|
|
2646
2648
|
}
|
|
2647
2649
|
};
|