Webhooks
Instead of asking us again and again whether something changed, give us a URL and we call it when something does. You register webhooks in your Quendoo agency account, under B2B → Webhooks. The same page lists every call we made and how your server answered. If you do not see the page, ask us to turn webhooks on for your account.
What you can subscribe to
| Webhook | Sent when | payload |
|---|---|---|
booking |
One of your bookings is created, changed, confirmed or cancelled, including by the hotel | The booking, exactly as GET /booking returns it with locale=en |
availability |
Availability changes on a room you can sell | The changed range, in the shape of GET /availabilities |
rates-restrictions |
Prices or restrictions change on a rate plan you can sell | The changed range, in the shape of GET /rates-restrictions |
The availability and rates-restrictions payloads cover only the
properties and rooms you may sell, and only the nights that changed:
- One property per call. Changes to several properties come as separate calls.
- Only the changed nights, room by room. If room 46 changed on 3 and 28 November, the call carries those two nights, not the 26 between them.
- At most 500 room-nights per call. A larger change, such as a season of new prices, comes as several calls in a row.
- A room that sells out arrives with
qty0 for those nights, so you can close it. (GET /availabilitiesand a resync leave out a room with nothing to sell in the range.)
A resync is the exception: it comes as one call per webhook, covering every property you named and every room for the whole range.
What we send
A POST to your URL, with Content-Type: application/json and this body:
{
"timestamp": 1784123456,
"nonce": "9f2c4e0b7a1d4c3e8b6a5f0e1d2c3b4a",
"webhook": "booking",
"sequence": 1842,
"payload": { "id": 712904, "booking_status": "APPROVED" }
}
timestamp: when we sent it, as Unix time.nonce: random, different on every call.webhook: which subscription this call is for.sequence: a counter of its own for each webhook you registered, 1, 2, 3, … A retry keeps its number, so receiving the same number twice means a retry. A number you never received means a call you missed: foravailabilityandrates-restrictions, ask for that range again; forbooking, read your recent bookings withGET /booking.format: present only if you choseranges(see below).payload: what changed.
The payload above is shortened. A real one is the full booking.
Nights or ranges
By default, availability and rates-restrictions list every night on its
own, exactly as GET /availabilities and
GET /rates-restrictions do:
"dates": [
{ "date": "2027-07-01", "qty": 3 },
{ "date": "2027-07-02", "qty": 3 },
{ "date": "2027-07-03", "qty": 1 }
]
You can choose ranges instead, for each webhook, on the B2B →
Webhooks page. Consecutive nights with exactly the same values then come
as one entry, and the body carries "format": "ranges":
"dates": [
{ "date_from": "2027-07-01", "date_to": "2027-07-02", "qty": 3 },
{ "date_from": "2027-07-03", "date_to": "2027-07-03", "qty": 1 }
]
The same applies to a rate's restrictions and to each accommodation's
prices. Both dates are included: date_to is the last night, not the
departure day.
Switch to ranges only after your system reads them. The change applies to the next call.
Checking that it came from us
Every call carries the header X-Signature-SHA256: an HMAC-SHA256 of the
raw request body, keyed with the shared secret of the webhook, as a hex
string.
- Compute the HMAC over the body exactly as you received it, before any parsing. A framework that decodes the JSON and encodes it again changes the bytes, and the signature no longer matches.
- The secret is base64. Decode it first, and key the HMAC with the decoded bytes.
- Compare in constant time, and reject a call whose signature does not match.
- Refuse replays: drop a call whose
timestampis too old, or whosenonceyou have already seen.
$body = file_get_contents('php://input');
$expected = hash_hmac('sha256', $body, base64_decode($secret));
if (! hash_equals($expected, $_SERVER['HTTP_X_SIGNATURE_SHA256'] ?? '')) {
http_response_code(401);
exit;
}
Answering
- Your URL must be a public address.
httporhttps, on any port. We refuse private, loopback and link-local addresses, both when you save the URL and on every call. - We do not follow redirects. A
3xxanswer counts as a failure, so register the final URL. - Answer with any
2xx, within ten seconds. Anything else, or no answer, counts as a failure. - A failed call is retried for up to two hours, at growing intervals
(30 seconds, then 1, 5, 15, 30 and 60 minutes). A retry carries
the data as it is when it is sent, not as it was when it first failed.
After that the call is marked failed; ask for the range again with
POST /webhooks/resync. - Do the work after you answer. Store the call, answer
200, then process it. Slow processing inside the request is the most common reason a call times out. - Changes are gathered before they go. We wait a few seconds after a change to availability, and 30 seconds after a change to prices, for the changes that usually follow it. A hotel editing a season then reaches you in a few calls, not hundreds. A waiting call always carries the values as they are when it is sent.
- At most 30 calls a minute per webhook. More changes wait for the next minute and are gathered into the calls that follow. Nothing is lost.
- While a call to you is failing, nothing else is sent to that webhook. When the retry goes, it carries what changed in the meantime too.
Asking for a range again
If you missed deliveries — your server was down, or a call kept failing for two hours — ask for the range again instead of pulling it window by window:
POST /webhooks/resync
{
"webhook": "availability",
"date_from": "2027-07-01",
"date_to": "2027-07-31",
"properties": [63]
}
webhook:availabilityorrates-restrictions.date_from,date_to: at most 31 days counting both ends, anddate_tonot in the past.properties: optional; leave it out for every property you sell.
We queue one delivery per webhook you registered for it, and it reaches
you like any other call. The answer is
{"queued": 1, "webhook": "availability", "date_from": "…", "date_to": "…"}.
You can ask 30 times an hour; only accepted requests count.
It is refused:
- with error 4 when
webhookis notavailabilityorrates-restrictions, when you have no enabled webhook for that event, or after 30 requests in an hour; - with error 3 when a date is invalid,
date_tois beforedate_fromor in the past, or the range is longer than 31 days; - with error 7 for a property you do not sell.
Webhooks and syncing
Webhooks tell you quickly. They are not a guarantee: your server can be down for longer than the retries last. Keep a nightly full sync of prices and availability as the safety net, and use webhooks to stay current between syncs.