Conventions

The rules every endpoint follows.

The envelope

{ "status": "ok", "message": "ok", "data": { … } }

status is ok or error. message is always a key, never a sentence. A single object comes back as data itself. A list comes back under a plural key, with meta beside it:

{ "status": "ok", "message": "ok",
  "data": { "bookings": [ … ], "meta": { "total": 1, "page": 1, "per_page": 50, "last_page": 1 } } }

Errors

An error has the HTTP status and a key to match on. Translate the key in your own interface — don't show it to people as it is.

{ "status": "error", "message": "errors.qc.idempotency_conflict" }

A rejected field names the field, the rule and its parameters:

{ "status": "error", "message": "errors.validation_error",
  "errors": { "name": [ { "key": "validation.required", "params": { "attribute": "name" } } ] } }
Status Means
401 no token, or a token that has expired — get a new one
403 the token lacks the scope, or the property is not its
404 the id names nothing — errors.not_found
409 the Idempotency-Key was used for a different request
422 a field was rejected — read errors
429 over the rate limit — wait Retry-After seconds

Every key is in the error dictionary. Every answer carries an X-Request-Id. Quote it when you write to us.

Ids

Hotels, room types, rate plans and bookings have string ids: the object's own is id, and another object names it property_id, room_type_id, rate_plan_id, booking_id. A rate plan id names the plan on ONE room. Quendoo's internal numbers never appear.

YOUR ids are partner_code — on the property, a room type, a rate plan, and, mapped by the hotel, on its extras, meal plans and bed types. A booking you make keeps your reference as partner_reference. Ids that belong to a sales channel are ota_… (ota_channel_id).

Configuration records — payment and cancellation policies, promotions, extras, booking modules, payment methods — have numeric ids (2183).

A property, room type or rate plan with a partner_code can be addressed by that code in the URL instead of the id. Booking ids are the hotel's booking codes (MDQAFARE).

Pages

A list takes ?page= and ?limit=. meta.per_page tells you the limit that was applied: one that is too large is lowered to the endpoint's maximum (100 for bookings, 200 for properties). last_page is at least 1.

The booking feed is the exception. It is read by cursor, not by page — see Receiving bookings.

Paths

Every path is lower case with underscores: room_types, booking_offers, age_groups, bookings/from_search. Six older paths were written with hyphens (age-groups, pricing-model, from-search, cancellation-quote, rotate-secret, property-types); they keep working, but use the underscore ones.

Dates and times

Money

Amounts are numbers in the property's currency, in its main unit (240 is 240 euros). The currency always comes with it: as currency beside the amount, or, on bookings, as { "amount": 240, "currency": "EUR" }. An offer search may show prices in another currency for the guest. The booking is always written in the property's own currency.

Idempotency-Key

Send an Idempotency-Key on every POST, PATCH, PUT and DELETE — any unique string; a UUID is best. If the connection drops, send the same request again with the same key:

An error answer is remembered too. If a write came back 422, fix the body and send it with a new key — the old key would answer 409.

A write without the header still works, but a retry can then do the work twice.