Your own booking engine
Price, check and book from the hotel website with the property key: the same data as Hotelgest’s engine.
6 min read
For a hotel website that sells rooms with its own engine instead of Hotelgest’s. The prices, packs and promo codes come from the same service Hotelgest’s booking engine reads, so what your website shows is what the hotel set in the PMS; what changes is the credential, the key the hotel issues. Websites that called the old API (api.hotelgest.com/v1/price/room, /v1/property/…) move here.
From your server, never from the browser
The key, and what to grant it
The hotel issues it in the PMS, under Settings → API keys, and chooses the endpoints it may call. The booking engine ones are only reachable when they are granted on purpose — a key issued without a selection does not reach them. Every key issued now answers encrypted: read the encryption guide before the first call.
| Endpoint | What your engine uses it for |
|---|---|
GET /api/rooms/{pcode}/types | Room types and their rooms: names, capacity and the ids everything else takes. |
GET /api/properties/{pcode}/settings/custom-policies | The names of the cancellation policies a rate refers to. |
GET /api/direct-booking/{pcode}/prices | The price of each rate for the stay, night by night, with the restrictions that decide whether it can be sold. |
GET /api/direct-booking/{pcode}/packs | The packs on sale. |
GET /api/direct-booking/{pcode}/promo-codes | Whether the code a guest typed exists, and what it takes off. |
GET /api/v2/rooms/{pcode}/availability | Which rooms are free, to pick the one you book. |
POST /api/v5/bookings/{pcode} | The booking. |
From a search to a booking
- 1Price the stayAsk for prices with the arrival and the departure. The answer is keyed by room type; under
rateeach one lists its rates (room type, board, policy, guests) with the price of each night inpriceList. Leave out the rates withmotor_excl=1, the closed ones (_closed=1), the ones whose_minstayor_maxstaythe stay does not meet (a_maxstayof0means no limit) and the ones where the stay starts on a date ofclosedarrivalor ends on one ofcloseddeparture. The room typepriceleaves none of those out: recompute it from the rates you keep. - 2Apply the promo code, if anyCheck it: an empty list means it does not exist. When it does, check
dfromanddtoagainst the stay and applyvalueasdtypesays:0an amount off each night,-1a percentage off the stay,-2an amount off the stay. - 3Pick the roomAvailability lists the free rooms of each type. The prices answer also says how many are free, but the booking needs one in particular.
- 4BookSend the room, the rate and the night prices you showed. The booking checks availability again and is rejected whole if the room was taken meanwhile; send an
Idempotency-Keyso a retry never books twice.
| In the booking (`rooms[]`) | Where it comes from |
|---|---|
rtcode, boardId, politicId | The rate you sold: its rtcode, board and policy. |
rcode | A free room of that type, from availability. |
adults, children, babies | The guests; their total is the rate’s occupancy. |
pax | The total of guests, as text (kept for compatibility). Required. |
ancillary | The price of each night, from the rate’s priceList, keyed by date. |
ancillaryWithDiscount | With a promo code, the night prices after the discount: the booking total is their sum. |
promoCode | The code checked above, as type-value-id-code, where type is fbn for dtype 0, pbn for -1 and ta for -2. |
promoCodeManual | { "isActive": false } unless reception applies a manual discount. Required. |
Prices are a snapshot