Skip to content

Receiving our reservations

When a guest books on Localoge, we notify you. Block those nights on your side, otherwise you will keep selling them elsewhere.

Fenêtre de terminal
curl -X PUT https://localoge.com/api/v1/channel/webhooks \
-H "Authorization: Bearer $LOCALOGE_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://partenaire.example.com/webhooks/localoge" }'
{ "success": true, "data": { "id": "…", "url": "…", "secret": "whsec_9f2c…", "events": [] } }

HTTPS is required. An empty events list means all events; specify it to receive only a subset.

We reject (400 INVALID_PAYLOAD) an unknown event name instead of ignoring it: otherwise a typo in reservation.canceled would silently cut you off from cancellations. The error message lists the known names. We also reject a URL that does not resolve to a public address (localhost, 10.x, 192.168.x…): expose a public endpoint, or use the mirror for your first tests.

A subscription applies to one instance: the one registered with your lok_test_ key on the sandbox receives nothing from production, and vice versa.

Or from your dashboard, without writing a line of code

Section titled “Or from your dashboard, without writing a line of code”

In your developer portal, open your application, enter the webhook URL and save: the secret is displayed once, in the same place. Same mechanism, same signature, same behavior. Handy if you want to receive your first events before you have written your API client.

The screen tells you whether delivery is actually wired up, not just whether a URL is saved. A button there regenerates the secret: the old one dies the second the new one is displayed, so deploy it on your side immediately.

Event When
reservation.created A guest booked on Localoge. Block these nights on your side.
reservation.updated A Localoge reservation changed (dates, guests, pets, total).
reservation.cancelled A Localoge reservation was cancelled: the nights are free again.
availability.updated The host changed their availability directly on Localoge.
property.updated A listing changed.
property.status_changed A listing’s status changed: published, paused, pending review. See Listing lifecycle.
message.received A message was posted in a stay’s conversation. See Messaging.
review.created A review was published on a property. The rating is out of ten.
payment.succeeded The rent for a Localoge reservation has been collected (confirmed by our payment provider).
payment.refunded Localoge refunded the guest of a Localoge reservation, fully or partially.
host.connected A host authorized you and you exchanged their code: here is their host_ref. Useful for a management company connecting several owners.
owner.payout_ready The owner of a payout_model: owner property finished registering: the property is no longer refused at booking. See Who gets the money.
host.revoked A host withdrew their authorization: their host_ref is no longer valid. Stop pushing their properties.
webhook.test Sent on demand (POST /webhooks/test or the dashboard button). Carries no business data.

We never send you back the reservations you sent us: you already know them, and you would replay them on your side.

Any event your code does not recognize must be acknowledged with a 2xx and ignored. We will add events; a 400 on a new name would keep the delivery retrying for thirty hours.

{
"event_id": "9b2e41c0-…",
"event": "reservation.created",
"event_key": "reservation.created:3f8a…",
"sequence": 18342,
"resource": "reservation:3f8a…",
"resource_version": 1,
"created_at": "2026-08-26T14:03:11.000Z",
"api_version": "v1",
"environment": "production",
"data": {
"reservation_id": "3f8a…",
"external_property_id": "PROP-4821",
"check_in": "2026-09-10",
"check_out": "2026-09-15",
"status": "confirmed",
"guests": 3,
"pets": 0,
"total": 72500,
"currency": "EUR",
"updated_at": "2026-08-26T14:03:11.000Z"
}
}

event_id identifies this event: it is unique, and identical across retries. event_key names the object concerned: two changes to the same reservation share the same key, but each has its own event_id. sequence is an increasing number (with gaps), the same as in GET /events. resource_version counts the changes to resource (a reservation, or a property): 1, 2, 3…

api_version stays v1 for the whole lifetime of this version. environment is sandbox or production: check it, and reject a sandbox event that lands on your production endpoint.

No guest personal data is sent to you: no name, no address, no phone number. You need to know that nights are taken, not who is sleeping in the bed. The only exception is the text of a message.received, written by a person.

Event data fields
reservation.* reservation_id, external_property_id, check_in, check_out, status, guests, total (cents), currency, updated_at
availability.updated external_property_id, dates (list of YYYY-MM-DD)
property.updated external_property_id, listing_id, changed (optional, e.g. ["extras"] when the host edited their options and extras: re-read GET /properties/{id}/extras), and status when the call came from you
property.status_changed external_property_id, listing_id, status, previous_status, reason (optional, for example archived by partner), updated_at
message.received external_property_id, reservation_id (Localoge identifier, or null), from (guest / host), text, sent_at
review.created external_property_id, reservation_id, rating (out of 10), comment, published_at
payment.succeeded, payment.refunded reservation_id, external_property_id, amount (cents: collected or refunded), reservation_total (cents), currency, occurred_at
host.connected host_ref, connected_at
owner.payout_ready external_property_id, listing_id, payout_ready (true)
host.revoked host_ref, revoked_at
webhook.test message, sent_at

