Webhooks
Tulo POSTs every booking change at the property to your server, signed with Tulo's own Ed25519 key. Verify the signature, act once per delivery, and answer 2xx.
Setting up#
Tulo sends webhooks to {your base URL}/tulo/webhooks, for example https://hotel.example/tulo/webhooks, as POST with Content-Type: application/json. Only Tulo sets the base URL, and an id of your choosing for the property (partner_place_id in every payload, empty when none was set): the property asks at support@mail.tulo.homes or WhatsApp +260 77 235 2417. A property's managers can read both, and Tulo's webhook signing keys, in the Tulo console under Settings, then API keys (from 1.4.1). A property with no base URL gets no webhooks.
You receive an event for every booking at the property, whatever its source: your website, the Tulo app, or the desk. The guest's name and phone are only on bookings your website created.
Events#
This is every event Tulo sends (from 1.4.1 the list is complete; it is read from the contract, which a test keeps equal to the events the code can send). Each carries the whole booking as it is after the change.
| Event | When |
|---|---|
booking.created | a Tulo app booking is waiting for the property to confirm it by hand (status confirming). It is followed by booking.confirmed or booking.cancelled. |
booking.confirmed | a booking is confirmed. A website, walk-in or phone booking when it is made; a Tulo app booking when it is confirmed (automatically or by the property). |
booking.cancelled | the whole booking ended before the stay: cancelled_by_guest, cancelled_by_property, or a Tulo app request the property declined (failed_rejected) or did not confirm in time (failed_timeout). |
booking.modified | the property changed the booking: dates, stay end, room type, party, beds, price, guest details or note. |
booking.checked_in | the guest checked in (several rooms: the first room in). |
booking.checked_out | the guest checked out (several rooms: the last room out). |
booking.no_show | the property marked that the guest did not arrive (status no_show). |
booking.no_show_undone | the property undid a no-show the same day (back to confirmed). |
booking.check_in_undone | the property undid a check-in. |
booking.check_out_undone | the property undid a check-out. |
booking.room_cancelled | (multi-room, 1.4.0) the property cancelled one room of a booking, or marked that one room's guests did not arrive. The booking stays confirmed; in booking.rooms[] that room has state cancelled or no_show and cancelled_at, and room_count, adults, children and stay_total no longer count it. The last room cannot be cancelled this way (the whole booking is cancelled instead, booking.cancelled). |
booking.updated | (multi-room, 1.4.0) something inside a multi-room booking changed without changing its status: a room added, a room moved to another room of the same type, one room checked in or out while others are not, or a named guest added, renamed, moved or removed. |
booking.unit_moved | the property moved the booking to another room of the same type (for example a room taken out of order). Nothing in the payload changes for the website (the physical room is never sent); you may ignore it. |
Payload#
The body is a WebhookEvent: event, occurred_at, partner_place_id and booking, the whole booking as it is after the change, in the same shape as GET /bookings/{id}. There is no diff: read the booking as the new state. A booking made with several rooms carries room_count and rooms[].
{
"event": "booking.created",
"occurred_at": "2026-11-13T10:00:00Z",
"partner_place_id": "EXT-1",
"booking": {
"id": "5f0c2a1e-8b7d-4c3a-9e21-0d6f4b8a7c11",
"place_id": "c4a1e7b2-3d5f-4e69-8a0b-1c2d3e4f5a6b",
"room_type_id": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"status": "confirmed",
"status_label": "Confirmed",
"source": "website",
"check_in": "2026-12-01",
"check_out": "2026-12-03",
"nights": 2,
"adults": 2,
"children": 0,
"beds": 1,
"stay_total": 90000,
"currency": "ZMW",
"payment": "pay_at_property",
"created_at": "2026-11-13T10:00:00Z",
"confirmed_at": "2026-11-13T10:00:00Z",
"cancelled_at": null,
"checked_in_at": null,
"checked_out_at": null
}
}Headers#
- X-Tulo-Key-Idstring · required
The
kidof the Tulo key that signed this delivery.- X-Tulo-Delivery-Idstring (uuid) · required
The delivery's id, the same on every retry of that delivery.
- X-Tulo-Timestampstring · required
Unix seconds of this attempt.
- X-Tulo-Signaturestring · required
The Ed25519 signature, base64url without padding.
- X-Tulo-Eventstring · required
The event, as in the body.
Verifying a delivery#
v1.{X-Tulo-Delivery-Id}.{X-Tulo-Timestamp}.{raw_body}raw_body is the exact bytes received. Verify before you parse the JSON: a parsed and re-serialised body will not verify.
- 1.Find Tulo's public key whose
kidisX-Tulo-Key-Id. FetchGET /partner/v1/signing-keys(no key needed, cacheable for 5 minutes) and cache the keys; fetch again when a delivery names akidyou do not have. - 2.Verify the signature over the signing string with that key.
- 3.Refuse a timestamp more than 5 minutes from your clock.
- 4.Process each
X-Tulo-Delivery-Idonce. Answer2xxto a repeat without acting again.
{
"keys": [
{
"kid": "tulo-2026-11-14",
"alg": "Ed25519",
"public_key": "<43 base64url characters>",
"status": "active"
}
]
}public_key is the raw 32-byte Ed25519 key in base64url. status is active for the key signing now, or retiring for an older key still valid for deliveries signed before a rotation. An empty list means Tulo is not sending webhooks.
Receiver code#
The Node.js receiver uses verifyWebhook from the signing helpers. Tulo's docs tests run it against the webhook test vector.
// tulo-webhooks.mjs: receive Tulo's booking webhooks. Node.js 18 or later.
import { TULO_API, publicKeyFromRaw, verifyWebhook } from "./tulo-signing.mjs";
// Tulo's public keys by kid. Refetched when a delivery names a kid we do not
// have yet (Tulo rotated its key).
const tuloKeys = new Map();
export async function tuloPublicKey(kid, fetchImpl = fetch) {
if (!tuloKeys.has(kid)) {
const res = await fetchImpl(`${TULO_API}/partner/v1/signing-keys`);
const { keys } = await res.json();
tuloKeys.clear();
for (const k of keys) tuloKeys.set(k.kid, publicKeyFromRaw(k.public_key));
}
return tuloKeys.get(kid);
}
// Handle one POST to /tulo/webhooks. `headers` has lower-case names and
// `rawBody` is the exact bytes received. `deliveries` remembers which
// X-Tulo-Delivery-Id values you have processed (use your database).
// Returns the HTTP status to answer: any 2xx stops Tulo's retries.
export async function receiveTuloWebhook({ headers, rawBody, deliveries, onEvent, fetchImpl, now }) {
const kid = headers["x-tulo-key-id"];
const deliveryId = headers["x-tulo-delivery-id"];
const timestamp = headers["x-tulo-timestamp"];
const signature = headers["x-tulo-signature"];
if (!kid || !deliveryId || !timestamp || !signature) return 400;
const publicKey = await tuloPublicKey(kid, fetchImpl);
if (!publicKey) return 401;
if (!verifyWebhook({ publicKey, deliveryId, timestamp, rawBody, signature, now })) return 401;
// A retry of a delivery you already handled: acknowledge, do nothing.
if (await deliveries.has(deliveryId)) return 200;
const event = JSON.parse(Buffer.from(rawBody).toString("utf8"));
await onEvent(event); // ignore event names and fields you do not know
await deliveries.add(deliveryId);
return 200;
}
// server.mjs
import { createServer } from "node:http";
import { receiveTuloWebhook } from "./tulo-webhooks.mjs";
createServer(async (req, res) => {
if (req.method !== "POST" || req.url !== "/tulo/webhooks") {
res.writeHead(404).end();
return;
}
// Collect the raw bytes: verify them before parsing anything.
const chunks = [];
for await (const chunk of req) chunks.push(chunk);
const status = await receiveTuloWebhook({
headers: req.headers, // Node gives lower-case names
rawBody: Buffer.concat(chunks),
deliveries: processedDeliveries, // your store of X-Tulo-Delivery-Id values
onEvent: async (event) => {
// event.event, event.occurred_at, event.booking ...
},
});
res.writeHead(status).end();
}).listen(8080);Test vector#
The webhook vector in the test vectors is signed by a public test key (kid tulo-test-vectors). Your verifier must accept it (with your clock set to its timestamp) and reject the two webhook must-fail cases.
- delivery_id
0b3f6d2a-41c7-4e8f-9a5b-6c1d2e3f4a5b- timestamp
1800000000- body
{"event":"booking.confirmed","occurred_at":"2026-11-13T10:00:00Z","partner_place_id":"EXT-1","booking":{"id":"5f0c2a1e-8b7d-4c3a-9e21-0d6f4b8a7c11","status":"confirmed"}}- public_key
ebVWLo_mVPlAeLES6KmLp5AfhTrmlb7X4OORC60ElmQ- signature
OzdIrdSRCUAg1sPtzogHPXllnLOjZWHrTWX0OIgzaXkl_jB044ywYNrRh_hyiHOks9GF0WSWRf2XUK0npixRAg
Delivery and retries#
- Each event is one delivery: one
X-Tulo-Delivery-Idand a body fixed when the event happened (occurred_atand the booking at that moment), the same bytes on every retry. Every attempt has a newX-Tulo-Timestampand signature. - The first attempt is made right after the change. Tulo waits at most 10 seconds for your answer. Any
2xxis success; a timeout, a connection error or any other status is a failed attempt. Answer at the URL itself (do not redirect), and do slow work after you answer. - After failed attempts 1 to 7 the next attempt waits at least 1, 2, 4, 8, 16, 32 and 60 minutes. After the 8th failed attempt the delivery is marked failed and not sent again.
- Retries are run by Tulo's scheduled retry job, so a retry happens at the later of that wait and the job's next run. The job runs once a day today: a failed first attempt can be retried up to a day later, and 8 attempts can span about 8 days.
- Deliveries can arrive more than once (a retry after a lost
2xx) and out of order (a retry after a newer event). Process eachX-Tulo-Delivery-Idonce; keep the latestoccurred_atyou have applied per booking and skip older ones, or read the booking withGET /bookings/{id}when it is one of yours.
| Attempt | Sent |
|---|---|
| 1 | Right after the event |
| 2 | At least 1 minute after attempt 1 failed |
| 3 | At least 2 minutes after attempt 2 |
| 4 | At least 4 minutes after attempt 3 |
| 5 | At least 8 minutes after attempt 4 |
| 6 | At least 16 minutes after attempt 5 |
| 7 | At least 32 minutes after attempt 6 |
| 8 | At least 60 minutes after attempt 7; the last attempt |
