@zimmerstack/connect 0.7.0 → 0.9.1

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.
Files changed (51) hide show
  1. package/AGENTS.md +305 -25
  2. package/README.md +572 -56
  3. package/dist/cjs/client.d.ts +528 -13
  4. package/dist/cjs/client.js +778 -46
  5. package/dist/cjs/doctor.d.ts +86 -0
  6. package/dist/cjs/doctor.js +689 -0
  7. package/dist/cjs/errors.d.ts +6 -2
  8. package/dist/cjs/errors.js +7 -2
  9. package/dist/cjs/generated.d.ts +2873 -203
  10. package/dist/cjs/generated.js +222 -8
  11. package/dist/cjs/grid.d.ts +6 -1
  12. package/dist/cjs/grid.js +8 -0
  13. package/dist/cjs/index.d.ts +14 -5
  14. package/dist/cjs/index.js +41 -1
  15. package/dist/cjs/key.d.ts +39 -0
  16. package/dist/cjs/key.js +85 -0
  17. package/dist/cjs/money.d.ts +81 -0
  18. package/dist/cjs/money.js +172 -0
  19. package/dist/cjs/notices.d.ts +44 -0
  20. package/dist/cjs/notices.js +64 -0
  21. package/dist/cjs/shownOnce.d.ts +42 -0
  22. package/dist/cjs/shownOnce.js +83 -0
  23. package/dist/cjs/webhooks.d.ts +182 -3
  24. package/dist/cjs/webhooks.js +75 -1
  25. package/dist/esm/client.d.ts +528 -13
  26. package/dist/esm/client.js +776 -46
  27. package/dist/esm/doctor.d.ts +86 -0
  28. package/dist/esm/doctor.js +685 -0
  29. package/dist/esm/errors.d.ts +6 -2
  30. package/dist/esm/errors.js +7 -2
  31. package/dist/esm/generated.d.ts +2873 -203
  32. package/dist/esm/generated.js +221 -7
  33. package/dist/esm/grid.d.ts +6 -1
  34. package/dist/esm/grid.js +7 -0
  35. package/dist/esm/index.d.ts +14 -5
  36. package/dist/esm/index.js +8 -3
  37. package/dist/esm/key.d.ts +39 -0
  38. package/dist/esm/key.js +81 -0
  39. package/dist/esm/mcp/cli.js +95 -11
  40. package/dist/esm/mcp/reference.generated.js +5741 -1008
  41. package/dist/esm/mcp/server.d.ts +14 -6
  42. package/dist/esm/mcp/server.js +451 -25
  43. package/dist/esm/money.d.ts +81 -0
  44. package/dist/esm/money.js +161 -0
  45. package/dist/esm/notices.d.ts +44 -0
  46. package/dist/esm/notices.js +56 -0
  47. package/dist/esm/shownOnce.d.ts +42 -0
  48. package/dist/esm/shownOnce.js +77 -0
  49. package/dist/esm/webhooks.d.ts +182 -3
  50. package/dist/esm/webhooks.js +69 -0
  51. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  /** This package's version, sent as the user agent so ZimmerStack can tell which client a request came from. */
2
- export declare const SDK_VERSION = "0.7.0";
2
+ export declare const SDK_VERSION = "0.9.1";
3
3
  /** Where the API lives. The key is sent nowhere else. */
4
4
  export declare const API_ORIGIN = "https://api.zimmerstack.com";
5
5
  export declare const API_PREFIX = "/api/v1/connect-api/v1";