The two payment.* events only concern reservations sold on Localoge: never a reservation you sent us, since we collect nothing on those. No banking data is sent to you, only amounts.

{
"event": "payment.refunded",
"event_key": "payment.refunded:re_3Q…",
"created_at": "2026-09-29T16:20:00.000Z",
"api_version": "v1",
"environment": "production",
"data": {
"reservation_id": "3f8a…",
"external_property_id": "PROP-4821",
"amount": 30000,
"reservation_total": 72500,
"currency": "EUR",
"occurred_at": "2026-09-29T16:20:00.000Z"
}
}

event_key is payment.succeeded:<reservation_id> (a single capture per reservation) and payment.refunded:<refund identifier>: several partial refunds of the same reservation are each a separate event. An amount lower than reservation_total on a payment.refunded indicates a partial refund.

The API reference describes every payload field by field.

The X-Localoge-Signature header carries t=<timestamp>,v1=<hmac>. The HMAC-SHA256 is computed over <timestamp>.<raw body>, with your secret.

import { createHmac, timingSafeEqual } from 'node:crypto';
function signatureValide(secret, corpsBrut, entete, toleranceSec = 300) {
const m = /^t=(\d+),v1=([0-9a-f]+)$/.exec(entete.trim());
if (!m) return false;
const t = Number(m[1]);
// The timestamp is part of the signed string: without this window, a captured
// delivery could be replayed forever.
if (Math.abs(Date.now() / 1000 - t) > toleranceSec) return false;
const attendu = createHmac('sha256', secret).update(`${t}.${corpsBrut}`).digest('hex');
const a = Buffer.from(attendu, 'hex');
const b = Buffer.from(m[2], 'hex');
return a.length === b.length && timingSafeEqual(a, b);
}

Against replay: every attempt is signed when it is sent, with a fresh timestamp; a retry therefore carries a fresh signature. Reject any signature older than 5 minutes and, within that window, any event_id already processed: a captured and replayed delivery is dropped either way.

Respond with a 2xx as soon as you receive the request, then process it in the background. We time out after 10 seconds.

Any non-2xx response, and any missing response, is a failure that we retry.

Capped exponential backoff: 1 minute, 4, 16, 64, about 4 hours, then every 6 hours (with a small random jitter). Ten attempts over about 30 hours, after which the delivery becomes failed (dead letter): it stays readable and can be replayed by hand (see below), and a human on our side is alerted: our team gets an alert and the developers of your space get an email, once, until your endpoint delivers again. The state of each endpoint (ok, degrade, en_panne) is readable in your developer space (GET /developers/espace/sante).

Each receiving endpoint has its own queue: an unreachable or slow partner never delays anyone else’s deliveries. Within your queue, deliveries go out one at a time, in sequence order; a delivery being retried does not block the next ones (hence resource_version, see Event ordering). Throughput and number of attempts are tunable per partner: contact us if your volume requires it.

Deduplicate on event_id (header X-Localoge-Event-Id, same value as in the body). A retry, a manual replay or a re-read through GET /events carry the same event_id: it keeps you from processing the same reservation twice when our first attempt reached you but its response got lost.

The X-Localoge-Event-Key header is still sent, to group the events of a same object.

Arrival order is not guaranteed: a retried event can arrive after a newer one. For each resource, keep the highest resource_version you processed, and ignore any event whose version is lower or equal: it is stale. The version is assigned inside the transaction of the change, so in the real order of facts.

Inspecting our deliveries, and replaying them

Section titled “Inspecting our deliveries, and replaying them”

Every event is a delivery you can inspect, with its status, its number of attempts and the last HTTP response from your server:

Fenêtre de terminal
curl "https://localoge.com/api/v1/channel/webhooks/deliveries?status=failed&limit=50" \
-H "Authorization: Bearer $LOCALOGE_KEY"
{
"success": true,
"environment": "production",
"data": {
"deliveries": [
{
"id": "d7c1…",
"event_id": "9b2e41c0-…",
"sequence": 18342,
"event": "reservation.created",
"event_key": "reservation.created:3f8a…",
"status": "failed",
"attempts": 7,
"last_http_status": 500,
"last_response_ms": 812,
"last_error": null,
"next_attempt_at": null,
"last_attempt_at": "2026-09-29T15:12:44.000Z",
"delivered_at": null,
"created_at": "2026-09-28T09:12:44.000Z",
"payload": { "reservation_id": "3f8a…" },
"history": [
{ "at": "2026-09-29T15:12:44.000Z", "http_status": 500, "ms": 812, "error": "HTTP 500" }
]
}
],
"next_cursor": null
}
}

