Prices, restrictions and availability
Two calls keep the calendar in your system in step with the hotel's:
/rates-restrictionssays what a night costs and the rules for booking it./availabilitiessays how many rooms are left.
Both work over a date range, so sync in ranges, not day by day.
GET /rates-restrictions
| Parameter | Required | |
|---|---|---|
date_from, date_to |
yes | YYYY-MM-DD |
properties |
no | Comma-separated property ids |
rooms |
no | Comma-separated room ids |
date_from must be today or later and date_to not before it; both days
are included (error 3 otherwise).
The answer is grouped property → room → rate plan; each property carries
its currency, and each rate plan two lists.
accommodations has one entry per way of filling the room, with a
price for each night. An accommodation says who it is for and where they
sleep:
person_code:Aadult,Tteenager,Cchild,Iinfant;bed_code:RBregular bed,EBextra bed,NBno bed;person_qty: how many such people.
Each accommodation is named by its acm_id (A2, CRB, …), and its
nights are in prices. Each night has:
price;is_opened: when it isfalse, that night cannot be booked andpriceisnull;- its own
restrictions.
restrictions is the same set of rules folded into one per night, safe
for every accommodation: a list of {date, restrictions}. Use it when you
need one answer for the rate plan as a whole. exact_stay appears only on
an accommodation's own nights, never in this folded list.
No rules is an empty object {}. Treat {} and [] alike as "no
restriction", on the rate plan and on every night.
The rules a night can carry:
| Field | Meaning |
|---|---|
min_los, max_los |
Shortest and longest stay that includes this night |
min_los_arrival, max_los_arrival |
Shortest and longest stay when arriving this day |
exact_stay |
The stay must be exactly this many nights |
no_arrival, no_departure |
No check-in, or no check-out, on this day |
min_abo, max_abo |
At least, or at most, this many days between booking and arrival |
How the nightly prices add up to a stay depends on the rate plan's
sell_type (from /properties): per room, per person, or per occupancy.
For the exact price of one stay and one party, do not add it up yourself.
Ask POST /search, or auto-price with
dry_run: both price the stay with the hotel's own rules, discounts
included.
GET /availabilities
How many units of each room are free, night by night.
| Parameter | Required | |
|---|---|---|
locale |
yes | Language of the names |
date_from, date_to |
yes | YYYY-MM-DD |
properties |
no | Comma-separated property ids |
rooms |
no | Comma-separated room ids |
The same date rules apply: date_from today or later, date_to not before
it, both included (error 3 otherwise).
For each room you get dates, which contains every date in the range, and
qty, the units left that night. Units the hotel holds in a sales block for
someone else are not counted as free.
A property or a room with nothing free for the whole range is left out of the answer. A missing room means "sold out for these dates", not "unknown".
Staying in sync
- Ranges, not single days. One call for a month is far lighter, for both of us, than thirty calls for one day each.
- Webhooks instead of polling. Subscribe to
availabilityandrates-restrictions, and we send you each changed range as it changes: see Webhooks. A full re-sync once a night is then enough. - The live calendar decides. Your copy can be minutes behind. A search and a booking always check the live calendar, and a booking for a room that has just sold out is refused, not overbooked, unless the hotel has set your rate plan to accept bookings without the availability check (see Book with your price).