@@ -14,10 +14,14 @@ export declare const LIMITS: {
14
14
  readonly propertyWritesPerMinute: 60;
15
15
  readonly propertyCellsPerMinute: 20000;
16
16
  readonly ipRequestsPerMinute: 240;
17
+ readonly ipAuthFailuresPerMinute: 20;
18
+ readonly keyAuthFailuresPerMinute: 5;
19
+ readonly globalUnauthenticatedPerMinute: 1200;
20
+ readonly globalRequestsPerMinute: 3000;
17
21
  readonly maxUpdatesPerRequest: 1000;
18
22
  readonly maxCellsPerRequest: 5000;
19
23
  readonly maxBodyBytes: 1048576;
20
- readonly horizonDays: 365;
24
+ readonly horizonDays: 500;
21
25
  readonly bookingsPerMinute: 20;
22
26
  readonly propertyBookingsPerMinute: 40;
23
27
  readonly propertyBookingsPerDay: 500;
@@ -27,19 +31,135 @@ export declare const LIMITS: {
27
31
  readonly maxNightsPerBooking: 90;
28
32
  };
29
33
  /** Every stable error code (`error.code`). Messages are for people and may change; branch on these. */
30
- export declare const ERROR_CODES: readonly ["API_KEY_INVALID", "API_KEY_REVOKED", "API_KEY_EXPIRED", "CONNECT_API_NOT_CONFIGURED", "IP_NOT_ALLOWED", "SCOPE_MISSING", "PROPERTY_UNAVAILABLE", "CHANNEL_MANAGER_DISABLED", "PMS_NOT_AVAILABLE", "VALIDATION", "RANGE_INVALID", "HORIZON", "TOO_MANY_UPDATES", "TOO_MANY_CELLS", "UNKNOWN_ROOM_TYPE", "UNKNOWN_RATE_PLAN", "CURRENCY_MISMATCH", "RATE_LIMITED", "NOTHING_ACCEPTED", "BATCH_NOT_FOUND", "IDEMPOTENCY_KEY_INVALID", "IDEMPOTENCY_KEY_REUSED", "IDEMPOTENCY_IN_FLIGHT", "STAY_INVALID", "UNKNOWN_ROOM_TYPE_FOR_PLAN", "OCCUPANCY_EXCEEDED", "NO_AVAILABILITY", "EXTERNAL_REFERENCE_REUSED", "PAYMENT_NOT_ALLOWED", "PAYMENT_EXCEEDS_TOTAL", "TAXES_NOT_CONFIGURED", "TAXES_INSIDE_RATES", "BOOKING_NOT_FOUND", "BOOKING_NOT_CANCELLABLE", "MODULE_NOT_ENTITLED", "SANDBOX_ONLY", "ROOM_TYPE_NOT_FOUND", "RATE_PLAN_NOT_FOUND", "CATALOG_CONFLICT", "CATALOG_BUSY", "CHANNEL_MANAGER_ERROR", "PROPERTY_REQUIRED", "PROPERTY_NOT_FOUND", "ARI_NOT_AUTHORITATIVE", "ROUTE_NOT_FOUND", "PAYLOAD_TOO_LARGE", "AUTH_BACKEND_UNAVAILABLE", "BOOKING_NOT_MODIFIABLE", "SANDBOX_NOT_FOUND", "SANDBOX_INCOMPLETE", "WRITES_FROZEN", "WRITES_SUSPENDED", "SHIELD_UNAVAILABLE", "CATALOG_LIMIT_REACHED", "TOO_MANY_NEW_ENTITIES", "RATE_OUT_OF_BAND", "CHANNEL_NOT_FOUND", "CHANNEL_SHARED", "MODIFIER_OUT_OF_BAND", "COMPANY_KEY_REQUIRED", "BILLING_SETUP_REQUIRED", "OWNER_HAS_ACCOUNT", "SANDBOX_LIMIT", "CONFIRMATION_MISMATCH", "PROPERTY_NOT_REMOVABLE", "PROPERTY_BUSY", "PRICE_UNAVAILABLE"];
34
+ export declare const ERROR_CODES: readonly ["API_KEY_INVALID", "API_KEY_REVOKED", "API_KEY_EXPIRED", "CONNECT_API_NOT_CONFIGURED", "IP_NOT_ALLOWED", "SCOPE_MISSING", "PROPERTY_UNAVAILABLE", "CHANNEL_MANAGER_DISABLED", "PMS_NOT_AVAILABLE", "VALIDATION", "RANGE_INVALID", "HORIZON", "TOO_MANY_UPDATES", "TOO_MANY_CELLS", "UNKNOWN_ROOM_TYPE", "UNKNOWN_RATE_PLAN", "CURRENCY_MISMATCH", "RATE_LIMITED", "NOTHING_ACCEPTED", "BATCH_NOT_FOUND", "IDEMPOTENCY_KEY_INVALID", "IDEMPOTENCY_KEY_REUSED", "IDEMPOTENCY_IN_FLIGHT", "STAY_INVALID", "UNKNOWN_ROOM_TYPE_FOR_PLAN", "OCCUPANCY_EXCEEDED", "NO_AVAILABILITY", "EXTERNAL_REFERENCE_REUSED", "PAYMENT_NOT_ALLOWED", "PAYMENT_EXCEEDS_TOTAL", "TAXES_NOT_CONFIGURED", "TAXES_INSIDE_RATES", "BOOKING_NOT_FOUND", "BOOKING_NOT_CANCELLABLE", "MODULE_NOT_ENTITLED", "SANDBOX_ONLY", "ROOM_TYPE_NOT_FOUND", "RATE_PLAN_NOT_FOUND", "CATALOG_CONFLICT", "CATALOG_BUSY", "CHANNEL_MANAGER_ERROR", "WEBHOOK_ENDPOINT_NOT_FOUND", "WEBHOOK_DELIVERY_NOT_FOUND", "WEBHOOK_ENDPOINT_LIMIT", "WEBHOOK_ENDPOINT_NOT_ACTIVE", "WEBHOOK_ENDPOINT_SUSPENDED", "WEBHOOK_PAYLOAD_EXPIRED", "WEBHOOK_ACCESS_ENDED", "WEBHOOKS_UNAVAILABLE", "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_NOT_CHANGEABLE", "PROPERTY_BUSY", "PRICE_UNAVAILABLE", "CONNECT_LINK_NOT_FOUND", "CONNECT_LINKS_UNAVAILABLE", "CHANNEL_NOT_AVAILABLE", "LIVE_KEY_REQUIRED", "NOT_READY", "KEY_NOT_FOUND", "KEY_LIMIT", "KEY_REVOKED", "KEY_ALREADY_ROTATING", "SCOPES_INVALID", "ALLOWED_CIDRS_INVALID", "REASON_REQUIRED", "SUPPORT_TICKET_NOT_FOUND", "SUPPORT_TICKET_CLOSED"];
31
35
  export type ErrorCode = (typeof ERROR_CODES)[number];
32
36
  /** What a key may do. The hotel's owner (or, for a vendor's key, the vendor) chose them when the key was made. */
33
- export declare const SCOPES: readonly ["ari:read", "ari:write", "catalog:write", "channel-modifiers:write", "channel-bookings:read", "direct-bookings:read", "direct-bookings:cancel", "bookings:read", "bookings:write", "bookings:payments", "properties:write"];
37
+ export declare const SCOPES: readonly ["ari:read", "ari:write", "catalog:write", "channel-modifiers:write", "channel-bookings:read", "direct-bookings:read", "direct-bookings:cancel", "bookings:read", "bookings:write", "bookings:payments", "properties:write", "webhooks:manage", "channels:connect", "keys:manage", "billing:read", "support:write"];
34
38
  export type Scope = (typeof SCOPES)[number];
35
39
  /** When a channel's price modifier takes effect. Show it where a person saves one. */
36
40
  export declare const MODIFIER_TAKES_EFFECT = "Saving a modifier makes the channel manager send that channel every date again, so prices already on the channel move to the new rule within minutes.";
41
+ /** Every notice an ARI write's answer may carry (`notices`): its stable code, its level, which writes it rides on and what it means. Branch on the code; show the notice's own message and action. */
42
+ export declare const NOTICES: readonly [{
43
+ readonly code: "NOT_SOURCE_OF_TRUTH";
44
+ readonly level: "warning";
45
+ readonly on: "every write";
46
+ readonly means: "The hotel is not live for this software yet: prices and stay rules sent now are stored and wait for go-live, and of room counts only one that lowers what is on sale goes out.";
47
+ }, {
48
+ readonly code: "ROOM_TYPE_NOT_LINKED";
49
+ readonly level: "warning";
50
+ readonly on: "availability";
51
+ readonly means: "The room type has no link to the channel manager: its count is kept and sent nowhere.";
52
+ }, {
53
+ readonly code: "PLAN_NOT_LINKED";
54
+ readonly level: "warning";
55
+ readonly on: "rates, restrictions";
56
+ readonly means: "The rate plan has no link to the channel manager: its values are kept and sent nowhere.";
57
+ }, {
58
+ readonly code: "PLAN_NOT_MAPPED";
59
+ readonly level: "warning";
60
+ readonly on: "rates, restrictions";
61
+ readonly means: "The rate plan is on the channel manager and no connected channel that is switched on sells it: nothing sells or stops because of this write.";
62
+ }, {
63
+ readonly code: "ROOM_STILL_ON_SALE";
64
+ readonly level: "warning";
65
+ readonly on: "restrictions";
66
+ readonly means: "You stop-sold one rate plan; the room is still on sale through its other plans (otherRatePlanIds).";
67
+ }, {
68
+ readonly code: "OTA_LINKED_RATES_NOT_REACHED";
69
+ readonly level: "info";
70
+ readonly on: "restrictions";
71
+ readonly means: "A stop-sell does not reach a rate an OTA links on its own side: only the room's count closes it.";
72
+ }, {
73
+ readonly code: "STAY_RULES_FROM_ANOTHER_PLAN";
74
+ readonly level: "warning";
75
+ readonly on: "restrictions";
76
+ readonly means: "On a channel, the OTA rate this plan sells takes its stay rules from another plan's row (otherRatePlanIds): a stay rule here alone does not reach it.";
77
+ }, {
78
+ readonly code: "PER_OTA_PLANS_FOLLOW";
79
+ readonly level: "info";
80
+ readonly on: "rates, restrictions";
81
+ readonly means: "The plan has per-OTA plans: its price is copied onto them and they follow its stay rules.";
82
+ }, {
83
+ readonly code: "PER_OTA_PLAN_FOLLOWS_PARENT";
84
+ readonly level: "warning";
85
+ readonly on: "rates, restrictions";
86
+ readonly means: "The plan you wrote is a per-OTA plan: its parent's price and stay rules replace what is set here.";
87
+ }, {
88
+ readonly code: "VALUE_HELD";
89
+ readonly level: "warning";
90
+ readonly on: "rates, restrictions";
91
+ readonly means: "The value equals one the channel manager refused: it is held with its words, not sent again.";
92
+ }, {
93
+ readonly code: "COUNT_WAS_REFUSED";
94
+ readonly level: "warning";
95
+ readonly on: "availability";
96
+ readonly means: "The last count sent for these nights was refused by the channel manager and nothing has landed since.";
97
+ }, {
98
+ readonly code: "COUNT_ZERO_IS_NOT_STOP_SELL";
99
+ readonly level: "info";
100
+ readonly on: "availability";
101
+ readonly means: "You sent availability 0: a count that closes every plan and channel, and that the next OTA cancellation or your next count moves. Not a switch.";
102
+ }, {
103
+ readonly code: "STOP_SELL_IS_NOT_A_COUNT";
104
+ readonly level: "info";
105
+ readonly on: "restrictions";
106
+ readonly means: "You sent a stop-sell: a switch on those plans. The room's count is untouched.";
107
+ }, {
108
+ readonly code: "COUNT_OPEN_BUT_PLANS_STOPPED";
109
+ readonly level: "warning";
110
+ readonly on: "availability";
111
+ readonly means: "You sent a count above 0 for nights on which every plan of the room is stop-sold: the room does not sell.";
112
+ }, {
113
+ readonly code: "NEW_DATES_OPEN_CLOSED";
114
+ readonly level: "warning";
115
+ readonly on: "availability";
116
+ readonly means: "The hotel's rule \"new dates open closed\" will set these nights to 0 when they come on sale.";
117
+ }, {
118
+ readonly code: "FAR_NIGHTS_NEED_A_COUNT";
119
+ readonly level: "warning";
120
+ readonly on: "rates, restrictions";
121
+ readonly means: "A night past day 365 with no count of its own goes out closed, whatever its price or stay rules.";
122
+ }, {
123
+ readonly code: "ENGINE_WILL_REPRICE";
124
+ readonly level: "warning";
125
+ readonly on: "rates";
126
+ readonly means: "The hotel's pricing engine is set to win: it replaces a price sent here at its next hourly update.";
127
+ }, {
128
+ readonly code: "ENGINE_WILL_RECOUNT";
129
+ readonly level: "warning";
130
+ readonly on: "availability";
131
+ readonly means: "The hotel publishes the count its bookings work out: a count above 0 sent here is replaced. A 0 holds.";
132
+ }, {
133
+ readonly code: "DRIFT_REPAIR_OFF";
134
+ readonly level: "info";
135
+ readonly on: "rates, restrictions";
136
+ readonly means: "The hotel switched the nightly repair off: a value changed on the channel manager's side is reported, not sent again.";
137
+ }];
138
+ export type NoticeCode = (typeof NOTICES)[number]["code"];
139
+ /** The three levels of a support ticket (`zs.supportTickets.create`): what each means and when ZimmerStack first replies. */
140
+ export declare const SUPPORT_SEVERITIES: readonly [{
141
+ readonly severity: "many_hotels";
142
+ readonly name: "Many hotels";
143
+ readonly means: "2 or more of your hotels, or all of them, cannot take bookings or cannot send prices and rooms to the booking sites.";
144
+ readonly firstReply: "Within 60 minutes, 9:00 to 21:00 IST, every day. Opened outside those hours: by 10:00 IST.";
145
+ }, {
146
+ readonly severity: "one_hotel";
147
+ readonly name: "One hotel";
148
+ readonly means: "One hotel cannot take bookings or cannot send prices and rooms to the booking sites.";
149
+ readonly firstReply: "Within one working day.";
150
+ }, {
151
+ readonly severity: "question";
152
+ readonly name: "Question";
153
+ readonly means: "Anything else: how something works, a bill, a change you plan, a problem that stops nothing.";
154
+ readonly firstReply: "Within one working day.";
155
+ }];
156
+ export type SupportSeverity = (typeof SUPPORT_SEVERITIES)[number]["severity"];
37
157
  export interface Error {
38
158
  statuscode: number;
39
159
  /** Human-readable, may change; branch on data.code */
40
160
  message: string;
41
161
  data: {
42
- code: "API_KEY_INVALID" | "API_KEY_REVOKED" | "API_KEY_EXPIRED" | "CONNECT_API_NOT_CONFIGURED" | "IP_NOT_ALLOWED" | "SCOPE_MISSING" | "PROPERTY_UNAVAILABLE" | "CHANNEL_MANAGER_DISABLED" | "PMS_NOT_AVAILABLE" | "VALIDATION" | "RANGE_INVALID" | "HORIZON" | "TOO_MANY_UPDATES" | "TOO_MANY_CELLS" | "UNKNOWN_ROOM_TYPE" | "UNKNOWN_RATE_PLAN" | "CURRENCY_MISMATCH" | "RATE_LIMITED" | "NOTHING_ACCEPTED" | "BATCH_NOT_FOUND" | "IDEMPOTENCY_KEY_INVALID" | "IDEMPOTENCY_KEY_REUSED" | "IDEMPOTENCY_IN_FLIGHT" | "STAY_INVALID" | "UNKNOWN_ROOM_TYPE_FOR_PLAN" | "OCCUPANCY_EXCEEDED" | "NO_AVAILABILITY" | "EXTERNAL_REFERENCE_REUSED" | "PAYMENT_NOT_ALLOWED" | "PAYMENT_EXCEEDS_TOTAL" | "TAXES_NOT_CONFIGURED" | "TAXES_INSIDE_RATES" | "BOOKING_NOT_FOUND" | "BOOKING_NOT_CANCELLABLE" | "MODULE_NOT_ENTITLED" | "SANDBOX_ONLY" | "ROOM_TYPE_NOT_FOUND" | "RATE_PLAN_NOT_FOUND" | "CATALOG_CONFLICT" | "CATALOG_BUSY" | "CHANNEL_MANAGER_ERROR" | "PROPERTY_REQUIRED" | "PROPERTY_NOT_FOUND" | "ARI_NOT_AUTHORITATIVE" | "ROUTE_NOT_FOUND" | "PAYLOAD_TOO_LARGE" | "AUTH_BACKEND_UNAVAILABLE" | "BOOKING_NOT_MODIFIABLE" | "SANDBOX_NOT_FOUND" | "SANDBOX_INCOMPLETE" | "WRITES_FROZEN" | "WRITES_SUSPENDED" | "SHIELD_UNAVAILABLE" | "CATALOG_LIMIT_REACHED" | "TOO_MANY_NEW_ENTITIES" | "RATE_OUT_OF_BAND" | "CHANNEL_NOT_FOUND" | "CHANNEL_SHARED" | "MODIFIER_OUT_OF_BAND" | "COMPANY_KEY_REQUIRED" | "BILLING_SETUP_REQUIRED" | "OWNER_HAS_ACCOUNT" | "SANDBOX_LIMIT" | "CONFIRMATION_MISMATCH" | "PROPERTY_NOT_REMOVABLE" | "PROPERTY_BUSY" | "PRICE_UNAVAILABLE";
162
+ code: "API_KEY_INVALID" | "API_KEY_REVOKED" | "API_KEY_EXPIRED" | "CONNECT_API_NOT_CONFIGURED" | "IP_NOT_ALLOWED" | "SCOPE_MISSING" | "PROPERTY_UNAVAILABLE" | "CHANNEL_MANAGER_DISABLED" | "PMS_NOT_AVAILABLE" | "VALIDATION" | "RANGE_INVALID" | "HORIZON" | "TOO_MANY_UPDATES" | "TOO_MANY_CELLS" | "UNKNOWN_ROOM_TYPE" | "UNKNOWN_RATE_PLAN" | "CURRENCY_MISMATCH" | "RATE_LIMITED" | "NOTHING_ACCEPTED" | "BATCH_NOT_FOUND" | "IDEMPOTENCY_KEY_INVALID" | "IDEMPOTENCY_KEY_REUSED" | "IDEMPOTENCY_IN_FLIGHT" | "STAY_INVALID" | "UNKNOWN_ROOM_TYPE_FOR_PLAN" | "OCCUPANCY_EXCEEDED" | "NO_AVAILABILITY" | "EXTERNAL_REFERENCE_REUSED" | "PAYMENT_NOT_ALLOWED" | "PAYMENT_EXCEEDS_TOTAL" | "TAXES_NOT_CONFIGURED" | "TAXES_INSIDE_RATES" | "BOOKING_NOT_FOUND" | "BOOKING_NOT_CANCELLABLE" | "MODULE_NOT_ENTITLED" | "SANDBOX_ONLY" | "ROOM_TYPE_NOT_FOUND" | "RATE_PLAN_NOT_FOUND" | "CATALOG_CONFLICT" | "CATALOG_BUSY" | "CHANNEL_MANAGER_ERROR" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_DELIVERY_NOT_FOUND" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_ACTIVE" | "WEBHOOK_ENDPOINT_SUSPENDED" | "WEBHOOK_PAYLOAD_EXPIRED" | "WEBHOOK_ACCESS_ENDED" | "WEBHOOKS_UNAVAILABLE" | "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_NOT_CHANGEABLE" | "PROPERTY_BUSY" | "PRICE_UNAVAILABLE" | "CONNECT_LINK_NOT_FOUND" | "CONNECT_LINKS_UNAVAILABLE" | "CHANNEL_NOT_AVAILABLE" | "LIVE_KEY_REQUIRED" | "NOT_READY" | "KEY_NOT_FOUND" | "KEY_LIMIT" | "KEY_REVOKED" | "KEY_ALREADY_ROTATING" | "SCOPES_INVALID" | "ALLOWED_CIDRS_INVALID" | "REASON_REQUIRED" | "SUPPORT_TICKET_NOT_FOUND" | "SUPPORT_TICKET_CLOSED";
43
163
  details?: unknown;
44
164
  };
45
165
  }
@@ -50,6 +170,8 @@ export interface Property {
50
170
  timezone: string;
51
171
  /** ISO 4217; every rate must be sent in it */
52
172
  currency: string;
173
+ /** Digits after the decimal point this currency's prices carry (ISO 4217): 2 for rupees, euros and dollars, 0 for yen. Every amount this API reads back as a decimal string has exactly this many (§2.10) */
174
+ decimals?: number;
53
175
  inventoryScope: "PMS_CM" | "CM_ONLY" | "PMS_CUTOVER" | "OWNER_SITE";
54
176
  /** 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 */
55
177
  sandbox: boolean;
@@ -104,9 +226,86 @@ export interface Property {
104
226
  pendingCells: number;
105
227
  };
106
228
  }
229
+ export interface Limits {
230
+ /** ISO 8601 instant the windows were read */
231
+ asOf: string;
232
+ key: {
233
+ kind: "hotel" | "company";
234
+ mode: "live" | "test";
235
+ /** The hotel these budgets are for; null on a company key that named none */
236
+ propertyId: number | null;
237
+ };
238
+ /** The budgets the key guard and the routes measure: a minute, or a rolling day */
239
+ budgets: Array<{
240
+ /** The budget's name: data.scope on the 429 that names it */
241
+ scope: string;
242
+ /** Its name in the RateLimit-Policy / RateLimit headers; null when it is not reported there */
243
+ header: string | null;
244
+ /** Whose traffic is counted together */
245
+ per: string;
246
+ /** The window in words: 60 s sliding, one clock hour (UTC), rolling 24 hours */
247
+ window: string;
248
+ windowSeconds: number | null;
249
+ /** The most the window holds, for THIS key, property and company */
250
+ quota: number;
251
+ /** What is counted: requests, writes, cells, bookings… */
252
+ unit: string;
253
+ /** Counted in the window now; null when this route cannot read it */
254
+ used: number | null;
255
+ /** What is left; null with used */
256
+ remaining: number | null;
257
+ /** Seconds until it has room again when nothing is left; otherwise until the oldest counted item leaves the window. 0 when nothing is counted */
258
+ resetSeconds: number | null;
259
+ /** What is counted, in a sentence */
260
+ counts: string;
261
+ }>;
262
+ /** Where the integration stands and its long budgets; null on a company key that named no hotel */
263
+ shield: {
264
+ standing: {
265
+ level: "CLEAR" | "WATCH" | "PAUSED" | "SUSPENDED";
266
+ reason: string | null;
267
+ until: string | null;
268
+ };
269
+ /** The budgets over an hour and a day, with this property's own quotas */
270
+ budgets: Array<{
271
+ /** The budget's name: data.scope on the 429 that names it */
272
+ scope: string;
273
+ /** Its name in the RateLimit-Policy / RateLimit headers; null when it is not reported there */
274
+ header: string | null;
275
+ /** Whose traffic is counted together */
276
+ per: string;
277
+ /** The window in words: 60 s sliding, one clock hour (UTC), rolling 24 hours */
278
+ window: string;
279
+ windowSeconds: number | null;
280
+ /** The most the window holds, for THIS key, property and company */
281
+ quota: number;
282
+ /** What is counted: requests, writes, cells, bookings… */
283
+ unit: string;
284
+ /** Counted in the window now; null when this route cannot read it */
285
+ used: number | null;
286
+ /** What is left; null with used */
287
+ remaining: number | null;
288
+ /** Seconds until it has room again when nothing is left; otherwise until the oldest counted item leaves the window. 0 when nothing is counted */
289
+ resetSeconds: number | null;
290
+ /** What is counted, in a sentence */
291
+ counts: string;
292
+ }>;
293
+ } | null;
294
+ /** The most one request may carry, and the most of a thing that may exist */
295
+ caps: Array<{
296
+ scope: string;
297
+ per: string;
298
+ quota: number;
299
+ unit: string;
300
+ counts: string;
301
+ }>;
302
+ note: string;
303
+ }
107
304
  export interface Catalog {
108
305
  /** ISO 4217; the property's, and the one every rate and booking is sent in */
109
306
  currency: string;
307
+ /** Digits after the decimal point this currency's prices carry (§2.10) */
308
+ decimals?: number;
110
309
  /** Every room type on the property, stable ids, in the order they were created */
111
310
  roomTypes: Array<{
112
311
  /** The number every availability write and every booking room names as roomTypeId */
@@ -139,6 +338,8 @@ export interface Catalog {
139
338
  /** The occupancy this plan is priced for; null = any */
140
339
  occupancy: number | null;
141
340
  currency: string;
341
+ /** The plan's standing price in major units, as a decimal string with the currency's own decimals ("4500.50"): the same field PUT /catalog/rate-plans takes, and the price every date of the plan opens for booking at. null = it follows the room type's base rate, which only a plan made on the hotel's own screens can do */
342
+ defaultRate?: string | null;
142
343
  /** false = a non-refundable plan */
143
344
  refundable: boolean;
144
345
  /** 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 */
@@ -207,7 +408,7 @@ export interface PropertyCreated {
207
408
  name: string;
208
409
  timezone: string;
209
410
  currency: string;
210
- /** 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 */
411
+ /** The property publishes to its channels. A new hotel is put on the channel manager when its billing starts, usually before this answer; while it is false, PUT /catalog/room-types with the same refs tries again. Always true for a sandbox */
211
412
  channelManager: boolean;
212
413
  /** true when a test key made it: everything lands locally, nothing reaches a channel and nothing is billed */
213
414
  sandbox: boolean;
@@ -222,6 +423,41 @@ export interface PropertyCreated {
222
423
  /** true: an earlier request with this X-Idempotency-Key already added this hotel; nothing new was made */
223
424
  replay: boolean;
224
425
  }
426
+ export interface PropertyChange {
427
+ /** The hotel's new name, as its guests know it. A sandbox's name keeps its ending, (sandbox) */
428
+ name?: string;
429
+ /** Only the parts you send change. The country is not one of them: it never changes by this request */
430
+ address?: {
431
+ /** The first line of the address */
432
+ line1?: string;
433
+ city?: string;
434
+ /** An empty string clears it */
435
+ state?: string;
436
+ /** An empty string clears it */
437
+ postalCode?: string;
438
+ };
439
+ }
440
+ export interface PropertyChanged {
441
+ id: number;
442
+ /** As stored now. A sandbox's name ends in (sandbox) */
443
+ name: string;
444
+ timezone: string;
445
+ currency: string;
446
+ /** The property publishes to its channels. Not changed by this request */
447
+ channelManager: boolean;
448
+ sandbox: boolean;
449
+ /** The hotel's address as stored now. A part the record does not hold is null */
450
+ address: {
451
+ line1: string | null;
452
+ city: string | null;
453
+ state: string | null;
454
+ postalCode: string | null;
455
+ /** ISO 3166-1 alpha-2. Never changed by this request */
456
+ country: string | null;
457
+ };
458
+ /** The fields whose stored value this request changed, by the names you send (name, address.line1, address.city, address.state, address.postalCode). Empty when everything you sent was already stored */
459
+ changed: Array<string>;
460
+ }
225
461
  export interface PropertyRemoved {
226
462
  id: number;
227
463
  /** The hotel's name; null only for a sandbox removed before its name was recorded */
@@ -284,9 +520,9 @@ export interface RatePlansUpsert {
284
520
  occupancy?: number | null;
285
521
  /** false = a non-refundable plan; default true */
286
522
  refundable?: boolean;
287
- /** 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 */
523
+ /** The plan's standing price in MAJOR units, a number or a decimal string (4500 or "4500.50"), like every rate here: what every date of the plan opens for booking at, mirrored to the channel manager. REQUIRED when the plan is new: a request that would create a plan without it is 400 VALIDATION and writes nothing. On a plan you already sent, omit it to leave the price as it is. null (follow the room type's base rate) is accepted only where the hotel has typed a base rate in ZimmerStack, and is 400 VALIDATION otherwise. Kept to the currency's own decimals (§2.10) */
288
524
  defaultRate?: number | string | null;
289
- /** Deprecated: the same standing price in MINOR units (paise). Send defaultRate instead; never both */
525
+ /** Deprecated: the same standing price in hundredths of the major unit (450050 is 4500.50). Send defaultRate instead; never both */
290
526
  defaultRateMinor?: number | null;
291
527
  }>;
292
528
  }
@@ -310,6 +546,17 @@ export interface CatalogUpsertResult {
310
546
  /** Why not, when enabled is false (for example: a room type still has no rate plan) */
311
547
  reason: string | null;
312
548
  };
549
+ /** Standing prices this request sent that could not be kept exactly as sent, each with what was kept and why (§2.10). Absent when every price was kept as sent */
550
+ rounded?: Array<{
551
+ /** Where in the request the amount sat, for example "updates[3].rate" */
552
+ field: string;
553
+ /** The amount as it was sent */
554
+ sent: string;
555
+ /** The amount as it is kept, in major units with the currency's own decimals */
556
+ kept: string;
557
+ /** Why, in a sentence; may change, do not branch on it */
558
+ reason: string;
559
+ }>;
313
560
  }
314
561
  export interface CatalogDeleteResult {
315
562
  id: number;
@@ -348,18 +595,25 @@ export interface AvailabilityWrite {
348
595
  /** ABSOLUTE count of rooms of this type for sale on each night of the range */
349
596
  available: number;
350
597
  }>;
598
+ /** true: decide everything a real write decides (what would change, what is unchanged, what is held, what would be refused, the notices) and write nothing. Answers 200 with the preview instead of 202. Default false */
599
+ dryRun?: boolean;
351
600
  }
352
601
  export interface RatesRead {
353
602
  /** Hotel-local calendar date, YYYY-MM-DD */
354
603
  from: string;
355
604
  /** Hotel-local calendar date, YYYY-MM-DD */
356
605
  to: string;
606
+ /** ISO 4217: the property's currency, the one every rate here is in */
357
607
  currency: string;
608
+ /** Digits after the decimal point this currency's prices carry (ISO 4217): 2, 0 or 3 (§2.10) */
609
+ decimals?: number;
358
610
  cells: Array<{
359
611
  ratePlanId: number;
360
612
  /** Hotel-local calendar date, YYYY-MM-DD */
361
613
  date: string;
362
- /** MINOR units (paise, cents) */
614
+ /** The price in MAJOR units, as a decimal string with the currency's own decimals: "4500.50" in rupees, "4500" in yen. The same value PUT /rates takes */
615
+ rate?: string;
616
+ /** The same price in HUNDREDTHS of the major unit (450050 is 4500.50), for every currency. That is the ISO 4217 minor unit only where the currency has two decimals: prefer rate */
363
617
  rateMinor: number;
364
618
  source: "MANUAL" | "BASE" | "ENGINE" | "CHANNEX_SEED" | "PLAN_DEFAULT" | "STANDING";
365
619
  }>;
@@ -373,11 +627,13 @@ export interface RatesWrite {
373
627
  /** Hotel-local calendar date, YYYY-MM-DD */
374
628
  dateTo: string;
375
629
  days?: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su">;
376
- /** Nightly sell price in MAJOR units (e.g. 4500 or "4500.00"), 1 to 21474836; rounded to a whole major unit for a property selling in rupees or in a currency without cents, kept to the cent otherwise (e.g. "89.50" in euros) */
630
+ /** Nightly sell price in MAJOR units, a number or a decimal string (4500, 4500.5 or "4500.50"), 1 to 21474836. Kept exactly, to the currency's own decimals (GET /property decimals): two for rupees, euros and dollars, none for yen. A number with more decimals than the currency has is rounded to them and named in the answer's rounded list; so is a fraction in a currency that has none. A decimal string takes at most two decimals: one with more is refused (400 VALIDATION) */
377
631
  rate: number | string;
378
632
  /** ISO 4217; must equal the property's currency (GET /property) */
379
633
  currency: string;
380
634
  }>;
635
+ /** true: decide everything a real write decides (what would change, what is unchanged, what is held, what would be refused, the notices) and write nothing. Answers 200 with the preview instead of 202. Default false */
636
+ dryRun?: boolean;
381
637
  }
382
638
  export interface RestrictionsRead {
383
639
  /** Hotel-local calendar date, YYYY-MM-DD */
@@ -412,6 +668,8 @@ export interface RestrictionsWrite {
412
668
  minStayThrough?: number;
413
669
  maxStay?: number;
414
670
  }>;
671
+ /** true: decide everything a real write decides (what would change, what is unchanged, what is held, what would be refused, the notices) and write nothing. Answers 200 with the preview instead of 202. Default false */
672
+ dryRun?: boolean;
415
673
  }
416
674
  export interface WriteAccepted {
417
675
  batchId: string;
@@ -444,14 +702,64 @@ export interface WriteAccepted {
444
702
  ratePlanId: number;
445
703
  /** Hotel-local calendar date, YYYY-MM-DD */
446
704
  date: string;
447
- /** The price this request set, MINOR units */
705
+ /** The price this request set, in hundredths of the major unit */
448
706
  rateMinor: number;
449
- /** The plan's standing price, MINOR units */
707
+ /** The plan's standing price, in hundredths of the major unit */
450
708
  standingMinor: number;
709
+ /** The same price in major units, as a decimal string ("4500.50") */
710
+ rate?: string;
711
+ /** The plan's standing price in major units, as a decimal string */
712
+ standing?: string;
451
713
  message: string;
452
714
  }>;
715
+ /** Prices this request sent that could not be kept exactly as sent, each with what was kept and why (§2.10): more decimals than the currency has, or a fraction in a currency that has none. At most 20; absent when every price was kept as sent */
716
+ rounded?: Array<{
717
+ /** Where in the request the amount sat, for example "updates[3].rate" */
718
+ field: string;
719
+ /** The amount as it was sent */
720
+ sent: string;
721
+ /** The amount as it is kept, in major units with the currency's own decimals */
722
+ kept: string;
723
+ /** Why, in a sentence; may change, do not branch on it */
724
+ reason: string;
725
+ }>;
726
+ /** How many of the request's prices were rounded in all; present with rounded */
727
+ roundedCount?: number;
453
728
  /** true when the write was taken through the safety lane: the integration is paused or over a budget, and this write only closed inventory (§6.6) */
454
729
  lane?: boolean;
730
+ /** true on PUT /rates and PUT /restrictions for a hotel that is not live yet (§2.15): the values are in our record and are pushed when the hotel goes live (POST /go-live), not before. Absent on a live hotel, and on PUT /availability: a room count is sent at once, live or not */
731
+ heldUntilGoLive?: boolean;
732
+ /** What this write did not do, or will not go on doing, one plain sentence each with a stable code and what to do (§2.20). Warnings first. At most 20; absent when there is nothing to say */
733
+ notices?: Array<{
734
+ /** Stable: branch on it. A code you do not know is a notice added later; show its message */
735
+ code: "NOT_SOURCE_OF_TRUTH" | "ROOM_TYPE_NOT_LINKED" | "PLAN_NOT_LINKED" | "PLAN_NOT_MAPPED" | "ROOM_STILL_ON_SALE" | "OTA_LINKED_RATES_NOT_REACHED" | "STAY_RULES_FROM_ANOTHER_PLAN" | "PER_OTA_PLANS_FOLLOW" | "PER_OTA_PLAN_FOLLOWS_PARENT" | "VALUE_HELD" | "COUNT_WAS_REFUSED" | "COUNT_ZERO_IS_NOT_STOP_SELL" | "STOP_SELL_IS_NOT_A_COUNT" | "COUNT_OPEN_BUT_PLANS_STOPPED" | "NEW_DATES_OPEN_CLOSED" | "FAR_NIGHTS_NEED_A_COUNT" | "ENGINE_WILL_REPRICE" | "ENGINE_WILL_RECOUNT" | "DRIFT_REPAIR_OFF";
736
+ /** warning: our record shows what you sent does not do the whole job (something still sells, nothing is sent, a rule will undo it) · info: how it works, said so the next surprise is not one */
737
+ level: "warning" | "info";
738
+ /** What is going on, in a sentence a person can read; may change, do not branch on it */
739
+ message: string;
740
+ /** What to do about it, naming the call */
741
+ action: string;
742
+ /** The room type it is about */
743
+ roomTypeId?: number;
744
+ /** The rate plans it is about (the ones you wrote) */
745
+ ratePlanIds?: Array<number>;
746
+ /** Other plans it names: the ones still selling, the plan that carries the star, the per-OTA plans */
747
+ otherRatePlanIds?: Array<number>;
748
+ /** The connected channels it is about */
749
+ channels?: Array<{
750
+ channelId: string;
751
+ /** BookingCom, Expedia, Agoda, Goibibo, AirBNB, … */
752
+ kind: string;
753
+ }>;
754
+ /** The first night it is about */
755
+ dateFrom?: string;
756
+ /** The last night it is about */
757
+ dateTo?: string;
758
+ /** How many nights between dateFrom and dateTo it is about (they need not be consecutive) */
759
+ nights?: number;
760
+ }>;
761
+ /** How many more notices there were past the 20 listed; present only when some were left out */
762
+ noticesOmitted?: number;
455
763
  }
456
764
  export interface BatchStatus {
457
765
  batchId: string;
@@ -469,6 +777,18 @@ export interface BatchStatus {
469
777
  /** Cells of this batch the channel manager refused: held, not re-sent (§6.6). More than 0 reads failed */
470
778
  parkedCells: number;
471
779
  lastError: string | null;
780
+ /** Cells written to our record that reach no channel, by room type or rate plan. Not-linked cells are not counted as pending (they are sent nowhere); not-mapped ones are sent and counted like any other */
781
+ unreachable?: Array<{
782
+ /** The room type, on an availability batch */
783
+ roomTypeId?: number;
784
+ /** The rate plan, on a rates or restrictions batch */
785
+ ratePlanId?: number;
786
+ /** How many of the batch's cells are this room type's or plan's */
787
+ cells: number;
788
+ /** not-linked: the room type or plan has no link to the channel manager, so nothing was sent for it (GET /catalog shows its sync state); the batch reads failed. not-mapped: linked and sent, but no connected channel that is switched on sells the plan, by what was last read of the hotel's connections (nightly): nothing sells or stops because of it. A not-mapped plan does not fail the batch */
789
+ status: "not-linked" | "not-mapped";
790
+ message: string;
791
+ }>;
472
792
  }
473
793
  export interface SyncStatus {
474
794
  propertyId: number;
@@ -491,6 +811,10 @@ export interface SyncStatus {
491
811
  lastPushAt: string | null;
492
812
  lastErrorAt: string | null;
493
813
  lastError: string | null;
814
+ /** Nights where the last read of the channel manager found it holding something other than our record (a price or stay rule changed in its own screen or on an OTA extranet). 0 = the last read agreed. The cells are pushed as channel.drift.detected */
815
+ driftCells?: number;
816
+ /** When that read found them; null when nothing differs */
817
+ driftSeenAt?: string | null;
494
818
  };
495
819
  /** Where this integration stands with the channel shield. Reads and bookings are never affected */
496
820
  shield: {
@@ -517,6 +841,18 @@ export interface SyncStatus {
517
841
  /** Cells of this batch the channel manager refused: held, not re-sent (§6.6). More than 0 reads failed */
518
842
  parkedCells: number;
519
843
  lastError: string | null;
844
+ /** Cells written to our record that reach no channel, by room type or rate plan. Not-linked cells are not counted as pending (they are sent nowhere); not-mapped ones are sent and counted like any other */
845
+ unreachable?: Array<{
846
+ /** The room type, on an availability batch */
847
+ roomTypeId?: number;
848
+ /** The rate plan, on a rates or restrictions batch */
849
+ ratePlanId?: number;
850
+ /** How many of the batch's cells are this room type's or plan's */
851
+ cells: number;
852
+ /** not-linked: the room type or plan has no link to the channel manager, so nothing was sent for it (GET /catalog shows its sync state); the batch reads failed. not-mapped: linked and sent, but no connected channel that is switched on sells the plan, by what was last read of the hotel's connections (nightly): nothing sells or stops because of it. A not-mapped plan does not fail the batch */
853
+ status: "not-linked" | "not-mapped";
854
+ message: string;
855
+ }>;
520
856
  } | null;
521
857
  }
522
858
  export interface BookingCreate {
@@ -728,6 +1064,8 @@ export interface SandboxBookingCreate {
728
1064
  otaName?: "Booking.com" | "Expedia" | "Agoda" | "Airbnb" | "MakeMyTrip" | "Goibibo" | "Website";
729
1065
  /** true = the channel collected the money (for Website: the guest paid online), so totalPaid equals the total; default false (pay at the property) */
730
1066
  paidByOta?: boolean;
1067
+ /** true = a cancellation that arrives with no booking before it (docs §2.4): the booking is recorded CANCELLED, no night is taken, and the one event sent is channel.booking.cancelled, with no created before it. What a hotel that moved from another channel manager sees when a guest cancels an older booking. Not for Website */
1068
+ arrivesCancelled?: boolean;
731
1069
  }
732
1070
  export interface SandboxBookingModify {
733
1071
  /** New arrival, YYYY-MM-DD in the property's timezone; today or later */
@@ -767,6 +1105,8 @@ export interface Channels {
767
1105
  type: "percent" | "fixed";
768
1106
  /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */
769
1107
  value: number;
1108
+ /** On a fixed step: the same amount in major units as a decimal string with the currency's own decimals ("200.00"). Absent on a percent step */
1109
+ amount?: string;
770
1110
  }> | null;
771
1111
  /** A separate adjustment the owner set for this channel in the ZimmerStack Channels app, applied before the modifier. Read-only here; null = none */
772
1112
  markupPlan: {
@@ -785,6 +1125,41 @@ export interface Channels {
785
1125
  raisedAt: string;
786
1126
  }>;
787
1127
  }
1128
+ export interface RequestLog {
1129
+ /** The instant the list starts at, as applied */
1130
+ since: string;
1131
+ /** How many days a request stays readable */
1132
+ retentionDays: number;
1133
+ /** Newest first. Facts about each call only: never a body, a query or a guest's data */
1134
+ items: Array<{
1135
+ /** The log entry's id */
1136
+ id: string;
1137
+ /** When the request arrived (ISO 8601, UTC) */
1138
+ at: string;
1139
+ /** GET, PUT, POST or DELETE */
1140
+ method: string;
1141
+ /** The route's pattern, for example "/bookings/:bookingId": never the address as sent, so no booking or guest id is kept */
1142
+ route: string;
1143
+ /** The HTTP status of the answer */
1144
+ status: number;
1145
+ /** data.code of a refusal (RATE_LIMITED, VALIDATION, …); null on a success */
1146
+ errorCode: string | null;
1147
+ /** The address the request came from. One you do not recognise is the first sign of a leaked key */
1148
+ address: string | null;
1149
+ /** How long the answer took, in milliseconds */
1150
+ durationMs: number;
1151
+ /** The X-Request-Id the answer carried: quote it to support */
1152
+ requestId: string | null;
1153
+ /** The hotel the request was about; null on a company key's call that names none (GET /properties) */
1154
+ propertyId: number | null;
1155
+ /** The key the request ran as; for a company key, its id on that hotel */
1156
+ keyId: number | null;
1157
+ }>;
1158
+ /** More requests matched than limit: ask again with cursor = nextCursor */
1159
+ more: boolean;
1160
+ /** Pass as cursor for the next, older, page; null when there is no more */
1161
+ nextCursor: string | null;
1162
+ }
788
1163
  export interface ModifierWrite {
789
1164
  /** The whole modifier, in the order it is applied; replaces what the channel holds. At most 5 steps. An empty list removes it: prices go to the channel as they are */
790
1165
  steps: Array<{
@@ -792,8 +1167,10 @@ export interface ModifierWrite {
792
1167
  action: "increase" | "decrease";
793
1168
  /** percent of the price, or a fixed amount in MAJOR units of the property's currency */
794
1169
  type: "percent" | "fixed";
795
- /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */
796
- value: number;
1170
+ /** How much, a number or a decimal string: 18 with type percent is 18 %; 200 or "200.00" with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. A fixed amount is kept to the currency's own decimals (§2.10); a percentage to two */
1171
+ value: number | string;
1172
+ /** What a read prints beside a fixed step. Leave it out, or send it back unchanged: when present it must equal value */
1173
+ amount?: string;
797
1174
  }>;
798
1175
  }
799
1176
  export interface ModifierResult {
@@ -809,11 +1186,28 @@ export interface ModifierResult {
809
1186
  type: "percent" | "fixed";
810
1187
  /** How much: 18 with type percent is 18 %; 200 with type fixed is 200.00 in the property's currency. Always positive: choose decrease instead of a minus sign. Two decimals at most */
811
1188
  value: number;
1189
+ /** On a fixed step: the same amount in major units as a decimal string with the currency's own decimals ("200.00"). Absent on a percent step */
1190
+ amount?: string;
812
1191
  }>;
813
1192
  /** false when the channel already held exactly these steps: nothing was sent to the channel manager and nothing was counted */
814
1193
  changed: boolean;
815
1194
  /** When it takes effect. Always: "Saving a modifier makes the channel manager send that channel every date again, so prices already on the channel move to the new rule within minutes." */
816
1195
  notice: string;
1196
+ /** ISO 4217: the currency a fixed step's amount is in, the property's */
1197
+ currency?: string;
1198
+ /** Digits after the decimal point that currency carries (§2.10) */
1199
+ decimals?: number;
1200
+ /** Fixed amounts this request sent that could not be kept exactly as sent, each with what was kept and why (§2.10). Absent when every amount was kept as sent */
1201
+ rounded?: Array<{
1202
+ /** Where in the request the amount sat, for example "updates[3].rate" */
1203
+ field: string;
1204
+ /** The amount as it was sent */
1205
+ sent: string;
1206
+ /** The amount as it is kept, in major units with the currency's own decimals */
1207
+ kept: string;
1208
+ /** Why, in a sentence; may change, do not branch on it */
1209
+ reason: string;
1210
+ }>;
817
1211
  }
818
1212
  export interface RatesResendAccepted {
819
1213
  /** Hotel-local calendar date, YYYY-MM-DD */
@@ -845,6 +1239,8 @@ export interface ChannelBookingsList {
845
1239
  items: Array<{
846
1240
  id: number;
847
1241
  reference: string;
1242
+ /** Our own counter of this booking's events: 1 on its first event, one more on each later one. A higher version is a later state whatever order deliveries arrived in. On a read it is the booking's current version (0: no event since versions began) */
1243
+ version?: number;
848
1244
  status: "CONFIRMED" | "CANCELLED";
849
1245
  stayStatus: string;
850
1246
  channel: {
@@ -867,6 +1263,8 @@ export interface ChannelBookingsList {
867
1263
  email?: string | null;
868
1264
  country: string | null;
869
1265
  language: string | null;
1266
+ /** Present when phone and email are null because of a rule, not because the booking has none: "retention" = the stay checked out more than 30 days ago (API reads and webhooks alike, a recovered or redelivered event included); "unavailable" = an API read that could not be logged just now, ask again. Absent otherwise */
1267
+ contactWithheld?: "retention" | "unavailable";
870
1268
  };
871
1269
  guestNotes: string | null;
872
1270
  occupancy: {
@@ -905,6 +1303,12 @@ export interface ChannelBookingsList {
905
1303
  commissionAmount: number | null;
906
1304
  taxAmount: number | null;
907
1305
  netPayoutAmount: number | null;
1306
+ /** The OTA's own fee on top of its commission, where it sent one; null when it named none. Informational: netPayoutAmount is gross minus commission and does not subtract it */
1307
+ feeAmount?: number | null;
1308
+ /** How the guest pays, in the OTA's own word (for example "credit_card"); null when the OTA sent none. A label only */
1309
+ paymentType?: string | null;
1310
+ /** true when the OTA pays the property with a virtual card it issues: the guest does not pay the desk for the room. true or false only; the card itself is never sent */
1311
+ virtualCard?: boolean;
908
1312
  } | null;
909
1313
  /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */
910
1314
  taxes?: {
@@ -927,132 +1331,40 @@ export interface ChannelBookingsList {
927
1331
  }>;
928
1332
  /** More rows matched than limit: ask again with cursor = nextCursor */
929
1333
  more: boolean;
930
- /** Pass as cursor for the next page; null when there is no more */
1334
+ /** Pass as cursor to resume exactly after this page. Returned on every page, the last one included (since 22 Nov 2026; null before that when there was no more): keep it and ask with it next time, so nothing is read twice and nothing is skipped */
931
1335
  nextCursor: string | null;
932
1336
  }
933
- export interface ChannelBooking {
934
- id: number;
935
- reference: string;
936
- status: "CONFIRMED" | "CANCELLED";
937
- stayStatus: string;
938
- channel: {
939
- otaName: string;
940
- otaReservationCode: string;
941
- source: string;
942
- sourceGroup: string;
943
- };
944
- stay: {
945
- checkIn: string;
946
- checkOut: string;
947
- nights: number;
948
- dayUse: boolean;
949
- };
950
- guest: {
951
- fullName: string;
952
- firstName: string | null;
953
- lastName: string | null;
954
- phone?: string | null;
955
- email?: string | null;
956
- country: string | null;
957
- language: string | null;
958
- };
959
- guestNotes: string | null;
960
- occupancy: {
961
- adults: number;
962
- children: number;
963
- };
964
- rooms: Array<{
965
- roomTypeId: number;
966
- roomTypeName: string;
967
- ratePlanId?: number | null;
968
- mealPlan: "EP" | "CP" | "MAP" | "AP";
969
- adults: number;
970
- children: number;
971
- checkIn: string;
972
- checkOut: string;
973
- nights: number;
974
- dayUse: boolean;
975
- ratePerNight: number;
976
- amount: number;
977
- status: string;
978
- }>;
979
- amounts: {
1337
+ export interface ChannelBookingEvent {
1338
+ type: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled";
1339
+ apiVersion: string;
1340
+ occurredAt: string;
1341
+ property: {
1342
+ id: number;
1343
+ name: string;
980
1344
  currency: string;
981
- total: number;
982
- paid: number;
983
- balanceDue: number;
984
- paymentCollect: "ota" | "property" | "unknown";
985
- /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */
986
- receivedCurrency?: string;
1345
+ timezone: string;
987
1346
  };
988
- finance: {
989
- otaName: string;
990
- amountBasis: string;
991
- currency: string | null;
992
- grossAmount: number | null;
993
- commissionAmount: number | null;
994
- taxAmount: number | null;
995
- netPayoutAmount: number | null;
996
- } | null;
997
- /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */
998
- taxes?: {
999
- lines: Array<{
1000
- code: string;
1001
- name: string;
1002
- kind: "TAX" | "FEE" | "PASS_THROUGH";
1003
- includedInRate: boolean;
1004
- amount: number;
1005
- }>;
1006
- includedInRates: number;
1007
- addedToTotal: number;
1347
+ data: {
1348
+ booking: ChannelBooking;
1008
1349
  };
1009
- cancellation: {
1010
- at: string;
1011
- reason: string | null;
1012
- } | null;
1013
- createdAt: string;
1014
- updatedAt: string;
1015
- }
1016
- export interface DirectBookingCancel {
1017
- /** policy (the default): what the booking's own cancellation policy gives back now, the same as the guest cancelling on the booking page. full: everything the guest paid online. none: nothing; the hotel settles any money itself. */
1018
- refund?: "policy" | "full" | "none";
1019
- /** Why; kept on the booking's activity log in ZimmerStack */
1020
- reason?: string;
1021
- }
1022
- export interface DirectBookingCancelResult {
1023
- /** The booking after the cancel, the webhook's shape: status CANCELLED, every room CANCELLED */
1024
- booking: {
1025
- id: number;
1026
- reference: string;
1027
- status: "CONFIRMED" | "CANCELLED";
1028
- stayStatus: string;
1029
- channel: {
1030
- otaName: string;
1031
- otaReservationCode: string;
1032
- source: string;
1033
- sourceGroup: string;
1034
- };
1035
- stay: {
1350
+ changes: Array<string> | null;
1351
+ previous: {
1352
+ stay?: {
1036
1353
  checkIn: string;
1037
1354
  checkOut: string;
1038
1355
  nights: number;
1039
1356
  dayUse: boolean;
1040
1357
  };
1041
- guest: {
1042
- fullName: string;
1043
- firstName: string | null;
1044
- lastName: string | null;
1045
- phone?: string | null;
1046
- email?: string | null;
1047
- country: string | null;
1048
- language: string | null;
1049
- };
1050
- guestNotes: string | null;
1051
- occupancy: {
1052
- adults: number;
1053
- children: number;
1358
+ amounts?: {
1359
+ currency: string;
1360
+ total: number;
1361
+ paid: number;
1362
+ balanceDue: number;
1363
+ paymentCollect: "ota" | "property" | "unknown";
1364
+ /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */
1365
+ receivedCurrency?: string;
1054
1366
  };
1055
- rooms: Array<{
1367
+ rooms?: Array<{
1056
1368
  roomTypeId: number;
1057
1369
  roomTypeName: string;
1058
1370
  ratePlanId?: number | null;
@@ -1067,7 +1379,43 @@ export interface DirectBookingCancelResult {
1067
1379
  amount: number;
1068
1380
  status: string;
1069
1381
  }>;
1070
- amounts: {
1382
+ occupancy?: {
1383
+ adults: number;
1384
+ children: number;
1385
+ };
1386
+ guest?: {
1387
+ fullName: string;
1388
+ };
1389
+ status?: "CONFIRMED" | "CANCELLED";
1390
+ } | null;
1391
+ truncated?: boolean;
1392
+ id: string;
1393
+ mode: "live" | "test";
1394
+ /** The event's place in this hotel's log: one higher than the hotel's last event, across every type. The same number rides the webhook */
1395
+ sequence: number;
1396
+ }
1397
+ export interface DirectBookingEvent {
1398
+ type: "direct.booking.created" | "direct.booking.modified" | "direct.booking.cancelled";
1399
+ apiVersion: string;
1400
+ occurredAt: string;
1401
+ property: {
1402
+ id: number;
1403
+ name: string;
1404
+ currency: string;
1405
+ timezone: string;
1406
+ };
1407
+ data: {
1408
+ booking: ChannelBooking;
1409
+ };
1410
+ changes: Array<string> | null;
1411
+ previous: {
1412
+ stay?: {
1413
+ checkIn: string;
1414
+ checkOut: string;
1415
+ nights: number;
1416
+ dayUse: boolean;
1417
+ };
1418
+ amounts?: {
1071
1419
  currency: string;
1072
1420
  total: number;
1073
1421
  paid: number;
@@ -1076,50 +1424,1143 @@ export interface DirectBookingCancelResult {
1076
1424
  /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */
1077
1425
  receivedCurrency?: string;
1078
1426
  };
1079
- finance: {
1080
- otaName: string;
1081
- amountBasis: string;
1082
- currency: string | null;
1083
- grossAmount: number | null;
1084
- commissionAmount: number | null;
1085
- taxAmount: number | null;
1086
- netPayoutAmount: number | null;
1087
- } | null;
1088
- /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */
1089
- taxes?: {
1090
- lines: Array<{
1091
- code: string;
1092
- name: string;
1093
- kind: "TAX" | "FEE" | "PASS_THROUGH";
1094
- includedInRate: boolean;
1095
- amount: number;
1096
- }>;
1097
- includedInRates: number;
1098
- addedToTotal: number;
1427
+ rooms?: Array<{
1428
+ roomTypeId: number;
1429
+ roomTypeName: string;
1430
+ ratePlanId?: number | null;
1431
+ mealPlan: "EP" | "CP" | "MAP" | "AP";
1432
+ adults: number;
1433
+ children: number;
1434
+ checkIn: string;
1435
+ checkOut: string;
1436
+ nights: number;
1437
+ dayUse: boolean;
1438
+ ratePerNight: number;
1439
+ amount: number;
1440
+ status: string;
1441
+ }>;
1442
+ occupancy?: {
1443
+ adults: number;
1444
+ children: number;
1099
1445
  };
1100
- cancellation: {
1101
- at: string;
1102
- reason: string | null;
1103
- } | null;
1104
- createdAt: string;
1105
- updatedAt: string;
1106
- };
1107
- refund: {
1108
- /** The refund this call asked for; null on a replay */
1109
- requested: "policy" | "full" | "none" | null;
1110
- /** What the guest gets back, in currency's major units (1998.5 = ₹1,998.50); 0 when nothing is owed */
1111
- amount: number;
1112
- /** ISO 4217, the property's currency */
1446
+ guest?: {
1447
+ fullName: string;
1448
+ };
1449
+ status?: "CONFIRMED" | "CANCELLED";
1450
+ stayStatus?: string;
1451
+ } | null;
1452
+ truncated?: boolean;
1453
+ id: string;
1454
+ mode: "live" | "test";
1455
+ /** The event's place in this hotel's log: one higher than the hotel's last event, across every type. The same number rides the webhook */
1456
+ sequence: number;
1457
+ }
1458
+ export interface ChannelSyncEvent {
1459
+ type: "channel.sync.alert" | "channel.sync.recovered";
1460
+ apiVersion: string;
1461
+ occurredAt: string;
1462
+ property: {
1463
+ id: number;
1464
+ name: string;
1113
1465
  currency: string;
1114
- /** NONE: nothing owed. PROCESSED: the payment gateway accepted the refund. PENDING: the refund is recorded and on its way (the gateway is processing it, or ZimmerStack issues it by hand). MANUAL: money is owed but there is no online payment to refund against; the hotel settles it. */
1115
- status: "NONE" | "PENDING" | "PROCESSED" | "MANUAL";
1466
+ timezone: string;
1116
1467
  };
1117
- /** true: the booking was already cancelled; nothing changed and no money moved */
1118
- replay: boolean;
1119
- }
1120
- export interface SandboxBooking {
1121
- /** The PMS booking id, the one the webhook carries */
1122
- bookingId: number;
1468
+ data: {
1469
+ sync: {
1470
+ event: string;
1471
+ channelId: string | null;
1472
+ channelKind: string | null;
1473
+ message: string | null;
1474
+ raisedAt: string;
1475
+ resolvedAt: string | null;
1476
+ };
1477
+ };
1478
+ changes: null;
1479
+ previous: null;
1480
+ id: string;
1481
+ mode: "live" | "test";
1482
+ /** The event's place in this hotel's log: one higher than the hotel's last event, across every type. The same number rides the webhook */
1483
+ sequence: number;
1484
+ }
1485
+ export interface ChannelDriftEvent {
1486
+ type: "channel.drift.detected" | "channel.drift.healed";
1487
+ apiVersion: string;
1488
+ occurredAt: string;
1489
+ property: {
1490
+ id: number;
1491
+ name: string;
1492
+ currency: string;
1493
+ timezone: string;
1494
+ };
1495
+ data: {
1496
+ drift: {
1497
+ from: string;
1498
+ to: string;
1499
+ cellCount: number;
1500
+ resentCount?: number;
1501
+ healing?: boolean;
1502
+ cells: Array<{
1503
+ kind: "rate" | "restriction" | "availability";
1504
+ ratePlanId?: number;
1505
+ roomTypeId?: number;
1506
+ date: string;
1507
+ field: string;
1508
+ yours: number | boolean | null;
1509
+ channel: number | boolean | null;
1510
+ resent?: boolean;
1511
+ }>;
1512
+ truncated: boolean;
1513
+ };
1514
+ };
1515
+ changes: null;
1516
+ previous: null;
1517
+ id: string;
1518
+ mode: "live" | "test";
1519
+ /** The event's place in this hotel's log: one higher than the hotel's last event, across every type. The same number rides the webhook */
1520
+ sequence: number;
1521
+ }
1522
+ export interface ChannelConnectEvent {
1523
+ type: "channel.connect.completed" | "channel.connect.expired";
1524
+ apiVersion: string;
1525
+ occurredAt: string;
1526
+ property: {
1527
+ id: number;
1528
+ name: string;
1529
+ currency: string;
1530
+ timezone: string;
1531
+ };
1532
+ data: {
1533
+ connect: {
1534
+ linkId: string;
1535
+ channel: string;
1536
+ channelName: string;
1537
+ channelId: string | null;
1538
+ selling: boolean;
1539
+ opened?: boolean;
1540
+ futureBookings?: "pulled" | "failed" | "none";
1541
+ };
1542
+ };
1543
+ changes: null;
1544
+ previous: null;
1545
+ id: string;
1546
+ mode: "live" | "test";
1547
+ /** The event's place in this hotel's log: one higher than the hotel's last event, across every type. The same number rides the webhook */
1548
+ sequence: number;
1549
+ }
1550
+ /** One event of a hotel's log: the webhook's own envelope, with its sequence. Tell them apart by type: channel.booking.* and direct.booking.* carry data.booking, channel.sync.* carries data.sync, channel.drift.* carries data.drift, channel.connect.* carries data.connect. A later edition may add a type: skip one you do not know and keep its sequence as your place */
1551
+ export type LoggedEvent = ChannelBookingEvent | DirectBookingEvent | ChannelSyncEvent | ChannelDriftEvent | ChannelConnectEvent;
1552
+ export interface EventsList {
1553
+ /** Oldest first. Each item is the webhook's own envelope for that event (id, type, occurredAt, mode, sequence, property, data, changes, previous): see the webhook contract */
1554
+ items: Array<LoggedEvent>;
1555
+ /** More events follow: ask again with after = nextAfter */
1556
+ more: boolean;
1557
+ /** The sequence of the last item, or the after you sent when the page is empty. Keep it: it is your place in the log */
1558
+ nextAfter: number;
1559
+ /** The lowest sequence still kept for this hotel (events are kept 90 days); null when the log is empty. If it is more than one above your after, events in between are no longer kept: reconcile with GET /channel-bookings and GET /direct-bookings */
1560
+ earliestSequence: number | null;
1561
+ /** How long an event stays in the log */
1562
+ retentionDays: number;
1563
+ }
1564
+ export interface SandboxNoShow {
1565
+ /** true: the hotel undoes the no-show (the nights are taken again). Default false: the guest did not arrive */
1566
+ undo?: boolean;
1567
+ }
1568
+ export interface SandboxSyncEvent {
1569
+ /** alert: a problem is raised · recovered: the newest open simulated problem is cleared */
1570
+ type: "channel.sync.alert" | "channel.sync.recovered";
1571
+ /** Which problem. On an alert, default rate_error. On recovered, clear the newest open problem of this kind; absent, the newest open one of any kind */
1572
+ event?: "rate_error" | "sync_error" | "disconnect_channel" | "settings_changed" | "inventory_out_of_sync";
1573
+ }
1574
+ export interface SandboxSyncEventView {
1575
+ /** The problem: rate_error, sync_error, disconnect_channel, settings_changed or inventory_out_of_sync */
1576
+ event: string;
1577
+ /** The pretend channel the problem is on (GET /channels lists it); null for inventory_out_of_sync, which is the property's */
1578
+ channelId: string | null;
1579
+ channelKind: string | null;
1580
+ raisedAt: string;
1581
+ resolvedAt: string | null;
1582
+ webhook: {
1583
+ eventType: "channel.sync.alert" | "channel.sync.recovered";
1584
+ /** The event is in the outbox; every endpoint on the sandbox that takes it receives it within seconds */
1585
+ queued: boolean;
1586
+ };
1587
+ }
1588
+ export interface WebhookEndpoint {
1589
+ id: number;
1590
+ /** live: the events of the hotels you may act on · test: your sandboxes'. A key manages the endpoints of its own mode */
1591
+ mode: "live" | "test";
1592
+ url: string;
1593
+ description: string | null;
1594
+ apiVersion: string;
1595
+ eventTypes: Array<string>;
1596
+ includeGuestContact: boolean;
1597
+ status: "ACTIVE" | "PAUSED" | "SUSPENDED";
1598
+ statusReason: string | null;
1599
+ secretVersion: number;
1600
+ /** While set, deliveries are also signed with the secret before the last rotation */
1601
+ previousSecretExpiresAt: string | null;
1602
+ notifyEmail: string | null;
1603
+ createdAt: string;
1604
+ updatedAt: string;
1605
+ /** When it was last paused or suspended: where a recover usually starts */
1606
+ lastStoppedAt: string | null;
1607
+ health: {
1608
+ state: "healthy" | "failing" | "paused" | "suspended";
1609
+ consecutiveFailures: number;
1610
+ failingSince: string | null;
1611
+ lastSuccessAt: string | null;
1612
+ lastFailureAt: string | null;
1613
+ lastErrorMessage: string | null;
1614
+ };
1615
+ }
1616
+ export interface WebhookEndpointList {
1617
+ items: Array<{
1618
+ id: number;
1619
+ /** live: the events of the hotels you may act on · test: your sandboxes'. A key manages the endpoints of its own mode */
1620
+ mode: "live" | "test";
1621
+ url: string;
1622
+ description: string | null;
1623
+ apiVersion: string;
1624
+ eventTypes: Array<string>;
1625
+ includeGuestContact: boolean;
1626
+ status: "ACTIVE" | "PAUSED" | "SUSPENDED";
1627
+ statusReason: string | null;
1628
+ secretVersion: number;
1629
+ /** While set, deliveries are also signed with the secret before the last rotation */
1630
+ previousSecretExpiresAt: string | null;
1631
+ notifyEmail: string | null;
1632
+ createdAt: string;
1633
+ updatedAt: string;
1634
+ /** When it was last paused or suspended: where a recover usually starts */
1635
+ lastStoppedAt: string | null;
1636
+ health: {
1637
+ state: "healthy" | "failing" | "paused" | "suspended";
1638
+ consecutiveFailures: number;
1639
+ failingSince: string | null;
1640
+ lastSuccessAt: string | null;
1641
+ lastFailureAt: string | null;
1642
+ lastErrorMessage: string | null;
1643
+ };
1644
+ }>;
1645
+ /** The most endpoints a partner may have, both modes together */
1646
+ limit: number;
1647
+ }
1648
+ export interface WebhookEndpointCreate {
1649
+ /** https only, a public address; checked now and again at every send */
1650
+ url: string;
1651
+ description?: string;
1652
+ /** The event types to receive; default the OTA booking events and both channel.sync events */
1653
+ eventTypes?: Array<string>;
1654
+ /** true: deliveries carry the guest's phone and email. Default false; change it at any time */
1655
+ includeGuestContact?: boolean;
1656
+ /** Where a failing endpoint is reported; default the partner's account email */
1657
+ notifyEmail?: string;
1658
+ /** Must be true: you confirm that guest booking details will be sent to this address */
1659
+ dataAck: true;
1660
+ }
1661
+ export interface WebhookEndpointCreated {
1662
+ endpoint: {
1663
+ id: number;
1664
+ /** live: the events of the hotels you may act on · test: your sandboxes'. A key manages the endpoints of its own mode */
1665
+ mode: "live" | "test";
1666
+ url: string;
1667
+ description: string | null;
1668
+ apiVersion: string;
1669
+ eventTypes: Array<string>;
1670
+ includeGuestContact: boolean;
1671
+ status: "ACTIVE" | "PAUSED" | "SUSPENDED";
1672
+ statusReason: string | null;
1673
+ secretVersion: number;
1674
+ /** While set, deliveries are also signed with the secret before the last rotation */
1675
+ previousSecretExpiresAt: string | null;
1676
+ notifyEmail: string | null;
1677
+ createdAt: string;
1678
+ updatedAt: string;
1679
+ /** When it was last paused or suspended: where a recover usually starts */
1680
+ lastStoppedAt: string | null;
1681
+ health: {
1682
+ state: "healthy" | "failing" | "paused" | "suspended";
1683
+ consecutiveFailures: number;
1684
+ failingSince: string | null;
1685
+ lastSuccessAt: string | null;
1686
+ lastFailureAt: string | null;
1687
+ lastErrorMessage: string | null;
1688
+ };
1689
+ };
1690
+ /** The signing secret (whsec_…). Shown in this answer only: store it now. null on a replay of the same request (X-Idempotent-Replay: true): we keep no copy to show again, so rotate the secret if the first answer was lost */
1691
+ secret: string | null;
1692
+ }
1693
+ export interface WebhookEndpointUpdate {
1694
+ url?: string;
1695
+ description?: string | null;
1696
+ eventTypes?: Array<string>;
1697
+ /** The guest-contact switch: applies to every delivery made from now on */
1698
+ includeGuestContact?: boolean;
1699
+ notifyEmail?: string | null;
1700
+ }
1701
+ export interface WebhookSecretRotated {
1702
+ /** The new signing secret. Shown in this answer only. null on a replay of the same request (X-Idempotent-Replay: true): rotate again if the first answer was lost */
1703
+ secret: string | null;
1704
+ secretVersion: number;
1705
+ /** Until then deliveries are signed with both secrets, so you can switch without losing one */
1706
+ previousExpiresAt: string;
1707
+ }
1708
+ export interface WebhookTest {
1709
+ /** Any event type an endpoint can receive, or zimmerstack.ping; default zimmerstack.ping */
1710
+ eventType?: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled" | "direct.booking.created" | "direct.booking.modified" | "direct.booking.cancelled" | "channel.sync.alert" | "channel.sync.recovered" | "channel.drift.detected" | "channel.drift.healed" | "channel.connect.completed" | "channel.connect.expired" | "platform.incident.opened" | "platform.incident.updated" | "platform.incident.resolved" | "support.ticket.replied" | "support.ticket.closed" | "zimmerstack.ping";
1711
+ }
1712
+ export interface WebhookRecover {
1713
+ /** Queue again every subscribed event since this instant (ISO 8601); at most 90 days back */
1714
+ since: string;
1715
+ }
1716
+ export interface WebhookRecoverResult {
1717
+ /** Failed deliveries queued again */
1718
+ reset: number;
1719
+ /** Events that had no delivery and now have one */
1720
+ created: number;
1721
+ scanned: number;
1722
+ /** More events than one run queues: run it again for the rest */
1723
+ truncated: boolean;
1724
+ }
1725
+ export interface WebhookDeliveryList {
1726
+ items: Array<{
1727
+ id: string;
1728
+ eventId: string;
1729
+ eventType: string;
1730
+ mode: "LIVE" | "TEST";
1731
+ status: "PENDING" | "DELIVERED" | "FAILED";
1732
+ attempts: number;
1733
+ nextAttemptAt: string;
1734
+ lastError: string | null;
1735
+ occurredAt: string;
1736
+ deliveredAt: string | null;
1737
+ createdAt: string;
1738
+ payloadBytes: number;
1739
+ /** false once the stored body has been dropped (14 days); a redeliver rebuilds it from the event while that is kept (90 days) */
1740
+ payloadAvailable: boolean;
1741
+ }>;
1742
+ nextCursor: string | null;
1743
+ }
1744
+ export interface WebhookDelivery {
1745
+ id: string;
1746
+ eventId: string;
1747
+ eventType: string;
1748
+ mode: "LIVE" | "TEST";
1749
+ status: "PENDING" | "DELIVERED" | "FAILED";
1750
+ attempts: number;
1751
+ nextAttemptAt: string;
1752
+ lastError: string | null;
1753
+ occurredAt: string;
1754
+ deliveredAt: string | null;
1755
+ createdAt: string;
1756
+ payloadBytes: number;
1757
+ /** false once the stored body has been dropped (14 days); a redeliver rebuilds it from the event while that is kept (90 days) */
1758
+ payloadAvailable: boolean;
1759
+ }
1760
+ export interface WebhookDeliveryDetail {
1761
+ id: string;
1762
+ eventId: string;
1763
+ eventType: string;
1764
+ mode: "LIVE" | "TEST";
1765
+ status: "PENDING" | "DELIVERED" | "FAILED";
1766
+ attempts: number;
1767
+ nextAttemptAt: string;
1768
+ lastError: string | null;
1769
+ occurredAt: string;
1770
+ deliveredAt: string | null;
1771
+ createdAt: string;
1772
+ payloadBytes: number;
1773
+ /** false once the stored body has been dropped (14 days); a redeliver rebuilds it from the event while that is kept (90 days) */
1774
+ payloadAvailable: boolean;
1775
+ /** The event as it was sent (the webhook's envelope), with a guest's phone and email masked in this read; null once the stored body has been dropped (payloadAvailable: false) */
1776
+ payload: unknown;
1777
+ /** Every attempt, oldest first */
1778
+ attempts_log: Array<{
1779
+ id: string;
1780
+ /** 1 for the first send, one more for each retry */
1781
+ attemptNo: number;
1782
+ startedAt: string;
1783
+ durationMs: number;
1784
+ /** SUCCESS, HTTP_ERROR, TIMEOUT, CONNECTION_ERROR, TLS_ERROR or BLOCKED_URL; more may come */
1785
+ outcome: string;
1786
+ /** The HTTP status your receiver answered; null when it never answered */
1787
+ responseStatus: number | null;
1788
+ /** The first 2 KB of what your receiver answered */
1789
+ responseBodySnippet: string | null;
1790
+ errorMessage: string | null;
1791
+ /** The address your URL resolved to for this attempt */
1792
+ resolvedIp: string | null;
1793
+ }>;
1794
+ request: {
1795
+ /** The headers the delivery carried; the timestamp and the signature are shown as placeholders */
1796
+ headers: Record<string, string>;
1797
+ };
1798
+ }
1799
+ export interface WebhookEndpointResumed {
1800
+ id: number;
1801
+ /** live: the events of the hotels you may act on · test: your sandboxes'. A key manages the endpoints of its own mode */
1802
+ mode: "live" | "test";
1803
+ url: string;
1804
+ description: string | null;
1805
+ apiVersion: string;
1806
+ eventTypes: Array<string>;
1807
+ includeGuestContact: boolean;
1808
+ status: "ACTIVE" | "PAUSED" | "SUSPENDED";
1809
+ statusReason: string | null;
1810
+ secretVersion: number;
1811
+ /** While set, deliveries are also signed with the secret before the last rotation */
1812
+ previousSecretExpiresAt: string | null;
1813
+ notifyEmail: string | null;
1814
+ createdAt: string;
1815
+ updatedAt: string;
1816
+ /** When it was last paused or suspended: where a recover usually starts */
1817
+ lastStoppedAt: string | null;
1818
+ health: {
1819
+ state: "healthy" | "failing" | "paused" | "suspended";
1820
+ consecutiveFailures: number;
1821
+ failingSince: string | null;
1822
+ lastSuccessAt: string | null;
1823
+ lastFailureAt: string | null;
1824
+ lastErrorMessage: string | null;
1825
+ };
1826
+ /** How many events the pause held; they are being sent now, oldest first */
1827
+ heldEvents: number;
1828
+ }
1829
+ export interface WebhookEndpointDeleted {
1830
+ id: number;
1831
+ deleted: true;
1832
+ }
1833
+ export interface WebhookTestQueued {
1834
+ /** The delivery in the log: GET /webhook-endpoints/{endpointId}/deliveries/{deliveryId} says what your receiver answered */
1835
+ deliveryId: string;
1836
+ eventId: string;
1837
+ /** The type that was sent */
1838
+ eventType: string;
1839
+ }
1840
+ export interface Status {
1841
+ asOf: string;
1842
+ /** The worst state of any component for your hotels; operational when nothing is open */
1843
+ overall: "operational" | "degraded" | "partial_outage" | "major_outage";
1844
+ components: Array<{
1845
+ /** api · bookings_in · ari_out · ota:<booking site> */
1846
+ id: string;
1847
+ name: string;
1848
+ kind: "platform" | "booking_site";
1849
+ covers: string;
1850
+ state: "operational" | "degraded" | "partial_outage" | "major_outage";
1851
+ incidentIds: Array<number>;
1852
+ }>;
1853
+ incidents: {
1854
+ open: Array<{
1855
+ /** The same id the platform.incident.* webhooks carry */
1856
+ id: number;
1857
+ component: string;
1858
+ componentName: string;
1859
+ /** degraded: working, slower or later than usual · partial_outage: not working for some hotels or requests · major_outage: not working */
1860
+ severity: "degraded" | "partial_outage" | "major_outage";
1861
+ status: "investigating" | "identified" | "monitoring" | "resolved";
1862
+ title: string;
1863
+ startedAt: string;
1864
+ updatedAt: string;
1865
+ resolvedAt: string | null;
1866
+ /** Which of YOUR hotels it touches */
1867
+ properties: {
1868
+ /** true: it touches every hotel */
1869
+ all: boolean;
1870
+ count: number;
1871
+ ids: Array<number>;
1872
+ truncated: boolean;
1873
+ };
1874
+ /** What we said, newest first */
1875
+ updates: Array<{
1876
+ at: string;
1877
+ status: "investigating" | "identified" | "monitoring" | "resolved";
1878
+ severity: "degraded" | "partial_outage" | "major_outage";
1879
+ message: string;
1880
+ }>;
1881
+ }>;
1882
+ /** Resolved in the last 7 days, so a consumer that missed the end still sees it ended */
1883
+ recent: Array<{
1884
+ /** The same id the platform.incident.* webhooks carry */
1885
+ id: number;
1886
+ component: string;
1887
+ componentName: string;
1888
+ /** degraded: working, slower or later than usual · partial_outage: not working for some hotels or requests · major_outage: not working */
1889
+ severity: "degraded" | "partial_outage" | "major_outage";
1890
+ status: "investigating" | "identified" | "monitoring" | "resolved";
1891
+ title: string;
1892
+ startedAt: string;
1893
+ updatedAt: string;
1894
+ resolvedAt: string | null;
1895
+ /** Which of YOUR hotels it touches */
1896
+ properties: {
1897
+ /** true: it touches every hotel */
1898
+ all: boolean;
1899
+ count: number;
1900
+ ids: Array<number>;
1901
+ truncated: boolean;
1902
+ };
1903
+ /** What we said, newest first */
1904
+ updates: Array<{
1905
+ at: string;
1906
+ status: "investigating" | "identified" | "monitoring" | "resolved";
1907
+ severity: "degraded" | "partial_outage" | "major_outage";
1908
+ message: string;
1909
+ }>;
1910
+ }>;
1911
+ };
1912
+ /** The availability we publish and report against. A target: it carries no service credits */
1913
+ uptimeTarget: {
1914
+ percent: number;
1915
+ window: string;
1916
+ credits: boolean;
1917
+ what: string;
1918
+ };
1919
+ /** The address of the hosted status page once there is one; null until then, and this read is the status */
1920
+ page: string | null;
1921
+ }
1922
+ export interface Billing {
1923
+ /** true: ZimmerStack bills you for your hotels. false: it bills each hotel directly, and the rest of this answer is empty */
1924
+ billed: boolean;
1925
+ /** ISO 4217: the currency your invoices are in */
1926
+ currency: string | null;
1927
+ outstanding: {
1928
+ /** What is owed on issued invoices, in major units as a decimal string ("944.00") */
1929
+ amount: string;
1930
+ /** The same, in hundredths of the major unit */
1931
+ amountMinor: number;
1932
+ openInvoices: number;
1933
+ oldestDueAt: string | null;
1934
+ };
1935
+ onboardingFee: {
1936
+ /** NOT_ASKED · WAIVED · LIVE_BEFORE (you were live before it began) · DUE (pay it in the portal before a live key or a hotel) · BILLING (its invoice is being issued) · PAID */
1937
+ state: "NOT_ASKED" | "WAIVED" | "LIVE_BEFORE" | "DUE" | "BILLING" | "PAID";
1938
+ /** The one-time fee, in major units as a decimal string ("944.00") */
1939
+ amount: string;
1940
+ currency: "USD";
1941
+ invoiceNumber: string | null;
1942
+ };
1943
+ quota: {
1944
+ /** Whether the quota is in force for you today; when false the numbers are what would apply */
1945
+ applies: boolean;
1946
+ why: "ACTIVE" | "NOT_STARTED" | "OUTSIDE_RULES" | "NOT_A_VENDOR";
1947
+ /** YYYY-MM-DD: the day the quota and the unpaid-invoice days begin */
1948
+ startsOn: string;
1949
+ properties: {
1950
+ /** How many hotels you may have live */
1951
+ allowed: number;
1952
+ /** How many you have */
1953
+ used: number;
1954
+ /** How many you may still add */
1955
+ free: number;
1956
+ };
1957
+ /** What opens the next level; null at the top of the ladder, where ZimmerStack sets it by hand: ask with a support ticket */
1958
+ next: {
1959
+ /** The next level */
1960
+ properties: number;
1961
+ /** About what paying ahead opens it today, in US dollars; the portal's Pay ahead bills the exact amount in your currency, in major units as a decimal string ("944.00") */
1962
+ payAhead: string;
1963
+ /** The same, in hundredths of the major unit */
1964
+ payAheadMinor: number;
1965
+ currency: "USD";
1966
+ } | null;
1967
+ /** true when ZimmerStack set your quota by hand */
1968
+ setByZimmerStack: boolean;
1969
+ rule: string;
1970
+ };
1971
+ paidAhead: {
1972
+ /** What is left of the money you paid ahead, before tax, in major units as a decimal string ("944.00") */
1973
+ amount: string;
1974
+ /** The same, in hundredths of the major unit */
1975
+ amountMinor: number;
1976
+ currency: string | null;
1977
+ };
1978
+ unpaidInvoiceDays: {
1979
+ applies: boolean;
1980
+ /** A monthly invoice is due by the end of this day of its month */
1981
+ dueDay: number;
1982
+ /** Still unpaid on this day: your hotels' booking-site connections are paused */
1983
+ pauseDay: number;
1984
+ /** This many days after the pause the hotels' service is ended (the month's last day when that is sooner) */
1985
+ endAfterDays: number;
1986
+ rule: string;
1987
+ /** Your unpaid monthly invoices under these rules, oldest first, each with its own instants */
1988
+ unpaid: Array<{
1989
+ invoiceNumber: string | null;
1990
+ dueAt: string;
1991
+ pauseAt: string;
1992
+ endAt: string;
1993
+ /** false: issued too late in the month for the pause to happen by itself; ZimmerStack decides it by hand */
1994
+ automatic: boolean;
1995
+ }>;
1996
+ };
1997
+ /** What the channel manager charges above its included room types and rate plans for a hotel whose limit ZimmerStack raised: passed on at cost, nothing added */
1998
+ atCost: {
1999
+ currency: "USD";
2000
+ what: string;
2001
+ /** How a recorded line reaches an invoice today. BY_ZIMMERSTACK: recorded, and added to one of your invoices by our team. AUTOMATIC: your next monthly invoice carries it by itself, one line for each, at cost */
2002
+ invoicing: "BY_ZIMMERSTACK" | "AUTOMATIC";
2003
+ /** The same, in a sentence */
2004
+ rule: string;
2005
+ /** Recorded and on no invoice yet, in major units as a decimal string ("944.00") */
2006
+ recorded: string;
2007
+ /** The same, in hundredths of the major unit */
2008
+ recordedMinor: number;
2009
+ items: Array<{
2010
+ /** YYYY-MM */
2011
+ month: string;
2012
+ property: {
2013
+ id: number;
2014
+ name: string;
2015
+ };
2016
+ kind: "room_types" | "rate_plans" | "rate_plans_per_room_type";
2017
+ /** In words: "3 room types above the 20 included" */
2018
+ what: string;
2019
+ held: number;
2020
+ included: number;
2021
+ quantity: number;
2022
+ /** The limit ZimmerStack allowed this hotel */
2023
+ allowedLimit: number;
2024
+ unitPrice: string;
2025
+ amount: string;
2026
+ amountMinor: number;
2027
+ /** RECORDED: on no invoice yet · INVOICED: on one of your invoices · WAIVED: not charged */
2028
+ status: "RECORDED" | "INVOICED" | "WAIVED";
2029
+ /** Where the line stands for you. ON_INVOICE: on the issued invoice named in invoiceNumber · ON_NEXT_INVOICE: on your next monthly invoice (it is on the one being prepared, or will be put on it by itself) · ADDED_BY_ZIMMERSTACK: recorded; our team adds it to one of your invoices · NOT_CHARGED: waived */
2030
+ standing: "ON_INVOICE" | "ON_NEXT_INVOICE" | "ADDED_BY_ZIMMERSTACK" | "NOT_CHARGED";
2031
+ /** The invoice it is on, once that invoice is issued (GET /billing/invoices lists it); null until then */
2032
+ invoiceNumber: string | null;
2033
+ }>;
2034
+ };
2035
+ }
2036
+ export interface BillingInvoices {
2037
+ billed: boolean;
2038
+ /** The 24 most recent issued invoices, newest first */
2039
+ items: Array<{
2040
+ /** The invoice's public id */
2041
+ id: string;
2042
+ number: string | null;
2043
+ /** A month's hotels, the one-time onboarding fee, or money paid ahead */
2044
+ about: "MONTH" | "ONBOARDING_FEE" | "PAID_AHEAD";
2045
+ /** YYYY-MM-DD */
2046
+ periodStart: string;
2047
+ /** YYYY-MM-DD */
2048
+ periodEnd: string;
2049
+ currency: string;
2050
+ /** OPEN · PARTIALLY_PAID · PAID (drafts and voided invoices are never listed) */
2051
+ status: string;
2052
+ issuedAt: string | null;
2053
+ dueAt: string | null;
2054
+ paidAt: string | null;
2055
+ overdue: boolean;
2056
+ /** The invoice before tax, in major units as a decimal string ("944.00") */
2057
+ beforeTax: string;
2058
+ /** The same, in hundredths of the major unit */
2059
+ beforeTaxMinor: number;
2060
+ /** Tax, in major units as a decimal string ("944.00") */
2061
+ tax: string;
2062
+ /** The same, in hundredths of the major unit */
2063
+ taxMinor: number;
2064
+ /** The invoice after tax, in major units as a decimal string ("944.00") */
2065
+ total: string;
2066
+ /** The same, in hundredths of the major unit */
2067
+ totalMinor: number;
2068
+ /** Paid so far, in major units as a decimal string ("944.00") */
2069
+ paid: string;
2070
+ /** Credited by credit notes, in major units as a decimal string ("944.00") */
2071
+ credited: string;
2072
+ /** Still owed, in major units as a decimal string ("944.00") */
2073
+ balance: string;
2074
+ /** The same, in hundredths of the major unit */
2075
+ balanceMinor: number;
2076
+ lines: Array<{
2077
+ description: string;
2078
+ hotel: string | null;
2079
+ quantity: number;
2080
+ kind: string;
2081
+ total: string;
2082
+ totalMinor: number;
2083
+ }>;
2084
+ }>;
2085
+ payments: Array<{
2086
+ receivedAt: string;
2087
+ amount: string;
2088
+ amountMinor: number;
2089
+ currency: string;
2090
+ method: string;
2091
+ invoiceNumber: string | null;
2092
+ }>;
2093
+ }
2094
+ export interface BillingNextInvoice {
2095
+ billed: boolean;
2096
+ /** When this was read. The invoice reads rooms, prices and the exchange rate again on the day it is made */
2097
+ asOf: string;
2098
+ /** YYYY-MM: the month the invoice is for */
2099
+ month: string | null;
2100
+ /** LIVE_ON_FIRST: every hotel live on the 1st, in full for the month starting · DAYS_LIVE: each hotel for the days it was live */
2101
+ counting: "LIVE_ON_FIRST" | "DAYS_LIVE";
2102
+ currency: string | null;
2103
+ lines: Array<{
2104
+ hotel: string;
2105
+ propertyId: number | null;
2106
+ /** CM = the channel manager */
2107
+ module: string;
2108
+ /** PRICE_LIST: read from a price list on bill day · AGREED_PRICE: a fixed price agreed with you · FIXED: this line keeps its own price */
2109
+ priced: "PRICE_LIST" | "AGREED_PRICE" | "FIXED";
2110
+ priceList: {
2111
+ id: number | null;
2112
+ name: string;
2113
+ currency: string;
2114
+ } | null;
2115
+ /** The room band the hotel falls in, as the price list names it */
2116
+ band: string | null;
2117
+ /** Rooms counted for the price: what the hotel declared, or the most it has on sale on one night when that is more */
2118
+ rooms: number | null;
2119
+ /** Present only when it has more rooms on sale than it declared */
2120
+ declaredRooms: number | null;
2121
+ /** How many of your hotels are in the same room band: what picks a volume price */
2122
+ hotelsInBand: number | null;
2123
+ unit: "ROOM" | "HOTEL";
2124
+ quantity: number;
2125
+ unitPrice: string;
2126
+ unitPriceMinor: number;
2127
+ amount: string;
2128
+ amountMinor: number;
2129
+ /** When the list is in another currency: its own unit price and the latest rate on file today */
2130
+ conversion: {
2131
+ fromCurrency: string;
2132
+ listUnitPrice: string;
2133
+ rate: string;
2134
+ rateDate: string;
2135
+ } | null;
2136
+ }>;
2137
+ beforeTax: string;
2138
+ beforeTaxMinor: number;
2139
+ /** true: GST is added on top (a partner in India). false: nothing is added to these prices */
2140
+ taxAddedOnTop: boolean;
2141
+ /** Money you paid ahead that an invoice can still take off. It comes off only as far as your quota level stays covered, so the invoice says how much */
2142
+ paidAhead: {
2143
+ amount: string;
2144
+ amountMinor: number;
2145
+ };
2146
+ /** Hotels or lines that are not on it today, each with why */
2147
+ notes: Array<string>;
2148
+ conversionMissing: {
2149
+ from: string;
2150
+ to: string;
2151
+ } | null;
2152
+ /** The channel manager's charges above its included room types and rate plans that are recorded and on no invoice yet, at cost */
2153
+ atCost: {
2154
+ /** BY_ZIMMERSTACK: our team adds these lines to an invoice by hand, so they are not counted in this answer's amounts. AUTOMATIC: this invoice carries each of them as a line of its own */
2155
+ invoicing: "BY_ZIMMERSTACK" | "AUTOMATIC";
2156
+ rule: string;
2157
+ lines: Array<{
2158
+ /** YYYY-MM: the month the channel manager counted it for */
2159
+ month: string;
2160
+ property: {
2161
+ id: number;
2162
+ name: string;
2163
+ };
2164
+ kind: "room_types" | "rate_plans" | "rate_plans_per_room_type";
2165
+ /** In words: "3 room types above the 20 included" */
2166
+ what: string;
2167
+ /** The charge itself, in US dollars */
2168
+ usdAmount: string;
2169
+ usdAmountMinor: number;
2170
+ /** AUTOMATIC: the same in this invoice's currency at the latest rate on file today, before tax; null when no rate is on file. BY_ZIMMERSTACK: null, the amount is on the invoice once our team has added the line */
2171
+ amount: string | null;
2172
+ amountMinor: number | null;
2173
+ }>;
2174
+ /** AUTOMATIC, and the invoice is not in US dollars: the latest rate on file today. The invoice reads the rate again on the day it is made */
2175
+ conversion: {
2176
+ fromCurrency: "USD";
2177
+ rate: string;
2178
+ rateDate: string;
2179
+ } | null;
2180
+ conversionMissing: {
2181
+ from: string;
2182
+ to: string;
2183
+ } | null;
2184
+ /** AUTOMATIC: what these lines add to this invoice before tax, beside beforeTax above (which is the hotel lines alone). BY_ZIMMERSTACK: 0.00 */
2185
+ beforeTax: string;
2186
+ beforeTaxMinor: number;
2187
+ };
2188
+ }
2189
+ export interface SupportTicketCreate {
2190
+ /** many_hotels: two or more of your hotels, or all, cannot take bookings or send prices and rooms · one_hotel: one hotel cannot · question: anything else. A test key's ticket is always question */
2191
+ severity: "many_hotels" | "one_hotel" | "question";
2192
+ /** One line: what is wrong, or what you are asking */
2193
+ subject: string;
2194
+ /** What you see, since when, and what you expected. Never paste a key, a secret or a guest's details: we already attach what our records show */
2195
+ message: string;
2196
+ /** The hotels affected, by their ids from GET /properties. Exactly one for one_hotel; two or more (or allProperties) for many_hotels; optional for question */
2197
+ propertyIds?: Array<number>;
2198
+ /** true: every hotel this key may act on is affected. Not together with propertyIds */
2199
+ allProperties?: boolean;
2200
+ }
2201
+ export interface SupportMessageCreate {
2202
+ /** Your reply. The ticket waits for ZimmerStack again from then */
2203
+ message: string;
2204
+ }
2205
+ export interface SupportTicket {
2206
+ /** Quote it in any mail about the ticket */
2207
+ id: number;
2208
+ subject: string;
2209
+ severity: "many_hotels" | "one_hotel" | "question";
2210
+ /** OPEN: waiting for ZimmerStack · ANSWERED: we replied, waiting for you · CLOSED */
2211
+ status: "OPEN" | "ANSWERED" | "CLOSED";
2212
+ /** The mode of the key that opened it. A key reads the tickets of its own mode */
2213
+ mode: "live" | "test";
2214
+ /** The hotels you said are affected */
2215
+ properties: {
2216
+ all: boolean;
2217
+ ids: Array<number>;
2218
+ };
2219
+ openedAt: string;
2220
+ lastMessageAt: string;
2221
+ /** When ZimmerStack first answers (x-zimmerstack.support.severities) */
2222
+ firstReply: {
2223
+ /** The first-reply target of this severity, in words */
2224
+ target: string;
2225
+ /** The instant the first reply is due, for many_hotels; null where the target is a working day */
2226
+ dueAt: string | null;
2227
+ repliedAt: string | null;
2228
+ };
2229
+ closedAt: string | null;
2230
+ closedBy: "partner" | "zimmerstack" | null;
2231
+ /** The thread, oldest first */
2232
+ messages: Array<{
2233
+ id: number;
2234
+ author: "partner" | "zimmerstack";
2235
+ body: string;
2236
+ createdAt: string;
2237
+ }>;
2238
+ diagnostic: {
2239
+ takenAt: string;
2240
+ windowHours: number;
2241
+ requests: {
2242
+ /** Your calls answered 400 or above in the window */
2243
+ refused: number;
2244
+ byCode: Array<{
2245
+ status: number;
2246
+ errorCode: string | null;
2247
+ count: number;
2248
+ lastAt: string | null;
2249
+ }>;
2250
+ lastRefused: Array<{
2251
+ requestId: string | null;
2252
+ at: string;
2253
+ method: string;
2254
+ route: string;
2255
+ status: number;
2256
+ errorCode: string | null;
2257
+ propertyId: number | null;
2258
+ }>;
2259
+ } | null;
2260
+ hotels: Array<{
2261
+ propertyId: number;
2262
+ inventory: {
2263
+ pendingCells: number;
2264
+ outOfSyncSince: string | null;
2265
+ lastOkAt: string | null;
2266
+ };
2267
+ rates: {
2268
+ waitingCells: number;
2269
+ refusedCells: number;
2270
+ lastPushAt: string | null;
2271
+ lastErrorAt: string | null;
2272
+ consecutiveFailures: number;
2273
+ };
2274
+ channelIssues: Array<{
2275
+ event: string;
2276
+ count: number;
2277
+ since: string | null;
2278
+ }>;
2279
+ shield: {
2280
+ level: string;
2281
+ until: string | null;
2282
+ };
2283
+ usage: {
2284
+ cellsChanged: number;
2285
+ refusals: number;
2286
+ refusedByChannelManager: number;
2287
+ };
2288
+ }>;
2289
+ hotelsNotShown: number;
2290
+ partner: {
2291
+ shield: {
2292
+ level: string;
2293
+ until: string | null;
2294
+ };
2295
+ usage: {
2296
+ cellsChanged: number;
2297
+ refusals: number;
2298
+ refusedByChannelManager: number;
2299
+ };
2300
+ } | null;
2301
+ webhooks: Array<{
2302
+ endpointId: number;
2303
+ status: string;
2304
+ consecutiveFailures: number;
2305
+ failingSince: string | null;
2306
+ lastSuccessAt: string | null;
2307
+ lastFailureAt: string | null;
2308
+ deliveries: {
2309
+ delivered: number;
2310
+ failed: number;
2311
+ pending: number;
2312
+ };
2313
+ lastFailed: Array<{
2314
+ deliveryId: string;
2315
+ eventType: string;
2316
+ attempts: number;
2317
+ at: string;
2318
+ }>;
2319
+ }> | null;
2320
+ /** Parts that could not be read at that moment */
2321
+ incomplete: Array<string>;
2322
+ } | null;
2323
+ }
2324
+ export interface SupportTicketList {
2325
+ items: Array<{
2326
+ /** Quote it in any mail about the ticket */
2327
+ id: number;
2328
+ subject: string;
2329
+ severity: "many_hotels" | "one_hotel" | "question";
2330
+ /** OPEN: waiting for ZimmerStack · ANSWERED: we replied, waiting for you · CLOSED */
2331
+ status: "OPEN" | "ANSWERED" | "CLOSED";
2332
+ /** The mode of the key that opened it. A key reads the tickets of its own mode */
2333
+ mode: "live" | "test";
2334
+ /** The hotels you said are affected */
2335
+ properties: {
2336
+ all: boolean;
2337
+ ids: Array<number>;
2338
+ };
2339
+ openedAt: string;
2340
+ lastMessageAt: string;
2341
+ /** When ZimmerStack first answers (x-zimmerstack.support.severities) */
2342
+ firstReply: {
2343
+ /** The first-reply target of this severity, in words */
2344
+ target: string;
2345
+ /** The instant the first reply is due, for many_hotels; null where the target is a working day */
2346
+ dueAt: string | null;
2347
+ repliedAt: string | null;
2348
+ };
2349
+ closedAt: string | null;
2350
+ closedBy: "partner" | "zimmerstack" | null;
2351
+ }>;
2352
+ nextCursor: string | null;
2353
+ }
2354
+ export interface ChannelBooking {
2355
+ id: number;
2356
+ reference: string;
2357
+ /** Our own counter of this booking's events: 1 on its first event, one more on each later one. A higher version is a later state whatever order deliveries arrived in. On a read it is the booking's current version (0: no event since versions began) */
2358
+ version?: number;
2359
+ status: "CONFIRMED" | "CANCELLED";
2360
+ stayStatus: string;
2361
+ channel: {
2362
+ otaName: string;
2363
+ otaReservationCode: string;
2364
+ source: string;
2365
+ sourceGroup: string;
2366
+ };
2367
+ stay: {
2368
+ checkIn: string;
2369
+ checkOut: string;
2370
+ nights: number;
2371
+ dayUse: boolean;
2372
+ };
2373
+ guest: {
2374
+ fullName: string;
2375
+ firstName: string | null;
2376
+ lastName: string | null;
2377
+ phone?: string | null;
2378
+ email?: string | null;
2379
+ country: string | null;
2380
+ language: string | null;
2381
+ /** Present when phone and email are null because of a rule, not because the booking has none: "retention" = the stay checked out more than 30 days ago (API reads and webhooks alike, a recovered or redelivered event included); "unavailable" = an API read that could not be logged just now, ask again. Absent otherwise */
2382
+ contactWithheld?: "retention" | "unavailable";
2383
+ };
2384
+ guestNotes: string | null;
2385
+ occupancy: {
2386
+ adults: number;
2387
+ children: number;
2388
+ };
2389
+ rooms: Array<{
2390
+ roomTypeId: number;
2391
+ roomTypeName: string;
2392
+ ratePlanId?: number | null;
2393
+ mealPlan: "EP" | "CP" | "MAP" | "AP";
2394
+ adults: number;
2395
+ children: number;
2396
+ checkIn: string;
2397
+ checkOut: string;
2398
+ nights: number;
2399
+ dayUse: boolean;
2400
+ ratePerNight: number;
2401
+ amount: number;
2402
+ status: string;
2403
+ }>;
2404
+ amounts: {
2405
+ currency: string;
2406
+ total: number;
2407
+ paid: number;
2408
+ balanceDue: number;
2409
+ paymentCollect: "ota" | "property" | "unknown";
2410
+ /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */
2411
+ receivedCurrency?: string;
2412
+ };
2413
+ finance: {
2414
+ otaName: string;
2415
+ amountBasis: string;
2416
+ currency: string | null;
2417
+ grossAmount: number | null;
2418
+ commissionAmount: number | null;
2419
+ taxAmount: number | null;
2420
+ netPayoutAmount: number | null;
2421
+ /** The OTA's own fee on top of its commission, where it sent one; null when it named none. Informational: netPayoutAmount is gross minus commission and does not subtract it */
2422
+ feeAmount?: number | null;
2423
+ /** How the guest pays, in the OTA's own word (for example "credit_card"); null when the OTA sent none. A label only */
2424
+ paymentType?: string | null;
2425
+ /** true when the OTA pays the property with a virtual card it issues: the guest does not pay the desk for the room. true or false only; the card itself is never sent */
2426
+ virtualCard?: boolean;
2427
+ } | null;
2428
+ /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */
2429
+ taxes?: {
2430
+ lines: Array<{
2431
+ code: string;
2432
+ name: string;
2433
+ kind: "TAX" | "FEE" | "PASS_THROUGH";
2434
+ includedInRate: boolean;
2435
+ amount: number;
2436
+ }>;
2437
+ includedInRates: number;
2438
+ addedToTotal: number;
2439
+ };
2440
+ cancellation: {
2441
+ at: string;
2442
+ reason: string | null;
2443
+ } | null;
2444
+ createdAt: string;
2445
+ updatedAt: string;
2446
+ }
2447
+ export interface DirectBookingCancel {
2448
+ /** policy (the default): what the booking's own cancellation policy gives back now, the same as the guest cancelling on the booking page. full: everything the guest paid online. none: nothing; the hotel settles any money itself. */
2449
+ refund?: "policy" | "full" | "none";
2450
+ /** Why; kept on the booking's activity log in ZimmerStack */
2451
+ reason?: string;
2452
+ }
2453
+ export interface DirectBookingCancelResult {
2454
+ /** The booking after the cancel, the webhook's shape: status CANCELLED, every room CANCELLED */
2455
+ booking: {
2456
+ id: number;
2457
+ reference: string;
2458
+ /** Our own counter of this booking's events: 1 on its first event, one more on each later one. A higher version is a later state whatever order deliveries arrived in. On a read it is the booking's current version (0: no event since versions began) */
2459
+ version?: number;
2460
+ status: "CONFIRMED" | "CANCELLED";
2461
+ stayStatus: string;
2462
+ channel: {
2463
+ otaName: string;
2464
+ otaReservationCode: string;
2465
+ source: string;
2466
+ sourceGroup: string;
2467
+ };
2468
+ stay: {
2469
+ checkIn: string;
2470
+ checkOut: string;
2471
+ nights: number;
2472
+ dayUse: boolean;
2473
+ };
2474
+ guest: {
2475
+ fullName: string;
2476
+ firstName: string | null;
2477
+ lastName: string | null;
2478
+ phone?: string | null;
2479
+ email?: string | null;
2480
+ country: string | null;
2481
+ language: string | null;
2482
+ /** Present when phone and email are null because of a rule, not because the booking has none: "retention" = the stay checked out more than 30 days ago (API reads and webhooks alike, a recovered or redelivered event included); "unavailable" = an API read that could not be logged just now, ask again. Absent otherwise */
2483
+ contactWithheld?: "retention" | "unavailable";
2484
+ };
2485
+ guestNotes: string | null;
2486
+ occupancy: {
2487
+ adults: number;
2488
+ children: number;
2489
+ };
2490
+ rooms: Array<{
2491
+ roomTypeId: number;
2492
+ roomTypeName: string;
2493
+ ratePlanId?: number | null;
2494
+ mealPlan: "EP" | "CP" | "MAP" | "AP";
2495
+ adults: number;
2496
+ children: number;
2497
+ checkIn: string;
2498
+ checkOut: string;
2499
+ nights: number;
2500
+ dayUse: boolean;
2501
+ ratePerNight: number;
2502
+ amount: number;
2503
+ status: string;
2504
+ }>;
2505
+ amounts: {
2506
+ currency: string;
2507
+ total: number;
2508
+ paid: number;
2509
+ balanceDue: number;
2510
+ paymentCollect: "ota" | "property" | "unknown";
2511
+ /** ISO 4217. Present only when the OTA sent the booking in another currency than the property's: the amounts in this booking (total, paid, balanceDue, each room's ratePerNight and amount) are then in THIS currency as the OTA sent them, not converted. Absent otherwise */
2512
+ receivedCurrency?: string;
2513
+ };
2514
+ finance: {
2515
+ otaName: string;
2516
+ amountBasis: string;
2517
+ currency: string | null;
2518
+ grossAmount: number | null;
2519
+ commissionAmount: number | null;
2520
+ taxAmount: number | null;
2521
+ netPayoutAmount: number | null;
2522
+ /** The OTA's own fee on top of its commission, where it sent one; null when it named none. Informational: netPayoutAmount is gross minus commission and does not subtract it */
2523
+ feeAmount?: number | null;
2524
+ /** How the guest pays, in the OTA's own word (for example "credit_card"); null when the OTA sent none. A label only */
2525
+ paymentType?: string | null;
2526
+ /** true when the OTA pays the property with a virtual card it issues: the guest does not pay the desk for the room. true or false only; the card itself is never sent */
2527
+ virtualCard?: boolean;
2528
+ } | null;
2529
+ /** The hotel's own tax lines on this booking. Present only where the hotel has confirmed its taxes (outside India) and the booking has been assessed; absent on every other booking */
2530
+ taxes?: {
2531
+ lines: Array<{
2532
+ code: string;
2533
+ name: string;
2534
+ kind: "TAX" | "FEE" | "PASS_THROUGH";
2535
+ includedInRate: boolean;
2536
+ amount: number;
2537
+ }>;
2538
+ includedInRates: number;
2539
+ addedToTotal: number;
2540
+ };
2541
+ cancellation: {
2542
+ at: string;
2543
+ reason: string | null;
2544
+ } | null;
2545
+ createdAt: string;
2546
+ updatedAt: string;
2547
+ };
2548
+ refund: {
2549
+ /** The refund this call asked for; null on a replay */
2550
+ requested: "policy" | "full" | "none" | null;
2551
+ /** What the guest gets back, in currency's major units (1998.5 = ₹1,998.50); 0 when nothing is owed */
2552
+ amount: number;
2553
+ /** ISO 4217, the property's currency */
2554
+ currency: string;
2555
+ /** NONE: nothing owed. PROCESSED: the payment gateway accepted the refund. PENDING: the refund is recorded and on its way (the gateway is processing it, or ZimmerStack issues it by hand). MANUAL: money is owed but there is no online payment to refund against; the hotel settles it. */
2556
+ status: "NONE" | "PENDING" | "PROCESSED" | "MANUAL";
2557
+ };
2558
+ /** true: the booking was already cancelled; nothing changed and no money moved */
2559
+ replay: boolean;
2560
+ }
2561
+ export interface SandboxBooking {
2562
+ /** The PMS booking id, the one the webhook carries */
2563
+ bookingId: number;
1123
2564
  /** The booking reference, SBX-… — the webhook's booking.reference */
1124
2565
  reference: string;
1125
2566
  /** The pretend channel-side id */
@@ -1142,9 +2583,11 @@ export interface SandboxBooking {
1142
2583
  /** true when a night had no sandbox availability left — the booking lands anyway, as an OTA booking would */
1143
2584
  oversold: boolean;
1144
2585
  createdAt: string;
2586
+ /** On a no-show simulation: the stay's own state after it, NOSHOW or UPCOMING. status above stays UPCOMING for a no-show, because the booking is not cancelled */
2587
+ stayStatus?: string;
1145
2588
  /** What this call put on the wire for the sandbox's webhook endpoints */
1146
2589
  webhook: {
1147
- eventType: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled" | "direct.booking.created" | "direct.booking.cancelled";
2590
+ eventType: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled" | "direct.booking.created" | "direct.booking.modified" | "direct.booking.cancelled";
1148
2591
  /** The event is in the outbox; every active endpoint on the sandbox receives it within seconds */
1149
2592
  queued: boolean;
1150
2593
  };
@@ -1152,37 +2595,881 @@ export interface SandboxBooking {
1152
2595
  export interface SandboxBookingsList {
1153
2596
  /** Simulated bookings on the sandbox (OTA and website), newest first */
1154
2597
  bookings: Array<{
1155
- /** The PMS booking id, the one the webhook carries */
2598
+ /** The PMS booking id, the one the webhook carries */
2599
+ bookingId: number;
2600
+ /** The booking reference, SBX-… — the webhook's booking.reference */
2601
+ reference: string;
2602
+ /** The pretend channel-side id */
2603
+ channelBookingId: string;
2604
+ otaName: string;
2605
+ /** The stay's state. GET /channel-bookings reads the same booking as status CONFIRMED (or CANCELLED) with stayStatus UPCOMING */
2606
+ status: "UPCOMING" | "CANCELLED";
2607
+ guestName: string;
2608
+ checkIn: string;
2609
+ checkOut: string;
2610
+ nights: number;
2611
+ rooms: number;
2612
+ roomTypeId: number;
2613
+ /** 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 */
2614
+ nightlyRate: number;
2615
+ /** Major units: every night's price × rooms */
2616
+ total: number;
2617
+ currency: string;
2618
+ paidByOta: boolean;
2619
+ /** true when a night had no sandbox availability left — the booking lands anyway, as an OTA booking would */
2620
+ oversold: boolean;
2621
+ createdAt: string;
2622
+ /** On a no-show simulation: the stay's own state after it, NOSHOW or UPCOMING. status above stays UPCOMING for a no-show, because the booking is not cancelled */
2623
+ stayStatus?: string;
2624
+ /** What this call put on the wire for the sandbox's webhook endpoints */
2625
+ webhook: {
2626
+ eventType: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled" | "direct.booking.created" | "direct.booking.modified" | "direct.booking.cancelled";
2627
+ /** The event is in the outbox; every active endpoint on the sandbox receives it within seconds */
2628
+ queued: boolean;
2629
+ };
2630
+ }>;
2631
+ }
2632
+ export interface ConnectLink {
2633
+ /** The link's id: what the reads, the revoke and the webhook name it by. Never its token */
2634
+ id: string;
2635
+ propertyId: number;
2636
+ /** Our key of the booking site */
2637
+ channel: string;
2638
+ /** Its name as a person reads it */
2639
+ channelName: string;
2640
+ /** pending: made, not opened · opened: someone is on the page · completed: Start selling was pressed · expired: it ran out first · revoked: you withdrew it, or a newer link replaced it */
2641
+ status: "pending" | "opened" | "completed" | "expired" | "revoked";
2642
+ createdAt: string;
2643
+ /** The link opens until this instant */
2644
+ expiresAt: string;
2645
+ openedAt: string | null;
2646
+ /** When the page saved the connection (paused until Start selling) */
2647
+ connectedAt: string | null;
2648
+ completedAt: string | null;
2649
+ revokedAt: string | null;
2650
+ /** The connection, as GET /channels lists it, once the page saved one */
2651
+ channelId: string | null;
2652
+ reference: string | null;
2653
+ returnUrl: string | null;
2654
+ /** The company key that made the link: named on the hotel's activity log beside everything the link does */
2655
+ createdByKey: {
2656
+ id: number;
2657
+ name: string;
2658
+ maskedKey: string;
2659
+ };
2660
+ }
2661
+ export interface ConnectLinkList {
2662
+ items: Array<{
2663
+ /** The link's id: what the reads, the revoke and the webhook name it by. Never its token */
2664
+ id: string;
2665
+ propertyId: number;
2666
+ /** Our key of the booking site */
2667
+ channel: string;
2668
+ /** Its name as a person reads it */
2669
+ channelName: string;
2670
+ /** pending: made, not opened · opened: someone is on the page · completed: Start selling was pressed · expired: it ran out first · revoked: you withdrew it, or a newer link replaced it */
2671
+ status: "pending" | "opened" | "completed" | "expired" | "revoked";
2672
+ createdAt: string;
2673
+ /** The link opens until this instant */
2674
+ expiresAt: string;
2675
+ openedAt: string | null;
2676
+ /** When the page saved the connection (paused until Start selling) */
2677
+ connectedAt: string | null;
2678
+ completedAt: string | null;
2679
+ revokedAt: string | null;
2680
+ /** The connection, as GET /channels lists it, once the page saved one */
2681
+ channelId: string | null;
2682
+ reference: string | null;
2683
+ returnUrl: string | null;
2684
+ /** The company key that made the link: named on the hotel's activity log beside everything the link does */
2685
+ createdByKey: {
2686
+ id: number;
2687
+ name: string;
2688
+ maskedKey: string;
2689
+ };
2690
+ }>;
2691
+ }
2692
+ export interface ConnectLinkCreate {
2693
+ /** The hotel, by its id from GET /properties */
2694
+ propertyId: number;
2695
+ /** The booking site to connect: one link connects one */
2696
+ channel: "bookingcom" | "gommt" | "agoda" | "expedia" | "tripcom" | "yatra" | "hostelworld" | "airbnb";
2697
+ /** How long the link opens for, 1 to 168 hours; default 72 */
2698
+ expiresInHours?: number;
2699
+ /** Your own reference for this link; answered back by the reads, never shown to the hotel */
2700
+ reference?: string;
2701
+ /** Where the page offers to send the person when it is done (your own screen); https only */
2702
+ returnUrl?: string;
2703
+ }
2704
+ export interface ConnectLinkCreated {
2705
+ link: {
2706
+ /** The link's id: what the reads, the revoke and the webhook name it by. Never its token */
2707
+ id: string;
2708
+ propertyId: number;
2709
+ /** Our key of the booking site */
2710
+ channel: string;
2711
+ /** Its name as a person reads it */
2712
+ channelName: string;
2713
+ /** pending: made, not opened · opened: someone is on the page · completed: Start selling was pressed · expired: it ran out first · revoked: you withdrew it, or a newer link replaced it */
2714
+ status: "pending" | "opened" | "completed" | "expired" | "revoked";
2715
+ createdAt: string;
2716
+ /** The link opens until this instant */
2717
+ expiresAt: string;
2718
+ openedAt: string | null;
2719
+ /** When the page saved the connection (paused until Start selling) */
2720
+ connectedAt: string | null;
2721
+ completedAt: string | null;
2722
+ revokedAt: string | null;
2723
+ /** The connection, as GET /channels lists it, once the page saved one */
2724
+ channelId: string | null;
2725
+ reference: string | null;
2726
+ returnUrl: string | null;
2727
+ /** The company key that made the link: named on the hotel's activity log beside everything the link does */
2728
+ createdByKey: {
2729
+ id: number;
2730
+ name: string;
2731
+ maskedKey: string;
2732
+ };
2733
+ };
2734
+ /** The address to send to the hotel's own person. It opens ONCE and is in this answer only: we keep a hash of its token, never the token. null on a replay of the same request (X-Idempotent-Replay: true): we keep no copy to show again, so make a new link if the first answer was lost (it withdraws this one) */
2735
+ url: string | null;
2736
+ /** What the hotel does at the booking site before it opens the link (in its extranet or through its support), naming our connectivity partner as that booking site lists it. Send it to the hotel first, and the url once the hotel has done it; null where there is no such step (Airbnb) */
2737
+ hotelStep: string | null;
2738
+ /** Earlier links for this hotel and booking site that nobody had opened, withdrawn by this one */
2739
+ withdrawn: number;
2740
+ }
2741
+ export interface Readiness {
2742
+ propertyId: number;
2743
+ /** true: your software is already this hotel's source of truth; there is nothing to do */
2744
+ live: boolean;
2745
+ /** true: every check passed, so POST /go-live will switch it on (also true when live) */
2746
+ ready: boolean;
2747
+ /** The nights the checks looked at, in the hotel's calendar */
2748
+ nights: {
2749
+ from: string;
2750
+ to: string;
2751
+ count: number;
2752
+ };
2753
+ /** Which of the two ways nothing_stale passed: our record matches the channels, or your software sent the whole year first. null when it did not pass, or the hotel is already live */
2754
+ passedBy: "record_matches" | "full_year_sent" | null;
2755
+ checks: Array<{
2756
+ id: "channel_manager" | "catalog_linked" | "prices_hold" | "nothing_stale";
2757
+ passed: boolean;
2758
+ /** What we found, in a sentence */
2759
+ summary: string;
2760
+ /** What to do when it did not pass; null when it passed */
2761
+ action: string | null;
2762
+ /** The numbers behind the sentence */
2763
+ details?: Record<string, unknown>;
2764
+ }>;
2765
+ }
2766
+ export interface GoLiveResult {
2767
+ propertyId: number;
2768
+ live: true;
2769
+ /** true: the hotel was already live and nothing changed */
2770
+ replay: boolean;
2771
+ /** When this call switched it on; null on a replay */
2772
+ wentLiveAt: string | null;
2773
+ passedBy: "record_matches" | "full_year_sent" | null;
2774
+ /** What happens now, and what to send */
2775
+ next: Array<string>;
2776
+ }
2777
+ export interface HotelKey {
2778
+ id: number;
2779
+ propertyId: number;
2780
+ name: string;
2781
+ /** The key's first twelve characters: the only form it has after the answer that made it */
2782
+ maskedKey: string;
2783
+ mode: "live" | "test";
2784
+ status: "ACTIVE" | "REVOKED";
2785
+ scopes: Array<string>;
2786
+ allowedCidrs: Array<string>;
2787
+ createdAt: string;
2788
+ lastUsedAt: string | null;
2789
+ lastUsedIp: string | null;
2790
+ expiresAt: string | null;
2791
+ /** Set while a rotation's overlap runs: this key stops answering at this instant */
2792
+ retireAt: string | null;
2793
+ /** The key that replaced this one */
2794
+ rotatedToId: number | null;
2795
+ revokedAt: string | null;
2796
+ revokedReason: string | null;
2797
+ }
2798
+ export interface HotelKeyList {
2799
+ items: Array<{
2800
+ id: number;
2801
+ propertyId: number;
2802
+ name: string;
2803
+ /** The key's first twelve characters: the only form it has after the answer that made it */
2804
+ maskedKey: string;
2805
+ mode: "live" | "test";
2806
+ status: "ACTIVE" | "REVOKED";
2807
+ scopes: Array<string>;
2808
+ allowedCidrs: Array<string>;
2809
+ createdAt: string;
2810
+ lastUsedAt: string | null;
2811
+ lastUsedIp: string | null;
2812
+ expiresAt: string | null;
2813
+ /** Set while a rotation's overlap runs: this key stops answering at this instant */
2814
+ retireAt: string | null;
2815
+ /** The key that replaced this one */
2816
+ rotatedToId: number | null;
2817
+ revokedAt: string | null;
2818
+ revokedReason: string | null;
2819
+ }>;
2820
+ /** The most active keys one hotel may hold, its owner's own included */
2821
+ limit: number;
2822
+ }
2823
+ export interface HotelKeyCreate {
2824
+ /** Your label for the key, shown to the hotel's owner too */
2825
+ name: string;
2826
+ /** What the key may do: any scope a hotel's own key may hold. Never a company key's own scopes */
2827
+ scopes: Array<string>;
2828
+ /** Addresses the key may be used from (IPv4 or IPv6, bare or CIDR); empty or absent: any address */
2829
+ allowedCidrs?: Array<string>;
2830
+ /** Optional end of life: a date (YYYY-MM-DD) or an ISO instant, at most two years away */
2831
+ expiresAt?: string;
2832
+ }
2833
+ export interface HotelKeyCreated {
2834
+ /** The secret. Shown in this answer only: store it now. We keep its hash. null on a replay of the same request (X-Idempotent-Replay: true): we keep no copy to show again, so rotate the key if the first answer was lost */
2835
+ key: string | null;
2836
+ view: {
2837
+ id: number;
2838
+ propertyId: number;
2839
+ name: string;
2840
+ /** The key's first twelve characters: the only form it has after the answer that made it */
2841
+ maskedKey: string;
2842
+ mode: "live" | "test";
2843
+ status: "ACTIVE" | "REVOKED";
2844
+ scopes: Array<string>;
2845
+ allowedCidrs: Array<string>;
2846
+ createdAt: string;
2847
+ lastUsedAt: string | null;
2848
+ lastUsedIp: string | null;
2849
+ expiresAt: string | null;
2850
+ /** Set while a rotation's overlap runs: this key stops answering at this instant */
2851
+ retireAt: string | null;
2852
+ /** The key that replaced this one */
2853
+ rotatedToId: number | null;
2854
+ revokedAt: string | null;
2855
+ revokedReason: string | null;
2856
+ };
2857
+ }
2858
+ export interface HotelKeyRotated {
2859
+ /** The new secret. Shown in this answer only. null on a replay of the same request (X-Idempotent-Replay: true): we keep no copy to show again, so revoke the new key and mint one if the first answer was lost */
2860
+ key: string | null;
2861
+ /** The new key */
2862
+ view: {
2863
+ id: number;
2864
+ propertyId: number;
2865
+ name: string;
2866
+ /** The key's first twelve characters: the only form it has after the answer that made it */
2867
+ maskedKey: string;
2868
+ mode: "live" | "test";
2869
+ status: "ACTIVE" | "REVOKED";
2870
+ scopes: Array<string>;
2871
+ allowedCidrs: Array<string>;
2872
+ createdAt: string;
2873
+ lastUsedAt: string | null;
2874
+ lastUsedIp: string | null;
2875
+ expiresAt: string | null;
2876
+ /** Set while a rotation's overlap runs: this key stops answering at this instant */
2877
+ retireAt: string | null;
2878
+ /** The key that replaced this one */
2879
+ rotatedToId: number | null;
2880
+ revokedAt: string | null;
2881
+ revokedReason: string | null;
2882
+ };
2883
+ /** The key it replaces: it keeps answering until retireAt, 24 hours on */
2884
+ retired: {
2885
+ id: number;
2886
+ propertyId: number;
2887
+ name: string;
2888
+ /** The key's first twelve characters: the only form it has after the answer that made it */
2889
+ maskedKey: string;
2890
+ mode: "live" | "test";
2891
+ status: "ACTIVE" | "REVOKED";
2892
+ scopes: Array<string>;
2893
+ allowedCidrs: Array<string>;
2894
+ createdAt: string;
2895
+ lastUsedAt: string | null;
2896
+ lastUsedIp: string | null;
2897
+ expiresAt: string | null;
2898
+ /** Set while a rotation's overlap runs: this key stops answering at this instant */
2899
+ retireAt: string | null;
2900
+ /** The key that replaced this one */
2901
+ rotatedToId: number | null;
2902
+ revokedAt: string | null;
2903
+ revokedReason: string | null;
2904
+ };
2905
+ }
2906
+ export interface HotelKeyRevoke {
2907
+ /** Why, 3 to 500 characters: it is written on the key and on the hotel's activity log */
2908
+ reason: string;
2909
+ }
2910
+ export interface WriteNotice {
2911
+ /** Stable: branch on it. A code you do not know is a notice added later; show its message */
2912
+ code: "NOT_SOURCE_OF_TRUTH" | "ROOM_TYPE_NOT_LINKED" | "PLAN_NOT_LINKED" | "PLAN_NOT_MAPPED" | "ROOM_STILL_ON_SALE" | "OTA_LINKED_RATES_NOT_REACHED" | "STAY_RULES_FROM_ANOTHER_PLAN" | "PER_OTA_PLANS_FOLLOW" | "PER_OTA_PLAN_FOLLOWS_PARENT" | "VALUE_HELD" | "COUNT_WAS_REFUSED" | "COUNT_ZERO_IS_NOT_STOP_SELL" | "STOP_SELL_IS_NOT_A_COUNT" | "COUNT_OPEN_BUT_PLANS_STOPPED" | "NEW_DATES_OPEN_CLOSED" | "FAR_NIGHTS_NEED_A_COUNT" | "ENGINE_WILL_REPRICE" | "ENGINE_WILL_RECOUNT" | "DRIFT_REPAIR_OFF";
2913
+ /** warning: our record shows what you sent does not do the whole job (something still sells, nothing is sent, a rule will undo it) · info: how it works, said so the next surprise is not one */
2914
+ level: "warning" | "info";
2915
+ /** What is going on, in a sentence a person can read; may change, do not branch on it */
2916
+ message: string;
2917
+ /** What to do about it, naming the call */
2918
+ action: string;
2919
+ /** The room type it is about */
2920
+ roomTypeId?: number;
2921
+ /** The rate plans it is about (the ones you wrote) */
2922
+ ratePlanIds?: Array<number>;
2923
+ /** Other plans it names: the ones still selling, the plan that carries the star, the per-OTA plans */
2924
+ otherRatePlanIds?: Array<number>;
2925
+ /** The connected channels it is about */
2926
+ channels?: Array<{
2927
+ channelId: string;
2928
+ /** BookingCom, Expedia, Agoda, Goibibo, AirBNB, … */
2929
+ kind: string;
2930
+ }>;
2931
+ /** The first night it is about */
2932
+ dateFrom?: string;
2933
+ /** The last night it is about */
2934
+ dateTo?: string;
2935
+ /** How many nights between dateFrom and dateTo it is about (they need not be consecutive) */
2936
+ nights?: number;
2937
+ }
2938
+ export interface WritePreview {
2939
+ /** Nothing was written, queued or stored: this is what the same request would do without dryRun */
2940
+ dryRun: true;
2941
+ resource: "availability" | "rates" | "restrictions";
2942
+ /** would-write: a real request answers 202 and writes wouldChangeCells · nothing-to-write: a real request answers 202 and writes nothing · would-refuse: a real request is refused as refusal says */
2943
+ verdict: "would-write" | "nothing-to-write" | "would-refuse";
2944
+ /** The refusal a real request would get now, when verdict is would-refuse; null otherwise */
2945
+ refusal: {
2946
+ /** The HTTP status the real request would get */
2947
+ status: number;
2948
+ /** Its data.code */
2949
+ code: string;
2950
+ message: string;
2951
+ /** On RATE_LIMITED: the budget that would refuse */
2952
+ scope?: string;
2953
+ retryAfterSeconds?: number;
2954
+ } | null;
2955
+ /** Distinct cells after per-request coalescing (last write wins) */
2956
+ requestedCells: number;
2957
+ /** Cells that would be written and sent: what a real request counts against the hour and day budgets */
2958
+ wouldChangeCells: number;
2959
+ /** Cells our record and the channel manager already hold: nothing would be written or sent */
2960
+ unchangedCells: number;
2961
+ /** Cells whose value the channel manager refused before: held, not sent again */
2962
+ heldCells: number;
2963
+ /** Cells our record would refuse (wouldReject says why) */
2964
+ wouldRejectCells: number;
2965
+ /** true when a real request would be taken through the safety lane: the integration is paused or over a budget and this request only closes inventory (§6.6) */
2966
+ lane: boolean;
2967
+ /** The ranges that would be written, with the value sent. At most 50 */
2968
+ wouldChange: Array<{
2969
+ /** The room types this range is about (PUT /availability) */
2970
+ roomTypeIds?: Array<number>;
2971
+ /** The rate plans this range is about (PUT /rates, PUT /restrictions) */
2972
+ ratePlanIds?: Array<number>;
2973
+ /** Hotel-local calendar date, YYYY-MM-DD */
2974
+ dateFrom: string;
2975
+ /** Hotel-local calendar date, YYYY-MM-DD */
2976
+ dateTo: string;
2977
+ /** The weekdays of the range it covers; null = every night of it */
2978
+ days: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su"> | null;
2979
+ /** Cells in this range (entities × nights) */
2980
+ cells: number;
2981
+ /** The count sent */
2982
+ available?: number;
2983
+ /** The price sent, as it would be kept: major units, the currency's own decimals */
2984
+ rate?: string;
2985
+ /** The same price in hundredths of the major unit */
2986
+ rateMinor?: number;
2987
+ stopSell?: boolean;
2988
+ closedToArrival?: boolean;
2989
+ closedToDeparture?: boolean;
2990
+ minStayArrival?: number;
2991
+ minStayThrough?: number;
2992
+ maxStay?: number;
2993
+ /** On a held range: the channel manager's own words for the refusal */
2994
+ reason?: string;
2995
+ }>;
2996
+ /** Ranges left out of wouldChange past the cap */
2997
+ wouldChangeOmitted?: number;
2998
+ /** The ranges already held. At most 50 */
2999
+ unchanged: Array<{
3000
+ /** The room types this range is about (PUT /availability) */
3001
+ roomTypeIds?: Array<number>;
3002
+ /** The rate plans this range is about (PUT /rates, PUT /restrictions) */
3003
+ ratePlanIds?: Array<number>;
3004
+ /** Hotel-local calendar date, YYYY-MM-DD */
3005
+ dateFrom: string;
3006
+ /** Hotel-local calendar date, YYYY-MM-DD */
3007
+ dateTo: string;
3008
+ /** The weekdays of the range it covers; null = every night of it */
3009
+ days: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su"> | null;
3010
+ /** Cells in this range (entities × nights) */
3011
+ cells: number;
3012
+ /** The count sent */
3013
+ available?: number;
3014
+ /** The price sent, as it would be kept: major units, the currency's own decimals */
3015
+ rate?: string;
3016
+ /** The same price in hundredths of the major unit */
3017
+ rateMinor?: number;
3018
+ stopSell?: boolean;
3019
+ closedToArrival?: boolean;
3020
+ closedToDeparture?: boolean;
3021
+ minStayArrival?: number;
3022
+ minStayThrough?: number;
3023
+ maxStay?: number;
3024
+ /** On a held range: the channel manager's own words for the refusal */
3025
+ reason?: string;
3026
+ }>;
3027
+ unchangedOmitted?: number;
3028
+ /** The ranges held after a refusal, each with the channel manager's words. At most 50 */
3029
+ held: Array<{
3030
+ /** The room types this range is about (PUT /availability) */
3031
+ roomTypeIds?: Array<number>;
3032
+ /** The rate plans this range is about (PUT /rates, PUT /restrictions) */
3033
+ ratePlanIds?: Array<number>;
3034
+ /** Hotel-local calendar date, YYYY-MM-DD */
3035
+ dateFrom: string;
3036
+ /** Hotel-local calendar date, YYYY-MM-DD */
3037
+ dateTo: string;
3038
+ /** The weekdays of the range it covers; null = every night of it */
3039
+ days: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su"> | null;
3040
+ /** Cells in this range (entities × nights) */
3041
+ cells: number;
3042
+ /** The count sent */
3043
+ available?: number;
3044
+ /** The price sent, as it would be kept: major units, the currency's own decimals */
3045
+ rate?: string;
3046
+ /** The same price in hundredths of the major unit */
3047
+ rateMinor?: number;
3048
+ stopSell?: boolean;
3049
+ closedToArrival?: boolean;
3050
+ closedToDeparture?: boolean;
3051
+ minStayArrival?: number;
3052
+ minStayThrough?: number;
3053
+ maxStay?: number;
3054
+ /** On a held range: the channel manager's own words for the refusal */
3055
+ reason?: string;
3056
+ }>;
3057
+ heldOmitted?: number;
3058
+ /** Groups our record would refuse, as far as it can be told without writing: a policy that forbids a plan price, a count above the rooms free. A real write can still refuse a group for a reason only the write meets; it is then in its rejected list */
3059
+ wouldReject: Array<{
3060
+ cells: number;
3061
+ error: string;
3062
+ }>;
3063
+ /** Accepted, but worth a look: an availability above the room type's room count (an oversell the channels will sell). Absent when there is nothing to say */
3064
+ warnings?: Array<{
3065
+ roomTypeId: number;
3066
+ /** Rooms of this type in our record */
3067
+ units: number;
3068
+ /** The highest count this request set for it */
3069
+ requested: number;
3070
+ message: string;
3071
+ }>;
3072
+ /** Accepted, but far outside the plan's standing price, on a property whose price band only warns (§6.6). At most 20; absent when there is nothing to say */
3073
+ priceWarnings?: Array<{
3074
+ ratePlanId: number;
3075
+ /** Hotel-local calendar date, YYYY-MM-DD */
3076
+ date: string;
3077
+ /** The price this request set, in hundredths of the major unit */
3078
+ rateMinor: number;
3079
+ /** The plan's standing price, in hundredths of the major unit */
3080
+ standingMinor: number;
3081
+ /** The same price in major units, as a decimal string ("4500.50") */
3082
+ rate?: string;
3083
+ /** The plan's standing price in major units, as a decimal string */
3084
+ standing?: string;
3085
+ message: string;
3086
+ }>;
3087
+ /** Prices that would not be kept exactly as sent (§2.10) */
3088
+ rounded?: Array<{
3089
+ /** Where in the request the amount sat, for example "updates[3].rate" */
3090
+ field: string;
3091
+ /** The amount as it was sent */
3092
+ sent: string;
3093
+ /** The amount as it is kept, in major units with the currency's own decimals */
3094
+ kept: string;
3095
+ /** Why, in a sentence; may change, do not branch on it */
3096
+ reason: string;
3097
+ }>;
3098
+ roundedCount?: number;
3099
+ /** What this write did not do, or will not go on doing, one plain sentence each with a stable code and what to do (§2.20). Warnings first. At most 20; absent when there is nothing to say */
3100
+ notices?: Array<{
3101
+ /** Stable: branch on it. A code you do not know is a notice added later; show its message */
3102
+ code: "NOT_SOURCE_OF_TRUTH" | "ROOM_TYPE_NOT_LINKED" | "PLAN_NOT_LINKED" | "PLAN_NOT_MAPPED" | "ROOM_STILL_ON_SALE" | "OTA_LINKED_RATES_NOT_REACHED" | "STAY_RULES_FROM_ANOTHER_PLAN" | "PER_OTA_PLANS_FOLLOW" | "PER_OTA_PLAN_FOLLOWS_PARENT" | "VALUE_HELD" | "COUNT_WAS_REFUSED" | "COUNT_ZERO_IS_NOT_STOP_SELL" | "STOP_SELL_IS_NOT_A_COUNT" | "COUNT_OPEN_BUT_PLANS_STOPPED" | "NEW_DATES_OPEN_CLOSED" | "FAR_NIGHTS_NEED_A_COUNT" | "ENGINE_WILL_REPRICE" | "ENGINE_WILL_RECOUNT" | "DRIFT_REPAIR_OFF";
3103
+ /** warning: our record shows what you sent does not do the whole job (something still sells, nothing is sent, a rule will undo it) · info: how it works, said so the next surprise is not one */
3104
+ level: "warning" | "info";
3105
+ /** What is going on, in a sentence a person can read; may change, do not branch on it */
3106
+ message: string;
3107
+ /** What to do about it, naming the call */
3108
+ action: string;
3109
+ /** The room type it is about */
3110
+ roomTypeId?: number;
3111
+ /** The rate plans it is about (the ones you wrote) */
3112
+ ratePlanIds?: Array<number>;
3113
+ /** Other plans it names: the ones still selling, the plan that carries the star, the per-OTA plans */
3114
+ otherRatePlanIds?: Array<number>;
3115
+ /** The connected channels it is about */
3116
+ channels?: Array<{
3117
+ channelId: string;
3118
+ /** BookingCom, Expedia, Agoda, Goibibo, AirBNB, … */
3119
+ kind: string;
3120
+ }>;
3121
+ /** The first night it is about */
3122
+ dateFrom?: string;
3123
+ /** The last night it is about */
3124
+ dateTo?: string;
3125
+ /** How many nights between dateFrom and dateTo it is about (they need not be consecutive) */
3126
+ nights?: number;
3127
+ }>;
3128
+ /** How many more notices there were past the 20 listed; present only when some were left out */
3129
+ noticesOmitted?: number;
3130
+ /** What this dry run cost. It also counted as one request and one write on the key and the property */
3131
+ spent: {
3132
+ /** Cells this dry run was charged against the property's cells-per-minute budget: the same as the write it previews */
3133
+ cells: number;
3134
+ };
3135
+ wouldSpend: {
3136
+ /** Changed cells a real request would count against the hour and day budgets; a dry run counts none */
3137
+ changedCells: number;
3138
+ };
3139
+ note: string;
3140
+ }
3141
+ export interface CloseRoomType {
3142
+ /** ZimmerStack room type id (GET /catalog) */
3143
+ roomTypeId: number;
3144
+ /** Hotel-local calendar date, YYYY-MM-DD */
3145
+ dateFrom: string;
3146
+ /** Hotel-local calendar date, YYYY-MM-DD */
3147
+ dateTo: string;
3148
+ /** Omitted or empty = every night of the range */
3149
+ days?: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su">;
3150
+ /** true: answer what the action would do, and do nothing */
3151
+ dryRun?: boolean;
3152
+ }
3153
+ export interface ReopenRoomType {
3154
+ /** ZimmerStack room type id (GET /catalog) */
3155
+ roomTypeId: number;
3156
+ /** Hotel-local calendar date, YYYY-MM-DD */
3157
+ dateFrom: string;
3158
+ /** Hotel-local calendar date, YYYY-MM-DD */
3159
+ dateTo: string;
3160
+ /** Omitted or empty = every night of the range */
3161
+ days?: Array<"mo" | "tu" | "we" | "th" | "fr" | "sa" | "su">;
3162
+ /** true: answer what the action would do, and do nothing */
3163
+ dryRun?: boolean;
3164
+ /** The count to put on sale on each reopened night. Omit it to put back the count each night held before the close; a night whose count was changed since is left as it is */
3165
+ available?: number;
3166
+ }
3167
+ export interface CloseResult {
3168
+ action: "close" | "reopen";
3169
+ /** true: nothing was done; this is what the action would do */
3170
+ dryRun: boolean;
3171
+ roomTypeId: number;
3172
+ /** Hotel-local calendar date, YYYY-MM-DD */
3173
+ dateFrom: string;
3174
+ /** Hotel-local calendar date, YYYY-MM-DD */
3175
+ dateTo: string;
3176
+ /** Nights the request named */
3177
+ nights: number;
3178
+ /** The room type's count: the one thing every rate of the room shares, on every channel */
3179
+ count: {
3180
+ /** close: nights whose count was set to 0 · reopen: nights whose count was put back or set */
3181
+ changedNights: number;
3182
+ /** close: nights already at 0 on our record and on the channel manager · reopen: nights whose count was left as it is */
3183
+ unchangedNights: number;
3184
+ };
3185
+ /** Every rate plan of the room type, each with what was done to it */
3186
+ ratePlans: Array<{
3187
+ ratePlanId: number;
3188
+ name: string;
3189
+ /** close: nights stop-sell was switched on · reopen: nights it was lifted */
3190
+ changedNights: number;
3191
+ /** close: nights it was already on · reopen: nights left stopped because they were stopped before the close */
3192
+ unchangedNights: number;
3193
+ /** Per-OTA plans of this plan that take its stop-sell on the channel manager by themselves */
3194
+ perOtaPlans: number;
3195
+ }>;
3196
+ /** What the action could not reach or did not touch, and why. Read it: a close that reads done here can still leave something selling */
3197
+ notReached: Array<{
3198
+ what: "room-type" | "rate-plan" | "ota-linked-rates" | "hotel";
3199
+ ratePlanId?: number;
3200
+ reason: "not-linked" | "not-mapped" | "not-ours" | "not-source-of-truth" | "no-count-before" | "changed-since" | "refused";
3201
+ message: string;
3202
+ }>;
3203
+ /** reopen: nights of the range that POST /availability/close had not closed. They were left alone. Always 0 on a close */
3204
+ skippedNights: number;
3205
+ /** The writes this action made, to watch land with GET /batches/{batchId}. Empty on a dry run and when nothing had to change */
3206
+ batches: Array<{
3207
+ resource: "availability" | "restrictions";
3208
+ batchId: string;
3209
+ poll: string;
3210
+ }>;
3211
+ /** true when the close was taken through the safety lane: the integration is paused or over a budget (§6.6). A close always may; a reopen never does */
3212
+ lane?: boolean;
3213
+ }
3214
+ export interface Explain {
3215
+ /** When this was read (ISO 8601, UTC). Everything here is our record: no call was made to the channel manager */
3216
+ asOf: string;
3217
+ propertyId: number;
3218
+ /** Hotel-local calendar date, YYYY-MM-DD */
3219
+ date: string;
3220
+ sandbox: boolean;
3221
+ /** Our record is what the channels are sent; false = nothing written here reaches a channel */
3222
+ sourceOfTruth: boolean;
3223
+ /** What is going on, in plain sentences, most important first. For a person; do not parse */
3224
+ summary: Array<string>;
3225
+ roomType: {
3226
+ id: number;
3227
+ name: string;
3228
+ linked: boolean;
3229
+ };
3230
+ count: {
3231
+ /** null: not found in the writes we looked through (searched says how far) */
3232
+ lastSent: {
3233
+ /** When your software sent it (ISO 8601, UTC) */
3234
+ at: string;
3235
+ /** The batch that carried it: GET /batches/{batchId} */
3236
+ batchId: string;
3237
+ /** The key it was sent with */
3238
+ keyId: number | null;
3239
+ available: number;
3240
+ } | null;
3241
+ record: {
3242
+ /** The count our record holds; null = none */
3243
+ available: number | null;
3244
+ /** software: your integration, through this API · person: someone on a ZimmerStack screen · engine: the hotel's pricing engine or its standing price · seed: copied from the channel manager when the hotel was set up, nobody's choice · policy: a rule of the hotel (new dates open closed) · channel: the channel manager's own number after an OTA booking or cancellation · nobody: we hold no value · unknown: set by hand, and we cannot tell by whom */
3245
+ setBy: "software" | "person" | "engine" | "seed" | "policy" | "channel" | "nobody" | "unknown";
3246
+ setAt: string | null;
3247
+ /** true: the count differs from what your software last sent, because something moved it after (an OTA booking or cancellation the hotel follows, a person, a rule) */
3248
+ movedSince: boolean;
3249
+ };
3250
+ channelManager: {
3251
+ available: number | null;
3252
+ /** null = never read: we do not know what it holds */
3253
+ seenAt: string | null;
3254
+ /** push: it took a count we sent · delta: it moved by one with a booking or cancellation · pull: we read it back */
3255
+ how: "push" | "delta" | "pull" | null;
3256
+ };
3257
+ inSync: boolean | null;
3258
+ /** A send of this night's count is waiting */
3259
+ queued: boolean;
3260
+ /** The sends of this night's count we still hold, newest first: the hotel's last inventory events that named it, and every refused or logged send */
3261
+ pushes: Array<{
3262
+ at: string;
3263
+ /** What made the send: OVERRIDE_SET (a count somebody set, your software included), a booking, a cancellation, a sweep… */
3264
+ cause: string;
3265
+ /** Who caused it: an account of the hotel (your software writes as the hotel's owner), the channel manager's own movement, or a job of ours */
3266
+ by: "software-or-person" | "channel" | "system";
3267
+ /** The booking behind it, when there is one */
3268
+ bookingId: number | null;
3269
+ /** The count sent; null when the log does not hold it */
3270
+ value: number | null;
3271
+ /** sent: the channel manager took it · refused: it answered and refused the value (words) · failed: the call failed and is retried · queued: not sent yet · not-needed: nothing had to be sent (the channel manager had moved its own number, or the value was the same) · partly-sent: some nights of that send landed */
3272
+ outcome: "sent" | "refused" | "failed" | "queued" | "not-needed" | "partly-sent";
3273
+ /** The channel manager's own words, on a refusal or a failure */
3274
+ words: string | null;
3275
+ }>;
3276
+ /** Set when POST /availability/close closed this night and it has not been reopened */
3277
+ closed: {
3278
+ at: string;
3279
+ countBefore: number | null;
3280
+ stopSellPlanIds: Array<number>;
3281
+ } | null;
3282
+ };
3283
+ /** The bookings that hold or held a room of this type on this night. Ids and times only: never a guest's name, phone or email */
3284
+ bookings: Array<{
1156
3285
  bookingId: number;
1157
- /** The booking reference, SBX-… — the webhook's booking.reference */
1158
- reference: string;
1159
- /** The pretend channel-side id */
1160
- channelBookingId: string;
1161
- otaName: string;
1162
- /** The stay's state. GET /channel-bookings reads the same booking as status CONFIRMED (or CANCELLED) with stayStatus UPCOMING */
1163
- status: "UPCOMING" | "CANCELLED";
1164
- guestName: string;
1165
- checkIn: string;
1166
- checkOut: string;
1167
- nights: number;
1168
- rooms: number;
1169
- roomTypeId: number;
1170
- /** 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 */
1171
- nightlyRate: number;
1172
- /** Major units: every night's price × rooms */
1173
- total: number;
1174
- currency: string;
1175
- paidByOta: boolean;
1176
- /** true when a night had no sandbox availability left — the booking lands anyway, as an OTA booking would */
1177
- oversold: boolean;
1178
- createdAt: string;
1179
- /** What this call put on the wire for the sandbox's webhook endpoints */
1180
- webhook: {
1181
- eventType: "channel.booking.created" | "channel.booking.modified" | "channel.booking.cancelled" | "direct.booking.created" | "direct.booking.cancelled";
1182
- /** The event is in the outbox; every active endpoint on the sandbox receives it within seconds */
1183
- queued: boolean;
3286
+ /** The OTA, or null for a booking made at the hotel or on its website */
3287
+ channel: string | null;
3288
+ status: "CONFIRMED" | "CANCELLED";
3289
+ bookedAt: string;
3290
+ cancelledAt: string | null;
3291
+ /** What each change of this booking did to the count, as the inventory log recorded it */
3292
+ moves: Array<{
3293
+ at: string;
3294
+ cause: string;
3295
+ outcome: string;
3296
+ }>;
3297
+ }>;
3298
+ /** The plan asked for, or every plan of the room type */
3299
+ plans: Array<{
3300
+ ratePlanId: number;
3301
+ name: string;
3302
+ /** The plan exists on the channel manager; false = nothing is sent for it */
3303
+ linked: boolean;
3304
+ price: {
3305
+ /** null: not found in the writes we looked through (searched says how far) */
3306
+ lastSent: {
3307
+ /** When your software sent it (ISO 8601, UTC) */
3308
+ at: string;
3309
+ /** The batch that carried it: GET /batches/{batchId} */
3310
+ batchId: string;
3311
+ /** The key it was sent with */
3312
+ keyId: number | null;
3313
+ rate: string;
3314
+ rateMinor: number;
3315
+ } | null;
3316
+ record: {
3317
+ /** The price our record holds, major units; null = none of its own */
3318
+ rate: string | null;
3319
+ rateMinor: number | null;
3320
+ /** The layer the price comes from: MANUAL (set by software or a person) · SEED (copied from the channel manager at set-up) · ENGINE · PLAN_DEFAULT · … */
3321
+ source: string | null;
3322
+ /** software: your integration, through this API · person: someone on a ZimmerStack screen · engine: the hotel's pricing engine or its standing price · seed: copied from the channel manager when the hotel was set up, nobody's choice · policy: a rule of the hotel (new dates open closed) · channel: the channel manager's own number after an OTA booking or cancellation · nobody: we hold no value · unknown: set by hand, and we cannot tell by whom */
3323
+ setBy: "software" | "person" | "engine" | "seed" | "policy" | "channel" | "nobody" | "unknown";
3324
+ };
3325
+ channelManager: {
3326
+ rate: string | null;
3327
+ rateMinor: number | null;
3328
+ /** When we last saw what it holds: a nightly read, or a send it took. null = never: we do not know what it holds */
3329
+ seenAt: string | null;
3330
+ };
3331
+ /** Our record and the channel manager's copy agree; null when one of them is not known */
3332
+ inSync: boolean | null;
3333
+ };
3334
+ stayRules: {
3335
+ lastSent: {
3336
+ /** When your software sent it (ISO 8601, UTC) */
3337
+ at: string;
3338
+ /** The batch that carried it: GET /batches/{batchId} */
3339
+ batchId: string;
3340
+ /** The key it was sent with */
3341
+ keyId: number | null;
3342
+ values: {
3343
+ stopSell?: boolean | null;
3344
+ closedToArrival?: boolean | null;
3345
+ closedToDeparture?: boolean | null;
3346
+ minStayArrival?: number | null;
3347
+ minStayThrough?: number | null;
3348
+ maxStay?: number | null;
3349
+ };
3350
+ } | null;
3351
+ record: {
3352
+ stopSell: boolean | null;
3353
+ closedToArrival: boolean | null;
3354
+ closedToDeparture: boolean | null;
3355
+ minStayArrival: number | null;
3356
+ minStayThrough: number | null;
3357
+ maxStay: number | null;
3358
+ /** Who the stop-sell in our record came from */
3359
+ stopSellSetBy: "software" | "person" | "engine" | "seed" | "policy" | "channel" | "nobody" | "unknown";
3360
+ };
3361
+ channelManager: {
3362
+ stopSell: boolean | null;
3363
+ closedToArrival: boolean | null;
3364
+ closedToDeparture: boolean | null;
3365
+ minStayArrival: number | null;
3366
+ minStayThrough: number | null;
3367
+ maxStay: number | null;
3368
+ seenAt: string | null;
3369
+ };
3370
+ inSync: boolean | null;
3371
+ };
3372
+ /** We keep the last send of a price or stay rule, not every one */
3373
+ send: {
3374
+ /** When a price or stay rule of this night last reached the channel manager */
3375
+ lastLandedAt: string | null;
3376
+ /** A change is waiting to be sent since then; null = nothing waits */
3377
+ queuedSince: string | null;
3378
+ /** The value of this night the channel manager refused: held, not sent again until you send another value */
3379
+ held: {
3380
+ since: string;
3381
+ /** The channel manager's own words */
3382
+ words: string;
3383
+ /** Daily retries made so far, of three */
3384
+ retries: number;
3385
+ } | null;
3386
+ /** Nights running the nightly repair has sent this night again because the channel manager held another value; null = it is not being repaired */
3387
+ driftResends: number | null;
3388
+ };
3389
+ family: {
3390
+ /** The plan this one is a per-OTA plan of; null for an ordinary plan */
3391
+ parent: {
3392
+ ratePlanId: number;
3393
+ name: string;
3394
+ } | null;
3395
+ perOtaPlans: Array<{
3396
+ /** Its id here, when it is a plan of GET /catalog too */
3397
+ ratePlanId: number | null;
3398
+ name: string | null;
3399
+ channelId: string | null;
3400
+ channelKind: string | null;
3401
+ /** follows-price: the channel manager reprices it when its parent is sent · own-price: its parent's price is copied onto it in the same send */
3402
+ mode: "follows-price" | "own-price";
3403
+ }>;
1184
3404
  };
3405
+ /** Every connection of the hotel, and whether it sells this plan. Empty when the connections have not been read */
3406
+ channels: Array<{
3407
+ channelId: string;
3408
+ kind: string;
3409
+ title: string | null;
3410
+ /** The connection is switched on */
3411
+ active: boolean;
3412
+ /** The connection sells this plan */
3413
+ mapped: boolean;
3414
+ /** Through the plan's own rows, or the rows of one of its per-OTA plans; null when not mapped */
3415
+ through: "itself" | "per-ota-plan" | null;
3416
+ /** Plans that carry the star for an OTA rate this plan also sells here: that rate takes its stay rules from them */
3417
+ starOnPlanIds: Array<number>;
3418
+ /** Rows the OTA derives on its own side: they cannot be written from here */
3419
+ readonlyRows: number;
3420
+ }>;
3421
+ /** mapped: a live connection sells it · not-mapped: none does, so a write for it changes nothing a guest sees · not-linked: it is not on the channel manager · unknown: the connections have not been read yet */
3422
+ reach: "mapped" | "not-mapped" | "not-linked" | "unknown";
3423
+ }>;
3424
+ channels: {
3425
+ /** false: this hotel's connections have not been read yet, so nothing is said about what they map */
3426
+ known: boolean;
3427
+ /** When the connections and what they map were last read from the channel manager (nightly) */
3428
+ seenAt: string | null;
3429
+ /** The connections that are switched on */
3430
+ live: Array<{
3431
+ channelId: string;
3432
+ kind: string;
3433
+ title: string | null;
3434
+ }>;
3435
+ };
3436
+ /** The rules in force on this night that can change what you sent, each in a sentence */
3437
+ policies: Array<{
3438
+ code: "NOT_SOURCE_OF_TRUTH" | "ROOM_TYPE_NOT_LINKED" | "PLAN_NOT_LINKED" | "PLAN_NOT_MAPPED" | "ROOM_STILL_ON_SALE" | "OTA_LINKED_RATES_NOT_REACHED" | "STAY_RULES_FROM_ANOTHER_PLAN" | "PER_OTA_PLANS_FOLLOW" | "PER_OTA_PLAN_FOLLOWS_PARENT" | "VALUE_HELD" | "COUNT_WAS_REFUSED" | "COUNT_ZERO_IS_NOT_STOP_SELL" | "STOP_SELL_IS_NOT_A_COUNT" | "COUNT_OPEN_BUT_PLANS_STOPPED" | "NEW_DATES_OPEN_CLOSED" | "FAR_NIGHTS_NEED_A_COUNT" | "ENGINE_WILL_REPRICE" | "ENGINE_WILL_RECOUNT" | "DRIFT_REPAIR_OFF" | "FOLLOWS_OTA_MOVES" | "WRITES_PAUSED" | "CLOSED_BY_ACTION";
3439
+ message: string;
1185
3440
  }>;
3441
+ searched: {
3442
+ /** Writes of your software we looked through for lastSent, per resource, newest first */
3443
+ batches: number;
3444
+ /** The oldest of them; a write before it is not found here */
3445
+ oldestBatchAt: string | null;
3446
+ /** The hotel's newest inventory events we looked through for pushes */
3447
+ inventoryEvents: number;
3448
+ };
3449
+ }
3450
+ export interface SandboxFault {
3451
+ /** refuse: the pretend channel refuses the next prices or stay rules, answering 200 with a warning as the channel manager does · throttle: it answers "too many requests" for a while · outage: it does not answer for a while */
3452
+ kind: "refuse" | "throttle" | "outage";
3453
+ /** refuse only: how many nights (rate plan × night) to refuse, in the order they are sent. Default 1 */
3454
+ values?: number;
3455
+ /** throttle and outage only: how long. Default 5 for a throttle, 10 for an outage (the alert needs five failed attempts, one a minute) */
3456
+ minutes?: number;
3457
+ /** refuse only: the pretend channel's words for the refusal, as your software will read them back */
3458
+ message?: string;
3459
+ }
3460
+ export interface SandboxFaultView {
3461
+ /** A fault is in force on this sandbox's pretend channel */
3462
+ active: boolean;
3463
+ kind: "refuse" | "throttle" | "outage" | null;
3464
+ /** refuse: nights still to be refused */
3465
+ remaining: number | null;
3466
+ /** throttle, outage: when the pretend channel answers normally again (ISO 8601, UTC) */
3467
+ until: string | null;
3468
+ /** refuse: the pretend channel's words */
3469
+ message: string | null;
3470
+ setAt: string | null;
3471
+ /** What to do next and what your software should then see, step by step */
3472
+ watch: Array<string>;
1186
3473
  }
1187
3474
  export interface Operations {
1188
3475
  /** The properties this key may act on */
@@ -1199,6 +3486,15 @@ export interface Operations {
1199
3486
  body: PropertyCreate;
1200
3487
  response: PropertyCreated;
1201
3488
  };
3489
+ /** Change a hotel */
3490
+ "PATCH /properties/{propertyId}": {
3491
+ path: {
3492
+ propertyId: string | number;
3493
+ };
3494
+ query: undefined;
3495
+ body: PropertyChange;
3496
+ response: PropertyChanged;
3497
+ };
1202
3498
  /** Remove a hotel you added (a software partner's company key) */
1203
3499
  "DELETE /properties/{propertyId}": {
1204
3500
  path: {
@@ -1217,6 +3513,13 @@ export interface Operations {
1217
3513
  body: undefined;
1218
3514
  response: Property;
1219
3515
  };
3516
+ /** Every budget this key sits under, with what is left and when it refills */
3517
+ "GET /limits": {
3518
+ path: undefined;
3519
+ query: undefined;
3520
+ body: undefined;
3521
+ response: Limits;
3522
+ };
1220
3523
  /** Room types and rate plans with the numeric ids every write uses */
1221
3524
  "GET /catalog": {
1222
3525
  path: undefined;
@@ -1271,7 +3574,7 @@ export interface Operations {
1271
3574
  path: undefined;
1272
3575
  query: undefined;
1273
3576
  body: AvailabilityWrite;
1274
- response: WriteAccepted;
3577
+ response: WritePreview | WriteAccepted;
1275
3578
  };
1276
3579
  /** Rates as our record holds them (minor units) */
1277
3580
  "GET /rates": {
@@ -1288,7 +3591,7 @@ export interface Operations {
1288
3591
  path: undefined;
1289
3592
  query: undefined;
1290
3593
  body: RatesWrite;
1291
- response: WriteAccepted;
3594
+ response: WritePreview | WriteAccepted;
1292
3595
  };
1293
3596
  /** Restrictions as our record holds them */
1294
3597
  "GET /restrictions": {
@@ -1305,7 +3608,53 @@ export interface Operations {
1305
3608
  path: undefined;
1306
3609
  query: undefined;
1307
3610
  body: RestrictionsWrite;
1308
- response: WriteAccepted;
3611
+ response: WritePreview | WriteAccepted;
3612
+ };
3613
+ /** Close a room type on these nights, everywhere */
3614
+ "POST /availability/close": {
3615
+ path: undefined;
3616
+ query: undefined;
3617
+ body: CloseRoomType;
3618
+ response: CloseResult;
3619
+ };
3620
+ /** Reopen a room type that POST /availability/close closed */
3621
+ "POST /availability/reopen": {
3622
+ path: undefined;
3623
+ query: undefined;
3624
+ body: ReopenRoomType;
3625
+ response: CloseResult;
3626
+ };
3627
+ /** Explain this night */
3628
+ "GET /explain": {
3629
+ path: undefined;
3630
+ query: {
3631
+ roomTypeId: number;
3632
+ ratePlanId?: number;
3633
+ date: string;
3634
+ };
3635
+ body: undefined;
3636
+ response: Explain;
3637
+ };
3638
+ /** Sandbox: the fault in force on the pretend channel */
3639
+ "GET /sandbox/faults": {
3640
+ path: undefined;
3641
+ query: undefined;
3642
+ body: undefined;
3643
+ response: SandboxFaultView;
3644
+ };
3645
+ /** Sandbox: make the pretend channel refuse, throttle or go down */
3646
+ "POST /sandbox/faults": {
3647
+ path: undefined;
3648
+ query: undefined;
3649
+ body: SandboxFault;
3650
+ response: SandboxFaultView;
3651
+ };
3652
+ /** Sandbox: end the fault */
3653
+ "DELETE /sandbox/faults": {
3654
+ path: undefined;
3655
+ query: undefined;
3656
+ body: undefined;
3657
+ response: SandboxFaultView;
1309
3658
  };
1310
3659
  /** Has what you sent reached the channels? */
1311
3660
  "GET /sync": {
@@ -1350,6 +3699,18 @@ export interface Operations {
1350
3699
  body: BookingCancel;
1351
3700
  response: Booking;
1352
3701
  };
3702
+ /** This key's own requests of the last 7 days */
3703
+ "GET /requests": {
3704
+ path: undefined;
3705
+ query: {
3706
+ since?: string;
3707
+ status?: string;
3708
+ limit?: number;
3709
+ cursor?: string;
3710
+ };
3711
+ body: undefined;
3712
+ response: RequestLog;
3713
+ };
1353
3714
  /** The connected channels and their open issues, from our record */
1354
3715
  "GET /channels": {
1355
3716
  path: undefined;
@@ -1394,6 +3755,228 @@ export interface Operations {
1394
3755
  body: undefined;
1395
3756
  response: ChannelBooking;
1396
3757
  };
3758
+ /** Your company webhook endpoints (a software partner's company key) */
3759
+ "GET /webhook-endpoints": {
3760
+ path: undefined;
3761
+ query: undefined;
3762
+ body: undefined;
3763
+ response: WebhookEndpointList;
3764
+ };
3765
+ /** Create a company webhook endpoint */
3766
+ "POST /webhook-endpoints": {
3767
+ path: undefined;
3768
+ query: undefined;
3769
+ body: WebhookEndpointCreate;
3770
+ response: WebhookEndpointCreated;
3771
+ };
3772
+ /** One company webhook endpoint, with its health */
3773
+ "GET /webhook-endpoints/{endpointId}": {
3774
+ path: {
3775
+ endpointId: string | number;
3776
+ };
3777
+ query: undefined;
3778
+ body: undefined;
3779
+ response: WebhookEndpoint;
3780
+ };
3781
+ /** Change an endpoint: its address, event types, notify email or the guest-contact switch */
3782
+ "PATCH /webhook-endpoints/{endpointId}": {
3783
+ path: {
3784
+ endpointId: string | number;
3785
+ };
3786
+ query: undefined;
3787
+ body: WebhookEndpointUpdate;
3788
+ response: WebhookEndpoint;
3789
+ };
3790
+ /** Delete an endpoint */
3791
+ "DELETE /webhook-endpoints/{endpointId}": {
3792
+ path: {
3793
+ endpointId: string | number;
3794
+ };
3795
+ query: undefined;
3796
+ body: undefined;
3797
+ response: WebhookEndpointDeleted;
3798
+ };
3799
+ /** Pause an endpoint: its events are held, not dropped */
3800
+ "POST /webhook-endpoints/{endpointId}/pause": {
3801
+ path: {
3802
+ endpointId: string | number;
3803
+ };
3804
+ query: undefined;
3805
+ body: undefined;
3806
+ response: WebhookEndpoint;
3807
+ };
3808
+ /** Resume an endpoint: what the pause held goes out, oldest first */
3809
+ "POST /webhook-endpoints/{endpointId}/resume": {
3810
+ path: {
3811
+ endpointId: string | number;
3812
+ };
3813
+ query: undefined;
3814
+ body: undefined;
3815
+ response: WebhookEndpointResumed;
3816
+ };
3817
+ /** Rotate the signing secret */
3818
+ "POST /webhook-endpoints/{endpointId}/rotate-secret": {
3819
+ path: {
3820
+ endpointId: string | number;
3821
+ };
3822
+ query: undefined;
3823
+ body: undefined;
3824
+ response: WebhookSecretRotated;
3825
+ };
3826
+ /** Send a test event of any type */
3827
+ "POST /webhook-endpoints/{endpointId}/test": {
3828
+ path: {
3829
+ endpointId: string | number;
3830
+ };
3831
+ query: undefined;
3832
+ body: WebhookTest;
3833
+ response: WebhookTestQueued;
3834
+ };
3835
+ /** Recover since: queue again what the endpoint missed */
3836
+ "POST /webhook-endpoints/{endpointId}/recover": {
3837
+ path: {
3838
+ endpointId: string | number;
3839
+ };
3840
+ query: undefined;
3841
+ body: WebhookRecover;
3842
+ response: WebhookRecoverResult;
3843
+ };
3844
+ /** The delivery log, newest first */
3845
+ "GET /webhook-endpoints/{endpointId}/deliveries": {
3846
+ path: {
3847
+ endpointId: string | number;
3848
+ };
3849
+ query: {
3850
+ status?: "PENDING" | "DELIVERED" | "FAILED";
3851
+ eventType?: string;
3852
+ mode?: "LIVE" | "TEST";
3853
+ from?: string;
3854
+ to?: string;
3855
+ cursor?: string;
3856
+ limit?: number;
3857
+ };
3858
+ body: undefined;
3859
+ response: WebhookDeliveryList;
3860
+ };
3861
+ /** One delivery: the body as sent, guest contact masked, and every attempt */
3862
+ "GET /webhook-endpoints/{endpointId}/deliveries/{deliveryId}": {
3863
+ path: {
3864
+ endpointId: string | number;
3865
+ deliveryId: string | number;
3866
+ };
3867
+ query: undefined;
3868
+ body: undefined;
3869
+ response: WebhookDeliveryDetail;
3870
+ };
3871
+ /** Send one delivery again */
3872
+ "POST /webhook-endpoints/{endpointId}/deliveries/{deliveryId}/redeliver": {
3873
+ path: {
3874
+ endpointId: string | number;
3875
+ deliveryId: string | number;
3876
+ };
3877
+ query: undefined;
3878
+ body: undefined;
3879
+ response: WebhookDelivery;
3880
+ };
3881
+ /** The components and the incidents that touch your hotels */
3882
+ "GET /status": {
3883
+ path: undefined;
3884
+ query: undefined;
3885
+ body: undefined;
3886
+ response: Status;
3887
+ };
3888
+ /** Your bills at a glance: what is owed, your quota, money paid ahead (a software partner's company key) */
3889
+ "GET /billing": {
3890
+ path: undefined;
3891
+ query: undefined;
3892
+ body: undefined;
3893
+ response: Billing;
3894
+ };
3895
+ /** Your issued invoices, each before and after tax */
3896
+ "GET /billing/invoices": {
3897
+ path: undefined;
3898
+ query: undefined;
3899
+ body: undefined;
3900
+ response: BillingInvoices;
3901
+ };
3902
+ /** What your next monthly invoice is made of, hotel by hotel */
3903
+ "GET /billing/next-invoice": {
3904
+ path: undefined;
3905
+ query: undefined;
3906
+ body: undefined;
3907
+ response: BillingNextInvoice;
3908
+ };
3909
+ /** Your support tickets, newest first (a software partner's company key) */
3910
+ "GET /support-tickets": {
3911
+ path: undefined;
3912
+ query: {
3913
+ status?: "OPEN" | "ANSWERED" | "CLOSED";
3914
+ cursor?: string;
3915
+ limit?: number;
3916
+ };
3917
+ body: undefined;
3918
+ response: SupportTicketList;
3919
+ };
3920
+ /** Open a support ticket */
3921
+ "POST /support-tickets": {
3922
+ path: undefined;
3923
+ query: undefined;
3924
+ body: SupportTicketCreate;
3925
+ response: SupportTicket;
3926
+ };
3927
+ /** One ticket: the thread and the diagnostic */
3928
+ "GET /support-tickets/{ticketId}": {
3929
+ path: {
3930
+ ticketId: string | number;
3931
+ };
3932
+ query: undefined;
3933
+ body: undefined;
3934
+ response: SupportTicket;
3935
+ };
3936
+ /** Reply on a ticket */
3937
+ "POST /support-tickets/{ticketId}/messages": {
3938
+ path: {
3939
+ ticketId: string | number;
3940
+ };
3941
+ query: undefined;
3942
+ body: SupportMessageCreate;
3943
+ response: SupportTicket;
3944
+ };
3945
+ /** Close your own ticket */
3946
+ "POST /support-tickets/{ticketId}/close": {
3947
+ path: {
3948
+ ticketId: string | number;
3949
+ };
3950
+ query: undefined;
3951
+ body: undefined;
3952
+ response: SupportTicket;
3953
+ };
3954
+ /** Sandbox: a website booking's no-show, or its undo (the real direct.booking.modified) */
3955
+ "POST /sandbox/bookings/{bookingId}/no-show": {
3956
+ path: {
3957
+ bookingId: string | number;
3958
+ };
3959
+ query: undefined;
3960
+ body: SandboxNoShow;
3961
+ response: SandboxBooking;
3962
+ };
3963
+ /** Sandbox: a channel problem, or its end (the real channel.sync.alert / channel.sync.recovered) */
3964
+ "POST /sandbox/sync-events": {
3965
+ path: undefined;
3966
+ query: undefined;
3967
+ body: SandboxSyncEvent;
3968
+ response: SandboxSyncEventView;
3969
+ };
3970
+ /** The hotel's ordered event log */
3971
+ "GET /events": {
3972
+ path: undefined;
3973
+ query: {
3974
+ after?: number;
3975
+ limit?: number;
3976
+ };
3977
+ body: undefined;
3978
+ response: EventsList;
3979
+ };
1397
3980
  /** The bookings guests made on the hotel's own website, in the webhook's shape */
1398
3981
  "GET /direct-bookings": {
1399
3982
  path: undefined;
@@ -1465,6 +4048,93 @@ export interface Operations {
1465
4048
  body: undefined;
1466
4049
  response: BatchStatus;
1467
4050
  };
4051
+ /** Your one-time connect links (a software partner's company key) */
4052
+ "GET /connect-links": {
4053
+ path: undefined;
4054
+ query: {
4055
+ propertyId?: number;
4056
+ limit?: number;
4057
+ };
4058
+ body: undefined;
4059
+ response: ConnectLinkList;
4060
+ };
4061
+ /** Make a one-time connect link for one hotel and one booking site */
4062
+ "POST /connect-links": {
4063
+ path: undefined;
4064
+ query: undefined;
4065
+ body: ConnectLinkCreate;
4066
+ response: ConnectLinkCreated;
4067
+ };
4068
+ /** Where one connect link stands */
4069
+ "GET /connect-links/{linkId}": {
4070
+ path: {
4071
+ linkId: string | number;
4072
+ };
4073
+ query: undefined;
4074
+ body: undefined;
4075
+ response: ConnectLink;
4076
+ };
4077
+ /** Withdraw a connect link */
4078
+ "POST /connect-links/{linkId}/revoke": {
4079
+ path: {
4080
+ linkId: string | number;
4081
+ };
4082
+ query: undefined;
4083
+ body: undefined;
4084
+ response: ConnectLink;
4085
+ };
4086
+ /** Is this hotel ready for your software to be its source of truth? */
4087
+ "GET /readiness": {
4088
+ path: undefined;
4089
+ query: undefined;
4090
+ body: undefined;
4091
+ response: Readiness;
4092
+ };
4093
+ /** Make your software this hotel's source of truth */
4094
+ "POST /go-live": {
4095
+ path: undefined;
4096
+ query: undefined;
4097
+ body: undefined;
4098
+ response: GoLiveResult;
4099
+ };
4100
+ /** The keys you made on a hotel (a software partner's company key) */
4101
+ "GET /properties/{propertyId}/keys": {
4102
+ path: {
4103
+ propertyId: string | number;
4104
+ };
4105
+ query: undefined;
4106
+ body: undefined;
4107
+ response: HotelKeyList;
4108
+ };
4109
+ /** Mint a key on a hotel */
4110
+ "POST /properties/{propertyId}/keys": {
4111
+ path: {
4112
+ propertyId: string | number;
4113
+ };
4114
+ query: undefined;
4115
+ body: HotelKeyCreate;
4116
+ response: HotelKeyCreated;
4117
+ };
4118
+ /** Rotate a key you made on a hotel */
4119
+ "POST /properties/{propertyId}/keys/{keyId}/rotate": {
4120
+ path: {
4121
+ propertyId: string | number;
4122
+ keyId: string | number;
4123
+ };
4124
+ query: undefined;
4125
+ body: undefined;
4126
+ response: HotelKeyRotated;
4127
+ };
4128
+ /** Revoke a key you made on a hotel */
4129
+ "POST /properties/{propertyId}/keys/{keyId}/revoke": {
4130
+ path: {
4131
+ propertyId: string | number;
4132
+ keyId: string | number;
4133
+ };
4134
+ query: undefined;
4135
+ body: HotelKeyRevoke;
4136
+ response: HotelKey;
4137
+ };
1468
4138
  }
1469
4139
  export type OperationKey = keyof Operations;
1470
4140
  /** idempotent: the server replays the stored answer when the idempotency key repeats, so the client may resend the request after a network failure. */