@zimmerstack/connect 0.4.1 → 0.5.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 +52 -0
- package/README.md +336 -154
- package/dist/cjs/client.d.ts +135 -6
- package/dist/cjs/client.js +180 -2
- package/dist/cjs/generated.d.ts +113 -4
- package/dist/cjs/generated.js +14 -3
- package/dist/cjs/index.d.ts +1 -1
- package/dist/esm/client.d.ts +135 -6
- package/dist/esm/client.js +179 -2
- package/dist/esm/generated.d.ts +113 -4
- package/dist/esm/generated.js +14 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/mcp/reference.generated.d.ts +2 -0
- package/dist/esm/mcp/reference.generated.js +223 -8
- package/dist/esm/mcp/reference.js +5 -2
- package/package.json +15 -3
|
@@ -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## 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";
|
|
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";
|
|
6
6
|
export const REFERENCE = {
|
|
7
7
|
"api": "ZimmerStack Connect API v1",
|
|
8
8
|
"base": "https://api.zimmerstack.com/api/v1/connect-api/v1",
|
|
@@ -13,6 +13,7 @@ export const REFERENCE = {
|
|
|
13
13
|
"description": "A company key: every hotel it may act on, with the id to name in the X-ZS-Property header; the one route a company key calls without that header. A hotel key: its own property, in the same shape. keyKind says which kind of key you hold.",
|
|
14
14
|
"scope": null,
|
|
15
15
|
"call": "zs.properties.list()",
|
|
16
|
+
"also": [],
|
|
16
17
|
"path": [],
|
|
17
18
|
"query": [],
|
|
18
19
|
"body": null,
|
|
@@ -66,12 +67,182 @@ export const REFERENCE = {
|
|
|
66
67
|
}
|
|
67
68
|
]
|
|
68
69
|
},
|
|
70
|
+
{
|
|
71
|
+
"key": "POST /properties",
|
|
72
|
+
"summary": "Add a hotel (a software partner's company key)",
|
|
73
|
+
"description": "Scope properties:write, company keys only; X-ZS-Property is not read. Makes a channel-manager hotel with its own owner account and its room types, on your invoice, exactly as the partner portal's Add a hotel form does. The answer is the hotel in GET /properties' shape with where its billing stands. With a test key it makes one of your sandboxes from the same body instead. x-zimmerstack.properties has the whole flow.",
|
|
74
|
+
"scope": "properties:write",
|
|
75
|
+
"call": "zs.properties.create(hotel)",
|
|
76
|
+
"also": [],
|
|
77
|
+
"path": [],
|
|
78
|
+
"query": [],
|
|
79
|
+
"body": "PropertyCreate",
|
|
80
|
+
"response": "PropertyCreated",
|
|
81
|
+
"answerStatus": [
|
|
82
|
+
200,
|
|
83
|
+
201
|
|
84
|
+
],
|
|
85
|
+
"idempotent": true,
|
|
86
|
+
"request": {
|
|
87
|
+
"name": "Ganga Guest House",
|
|
88
|
+
"owner": {
|
|
89
|
+
"name": "Meera Joshi",
|
|
90
|
+
"email": "meera@gangaguesthouse.example",
|
|
91
|
+
"phone": "+91 98765 43210"
|
|
92
|
+
},
|
|
93
|
+
"address": {
|
|
94
|
+
"line1": "14 Assi Ghat Road",
|
|
95
|
+
"city": "Varanasi",
|
|
96
|
+
"state": "Uttar Pradesh",
|
|
97
|
+
"postalCode": "221005",
|
|
98
|
+
"country": "IN"
|
|
99
|
+
},
|
|
100
|
+
"taxId": "09ABCDE1234F1Z5",
|
|
101
|
+
"roomTypes": [
|
|
102
|
+
{
|
|
103
|
+
"ref": "rt-river",
|
|
104
|
+
"name": "River View Room",
|
|
105
|
+
"roomCount": 6,
|
|
106
|
+
"adults": 2,
|
|
107
|
+
"defaultRate": 3200
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"ref": "rt-family",
|
|
111
|
+
"name": "Family Room",
|
|
112
|
+
"roomCount": 2,
|
|
113
|
+
"adults": 4,
|
|
114
|
+
"defaultRate": 5400
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
"answer": {
|
|
119
|
+
"id": 63,
|
|
120
|
+
"name": "Ganga Guest House",
|
|
121
|
+
"timezone": "Asia/Kolkata",
|
|
122
|
+
"currency": "INR",
|
|
123
|
+
"channelManager": false,
|
|
124
|
+
"sandbox": false,
|
|
125
|
+
"billing": {
|
|
126
|
+
"state": "ACTIVE",
|
|
127
|
+
"reason": null,
|
|
128
|
+
"message": "This hotel's billing has started: it is on your next monthly invoice."
|
|
129
|
+
},
|
|
130
|
+
"replay": true
|
|
131
|
+
},
|
|
132
|
+
"refusals": [
|
|
133
|
+
{
|
|
134
|
+
"status": 400,
|
|
135
|
+
"description": "data.code VALIDATION: a shape, a country, currency or time zone the country does not have, a GSTIN that is not one, a room type name or ref twice; a request ZimmerStack is holding (the message says so, data.details.reason: do not send it again, write to support); or IDEMPOTENCY_KEY_INVALID: the header is missing or malformed"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"status": 401,
|
|
139
|
+
"description": "Missing, malformed, unknown or revoked key (data.code API_KEY_INVALID | API_KEY_REVOKED | API_KEY_EXPIRED)"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"status": 403,
|
|
143
|
+
"description": "COMPANY_KEY_REQUIRED: a hotel's own key was used; SCOPE_MISSING: the company key lacks properties:write; IP_NOT_ALLOWED as everywhere; or WRITES_SUSPENDED: ZimmerStack has suspended your company's writes"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"status": 409,
|
|
147
|
+
"description": "OWNER_HAS_ACCOUNT: the owner's email already has an account (data.details.addedByYou says whether you made it); BILLING_SETUP_REQUIRED: finish your billing setup in the partner portal first; SANDBOX_LIMIT: a test key and you already hold the most sandboxes; or IDEMPOTENCY_KEY_REUSED / IDEMPOTENCY_IN_FLIGHT"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"status": 413,
|
|
151
|
+
"description": "Body larger than 1048576 bytes (x-zimmerstack.limits.maxBodyBytes); nothing was read"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"status": 429,
|
|
155
|
+
"description": "A per-minute budget; partner-new-properties-hour: the most hotels a partner may add in an hour; or, with a test key, partner-new-sandboxes-hour: the most sandboxes it may make in an hour. Honour Retry-After"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"status": 503,
|
|
159
|
+
"description": "PROPERTY_BUSY: this hotel is still being added by an earlier request, retry with the same key; PRICE_UNAVAILABLE: it could not be priced just now; or WRITES_FROZEN as on every structure write. Nothing here is a verdict: honour Retry-After and send the same request again"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"key": "DELETE /properties/{propertyId}",
|
|
165
|
+
"summary": "Remove a hotel you added (a software partner's company key)",
|
|
166
|
+
"description": "Scope properties:write, company keys only; X-ZS-Property is not read. One call: the hotel's subscription is cancelled, then its channel connections, rate plans, room types and listing are taken off the channel manager, your keys stop reaching it and its logins close. Bookings and bills are kept. Only a hotel you added and pay for, that runs the channel manager alone. A repeat after it is gone answers 200 with replay: true. With a test key it deletes one of your sandboxes. x-zimmerstack.properties has the whole flow.",
|
|
167
|
+
"scope": "properties:write",
|
|
168
|
+
"call": "zs.properties.delete(propertyId, { confirm })",
|
|
169
|
+
"also": [
|
|
170
|
+
"zs.properties.remove(propertyId, { confirm })"
|
|
171
|
+
],
|
|
172
|
+
"path": [
|
|
173
|
+
"propertyId"
|
|
174
|
+
],
|
|
175
|
+
"query": [
|
|
176
|
+
{
|
|
177
|
+
"name": "confirm",
|
|
178
|
+
"required": true,
|
|
179
|
+
"type": "string",
|
|
180
|
+
"description": "The hotel's exact name, as GET /properties prints it (URL-encoded). Asked so a wrong id never removes a hotel; not needed once the hotel is already gone"
|
|
181
|
+
}
|
|
182
|
+
],
|
|
183
|
+
"body": null,
|
|
184
|
+
"response": "PropertyRemoved",
|
|
185
|
+
"answerStatus": [
|
|
186
|
+
200,
|
|
187
|
+
202
|
|
188
|
+
],
|
|
189
|
+
"idempotent": false,
|
|
190
|
+
"request": null,
|
|
191
|
+
"answer": {
|
|
192
|
+
"id": 63,
|
|
193
|
+
"name": "Ganga Guest House",
|
|
194
|
+
"removed": true,
|
|
195
|
+
"replay": false,
|
|
196
|
+
"sandbox": false,
|
|
197
|
+
"access": "CLOSED",
|
|
198
|
+
"billing": {
|
|
199
|
+
"state": "CANCELLED",
|
|
200
|
+
"cancelledAt": "2026-11-19T09:30:12.000Z"
|
|
201
|
+
},
|
|
202
|
+
"channelManager": {
|
|
203
|
+
"state": "REMOVED",
|
|
204
|
+
"step": null,
|
|
205
|
+
"stillConnected": null
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"refusals": [
|
|
209
|
+
{
|
|
210
|
+
"status": 400,
|
|
211
|
+
"description": "confirm is missing or is not the hotel's exact name"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"status": 401,
|
|
215
|
+
"description": "Missing, malformed, unknown or revoked key (data.code API_KEY_INVALID | API_KEY_REVOKED | API_KEY_EXPIRED)"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"status": 403,
|
|
219
|
+
"description": "COMPANY_KEY_REQUIRED: a hotel's own key was used; SCOPE_MISSING: the company key lacks properties:write; IP_NOT_ALLOWED as everywhere; or WRITES_SUSPENDED: ZimmerStack has suspended your company's writes"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"status": 404,
|
|
223
|
+
"description": "No hotel with this id that this key may act on"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"status": 409,
|
|
227
|
+
"description": "Not yours to remove: data.details.reason is OWNER_ALLOWED (its owner removes your access) or NOT_BILLED_TO_YOU · OTHER_PRODUCTS · SHARES_ACCOUNT (write to ZimmerStack support)"
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"status": 429,
|
|
231
|
+
"description": "A per-minute budget, or vendor-property-removals-day: the most hotels your company may remove in a rolling day. Honour Retry-After"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"status": 503,
|
|
235
|
+
"description": "PROPERTY_BUSY: a hotel of yours is being added or removed right now and nothing was changed; or, with a Retry-After of an hour, this hotel's removal has started and could not finish: ZimmerStack has been told and finishes it. WRITES_FROZEN or SHIELD_UNAVAILABLE as on every structure write. Honour Retry-After and send it again: once the hotel is gone the answer is 200 with replay: true"
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
},
|
|
69
239
|
{
|
|
70
240
|
"key": "GET /property",
|
|
71
241
|
"summary": "The property this key is for",
|
|
72
242
|
"description": "",
|
|
73
243
|
"scope": null,
|
|
74
244
|
"call": "zs.property.get()",
|
|
245
|
+
"also": [],
|
|
75
246
|
"path": [],
|
|
76
247
|
"query": [],
|
|
77
248
|
"body": null,
|
|
@@ -154,6 +325,10 @@ export const REFERENCE = {
|
|
|
154
325
|
"description": "",
|
|
155
326
|
"scope": null,
|
|
156
327
|
"call": "zs.catalog.get()",
|
|
328
|
+
"also": [
|
|
329
|
+
"zs.roomTypes.list()",
|
|
330
|
+
"zs.ratePlans.list()"
|
|
331
|
+
],
|
|
157
332
|
"path": [],
|
|
158
333
|
"query": [],
|
|
159
334
|
"body": null,
|
|
@@ -239,6 +414,9 @@ export const REFERENCE = {
|
|
|
239
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 read at creation only. The answer lists our id, the action and the sync status per entity, and where the property's channel manager stands.",
|
|
240
415
|
"scope": "catalog:write",
|
|
241
416
|
"call": "zs.catalog.upsertRoomTypes(body)",
|
|
417
|
+
"also": [
|
|
418
|
+
"zs.roomTypes.save(roomType)"
|
|
419
|
+
],
|
|
242
420
|
"path": [],
|
|
243
421
|
"query": [],
|
|
244
422
|
"body": "RoomTypesUpsert",
|
|
@@ -327,7 +505,10 @@ export const REFERENCE = {
|
|
|
327
505
|
"summary": "Delete a room type: the channel manager's copy first, then ours; its plans go with it",
|
|
328
506
|
"description": "Scope catalog:write. Refused while rooms are assigned to it on a PMS property, or while a channel still sells one of its plans. Nothing changes here when the channel manager refuses.",
|
|
329
507
|
"scope": "catalog:write",
|
|
330
|
-
"call": "zs.
|
|
508
|
+
"call": "zs.roomTypes.delete(idOrRef)",
|
|
509
|
+
"also": [
|
|
510
|
+
"zs.catalog.deleteRoomType(roomTypeId)"
|
|
511
|
+
],
|
|
331
512
|
"path": [
|
|
332
513
|
"roomTypeId"
|
|
333
514
|
],
|
|
@@ -384,6 +565,9 @@ export const REFERENCE = {
|
|
|
384
565
|
"description": "Scope catalog:write. Up to 100 per request, each ref once; name the room type by our id (roomTypeId) or by the ref you gave it (roomTypeRef, in this request or an earlier one). A ref seen before is updated where the fields differ; a new ref whose name exists under the same room type (with no ref) adopts that plan; anything else is created here and on the channel manager at once, seeded at defaultRateMinor when given. A plan never moves between room types.",
|
|
385
566
|
"scope": "catalog:write",
|
|
386
567
|
"call": "zs.catalog.upsertRatePlans(body)",
|
|
568
|
+
"also": [
|
|
569
|
+
"zs.ratePlans.save(ratePlan)"
|
|
570
|
+
],
|
|
387
571
|
"path": [],
|
|
388
572
|
"query": [],
|
|
389
573
|
"body": "RatePlansUpsert",
|
|
@@ -476,7 +660,10 @@ export const REFERENCE = {
|
|
|
476
660
|
"summary": "Delete a rate plan: the channel manager's copy first, then ours",
|
|
477
661
|
"description": "Scope catalog:write. Refused while a channel still sells it (unmap it on the channel manager first). Nothing changes here when the channel manager refuses.",
|
|
478
662
|
"scope": "catalog:write",
|
|
479
|
-
"call": "zs.
|
|
663
|
+
"call": "zs.ratePlans.delete(idOrRef)",
|
|
664
|
+
"also": [
|
|
665
|
+
"zs.catalog.deleteRatePlan(ratePlanId)"
|
|
666
|
+
],
|
|
480
667
|
"path": [
|
|
481
668
|
"ratePlanId"
|
|
482
669
|
],
|
|
@@ -531,6 +718,7 @@ export const REFERENCE = {
|
|
|
531
718
|
"description": "Served from our record, never from the channel manager.",
|
|
532
719
|
"scope": "ari:read",
|
|
533
720
|
"call": "zs.availability.get({ from, to })",
|
|
721
|
+
"also": [],
|
|
534
722
|
"path": [],
|
|
535
723
|
"query": [
|
|
536
724
|
{
|
|
@@ -587,6 +775,7 @@ export const REFERENCE = {
|
|
|
587
775
|
"description": "Each update sets the ABSOLUTE number of rooms for sale for one room type over a date range. Lands in our record and rides the inventory drain to the channels.",
|
|
588
776
|
"scope": "ari:write",
|
|
589
777
|
"call": "zs.availability.set(updates)",
|
|
778
|
+
"also": [],
|
|
590
779
|
"path": [],
|
|
591
780
|
"query": [],
|
|
592
781
|
"body": "AvailabilityWrite",
|
|
@@ -666,6 +855,7 @@ export const REFERENCE = {
|
|
|
666
855
|
"description": "Served from our record, never from the channel manager.",
|
|
667
856
|
"scope": "ari:read",
|
|
668
857
|
"call": "zs.rates.get({ from, to })",
|
|
858
|
+
"also": [],
|
|
669
859
|
"path": [],
|
|
670
860
|
"query": [
|
|
671
861
|
{
|
|
@@ -722,6 +912,7 @@ export const REFERENCE = {
|
|
|
722
912
|
"description": "Each update sets the price of one rate plan over a date range, optionally masked to weekdays (`days`). `currency` must equal the property's. Lands in our record and rides the ARI projector to the channels.",
|
|
723
913
|
"scope": "ari:write",
|
|
724
914
|
"call": "zs.rates.set(updates)",
|
|
915
|
+
"also": [],
|
|
725
916
|
"path": [],
|
|
726
917
|
"query": [],
|
|
727
918
|
"body": "RatesWrite",
|
|
@@ -807,6 +998,7 @@ export const REFERENCE = {
|
|
|
807
998
|
"description": "null = we hold no opinion for that field on that night.",
|
|
808
999
|
"scope": "ari:read",
|
|
809
1000
|
"call": "zs.restrictions.get({ from, to })",
|
|
1001
|
+
"also": [],
|
|
810
1002
|
"path": [],
|
|
811
1003
|
"query": [
|
|
812
1004
|
{
|
|
@@ -863,6 +1055,7 @@ export const REFERENCE = {
|
|
|
863
1055
|
"description": "Each update sets ANY subset of stopSell, closedToArrival, closedToDeparture, minStayArrival, minStayThrough, maxStay for one rate plan over a date range; fields you omit are left as they are.",
|
|
864
1056
|
"scope": "ari:write",
|
|
865
1057
|
"call": "zs.restrictions.set(updates)",
|
|
1058
|
+
"also": [],
|
|
866
1059
|
"path": [],
|
|
867
1060
|
"query": [],
|
|
868
1061
|
"body": "RestrictionsWrite",
|
|
@@ -943,6 +1136,7 @@ export const REFERENCE = {
|
|
|
943
1136
|
"description": "Poll this instead of asking the channel manager: inventory pipe state, rate cells still queued, the projector's last outcome and the newest batch still pending.",
|
|
944
1137
|
"scope": "ari:read",
|
|
945
1138
|
"call": "zs.sync.get()",
|
|
1139
|
+
"also": [],
|
|
946
1140
|
"path": [],
|
|
947
1141
|
"query": [],
|
|
948
1142
|
"body": null,
|
|
@@ -982,6 +1176,7 @@ export const REFERENCE = {
|
|
|
982
1176
|
"description": "Scope bookings:read. Only bookings a key of this property created; front-desk and OTA bookings are never listed.",
|
|
983
1177
|
"scope": "bookings:read",
|
|
984
1178
|
"call": "zs.bookings.list(query)",
|
|
1179
|
+
"also": [],
|
|
985
1180
|
"path": [],
|
|
986
1181
|
"query": [
|
|
987
1182
|
{
|
|
@@ -1044,6 +1239,7 @@ export const REFERENCE = {
|
|
|
1044
1239
|
"description": "Scope bookings:write (+ bookings:payments to record a payment). One entry in `rooms` per room. The stay is checked for availability under the property's inventory lock and written with its inventory event in one transaction; the channels update within seconds. A repeated externalReference answers 200 with the same booking (replay: true) while it is this key's and live; another key's reference, or one of your own cancelled bookings, is 409 EXTERNAL_REFERENCE_REUSED (send a new reference after a cancel). 1–90 nights, arrival from today to today + horizonDays, in the property's timezone.",
|
|
1045
1240
|
"scope": "bookings:write",
|
|
1046
1241
|
"call": "zs.bookings.create(body)",
|
|
1242
|
+
"also": [],
|
|
1047
1243
|
"path": [],
|
|
1048
1244
|
"query": [],
|
|
1049
1245
|
"body": "BookingCreate",
|
|
@@ -1171,6 +1367,7 @@ export const REFERENCE = {
|
|
|
1171
1367
|
"description": "",
|
|
1172
1368
|
"scope": "bookings:read",
|
|
1173
1369
|
"call": "zs.bookings.get(bookingId)",
|
|
1370
|
+
"also": [],
|
|
1174
1371
|
"path": [
|
|
1175
1372
|
"bookingId"
|
|
1176
1373
|
],
|
|
@@ -1259,6 +1456,7 @@ export const REFERENCE = {
|
|
|
1259
1456
|
"description": "Scope bookings:write. Idempotent: an already-cancelled booking answers 200 with replay: true. A booking the desk has checked in is 409 BOOKING_NOT_CANCELLABLE.",
|
|
1260
1457
|
"scope": "bookings:write",
|
|
1261
1458
|
"call": "zs.bookings.cancel(bookingId, body)",
|
|
1459
|
+
"also": [],
|
|
1262
1460
|
"path": [
|
|
1263
1461
|
"bookingId"
|
|
1264
1462
|
],
|
|
@@ -1302,6 +1500,7 @@ export const REFERENCE = {
|
|
|
1302
1500
|
"description": "Scope ari:read. No channel-manager call: asOf is when the list was captured (the nightly settings sweep); open issues are live. Each channel carries its price modifier (x-zimmerstack.modifiers); a modifier set through this API shows at once.",
|
|
1303
1501
|
"scope": "ari:read",
|
|
1304
1502
|
"call": "zs.channels.list()",
|
|
1503
|
+
"also": [],
|
|
1305
1504
|
"path": [],
|
|
1306
1505
|
"query": [],
|
|
1307
1506
|
"body": null,
|
|
@@ -1375,6 +1574,7 @@ export const REFERENCE = {
|
|
|
1375
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. Takes effect on prices sent to the channel after the change; prices already there stay until sent again (POST /rates/resend). Steps the channel already holds answer changed: false and cost nothing.",
|
|
1376
1575
|
"scope": "channel-modifiers:write",
|
|
1377
1576
|
"call": "zs.channels.setModifier(channelId, steps)",
|
|
1577
|
+
"also": [],
|
|
1378
1578
|
"path": [
|
|
1379
1579
|
"channelId"
|
|
1380
1580
|
],
|
|
@@ -1463,6 +1663,7 @@ export const REFERENCE = {
|
|
|
1463
1663
|
"description": "Scope ari:write. Marks every rate-plan night of the writable horizon to be sent again, unchanged, so each channel's current modifier applies to it. The nights travel like any write: paced, coalesced, never lost. Use it after changing a modifier; it is limited per property per day (data.scope rate-resends-day). No body.",
|
|
1464
1664
|
"scope": "ari:write",
|
|
1465
1665
|
"call": "zs.rates.resend()",
|
|
1666
|
+
"also": [],
|
|
1466
1667
|
"path": [],
|
|
1467
1668
|
"query": [],
|
|
1468
1669
|
"body": null,
|
|
@@ -1513,6 +1714,7 @@ export const REFERENCE = {
|
|
|
1513
1714
|
"description": "Scope channel-bookings:read. Oldest change first; since (default the last 7 days) is on the booking's last change so cancellations and modifications are listed again; while more is true, ask again with cursor = nextCursor, which resumes exactly after the last item even when many bookings changed in the same instant.",
|
|
1514
1715
|
"scope": "channel-bookings:read",
|
|
1515
1716
|
"call": "zs.channelBookings.list(query)",
|
|
1717
|
+
"also": [],
|
|
1516
1718
|
"path": [],
|
|
1517
1719
|
"query": [
|
|
1518
1720
|
{
|
|
@@ -1651,6 +1853,7 @@ export const REFERENCE = {
|
|
|
1651
1853
|
"description": "Scope channel-bookings:read. 404 for a booking that is not this property's or not a channel booking.",
|
|
1652
1854
|
"scope": "channel-bookings:read",
|
|
1653
1855
|
"call": "zs.channelBookings.get(bookingId)",
|
|
1856
|
+
"also": [],
|
|
1654
1857
|
"path": [
|
|
1655
1858
|
"bookingId"
|
|
1656
1859
|
],
|
|
@@ -1759,6 +1962,7 @@ export const REFERENCE = {
|
|
|
1759
1962
|
"description": "Scope direct-bookings:read. The bookings of the ZimmerStack booking engine on this property: the pull beside the direct.booking.* webhooks (x-zimmerstack.directBookings). Oldest change first; since (default the last 7 days) is on the booking's last change so a cancellation is listed again; while more is true, ask again with cursor = nextCursor. A booking deleted in ZimmerStack stays listed, as CANCELLED. Read it before a full availability push.",
|
|
1760
1963
|
"scope": "direct-bookings:read",
|
|
1761
1964
|
"call": "zs.directBookings.list(query)",
|
|
1965
|
+
"also": [],
|
|
1762
1966
|
"path": [],
|
|
1763
1967
|
"query": [
|
|
1764
1968
|
{
|
|
@@ -1889,6 +2093,7 @@ export const REFERENCE = {
|
|
|
1889
2093
|
"description": "Scope direct-bookings:read. 404 for a booking that is not this property's or was not made on its website.",
|
|
1890
2094
|
"scope": "direct-bookings:read",
|
|
1891
2095
|
"call": "zs.directBookings.get(bookingId)",
|
|
2096
|
+
"also": [],
|
|
1892
2097
|
"path": [
|
|
1893
2098
|
"bookingId"
|
|
1894
2099
|
],
|
|
@@ -1989,6 +2194,7 @@ export const REFERENCE = {
|
|
|
1989
2194
|
"description": "Scope direct-bookings:cancel (granted on its own, never by default). The whole booking, while it is UPCOMING: the nights go back on sale, the guest gets the usual cancellation message and direct.booking.cancelled says \"Cancelled by the hotel\". refund decides the money (x-zimmerstack.directBookings.cancel); the answer says what the guest gets back and its status. Idempotent: an already-cancelled booking answers 200 with replay: true and moves no money.",
|
|
1990
2195
|
"scope": "direct-bookings:cancel",
|
|
1991
2196
|
"call": "zs.directBookings.cancel(bookingId, body)",
|
|
2197
|
+
"also": [],
|
|
1992
2198
|
"path": [
|
|
1993
2199
|
"bookingId"
|
|
1994
2200
|
],
|
|
@@ -2104,6 +2310,7 @@ export const REFERENCE = {
|
|
|
2104
2310
|
"description": "Scope ari:read, test keys only (403 SANDBOX_ONLY on a live key).",
|
|
2105
2311
|
"scope": "ari:read",
|
|
2106
2312
|
"call": "zs.sandbox.bookings.list()",
|
|
2313
|
+
"also": [],
|
|
2107
2314
|
"path": [],
|
|
2108
2315
|
"query": [],
|
|
2109
2316
|
"body": null,
|
|
@@ -2169,6 +2376,7 @@ export const REFERENCE = {
|
|
|
2169
2376
|
"description": "Scope ari:write, test keys only (403 SANDBOX_ONLY on a live key). Creates a channel booking on the sandbox exactly as the channel manager would: the booking row, the room type's availability moved down for every night, the inventory event, and the channel.booking.created webhook queued to every endpoint registered on the sandbox. A sold-out night does not refuse (an OTA oversells; the PMS is told): the booking lands with oversold: true.",
|
|
2170
2377
|
"scope": "ari:write",
|
|
2171
2378
|
"call": "zs.sandbox.bookings.create(body)",
|
|
2379
|
+
"also": [],
|
|
2172
2380
|
"path": [],
|
|
2173
2381
|
"query": [],
|
|
2174
2382
|
"body": "SandboxBookingCreate",
|
|
@@ -2239,6 +2447,7 @@ export const REFERENCE = {
|
|
|
2239
2447
|
"description": "Scope ari:write, test keys only (403 SANDBOX_ONLY on a live key). Idempotent: an already-cancelled booking answers 200 with webhook.queued false.",
|
|
2240
2448
|
"scope": "ari:write",
|
|
2241
2449
|
"call": "zs.sandbox.bookings.cancel(bookingId)",
|
|
2450
|
+
"also": [],
|
|
2242
2451
|
"path": [
|
|
2243
2452
|
"bookingId"
|
|
2244
2453
|
],
|
|
@@ -2280,6 +2489,7 @@ export const REFERENCE = {
|
|
|
2280
2489
|
"description": "Scope ari:write, test keys only (403 SANDBOX_ONLY on a live key). At least one field. The old nights go back on the sandbox's availability, the new ones come off; channel.booking.modified carries changes and previous.",
|
|
2281
2490
|
"scope": "ari:write",
|
|
2282
2491
|
"call": "zs.sandbox.bookings.modify(bookingId, body)",
|
|
2492
|
+
"also": [],
|
|
2283
2493
|
"path": [
|
|
2284
2494
|
"bookingId"
|
|
2285
2495
|
],
|
|
@@ -2328,6 +2538,7 @@ export const REFERENCE = {
|
|
|
2328
2538
|
"description": "",
|
|
2329
2539
|
"scope": "ari:read",
|
|
2330
2540
|
"call": "zs.batches.get(batchId)",
|
|
2541
|
+
"also": [],
|
|
2331
2542
|
"path": [
|
|
2332
2543
|
"batchId"
|
|
2333
2544
|
],
|
|
@@ -2377,10 +2588,13 @@ export const REFERENCE = {
|
|
|
2377
2588
|
}
|
|
2378
2589
|
],
|
|
2379
2590
|
"types": {
|
|
2380
|
-
"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\";\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\" | \"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}",
|
|
2381
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}",
|
|
2382
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}",
|
|
2383
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
|
+
"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
|
+
"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
|
+
"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}",
|
|
2384
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 (its count caps what the channels sell); a count below the rooms holding upcoming stays is refused. 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}",
|
|
2385
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}",
|
|
2386
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}",
|
|
@@ -2415,18 +2629,19 @@ export const REFERENCE = {
|
|
|
2415
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}"
|
|
2416
2630
|
},
|
|
2417
2631
|
"topics": {
|
|
2418
|
-
"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)\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 (
|
|
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",
|
|
2419
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",
|
|
2420
2634
|
"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",
|
|
2421
2635
|
"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",
|
|
2422
|
-
"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; 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: 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",
|
|
2636
|
+
"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
|
+
"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",
|
|
2423
2638
|
"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",
|
|
2424
2639
|
"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",
|
|
2425
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 two event types. An endpoint registered before they existed receives none until its owner ticks them.\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. 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. There is no modified event: the booking engine never changes a booking's dates.\nafterwards: What the hotel changes on a website booking in ZimmerStack afterwards (other dates, one room of several cancelled, a no-show) sends no event. 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 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",
|
|
2426
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, granted separately: one call moves every price on that channel).\ntakesEffect: 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.\nresend: POST /rates/resend (scope ari:write) sends the property's prices and stay rules to the channels again, unchanged, so every night picks the current modifiers up. Re-sending the same price through PUT /rates does nothing: a value our record already holds is dropped before anything is sent. The re-send is the way, and 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 - POST /rates/resend if nights already on the channel should move too, then watch rates.dirtyCells on GET /sync fall to 0\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",
|
|
2427
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",
|
|
2428
|
-
"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\"\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\n- IDEMPOTENCY_KEY_REUSED (409): \"This idempotency key was already used with a different request body.\"\n- IDEMPOTENCY_IN_FLIGHT\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.\"
|
|
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",
|
|
2429
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, or cancelled, on the hotel's own website through ZimmerStack's booking engine: topic website-bookings; an endpoint gets them only when it lists those two types); 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",
|
|
2430
|
-
"the-package": "@zimmerstack/connect 0.
|
|
2645
|
+
"the-package": "@zimmerstack/connect 0.5.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"
|
|
2431
2646
|
}
|
|
2432
2647
|
};
|