@zimmerstack/connect 0.9.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.
- package/AGENTS.md +41 -15
- package/README.md +145 -55
- package/dist/cjs/client.d.ts +33 -8
- package/dist/cjs/client.js +42 -8
- package/dist/cjs/doctor.js +1 -1
- package/dist/cjs/generated.d.ts +54 -10
- package/dist/cjs/generated.js +3 -1
- package/dist/esm/client.d.ts +33 -8
- package/dist/esm/client.js +42 -8
- package/dist/esm/doctor.js +1 -1
- package/dist/esm/generated.d.ts +54 -10
- package/dist/esm/generated.js +3 -1
- package/dist/esm/mcp/cli.js +7 -2
- package/dist/esm/mcp/reference.generated.js +1557 -312
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -14,7 +14,7 @@ https://docs.zimmerstack.com/llms-full.txt
|
|
|
14
14
|
- The package refuses to start in a browser or in React Native. Do not work around that: the
|
|
15
15
|
person's own frontend calls their own server, and the server calls ZimmerStack. Never put the key in
|
|
16
16
|
a variable a bundler sends to the browser (`VITE_`, `NEXT_PUBLIC_`, `REACT_APP_`, `EXPO_PUBLIC_`).
|
|
17
|
-
An app with no server gets the smallest one: https://docs.zimmerstack.com/
|
|
17
|
+
An app with no server gets the smallest one: https://docs.zimmerstack.com/guides/node-package#no-server. A plain
|
|
18
18
|
`fetch` from a browser is refused too ("Failed to fetch"), on purpose.
|
|
19
19
|
- `zsk_test_…` is a sandbox: nothing reaches a channel. Build and test with it. `zsk_live_…` is a real
|
|
20
20
|
hotel. The package refuses to WRITE with a live key under a test runner; never switch that off to
|
|
@@ -24,8 +24,14 @@ https://docs.zimmerstack.com/llms-full.txt
|
|
|
24
24
|
serves one hotel. A test company key that reaches one sandbox finds it by itself; with several,
|
|
25
25
|
name one; a live key never guesses.
|
|
26
26
|
- No key yet: a software company signs up, free, at https://www.zimmerstack.com/partners/pms-companies#join
|
|
27
|
-
and makes test
|
|
27
|
+
and makes its test key in the partner portal: Developers → Create company key → Your sandbox
|
|
28
|
+
(zsk_test_), with "Also add and remove hotels" ticked. A hotel's owner makes one in Admin →
|
|
28
29
|
Developers → API keys.
|
|
30
|
+
- A software company builds in the order a hotel is made, all with that test key: `zs.properties.list()`
|
|
31
|
+
(the hotels the key reaches), `zs.properties.create(hotel)` (a test hotel in its sandbox, born with its
|
|
32
|
+
first room type and one room-only rate plan), then on `zs.forProperty(id)`: `roomTypes.save`,
|
|
33
|
+
`ratePlans.save`, `availability.set` and `rates.set`. The same steps, one page each:
|
|
34
|
+
https://docs.zimmerstack.com/partner/test-key
|
|
29
35
|
- A key is zsk_live_ (or zsk_test_ on a sandbox) + 40 letters and digits + a 6-character checksum (the CRC32 of everything before it, in base 62), so a key can be told from a look-alike without asking us. Where a person pastes a key (a settings screen, a
|
|
30
36
|
deploy script), check it with `checkKey(value)` first: it tells a mistyped or cut-short key from a real
|
|
31
37
|
one without sending it anywhere, and its `message` never contains the key.
|
|
@@ -125,8 +131,10 @@ hotel gets more, and `zs.limits.get()` says exactly.
|
|
|
125
131
|
`zs.grid.load` gives major units; `zs.grid.save` takes them.
|
|
126
132
|
- `rateMinor` and every other `…Minor` field is HUNDREDTHS of the major unit for every currency (450050 = 4500.50;
|
|
127
133
|
1500000 = 15000 yen), which is the ISO minor unit only where the currency has two decimals. Prefer `rate`.
|
|
128
|
-
- A price with more decimals than the currency has
|
|
129
|
-
the answer's `rounded` list
|
|
134
|
+
- A price sent as a NUMBER with more decimals than the currency has (4500.505 in rupees) is rounded and named in
|
|
135
|
+
the answer's `rounded` list, and so is a fraction in a currency that has none (15000.5 yen): show that list to
|
|
136
|
+
the person, never hide it. A price sent as a decimal STRING takes at most two decimals: one with more
|
|
137
|
+
("4500.505") is refused, 400 `VALIDATION`, and nothing is written. It is never rounded for you.
|
|
130
138
|
- Never do money arithmetic on floats, and never divide by 100 yourself. The package's helpers work on the
|
|
131
139
|
strings: `toAmount(value, decimals)`, `addAmounts`, `subtractAmounts`, `multiplyAmount(amount, factor, decimals)`,
|
|
132
140
|
`compareAmounts`, `formatAmount(amount, { currency, decimals, locale })`. A ledger that stores whole minor
|
|
@@ -259,9 +267,13 @@ hotel gets more, and `zs.limits.get()` says exactly.
|
|
|
259
267
|
to, once `ready` is true. `NOT_READY` lists the checks that did not pass (`err.details`): fix them and
|
|
260
268
|
call again; never retry it in a loop. Only ZimmerStack support switches a hotel back.
|
|
261
269
|
- Connecting a booking site: `zs.connectLinks.create({ propertyId, channel })` (scope `channels:connect`,
|
|
262
|
-
a LIVE key: a test key is refused) answers a one-time `url` for the hotel's own person, who
|
|
263
|
-
|
|
264
|
-
|
|
270
|
+
a LIVE key: a test key is refused) answers a one-time `url` for the hotel's own person, who types the
|
|
271
|
+
hotel's id at the booking site (MakeMyTrip also its access token) and confirms every room and rate match
|
|
272
|
+
on ZimmerStack's page. Only Airbnb is connected from the link alone (the host signs in on Airbnb's own
|
|
273
|
+
page): every other booking site must first accept our connectivity partner for the hotel, in its extranet
|
|
274
|
+
or through its support. Send `hotelStep` to the hotel first and the `url` once that step is done. Never
|
|
275
|
+
ask a hotel for a booking site's sign-in, hotel id or token, never store one, and never build a screen
|
|
276
|
+
that takes one: no call accepts it.
|
|
265
277
|
Listen for `channel.connect.completed` and `channel.connect.expired` (match on `data.connect.linkId`).
|
|
266
278
|
- `zs.hotelKeys.list`, `.create`, `.rotate` and `.revoke` (scope `keys:manage`) manage the keys you made on
|
|
267
279
|
a hotel you added; never a company key, never the hotel's own. A rotation makes a new key with the same name, scopes, addresses and expiry; the old one keeps answering for 24 hours (retireAt), then stops.
|
|
@@ -296,6 +308,11 @@ hotel gets more, and `zs.limits.get()` says exactly.
|
|
|
296
308
|
id for it: sending the same ref again changes that entity, it never makes a second one. Several in
|
|
297
309
|
one request: `zs.catalog.upsertRoomTypes` and `zs.catalog.upsertRatePlans`. All need the scope
|
|
298
310
|
`catalog:write`.
|
|
311
|
+
- A new rate plan needs `defaultRate`, its real price for a night: without it the request is refused
|
|
312
|
+
(400 `VALIDATION`, `details.refs` names the plans) and nothing in it is saved. Every date of a new
|
|
313
|
+
plan can be sold at that price until the price of each night is sent, so never write a test number
|
|
314
|
+
or a made-up one; ask the person for the price. `defaultRate: null` is refused for a plan the
|
|
315
|
+
integration made.
|
|
299
316
|
- Every later write names ZimmerStack's numeric `id`, not the ref: room counts name a room type's
|
|
300
317
|
id, prices and stay rules name a rate plan's id. `zs.roomTypes.list()` and `zs.ratePlans.list()`
|
|
301
318
|
give them, and so does the answer of each `save`.
|
|
@@ -308,19 +325,28 @@ hotel gets more, and `zs.limits.get()` says exactly.
|
|
|
308
325
|
booking site still sells it, an upcoming stay holds one of its rooms, or rooms are still assigned
|
|
309
326
|
to the room type. Nothing was deleted. Show the message and stop; do not try another way round.
|
|
310
327
|
|
|
311
|
-
## Adding and removing a hotel (a software partner's company key)
|
|
328
|
+
## Adding, changing and removing a hotel (a software partner's company key)
|
|
312
329
|
|
|
313
|
-
- Only a COMPANY key with the scope `properties:write` can do
|
|
314
|
-
(`COMPANY_KEY_REQUIRED`). The person ticks "Also add and remove hotels" when making the key in
|
|
315
|
-
partner portal; only the account's owner or an Admin is offered that tick box.
|
|
316
|
-
hotel with `forProperty`.
|
|
330
|
+
- Only a COMPANY key with the scope `properties:write` can do any of the three; a hotel's own key
|
|
331
|
+
cannot (`COMPANY_KEY_REQUIRED`). The person ticks "Also add and remove hotels" when making the key in
|
|
332
|
+
the partner portal; only the account's owner or an Admin is offered that tick box. None of the calls
|
|
333
|
+
names a hotel with `forProperty`.
|
|
317
334
|
- `zs.properties.create({ name, owner, address, roomTypes })` adds a hotel and answers with its `id`:
|
|
318
335
|
act on it with `zs.forProperty(id)`. The owner gets the sign-in details by email, never the caller.
|
|
319
336
|
It joins the partner's monthly invoice. With a `zsk_test_` key the same call makes a sandbox, which
|
|
320
337
|
is never billed. A partner may add 20 hotels an hour.
|
|
321
|
-
- After adding:
|
|
322
|
-
|
|
323
|
-
|
|
338
|
+
- After adding: a hotel added with its room types is put on the channel manager when its billing
|
|
339
|
+
starts, usually at once (`channelManager` in the answer says). If a call answers 409
|
|
340
|
+
CHANNEL_MANAGER_DISABLED, send its room types again with the same refs (`zs.roomTypes.save` or
|
|
341
|
+
`zs.catalog.upsertRoomTypes`); then the rate plans, then room counts and prices.
|
|
342
|
+
- `zs.properties.update(propertyId, { name, address })` changes the name or the address of a hotel the
|
|
343
|
+
partner added. Send only what changes: `name`, and under `address` any of `line1`, `city`,
|
|
344
|
+
`state`, `postalCode`. It never changes the hotel's country, currency, time zone, owner or tax id
|
|
345
|
+
(sending one is `VALIDATION`), and it changes the hotel's record in ZimmerStack, not the name of its
|
|
346
|
+
listing on a booking site. The answer's `changed` lists the fields whose stored value moved; empty
|
|
347
|
+
means everything sent was already stored. `PROPERTY_NOT_CHANGEABLE` means the hotel's owner let the
|
|
348
|
+
partner in, so the owner changes it: show the message and stop. After a new name, `delete` wants that
|
|
349
|
+
new name in `confirm`.
|
|
324
350
|
- `zs.properties.delete(propertyId, { confirm })` (also `zs.properties.remove`) removes a hotel the
|
|
325
351
|
partner added, FOR GOOD: its booking sites are disconnected, its rate plans and then its room types
|
|
326
352
|
are removed from the channel manager, the hotel is closed and it comes off the invoice from the next
|
package/README.md
CHANGED
|
@@ -4,30 +4,39 @@ Add a channel manager to your hotel software. This package sends a hotel's rooms
|
|
|
4
4
|
Booking.com, Airbnb, Expedia, Agoda, MakeMyTrip and the other booking sites, and brings their bookings
|
|
5
5
|
back to you.
|
|
6
6
|
|
|
7
|
-
- **Free to build.** You get a practice hotel the moment you sign up
|
|
8
|
-
real booking site.
|
|
7
|
+
- **Free to build.** You get a sandbox with a practice hotel the moment you sign up, and your software
|
|
8
|
+
can create more. Nothing you do there reaches a real booking site.
|
|
9
9
|
- **Public prices.** A fixed price for each live property a month, on one invoice. A partner in India
|
|
10
10
|
pays the price plus GST. A partner outside India pays its own price, with nothing added. You accept
|
|
11
11
|
it in the partner portal. Going live has a one-time onboarding fee of $50, paid once in the portal
|
|
12
|
-
before your live key.
|
|
12
|
+
before your live key. The price list: <https://docs.zimmerstack.com/pricing>
|
|
13
13
|
- **Made for AI coding tools.** The package carries its own rules file and a helper your coding agent
|
|
14
14
|
can ask. See [For AI coding agents](#for-ai-coding-agents).
|
|
15
15
|
|
|
16
|
-
[Docs](https://docs.zimmerstack.com) · [Quickstart](https://docs.zimmerstack.com/
|
|
16
|
+
[Docs](https://docs.zimmerstack.com) · [Quickstart](https://docs.zimmerstack.com/partner/first-call) ·
|
|
17
17
|
[Pricing](https://docs.zimmerstack.com/pricing) · [Partner portal](https://partner.zimmerstack.com/login) ·
|
|
18
18
|
[Starter app](https://github.com/zimmerstack/connect-starter) ·
|
|
19
19
|
[Source](https://github.com/zimmerstack/connect-node) ·
|
|
20
20
|
[Changelog](https://docs.zimmerstack.com/changelog) · <support@zimmerstack.com>
|
|
21
21
|
|
|
22
|
-
## Start
|
|
22
|
+
## Start here
|
|
23
|
+
|
|
24
|
+
You learn the API in the order a hotel is made: the hotel, its room types, its rate plans, then its
|
|
25
|
+
rooms and prices. All of it happens in your sandbox, with a test key. Nothing reaches a real booking
|
|
26
|
+
site and nothing is billed.
|
|
23
27
|
|
|
24
28
|
**1. Sign up.** It is free and takes one emailed code:
|
|
25
|
-
<https://www.zimmerstack.com/partners/pms-companies#join>.
|
|
26
|
-
|
|
27
|
-
you
|
|
29
|
+
<https://www.zimmerstack.com/partners/pms-companies#join>. You get a sandbox: the place where your test
|
|
30
|
+
hotels live. A test hotel is a practice hotel that no booking site ever sees. One example test hotel is
|
|
31
|
+
made for you. Working for one hotel only? Its owner makes your key in Admin → Developers → API keys.
|
|
32
|
+
You join at step 3 and skip step 6, because your hotel is already there. Where a later step says
|
|
33
|
+
`hotel`, use `zs`.
|
|
28
34
|
|
|
29
35
|
**2. Make a test key.** Open the [partner portal](https://partner.zimmerstack.com/login), then
|
|
30
|
-
Developers, then Create key
|
|
36
|
+
Developers, then **Create company key**. Under **Reaches**, choose **Your sandbox (zsk_test_)**. Keep
|
|
37
|
+
**Also add and remove hotels** ticked, then press **Create company key**. The key starts with
|
|
38
|
+
`zsk_test_` and is shown once, so copy it now. It is one key for all your test hotels, so each call
|
|
39
|
+
says which hotel it is for.
|
|
31
40
|
|
|
32
41
|
**3. Install the package.** It needs Node 20 or newer.
|
|
33
42
|
|
|
@@ -42,22 +51,85 @@ npm install @zimmerstack/connect
|
|
|
42
51
|
ZIMMERSTACK_CONNECT_KEY=zsk_test_…
|
|
43
52
|
```
|
|
44
53
|
|
|
45
|
-
**5. Make your first call.**
|
|
54
|
+
**5. Make your first call.** Ask which hotels your key reaches.
|
|
46
55
|
|
|
47
56
|
```ts
|
|
48
57
|
import { ZimmerStack } from "@zimmerstack/connect";
|
|
49
58
|
|
|
50
59
|
const zs = new ZimmerStack(); // reads ZIMMERSTACK_CONNECT_KEY. Make one and reuse it.
|
|
51
60
|
|
|
52
|
-
|
|
53
|
-
const
|
|
54
|
-
|
|
61
|
+
const { properties } = await zs.properties.list();
|
|
62
|
+
for (const p of properties) console.log(p.id, p.name, p.currency, p.sandbox);
|
|
63
|
+
```
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
65
|
+
The list holds the example test hotel from step 1. Next, your software makes a hotel itself.
|
|
66
|
+
|
|
67
|
+
**6. Create a hotel.** With a test key, this call makes a hotel in your sandbox. With a live key, the same call adds a real hotel. The request is
|
|
68
|
+
checked exactly as for a real hotel, but nobody is emailed and nothing is billed. You can hold up to
|
|
69
|
+
five test hotels at one time, the example included.
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
const made = await zs.properties.create({
|
|
73
|
+
name: "The Lantern House",
|
|
74
|
+
owner: { name: "Asha Rao", email: "asha@lanternhouse.example", phone: "+91 98765 43210" },
|
|
75
|
+
address: { line1: "14 Hill Road", city: "Shimla", country: "IN" },
|
|
76
|
+
roomTypes: [{ ref: "rt-deluxe", name: "Deluxe Room", roomCount: 10, defaultRate: 4500 }],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const hotel = zs.forProperty(made.id); // the same client, working on this hotel
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The request needs at least one room type. So the hotel is born with its first room type, and with one
|
|
83
|
+
room-only rate plan for it at `defaultRate`: 4500 means 4,500.00 in the hotel's own currency.
|
|
84
|
+
|
|
85
|
+
**7. Create room types.** A room type is a kind of room the hotel sells. This hotel has the Deluxe Room
|
|
86
|
+
already, so add a second one. `ref` is your own id for it.
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const suite = await hotel.roomTypes.save({ ref: "rt-suite", name: "Suite", roomCount: 2, adults: 3 });
|
|
90
|
+
suite.id; // ZimmerStack's id for it: name it when you set the rooms left to sell
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**8. Create rate plans.** A rate plan is one way to sell a room type. Prices belong to rate plans. Add
|
|
94
|
+
breakfast to the Deluxe Room, and give the Suite its first rate plan.
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const breakfast = await hotel.ratePlans.save({ ref: "rp-bb", roomTypeRef: "rt-deluxe", name: "Bed and breakfast", mealPlan: "CP", defaultRate: 5000 });
|
|
98
|
+
await hotel.ratePlans.save({ ref: "rp-suite", roomTypeRef: "rt-suite", name: "Room only", mealPlan: "EP", defaultRate: 9000 });
|
|
99
|
+
breakfast.id; // name it when you set prices and stay rules
|
|
59
100
|
```
|
|
60
101
|
|
|
102
|
+
**9. Send availability and rates.** Availability is the rooms left to sell on each night. A rate is the
|
|
103
|
+
price of one rate plan on each night. Send both for three nights.
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
// Rooms left to sell name a room type's id. The Deluxe Room was born with the hotel, so read its id.
|
|
107
|
+
const deluxe = (await hotel.roomTypes.list()).find((room) => room.ref === "rt-deluxe")!;
|
|
108
|
+
await hotel.availability.set([{ roomTypeId: deluxe.id, dateFrom: "2026-12-24", dateTo: "2026-12-26", available: 3 }]);
|
|
109
|
+
|
|
110
|
+
// Prices name a rate plan's id.
|
|
111
|
+
const accepted = await hotel.rates.set([{ ratePlanId: breakfast.id, dateFrom: "2026-12-24", dateTo: "2026-12-26", rate: 5500 }]);
|
|
112
|
+
|
|
113
|
+
// Accepted means ZimmerStack has saved it. On a test hotel a change lands within a minute and stops there.
|
|
114
|
+
const batch = await hotel.batches.wait(accepted[0]!.batchId);
|
|
115
|
+
console.log(batch.status); // "landed"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Each step has its own page in the docs, with every field explained:
|
|
119
|
+
[get a test key](https://docs.zimmerstack.com/partner/test-key) ·
|
|
120
|
+
[make your first call](https://docs.zimmerstack.com/partner/first-call) ·
|
|
121
|
+
[create a hotel](https://docs.zimmerstack.com/partner/create-hotel) ·
|
|
122
|
+
[create room types](https://docs.zimmerstack.com/partner/room-types) ·
|
|
123
|
+
[create rate plans](https://docs.zimmerstack.com/partner/rate-plans) ·
|
|
124
|
+
[send availability and rates](https://docs.zimmerstack.com/partner/send-availability-and-rates).
|
|
125
|
+
|
|
126
|
+
**Next: receive a booking, then go live.** Your test hotel can now take a test booking.
|
|
127
|
+
[Receive a booking](https://docs.zimmerstack.com/partner/receive-booking) shows how to add your webhook
|
|
128
|
+
address and pretend a booking came in; the short version is in [Receive bookings](#receive-bookings)
|
|
129
|
+
below. Then [accept the price](https://docs.zimmerstack.com/partner/price) and
|
|
130
|
+
[add your first hotel](https://docs.zimmerstack.com/partner/first-hotel) with a live key. The calls
|
|
131
|
+
stay the same: with a live key they work on real hotels.
|
|
132
|
+
|
|
61
133
|
Want a working app to start from? The [starter app](https://github.com/zimmerstack/connect-starter) has
|
|
62
134
|
a one-click Deploy button.
|
|
63
135
|
|
|
@@ -70,7 +142,7 @@ calls ZimmerStack.
|
|
|
70
142
|
- Never put the key in a `VITE_`, `NEXT_PUBLIC_`, `REACT_APP_` or `EXPO_PUBLIC_` variable. Those are
|
|
71
143
|
sent to every visitor's browser.
|
|
72
144
|
- Your app has no server (a Vite, Lovable or Bolt page)? The docs show the smallest one:
|
|
73
|
-
<https://docs.zimmerstack.com/
|
|
145
|
+
<https://docs.zimmerstack.com/guides/node-package#no-server>
|
|
74
146
|
|
|
75
147
|
## What you can do
|
|
76
148
|
|
|
@@ -105,6 +177,7 @@ calls ZimmerStack.
|
|
|
105
177
|
| Create a booking from your own booking engine | `zs.bookings.create(booking)` |
|
|
106
178
|
| Work with many hotels on one key | `zs.forProperty(propertyId)` |
|
|
107
179
|
| Add a hotel | `zs.properties.create(hotel)` |
|
|
180
|
+
| Change a hotel | `zs.properties.update(propertyId, changes)` |
|
|
108
181
|
| Remove a hotel I added | `zs.properties.delete(propertyId, { confirm })` |
|
|
109
182
|
| Let a hotel connect a booking site itself | `zs.connectLinks.create({ propertyId, channel })` |
|
|
110
183
|
| Check that a hotel is ready, and make my software its source of truth | `zs.readiness.get()` · `zs.readiness.goLive()` |
|
|
@@ -128,9 +201,11 @@ calendar helpers `zs.grid.load()` and `zs.grid.save()` always use normal numbers
|
|
|
128
201
|
|
|
129
202
|
`rateMinor` is still returned, and is always hundredths of the currency's unit: that is paise or cents
|
|
130
203
|
where a currency has two decimals, and it is not yen (`1500000` is 15,000 yen). Read `rate` and you never
|
|
131
|
-
divide. A
|
|
132
|
-
|
|
133
|
-
|
|
204
|
+
divide. A number with more decimals than the currency has (`4500.505` in rupees) is rounded and named in
|
|
205
|
+
the answer's `rounded` list, and so is a fraction in a currency that has none, so nothing changes
|
|
206
|
+
without the answer saying so. A decimal string takes at most two decimals: one with more
|
|
207
|
+
(`"4500.505"`) is refused with a 400 `VALIDATION` error and nothing is saved. It is never rounded for
|
|
208
|
+
you. A three-decimal currency is kept as a whole amount for now.
|
|
134
209
|
|
|
135
210
|
The package has helpers for money, so you never do the arithmetic on floats (from 0.9.0). They take and
|
|
136
211
|
return the same decimal strings, and `decimals` comes from the API's own answer:
|
|
@@ -187,7 +262,7 @@ Room counts usually reach the booking sites in seconds. A full calendar of price
|
|
|
187
262
|
Inside a short-lived function (Vercel, Netlify), show the `batchId` and read `zs.sync.get()` later
|
|
188
263
|
instead of waiting.
|
|
189
264
|
|
|
190
|
-
Guide: <https://docs.zimmerstack.com/rate-grid>
|
|
265
|
+
Guide: <https://docs.zimmerstack.com/guides/rate-grid>
|
|
191
266
|
|
|
192
267
|
## See what a change will do, and read what it did not do
|
|
193
268
|
|
|
@@ -251,8 +326,8 @@ manager was last seen holding, with any value it refused in its own words. It ca
|
|
|
251
326
|
site's own screen: it reads the channel manager's copy, as last seen. "What your software last sent" is
|
|
252
327
|
there for changes made after this feature shipped.
|
|
253
328
|
|
|
254
|
-
Guides: <https://docs.zimmerstack.com/dry-run> · <https://docs.zimmerstack.com/notices> ·
|
|
255
|
-
<https://docs.zimmerstack.com/close-and-reopen> · <https://docs.zimmerstack.com/explain>
|
|
329
|
+
Guides: <https://docs.zimmerstack.com/guides/dry-run> · <https://docs.zimmerstack.com/guides/notices> ·
|
|
330
|
+
<https://docs.zimmerstack.com/guides/close-and-reopen> · <https://docs.zimmerstack.com/guides/explain-one-night>
|
|
256
331
|
|
|
257
332
|
## Set up a hotel's rooms: create, change, delete
|
|
258
333
|
|
|
@@ -263,7 +338,8 @@ sell it, like "Bed and breakfast". Prices belong to rate plans.
|
|
|
263
338
|
// `ref` is your own id for the room type.
|
|
264
339
|
const room = await zs.roomTypes.save({ ref: "deluxe", name: "Deluxe Room", roomCount: 8, adults: 2 });
|
|
265
340
|
|
|
266
|
-
// `defaultRate` is the plan's
|
|
341
|
+
// `defaultRate` is the plan's real price for a night: 4500 means 4,500.00. A new rate plan needs it:
|
|
342
|
+
// every date of the plan can be sold at this price until you send the price of each night.
|
|
267
343
|
const plan = await zs.ratePlans.save({ ref: "deluxe-bb", roomTypeRef: "deluxe", name: "Bed and breakfast", mealPlan: "CP", defaultRate: 4500 });
|
|
268
344
|
|
|
269
345
|
room.id; // name it when you set the rooms left to sell
|
|
@@ -284,7 +360,7 @@ await zs.roomTypes.delete("deluxe"); // its rate plans are deleted with it
|
|
|
284
360
|
- Call a delete only when a person chose to delete that one thing. Never from a loop or a clean-up
|
|
285
361
|
script.
|
|
286
362
|
|
|
287
|
-
Guide: <https://docs.zimmerstack.com/
|
|
363
|
+
Guide: <https://docs.zimmerstack.com/reference>
|
|
288
364
|
|
|
289
365
|
## Receive bookings
|
|
290
366
|
|
|
@@ -378,7 +454,7 @@ hotel `zs.bookings.create` also takes `nightlyRateIncludesTaxes`; `false` is ref
|
|
|
378
454
|
`TAXES_NOT_CONFIGURED` where the hotel has confirmed no lines, and `TAXES_INSIDE_RATES` where all its
|
|
379
455
|
taxes sit inside its prices.
|
|
380
456
|
|
|
381
|
-
Guide: <https://docs.zimmerstack.com/webhooks>
|
|
457
|
+
Guide: <https://docs.zimmerstack.com/guides/webhooks>
|
|
382
458
|
|
|
383
459
|
## A different price on each booking site
|
|
384
460
|
|
|
@@ -409,7 +485,7 @@ automatically.
|
|
|
409
485
|
One call to `zs.channels.setModifier()` moves every price on that booking site. Call it when a person
|
|
410
486
|
saved the setting. Never from a loop, a timer or a set-up script.
|
|
411
487
|
|
|
412
|
-
Guide: <https://docs.zimmerstack.com/per-ota>
|
|
488
|
+
Guide: <https://docs.zimmerstack.com/guides/price-per-ota>
|
|
413
489
|
|
|
414
490
|
## Many hotels on one key
|
|
415
491
|
|
|
@@ -421,8 +497,8 @@ const hotel = zs.forProperty(properties[0]!.id); // the same client, working on
|
|
|
421
497
|
await hotel.grid.load("2026-12-01", "2026-12-14");
|
|
422
498
|
```
|
|
423
499
|
|
|
424
|
-
- A **test** company key reaches your practice hotels. While you have only one, the package finds it
|
|
425
|
-
itself,
|
|
500
|
+
- A **test** company key reaches all your practice hotels. While you have only one, the package finds it
|
|
501
|
+
by itself. With several, name one, as the Start does from step 6.
|
|
426
502
|
- A **live** key never guesses. Always name the hotel.
|
|
427
503
|
- An app that serves one hotel can name it once: `ZIMMERSTACK_PROPERTY_ID=61` on the server, or
|
|
428
504
|
`new ZimmerStack({ propertyId: 61 })`.
|
|
@@ -451,12 +527,22 @@ const hotel = zs.forProperty(added.id);
|
|
|
451
527
|
await hotel.roomTypes.save({ ref: "rt-river", name: "River View Room", roomCount: 6, adults: 2 });
|
|
452
528
|
```
|
|
453
529
|
|
|
454
|
-
The hotel works at once and joins your monthly invoice on the next 1st.
|
|
455
|
-
the
|
|
530
|
+
The hotel works at once and joins your monthly invoice on the next 1st. It is put on the channel manager
|
|
531
|
+
when its billing starts, with the room types you sent; then you connect its booking sites in the partner
|
|
532
|
+
portal.
|
|
533
|
+
|
|
534
|
+
```ts
|
|
535
|
+
// Change a hotel you added: its name, its address, or both. Only what you send changes.
|
|
536
|
+
const changed = await zs.properties.update(added.id, { name: "Ganga Riverside Guest House", address: { line1: "16 Assi Ghat Road" } });
|
|
537
|
+
changed.changed; // ["name", "address.line1"]
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
It never changes the hotel's country, currency, time zone, owner or tax id. It changes the hotel in
|
|
541
|
+
ZimmerStack, not the name of its listing on a booking site.
|
|
456
542
|
|
|
457
543
|
```ts
|
|
458
|
-
// Remove a hotel you added. confirm is the hotel's exact name, so a wrong id never removes a hotel.
|
|
459
|
-
const gone = await zs.properties.delete(added.id, { confirm:
|
|
544
|
+
// Remove a hotel you added. confirm is the hotel's exact name as it is now, so a wrong id never removes a hotel.
|
|
545
|
+
const gone = await zs.properties.delete(added.id, { confirm: changed.name });
|
|
460
546
|
gone.channelManager.state; // "REMOVED", or "RETRYING" while one step is still finishing
|
|
461
547
|
```
|
|
462
548
|
|
|
@@ -471,27 +557,31 @@ package waits up to a minute and a half for these two calls. If no answer arrive
|
|
|
471
557
|
error), you can safely call `delete` again: a hotel that is already gone answers `replay: true`, and
|
|
472
558
|
one that is still being removed answers `PROPERTY_BUSY` (wait, then ask again).
|
|
473
559
|
|
|
474
|
-
Guide: <https://docs.zimmerstack.com/hotels>
|
|
560
|
+
Guide: <https://docs.zimmerstack.com/guides/add-and-remove-hotels>
|
|
475
561
|
|
|
476
562
|
## Connect a booking site, go live, and a hotel's keys
|
|
477
563
|
|
|
478
564
|
A software company's **company key** can do three more things without the partner portal (from 0.9.0).
|
|
479
565
|
Each needs its own permission, ticked when the key is made.
|
|
480
566
|
|
|
481
|
-
**A connect link.** The hotel's own person connects a booking site.
|
|
482
|
-
|
|
567
|
+
**A connect link.** The hotel's own person connects a booking site. Only Airbnb is connected from
|
|
568
|
+
the link alone: the host signs in on Airbnb's own page. Every other booking site must first accept
|
|
569
|
+
our connectivity partner for the hotel, in its extranet or through its support. That step can take
|
|
570
|
+
days, and no call does it: `hotelStep` in the answer says how.
|
|
483
571
|
|
|
484
572
|
```ts
|
|
485
573
|
import { shownOnce } from "@zimmerstack/connect";
|
|
486
574
|
|
|
487
575
|
const made = await zs.connectLinks.create({ propertyId: 61, channel: "bookingcom" });
|
|
488
|
-
await
|
|
576
|
+
await tellTheHotel(made.hotelStep); // the step at the booking site, first (null for Airbnb)
|
|
577
|
+
await sendOnceTheStepIsDone(shownOnce(made)); // then the link
|
|
489
578
|
```
|
|
490
579
|
|
|
491
|
-
The hotel opens the link on ZimmerStack's page
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
580
|
+
The hotel's person opens the link on ZimmerStack's page and types the hotel's id at the booking site
|
|
581
|
+
(MakeMyTrip and Goibibo also ask for the access token they give). Then they confirm each room and
|
|
582
|
+
rate match, and press Start selling. You then receive `channel.connect.completed`. No call takes the
|
|
583
|
+
booking site's details or a match. A link is made with a **live** key only: a practice hotel has no
|
|
584
|
+
booking site to connect. Permission: `channels:connect`.
|
|
495
585
|
|
|
496
586
|
**Readiness and go-live.** A hotel you add is yours from the first day. A hotel that let you in with
|
|
497
587
|
your vendor code is not, until it goes live.
|
|
@@ -530,8 +620,8 @@ console.log(withoutShownOnce(minted)); // safe to log: th
|
|
|
530
620
|
in it: `shownOnce` then throws an error that names the call that gets you a new one. It never hands you
|
|
531
621
|
an empty value to store by mistake.
|
|
532
622
|
|
|
533
|
-
Guides: <https://docs.zimmerstack.com/connect-
|
|
534
|
-
<https://docs.zimmerstack.com/
|
|
623
|
+
Guides: <https://docs.zimmerstack.com/guides/connect-an-ota> · <https://docs.zimmerstack.com/partner/go-live> ·
|
|
624
|
+
<https://docs.zimmerstack.com/guides/keys-and-scopes#hotel-keys>
|
|
535
625
|
|
|
536
626
|
## Your bills, support and status
|
|
537
627
|
|
|
@@ -555,8 +645,8 @@ const { incidents } = await zs.status.get(); // is something wrong on ZimmerSta
|
|
|
555
645
|
- `zs.status.get()` lists the incidents that touch your hotels. During one, keep what your people
|
|
556
646
|
changed and send it when it ends.
|
|
557
647
|
|
|
558
|
-
Guides: <https://docs.zimmerstack.com/
|
|
559
|
-
<https://docs.zimmerstack.com/status>
|
|
648
|
+
Guides: <https://docs.zimmerstack.com/guides/bills-by-api> · <https://docs.zimmerstack.com/guides/support> ·
|
|
649
|
+
<https://docs.zimmerstack.com/guides/status-and-incidents>
|
|
560
650
|
|
|
561
651
|
## Bookings from the hotel's own website
|
|
562
652
|
|
|
@@ -618,7 +708,7 @@ that booking. The nights come back and no money moves. To try a no-show, call
|
|
|
618
708
|
`zs.sandbox.bookings.noShow(bookingId)` on that booking: your address receives the real
|
|
619
709
|
`direct.booking.modified`, and `{ undo: true }` takes it back.
|
|
620
710
|
|
|
621
|
-
Guide: <https://docs.zimmerstack.com/website-bookings>
|
|
711
|
+
Guide: <https://docs.zimmerstack.com/guides/website-bookings>
|
|
622
712
|
|
|
623
713
|
## When the API says no
|
|
624
714
|
|
|
@@ -650,7 +740,7 @@ const zs = new ZimmerStack({ onEvent: (e) => e.type === "wait" && console.log(e.
|
|
|
650
740
|
await zs.rates.set(updates, { maxWaitSeconds: 3600 }); // "PUT /rates lands in about 25 minutes (waiting for the cells-hour budget)."
|
|
651
741
|
```
|
|
652
742
|
|
|
653
|
-
Every code, what it means and what to do: <https://docs.zimmerstack.com/errors>
|
|
743
|
+
Every code, what it means and what to do: <https://docs.zimmerstack.com/guides/errors>
|
|
654
744
|
|
|
655
745
|
## When something is wrong: the doctor
|
|
656
746
|
|
|
@@ -702,7 +792,7 @@ npx @zimmerstack/connect doctor --room-type 412 --night 2026-12-31
|
|
|
702
792
|
error code, the address and the request id of each call, never a body. An address you do not
|
|
703
793
|
recognise is the first sign of a leaked key.
|
|
704
794
|
|
|
705
|
-
Guide: <https://docs.zimmerstack.com/
|
|
795
|
+
Guide: <https://docs.zimmerstack.com/guides/keys-and-scopes>
|
|
706
796
|
|
|
707
797
|
## What the package does for you
|
|
708
798
|
|
|
@@ -718,7 +808,7 @@ Guide: <https://docs.zimmerstack.com/authentication>
|
|
|
718
808
|
| A refused key is not tried again | After a key is refused, it stops calling. |
|
|
719
809
|
| A test must not touch a real hotel | Refuses to change anything with a `zsk_live_` key while your tests run. |
|
|
720
810
|
|
|
721
|
-
Limits in full: <https://docs.zimmerstack.com/limits>
|
|
811
|
+
Limits in full: <https://docs.zimmerstack.com/guides/rate-limits>
|
|
722
812
|
|
|
723
813
|
## Limits
|
|
724
814
|
|
|
@@ -829,7 +919,7 @@ it (`arrivesCancelled: true`), a website booking and its no-show, and a channel
|
|
|
829
919
|
makes its pretend booking site refuse the next price, so you can watch your software handle it. A software company makes test keys
|
|
830
920
|
in the partner portal under Developers. A hotel's owner makes one in Admin → Developers → API keys.
|
|
831
921
|
|
|
832
|
-
Guide: <https://docs.zimmerstack.com/sandbox>
|
|
922
|
+
Guide: <https://docs.zimmerstack.com/guides/sandbox>
|
|
833
923
|
|
|
834
924
|
## For AI coding agents
|
|
835
925
|
|
|
@@ -885,15 +975,15 @@ test key only and refuses a live one, so an agent cannot change a real hotel thr
|
|
|
885
975
|
the rules and the lookups still work.
|
|
886
976
|
|
|
887
977
|
The whole API in one file an agent can read: <https://docs.zimmerstack.com/llms-full.txt>.
|
|
888
|
-
More: <https://docs.zimmerstack.com/ai>
|
|
978
|
+
More: <https://docs.zimmerstack.com/guides/build-with-ai>
|
|
889
979
|
|
|
890
980
|
## Words used here
|
|
891
981
|
|
|
892
982
|
| Word | What it means |
|
|
893
983
|
|---|---|
|
|
894
984
|
| Booking site | A website that sells the hotel's rooms: Booking.com, Airbnb, Expedia and the rest. Travel people say OTA. The API calls each one a channel. |
|
|
895
|
-
| Sandbox |
|
|
896
|
-
| Key | A password for your software. `zsk_test_` works
|
|
985
|
+
| Sandbox | Where your practice hotels live. The docs call one a test hotel. It behaves like a real hotel, but no booking site ever sees it. |
|
|
986
|
+
| Key | A password for your software. `zsk_test_` works in your sandbox, `zsk_live_` on a real hotel. |
|
|
897
987
|
| Company key | One key for all of a software company's hotels. Each call says which hotel it is for. |
|
|
898
988
|
| Room type | A kind of room the hotel sells, like "Deluxe Room". |
|
|
899
989
|
| Rate plan | One way to sell a room type, like "Bed and breakfast". Prices belong to rate plans. |
|
|
@@ -901,14 +991,14 @@ More: <https://docs.zimmerstack.com/ai>
|
|
|
901
991
|
| Webhook | A message ZimmerStack sends to your server when something happens, such as a new booking. |
|
|
902
992
|
| Permission | What a key may do, like `catalog:write` for changing room types and rate plans. The API calls it a scope. |
|
|
903
993
|
|
|
904
|
-
More words: <https://docs.zimmerstack.com/
|
|
994
|
+
More words: <https://docs.zimmerstack.com/words>
|
|
905
995
|
|
|
906
996
|
## Find everything
|
|
907
997
|
|
|
908
998
|
| Where | What is there |
|
|
909
999
|
|---|---|
|
|
910
1000
|
| <https://docs.zimmerstack.com> | The guides and the full reference |
|
|
911
|
-
| <https://docs.zimmerstack.com/
|
|
1001
|
+
| <https://docs.zimmerstack.com/partner/first-call> | The first calls, step by step |
|
|
912
1002
|
| <https://docs.zimmerstack.com/pricing> | What a live property costs a month |
|
|
913
1003
|
| <https://www.zimmerstack.com/partners/pms-companies#join> | Sign up, free |
|
|
914
1004
|
| <https://partner.zimmerstack.com/login> | The partner portal: your practice hotels, keys, webhooks, hotels and bills |
|
package/dist/cjs/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AvailabilityWrite, type BatchStatus, type Billing, type BillingInvoices, type BillingNextInvoice, type Booking, type BookingCancel, type BookingCreate, type Catalog, type CatalogDeleteResult, type CatalogUpsertResult, type ChannelBooking, type CloseResult, type CloseRoomType, type ConnectLink, type ConnectLinkCreate, type ConnectLinkCreated, type ConnectLinkList, type DirectBookingCancel, type DirectBookingCancelResult, type EventsList, type Explain, type GoLiveResult, type HotelKey, type HotelKeyCreate, type HotelKeyCreated, type HotelKeyList, type HotelKeyRevoke, type HotelKeyRotated, type Limits, type LoggedEvent, type ModifierResult, type OperationKey, type Operations, type PropertyCreate, type PropertyCreated, type PropertyRemoved, type RatePlansUpsert, type RatesResendAccepted, type RatesWrite, type Readiness, type ReopenRoomType, type RequestLog, type RestrictionsWrite, type RoomTypesUpsert, type SandboxBooking, type SandboxBookingCreate, type SandboxBookingModify, type SandboxFault, type SandboxFaultView, type SandboxNoShow, type SandboxSyncEvent, type SandboxSyncEventView, type Status, type SupportTicket, type SupportTicketCreate, type SupportTicketList, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryList, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointCreated, type WebhookEndpointDeleted, type WebhookEndpointList, type WebhookEndpointResumed, type WebhookEndpointUpdate, type WebhookRecoverResult, type WebhookSecretRotated, type WebhookTest, type WebhookTestQueued, type WriteAccepted, type WritePreview } from "./generated.js";
|
|
1
|
+
import { type AvailabilityWrite, type BatchStatus, type Billing, type BillingInvoices, type BillingNextInvoice, type Booking, type BookingCancel, type BookingCreate, type Catalog, type CatalogDeleteResult, type CatalogUpsertResult, type ChannelBooking, type CloseResult, type CloseRoomType, type ConnectLink, type ConnectLinkCreate, type ConnectLinkCreated, type ConnectLinkList, type DirectBookingCancel, type DirectBookingCancelResult, type EventsList, type Explain, type GoLiveResult, type HotelKey, type HotelKeyCreate, type HotelKeyCreated, type HotelKeyList, type HotelKeyRevoke, type HotelKeyRotated, type Limits, type LoggedEvent, type ModifierResult, type OperationKey, type Operations, type PropertyChange, type PropertyChanged, type PropertyCreate, type PropertyCreated, type PropertyRemoved, type RatePlansUpsert, type RatesResendAccepted, type RatesWrite, type Readiness, type ReopenRoomType, type RequestLog, type RestrictionsWrite, type RoomTypesUpsert, type SandboxBooking, type SandboxBookingCreate, type SandboxBookingModify, type SandboxFault, type SandboxFaultView, type SandboxNoShow, type SandboxSyncEvent, type SandboxSyncEventView, type Status, type SupportTicket, type SupportTicketCreate, type SupportTicketList, type WebhookDelivery, type WebhookDeliveryDetail, type WebhookDeliveryList, type WebhookEndpoint, type WebhookEndpointCreate, type WebhookEndpointCreated, type WebhookEndpointDeleted, type WebhookEndpointList, type WebhookEndpointResumed, type WebhookEndpointUpdate, type WebhookRecoverResult, type WebhookSecretRotated, type WebhookTest, type WebhookTestQueued, type WriteAccepted, type WritePreview } from "./generated.js";
|
|
2
2
|
import { type Grid, type GridEdits, type ModifierStep } from "./grid.js";
|
|
3
3
|
export interface ZimmerStackOptions {
|
|
4
4
|
/**
|
|
@@ -241,6 +241,26 @@ export declare class ZimmerStack {
|
|
|
241
241
|
* const seaBreeze = zs.forProperty(hotel.id);
|
|
242
242
|
*/
|
|
243
243
|
create: (hotel: PropertyCreate, options?: WriteOptions) => Promise<PropertyCreated>;
|
|
244
|
+
/**
|
|
245
|
+
* Change a hotel YOU ADDED: its name, its address, or both. A company key with the scope properties:write.
|
|
246
|
+
*
|
|
247
|
+
* Send only what changes: `name`, and under `address` any of `line1`, `city`, `state` and `postalCode`. A
|
|
248
|
+
* field you leave out stays as it is. It never changes the hotel's country, currency, time zone, owner or
|
|
249
|
+
* tax id (sending one is refused with VALIDATION), and it changes the hotel's record in ZimmerStack, not
|
|
250
|
+
* the name of its listing on a booking site.
|
|
251
|
+
*
|
|
252
|
+
* The answer is the hotel with its `address` and `changed`: the fields whose stored value moved. An empty
|
|
253
|
+
* `changed` means everything you sent was already stored. A hotel whose owner let you in is refused with
|
|
254
|
+
* PROPERTY_NOT_CHANGEABLE: its owner changes it. With a test key it changes one of your sandboxes, whose
|
|
255
|
+
* name keeps its ending, "(sandbox)". Safe to retry: the call carries an idempotency key.
|
|
256
|
+
*
|
|
257
|
+
* After a new name, `zs.properties.delete` wants that new name in `confirm`.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* const hotel = await zs.properties.update(61, { name: "Sea Breeze Suites", address: { line1: "14 Beach Road" } });
|
|
261
|
+
* hotel.changed; // ["name", "address.line1"]
|
|
262
|
+
*/
|
|
263
|
+
update: (propertyId: number, changes: PropertyChange, options?: WriteOptions) => Promise<PropertyChanged>;
|
|
244
264
|
/**
|
|
245
265
|
* Remove a hotel YOU ADDED, for good. A company key with the scope properties:write.
|
|
246
266
|
*
|
|
@@ -420,19 +440,24 @@ export declare class ZimmerStack {
|
|
|
420
440
|
/** Your connect links, newest first; `propertyId` narrows them to one hotel. */
|
|
421
441
|
list: (query?: Op<"GET /connect-links">["query"], options?: ReadOptions) => Promise<ConnectLinkList>;
|
|
422
442
|
/**
|
|
423
|
-
* Make a one-time link for ONE hotel and ONE booking site.
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
443
|
+
* Make a one-time link for ONE hotel and ONE booking site. Only Airbnb is connected from the link alone
|
|
444
|
+
* (the host signs in on Airbnb's own page). Every other booking site must FIRST accept our connectivity
|
|
445
|
+
* partner for the hotel, in its extranet or through its support: send `hotelStep` to the hotel first, and
|
|
446
|
+
* the answer's `url` once that step is done. On ZimmerStack's hosted page the hotel's own person types
|
|
447
|
+
* the hotel's id at the booking site (MakeMyTrip also its access token), confirms every room and rate
|
|
448
|
+
* match and presses Start selling. The call takes no booking-site detail and no match. You hear
|
|
449
|
+
* `channel.connect.completed`, or `channel.connect.expired` if the link ran out.
|
|
427
450
|
*
|
|
428
451
|
* THE `url` IS SHOWN ONCE: it is in this answer only, and null on a replay of the same request
|
|
429
452
|
* (`shownOnce(answer)` returns it or says what to do). `hotelStep` is what the hotel does at the booking
|
|
430
|
-
* site first, for your own screen or message. A LIVE key only: a
|
|
431
|
-
* key is refused (LIVE_KEY_REQUIRED). The hotel is `propertyId`
|
|
453
|
+
* site first (null for Airbnb), for your own screen or message; it can take days. A LIVE key only: a
|
|
454
|
+
* sandbox has no booking site, so a test key is refused (LIVE_KEY_REQUIRED). The hotel is `propertyId`
|
|
455
|
+
* in the body; `forProperty` is not read.
|
|
432
456
|
*
|
|
433
457
|
* @example
|
|
434
458
|
* const made = await zs.connectLinks.create({ propertyId: 61, channel: "bookingcom", returnUrl: "https://pms.example/hotels/61" });
|
|
435
|
-
* await
|
|
459
|
+
* await tellTheHotel(made.hotelStep); // first
|
|
460
|
+
* await sendOnceTheStepIsDone(shownOnce(made)); // then the link
|
|
436
461
|
*/
|
|
437
462
|
create: (body: ConnectLinkCreate, options?: WriteOptions) => Promise<ConnectLinkCreated>;
|
|
438
463
|
/** Where one link stands: pending, opened, completed, expired or revoked. Never its address again. */
|