Deliveries are sorted newest first, 50 per page by default (200 at most), and paged with next_cursor. status is pending (waiting, being sent or retrying), delivered or failed (abandoned after ten attempts). last_response_ms is your server’s response time on the last attempt. history keeps the last ten attempts (date, HTTP status, duration, short error); never the content of your response.

Once your server is fixed, requeue a delivery:

Fenêtre de terminal
curl -X POST https://localoge.com/api/v1/channel/webhooks/deliveries/d7c1…/retry \
-H "Authorization: Bearer $LOCALOGE_KEY"
{ "success": true, "environment": "production", "data": { "id": "d7c1…", "status": "pending" } }

It goes out again with the same event_id and the attempt counter reset to zero: your deduplication will recognize it if it had in fact arrived. 404 NOT_FOUND for an unknown delivery, 409 CONFLICT if it is being sent at that very moment.

Fenêtre de terminal
curl -X POST https://localoge.com/api/v1/channel/webhooks/test \
-H "Authorization: Bearer $LOCALOGE_KEY"
{
"success": true,
"environment": "production",
"data": { "event": "webhook.test", "event_key": "webhook.test:6c0e…", "status": "pending" }
}

202 response: the event is queued, then sent to your registered URL, signed like any other. Its data is { "message": "Test event from Localoge", "sent_at": "…" }. It is the fastest way to check your receiver and your signature verification without creating a reservation. Without an active webhook, the response is 409 CONFLICT.

Register https://localoge.com/webhook-echo/<your-identifier> as your endpoint (or its equivalent on https://sandbox.localoge.com), trigger an event, then read back what we sent:

Fenêtre de terminal
curl https://localoge.com/api/v1/channel/webhook-echo \
-H "Authorization: Bearer $LOCALOGE_KEY"

You see the last twenty deliveries received (kept for 24 hours), headers included, with our verdict on the signature. If it is valid on our side and rejected on yours, the bug is in your verification. To test that you reject a forged signature, replay the received body to your server with a modified X-Localoge-Signature header: it must respond with a 4xx.

Fenêtre de terminal
curl "https://localoge.com/api/v1/channel/reservations?updated_since=2026-08-25T00:00:00Z" \
-H "Authorization: Bearer $LOCALOGE_KEY"

updated_since filters on the modification date: a reservation cancelled since then shows up again with status: "cancelled". See Pagination.

Only poll GET /events as a safety net. Once subscribed to a webhook, you do not need to read it every minute: once every five minutes is enough as a safety net, with your cursor. This limit is applied partner by partner, after notice: while your webhook subscription is delivering correctly, a poll that follows an empty poll by less than five minutes gets 429 with Retry-After (the pages of a catch-up are not limited). Without a webhook, or if your deliveries are failing, there is no limit: polling is then your only way. The response header X-Localoge-Recommended-Poll-Seconds (300) reminds you. Also poll after an outage of your receiver, to catch up on what was missed.

More general still, GET /events returns every event emitted for you, delivered or not, even without a registered webhook, ordered by sequence, in the same format as webhooks (event_id, sequence, event, event_key, resource, resource_version, created_at, data; id equals event_id). Its date filter is called since (event creation date):

Fenêtre de terminal
curl "https://localoge.com/api/v1/channel/events?since=2026-09-28T00:00:00Z&limit=200" \
-H "Authorization: Bearer $LOCALOGE_KEY"

Call it after an outage on your side, or once a day as a safety net. Webhooks are the fast path; this is the backstop.

Keep next_cursor and resume from it on the next call: it carries the last sequence read. It is never null: on an empty page you get back the cursor you sent (or the latest known one). has_more is true while events remain to be read: loop on it, then keep the last next_cursor for your next run. An event committed late always gets a sequence higher than what you already read, so resuming from the cursor never loses an event, even after an interruption in the middle of a page. A cursor obtained before 2026-11-10 is still accepted: it is re-read from its date and may return events you already saw (drop them by event_id).

The journal read by GET /events and the delivery history are kept 90 days. After that, successful deliveries and journal rows are purged; an undelivered delivery (pending or permanently failed) is never purged until it is delivered. If you resume GET /events with a cursor older than 90 days, you restart from what remains: then do a full re-read through GET /reservations?updated_since=…. Per-resource version numbers never restart from zero.