# Lodgehog PMS API - full reference REST API for a hotel property management system. An API key belongs to exactly one property and can only ever reach that property's data. Every key reads, prices included: nightly rates per rate plan, and quotes for a stay. A key created with write access can also create, change and cancel reservations, record payments and post charges on them, add and edit guests, set room statuses, block rooms and change rates (see "Writing" below). Base URL: https://api.lodgehog.com/v1 OpenAPI schema: https://api.lodgehog.com/v1/schema/ (add ?format=json for JSON) Interactive reference: https://api.lodgehog.com/v1/docs/ ## Authentication Send the key as a bearer token on every request: curl https://api.lodgehog.com/v1/reservations/ \ -H "Authorization: Bearer lh_live_..." Keys start with `lh_live_`. A property administrator creates them under Property settings > API & Webhooks in the PMS. The key is shown once at creation; only a hash is stored, so a lost key has to be replaced rather than recovered. Keys can be revoked, which takes effect immediately. Write access is chosen when the key is created and cannot be added later: to give an integration write access, the property creates a new key with it ticked. A read-only key that tries to write gets `403 write_access_required`. There is no OAuth flow, no refresh token and no expiry. ## Conventions - All timestamps are UTC ISO 8601 ending in `Z`, e.g. `2026-09-22T12:00:00Z`. - Dates (check-in, check-out, charge dates) are plain `YYYY-MM-DD`. - Money is a decimal **string** with two places, e.g. `"850.00"`. Never a JSON number: a float loses cents. - Currency is the property's, given as an ISO 4217 code in `totals.currency`. - Ids are UUIDs. - Enumerated values are readable words (`confirmed`, `pix`, `per_night`), not internal codes. ## Endpoints ### GET /v1/reservations/ The property's reservations, newest first. Paginated (cursor). Query parameters: - `status` - comma-separated. One or more of: `confirmed`, `checked_in`, `checked_out`, `prereserved`, `cancelled`, `blocked`, `pending_payment`. - `checkin_from`, `checkin_to` - `YYYY-MM-DD`, inclusive. - `checkout_from`, `checkout_to` - `YYYY-MM-DD`, inclusive. - `modified_since` - ISO 8601 timestamp. Reservations changed at or after it. - `created_since` - ISO 8601 timestamp. - `guest` - guest id. Matches the main guest or any additional guest. - `room` - room id. - `include_cancelled` - `true` to include cancelled reservations. - `limit` - page size, default 50, maximum 200. - `cursor` - opaque; take it from the `next` link, do not construct it. Cancelled reservations are **excluded by default**. They are included if `include_cancelled=true`, or if `status` names `cancelled`. ### GET /v1/reservations/{id}/ One reservation, in the same shape as a list row. Cancelled reservations are returned here regardless of any filter. ### GET /v1/guests/ The property's guests, ordered by name. Paginated (cursor). Parameters: `q` (matches name or e-mail), `email`, `identity_number`, `limit`, `cursor`. ### GET /v1/guests/{id}/ One guest, with its `version` as the `ETag`. ### GET /v1/rooms/ Every room, unpaginated - a property has tens of them, and an integration resolving the ids on a reservation wants them all at once. Parameter: `room_category` (id). [{"id": "...", "name": "101", "status": "clean", "room_category": {"id": "...", "name": "Standard"}}] `status` is the housekeeping status: `clean`, `dirty`, `inspected`, `occupied` (a guest is checked in), `blocked` (out of service: not for sale anywhere) or `archived` (removed from the property). ### GET /v1/rooms/{id}/ One room. ### GET /v1/room-categories/ Every room category, unpaginated. ### GET /v1/rate-plans/ Every rate plan, unpaginated, ordered by room category and name. Its `id` is the `rate_plan_id` a new reservation can be priced from. Parameter: `room_category` (id). [ { "id": "...", "name": "Flexible", "room_category": {"id": "...", "name": "Standard"}, "valid_from": "2026-01-01", "valid_to": null, "min_stay": 1, "max_stay": null, "meal_plan": "breakfast", "cancellation_policy": { "kind": "free_until", "days": 7, "penalty": "first_night", "name": "Free cancellation until 7 days before arrival", "text": "..." }, "sells_on_booking_engine": true } ] - `min_stay` is the plan's usual minimum; single nights can ask for more (see `/v1/rates/`). - `meal_plan` - `none`, `breakfast`, `half_board`, `full_board`, or null when the property has not said. - `cancellation_policy` - what the property's booking engine sells the plan with: `kind` is `free_until` (free until `days` before arrival, then `penalty`: `first_night`, `half` or `full` of the price), `free`, `non_refundable` or `custom`. `text` is the whole policy in English. Null when the plan has none. - `sells_on_booking_engine` - whether guests can book it on the property's own website. Every plan can be booked through this API either way. Prices vary by night, occupancy and date overrides, so they are not here: read them per night from `/v1/rates/`, or for a stay from `/v1/quote/`. Omit `price` on a reservation room to have the plan price it. ### GET /v1/reservations/{id}/charges/ The reservation's charges, oldest first, unpaginated: the same list as its `charges`. ### GET /v1/reservations/{id}/charges/{charge_id}/ One charge, with its `version` as the `ETag`. ### GET /v1/reservations/{id}/deductions/ The reservation's deductions, oldest first, unpaginated: the same list as its `deductions`. ### GET /v1/reservations/{id}/deductions/{deduction_id}/ One deduction, with its `version` as the `ETag`. ### GET /v1/items/ What the property sells on the folio - breakfast, a transfer, the minibar - by name, unpaginated. Their `id` is the `item_id` a charge can name. [ {"id": "...", "name": "Breakfast", "unit_value": "35.00", "stock_quantity": 40, "offered_on_booking_engine": true} ] `stock_quantity` is null for an item whose stock the property does not count. `offered_on_booking_engine` - guests can add it as an extra when booking on the property's website. ### GET /v1/reservations/{id}/payments/ The reservation's payments, oldest first, unpaginated: the same list as its `payments`. ### GET /v1/reservations/{id}/payments/{payment_id}/ One payment, with its `version` as the `ETag`. ### GET /v1/accounts/ The property's accounts - where its money goes (a bank account, the cash drawer) - main account first, unpaginated. Their `id` is the `account_id` a payment can name. [ {"id": "...", "name": "Main account", "type": "bank", "is_default": true, "is_active": true}, {"id": "...", "name": "Cash drawer", "type": "cash", "is_default": false, "is_active": true} ] `type` is `bank`, `cash` or `other`. Only active accounts take payments. ### GET /v1/availability/ Rooms left to sell, per room category and night - the numbers LodgeHog pushes to the sales channels (Booking.com, Expedia, Airbnb...). Not paginated. Query parameters: - `start_date` - `YYYY-MM-DD`, the first night. Defaults to today at the property. - `end_date` - `YYYY-MM-DD`, the last night, inclusive. Defaults to 30 nights from `start_date`. At most 366 nights per request. { "start_date": "2026-11-01", "end_date": "2026-11-02", "room_categories": [ { "id": "...", "name": "Standard", "synced_to_channels": true, "rooms": 4, "out_of_service": 1, "nights": [ {"date": "2026-11-01", "booked": 3, "available": 1}, {"date": "2026-11-02", "booked": 0, "available": 4} ] } ] } - `rooms` - rooms in the category that can be sold. `out_of_service` - rooms currently blocked (under maintenance, say), which are not in `rooms` for any night. - `booked` - room lines holding a room of the category that night: every reservation that is not cancelled, including `blocked` ones (rooms the property is holding back) and `checked_out` ones, which stay sold until their original checkout date. Reservations on an out-of-service room are not counted, since that room was never in `rooms`. - `available` = `rooms` - `booked`, never below 0. Two reservations on one room both count, so `booked` can exceed `rooms` when the property is overbooked. - The checkout date is not a night: a 1 to 3 November stay books the nights of the 1st and 2nd. - `synced_to_channels` - whether the category is connected to the channel manager. Only those categories are pushed to the channels; the others are counted the same way but sold only directly. - Rate restrictions (stop-sell, closed to arrival, minimum stay) are set per rate plan and are not part of these numbers. ### GET /v1/property/ The property the key belongs to. Not paginated. { "id": "...", "name": "Pousada Mar Azul", "email": "contato@example.com", "phone": "+5512999999999", "website": "https://example.com", "address": "Rua da Praia 10, Ubatuba - SP, Brazil", "country": "BR", "timezone": "America/Sao_Paulo", "currency": "BRL", "checkin_time": "14:00", "checkout_time": "11:00", "description": "...", "house_rules": "...", "cancellation_policy": {"kind": "free", "name": "Free cancellation", "text": "..."}, "booking_engine_url": "https://reservas.example.com/pousada-mar-azul/" } - `timezone` (IANA) is the property's clock: "today" in every default (an availability window, a payment date) is today there. - `currency` (ISO 4217) is the one every amount in the API is in. - `description`, `house_rules` and `cancellation_policy` are what the property's booking engine shows guests, in the property's own language (`cancellation_policy.text` is English). Each rate plan can sell with its own cancellation policy; this one is the property's default. - `booking_engine_url` - the property's own booking website, once it is online; null before. ### GET /v1/rates/ Each rate plan's price and restrictions per night, as the property's rates calendar shows them. Not paginated. Query parameters: - `start_date`, `end_date` - as for `/v1/availability/`: the first and last night, both included, 30 nights from today by default, at most 366. - `rate_plan`, `room_category` - ids, to narrow it down. { "start_date": "2026-11-01", "end_date": "2026-11-02", "currency": "BRL", "rate_plans": [ { "rate_plan": {"id": "...", "name": "Flexible"}, "room_category": {"id": "...", "name": "Standard"}, "nights": [ {"date": "2026-11-01", "within_plan_dates": true, "price": "250.00", "prices_by_guests": ["220.00", "250.00", "290.00"], "min_stay": 2, "stop_sell": false, "closed_to_arrival": false, "closed_to_departure": false} ] } ] } - `price` - the night's rate for the plan's base occupancy: the plan's usual price for that day of the week, or the one the property set for that night. Still shown on a `stop_sell` night. - `prices_by_guests` - what one night costs for 1, 2, 3... adults, up to the room category's capacity: `prices_by_guests[0]` is one adult. Null for a party the plan cannot seat, and for every party on a night that does not sell (`stop_sell`). Children are priced per stay - use `/v1/quote/`. - `min_stay` - the shortest stay that may include this night. A stay has to meet the longest `min_stay` of its nights. - `stop_sell` - the night is closed. `closed_to_arrival` - no stay may start on it. `closed_to_departure` - no stay may end on it. - `within_plan_dates` - false for a night before the plan's `valid_from` or after its `valid_to`. Those do not sell and have no price, unless the property set one for that night. ### GET /v1/quote/ What a stay costs. For every room category: how many of its rooms are free for the dates, and what each of its rate plans charges this party for the whole stay, with the property's own taxes. This is the call to make before telling a guest a price. Query parameters: - `checkin_date`, `checkout_date` - required, `YYYY-MM-DD`. The checkout date is not a night. - `adults` - required, at least 1. - `child_ages` - one age per child, comma-separated, e.g. `4,9`. Rate plans that charge for children price them by age. - `room_category` - id, to quote only that category. { "checkin_date": "2026-11-01", "checkout_date": "2026-11-03", "nights": 2, "adults": 2, "child_ages": [6], "currency": "BRL", "room_categories": [ { "id": "...", "name": "Standard", "max_guests": 3, "available_rooms": 2, "rate_plans": [ { "id": "...", "name": "Flexible", "unavailable_reason": null, "min_stay": 1, "room_price": "500.00", "additional_fee": {"name": "Cleaning", "amount": "50.00"}, "total_price": "550.00", "taxes": [{"id": "...", "name": "City tax", "included": false, "amount": "55.00"}], "taxes_total": "55.00", "total_with_taxes": "605.00", "meal_plan": "breakfast", "cancellation_policy": {"kind": "free", "name": "Free cancellation", "text": "..."}, "sells_on_booking_engine": true }, { "id": "...", "name": "Non-refundable", "unavailable_reason": "min_stay", "min_stay": 3, "room_price": null, "additional_fee": null, "total_price": null, "taxes": [], "taxes_total": null, "total_with_taxes": null, "meal_plan": null, "cancellation_policy": null, "sells_on_booking_engine": false } ] } ] } - A stay is bookable with a rate plan when its category's `available_rooms` is above 0 and the plan's `unavailable_reason` is null. - `available_rooms` - rooms of the category that `POST /v1/reservations/` could assign for these dates. Booking two at once can find fewer when the property has linked units (a house and the bedrooms inside it). - `total_price` - the room for the whole stay, its rate plan's fee (`additional_fee`) included. A reservation room line with this `rate_plan_id`, the same dates and party and no `price` is recorded at exactly this total. - `taxes` - the property's own taxes and fees. `included` ones are already part of the price and only shown; the others are added on top, and `taxes_total` is their sum. They are posted as charges on a reservation created with `charge_taxes` (the default). - `total_with_taxes` - what the guest pays: `total_price` + `taxes_total`. - `min_stay` - the shortest stay these dates allow with this plan. - `unavailable_reason` - why the plan cannot sell this stay: `too_many_guests` (the party does not fit the category), `min_stay`, `max_stay`, `closed_to_arrival`, `closed_to_departure`, `outside_plan_dates` (the plan does not cover every night), `stop_sell` (a night is closed), or `no_price` (anything else, such as a category set up without a capacity). - Every category and plan is quoted, including those the property does not sell on its own website (`sells_on_booking_engine` false). Leave those out if you only want to offer what the property sells to guests directly. ## Writing Needs a key with write access. Bodies are JSON (`Content-Type: application/json`), and every write answers with the whole reservation object, as a GET would - except recording a payment, which answers with the payment. Writes are the property's own: they go through the same checks as the front desk, show on its calendar at once, and reach the sales channels like any other booking. A room is never double-booked: a request for a room that is not free is refused with `409`, however close two requests arrive. ### POST /v1/reservations/ Create a reservation. Answers `201` with the reservation and a `Location` header. curl -X POST https://api.lodgehog.com/v1/reservations/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 8f14e45f-ceea-467a-9575-9b7f2e2b1c3d" \ -d '{ "checkin_date": "2026-11-01", "checkout_date": "2026-11-04", "guest": {"name": "Ana Souza", "email": "ana@example.com", "phone": "+5511987654321"}, "rooms": [ {"room_category_id": "...", "rate_plan_id": "...", "adults": 2}, {"room_id": "...", "price": "900.00", "adults": 1, "children": 1, "child_ages": [6]} ], "notes": "Late arrival" }' - `checkin_date`, `checkout_date` - required. The checkout date is not a night. At most 366 nights. - `status` - `confirmed` (default), `prereserved` or `checked_in`. - The guest: either `guest_id` (a guest from `/v1/guests/`) or `guest`, an object with `name` (required), `email`, `phone`, `date_of_birth`, `nationality` (ISO 3166-1 alpha-2), `identity_type`, `identity_number` and `notes`. A `guest` is matched against the property's guests by name and phone (or e-mail, when there is no phone) and reused when it is the same person; otherwise a new guest is created. A phone without a country code is read as the property's country; prefer E.164. - `rooms` - one line per room booked, each with exactly one of: - `room_id` - that room, which must be free for every night; - `room_category_id` - any free room of the category, assigned for you (the response says which). and: - `adults` (required, at least 1), `children` (default 0), `child_ages` (one age per child; used by rate plans that price children by age). - `price` - the total for the whole stay for this room, as a string. Omit it to price the stay from `rate_plan_id`, as the property's rates calendar would; a rate plan that is closed, outside its minimum or maximum stay or unpriced on a night cannot, and is refused with `422 price_unavailable`. - `rate_plan_id` - optional with a price. Records what was sold; with a `room_category_id` it must belong to that category. List them with `GET /v1/rate-plans/`. - `notes` - free text, up to 1000 characters. - `charge_taxes` - default `true`. Posts the property's own taxes and fees (set up in the PMS) as `tax_or_fee` charges, as the reservation page does. - `payments` - optional, up to 20: money already received, such as a deposit taken when booking, each shaped as for `POST /v1/reservations/{id}/payments/`. They are recorded with the reservation or not at all: a bad one refuses the whole request, and the request's `Idempotency-Key` covers them too. The new reservation's `source.made_by` is `api`. No e-mail is sent to the guest. ### PATCH /v1/reservations/{id}/ Change a reservation. Only the fields sent change. Accepts `status`, `checkin_date`, `checkout_date`, `guest_id` or `guest`, `rooms` and `notes`, shaped as for POST. `rooms` replaces the whole list. Without `rooms`, the current rooms are kept and must still be free on any new dates; a per-night price keeps its nightly rate, and a total stays the same total. Needs the reservation's current `version` in an `If-Match` header: curl -X PATCH https://api.lodgehog.com/v1/reservations/{id}/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -H 'If-Match: "1789998138642209"' \ -d '{"checkout_date": "2026-11-05"}' GET responses carry the version as their `ETag`, so echoing that header back works. A missing `If-Match` is `428 precondition_required`; a version that is no longer current - someone changed the reservation since you read it - is `412 version_mismatch`: read it again and decide whether your change still applies. - `status` - `confirmed`, `prereserved`, `checked_in`, `checked_out` or `cancelled`. Checking a guest in today marks the room occupied. - Cancel with `{"status": "cancelled"}` and nothing else. The room goes back on sale. A cancelled reservation can be confirmed again if its rooms are still free (`409 room_unavailable` if not). - A `blocked` reservation is changed through `/v1/blocks/` instead, and a `pending_payment` one cannot be changed: both are `409 not_editable`. Reservations from a travel site (`source.made_by` is `channel_manager`) belong to that site. The site sends every change to the booking and rewrites its dates, rooms, prices and notes each time, and a cancellation made here would put back on sale a room whose guest is still coming. So for those only `status` can be changed, between `confirmed`, `checked_in` and `checked_out`; anything else, including cancelling, is `409 managed_by_channel`. Change or cancel them on the travel site. Booking-engine and chatbot reservations are the property's own and can be changed like any other. ### POST /v1/reservations/{id}/payments/ Record money received for a reservation, as the front desk's "New payment" does. Answers `201` with the payment, shaped as in a reservation's `payments`, and a `Location` header. The reservation's `totals` and `modified_at` move with it, and a `reservation.updated` webhook goes out. To record a deposit with a new booking, send it in that POST's `payments` instead. curl -X POST https://api.lodgehog.com/v1/reservations/{id}/payments/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 2c5e9a51-0f0e-4f43-9b0d-6f1c3a7d8e21" \ -d '{"value": "450.00", "method": "credit_card", "date": "2026-11-01"}' - `value` - required, as a string in the property's currency. Not zero; negative records money given back. - `method` - required. `cash`, `credit_card`, `debit_card`, `bank_transfer`, `check`, `ota` (collected by the travel site), `discount` or `other`; `pix` and `boleto` for a property in Brazil, `mobile_money` for one in Africa. Anything else is a `400` listing what the property takes. - `date` - when it was received. Defaults to today at the property. - `account_id` - which of the property's accounts the money went into, from `GET /v1/accounts/`. Defaults to its main account. No `If-Match`: a payment does not change the reservation's `version`, so it cannot conflict with an edit. Send an `Idempotency-Key`: a retried payment without one is recorded twice. A travel site's reservation takes payments too; the site's revisions never touch payments recorded here. A block, or a `pending_payment` booking-engine reservation, is `409 not_editable`. ### PATCH /v1/reservations/{id}/payments/{payment_id}/ Correct a payment. Only the fields sent change; they are those of the POST, and `"account_id": null` moves it back to the main account. Needs the payment's current `version` in `If-Match`, as a reservation PATCH does with the reservation's: `428` without it, `412 version_mismatch` when stale. ### DELETE /v1/reservations/{id}/payments/{payment_id}/ Delete a payment recorded by mistake. Answers `204`; repeating it is a `404`. Neither touches a payment another system owns, which is `409 not_editable`: one the channel manager recorded from a travel site (`created_by_channel_manager`), which the site's next change to the booking replaces anyway, or one taken online through a payment provider, which the property refunds from the PMS. ### POST /v1/reservations/{id}/charges/ Post something to a reservation's folio, as the front desk's "New charge" does: breakfast, a parking space, a late checkout. Answers `201` with the charge, shaped as in a reservation's `charges`, and a `Location` header. The reservation's `totals` and `modified_at` move with it, and a `reservation.updated` webhook goes out. curl -X POST https://api.lodgehog.com/v1/reservations/{id}/charges/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 6b1d3c0e-2f4a-4f7e-9a51-3c8e7d2b1a90" \ -d '{"item_id": "...", "quantity": 2, "date": "2026-11-02", "notes": "Gluten free"}' - `item_id` - an item from `GET /v1/items/`. Its name and price are the defaults for `name` and `unit_value`; a different `unit_value` is charged this once and leaves the item's price alone. - `name` and `unit_value` - required without an `item_id`. `unit_value` is the price of one, as a string; negative for a discount. - `quantity` - default 1, at most 1000. - `date` - default today at the property. - `notes` - free text, up to 500 characters. An item whose stock the property counts is counted out; asking for more than is left is `409 out_of_stock`, and nothing is posted. A travel site's reservation takes charges too - the site's revisions only replace the charges the channel manager recorded. A block, or a `pending_payment` booking-engine reservation, is `409 not_editable`. Send an `Idempotency-Key`: a retried charge without one is posted twice. ### PATCH /v1/reservations/{id}/charges/{charge_id}/ Correct a charge: `name`, `unit_value`, `quantity`, `date` or `notes`; only the fields sent change. The item cannot be swapped - delete the charge and post another. Changing the quantity of a stocked item counts the difference in or out (`409 out_of_stock` if there isn't enough). Needs the charge's current `version` in `If-Match`: `428` without it, `412 version_mismatch` when stale. ### DELETE /v1/reservations/{id}/charges/{charge_id}/ Delete a charge posted by mistake; a stocked item's stock is counted back. Answers `204`; repeating it is a `404`. Neither touches a charge something else owns, which is `409 not_editable`: one the channel manager recorded from a travel site (`created_by_channel_manager`), and the property's own taxes and fees (`kind` `tax_or_fee` posted with `charge_taxes`), which are worked out again whenever the stay changes. ### POST /v1/reservations/{id}/deductions/ Record something that comes off the stay's revenue, as the reservation page's "Add deduction" does: a commission, a tax the property pays on the stay, a refund for damages, a cancellation fee. The guest never sees it and owes nothing more or less: `totals.total_due` stays put, while `totals.total_deductions` and `totals.net_revenue` move. Answers `201` with the deduction, shaped as in a reservation's `deductions`, and a `Location` header; a `reservation.updated` webhook goes out. curl -X POST https://api.lodgehog.com/v1/reservations/{id}/deductions/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: 0f6c2a9e-7b1d-4e38-a5c4-92d1e8b3f7a0" \ -d '{"kind": "host_commission", "value": "120.00", "description": "Co-host"}' - `kind` - `ota_commission`, `host_commission`, `taxes`, `damages_and_refunds`, `cancellation_fee` or `other`. - `value` - the amount taken off, as a string; not negative. - `description` - optional, up to 100 characters. A block, which has no revenue, is `409 not_editable`. Send an `Idempotency-Key`: a retried deduction without one is recorded twice. ### PATCH /v1/reservations/{id}/deductions/{deduction_id}/ Correct a deduction: `kind`, `value` or `description`; only the fields sent change. Needs the deduction's current `version` in `If-Match`: `428` without it, `412 version_mismatch` when stale. ### DELETE /v1/reservations/{id}/deductions/{deduction_id}/ Delete a deduction recorded by mistake. Answers `204`; repeating it is a `404`. Neither touches a deduction the channel manager recorded from a travel site (`created_by_channel_manager`), which is `409 not_editable`: the site's next change to the booking replaces it. ### POST /v1/guests/ Add a guest, shaped as the `guest` of `POST /v1/reservations/`: `name` (required), `email`, `phone`, `date_of_birth`, `nationality`, `identity_type` (`identity_card`, `drivers_license`, `passport`, `cpf`, `cnpj`), `identity_number` and `notes`. Answers `201` with the guest and a `Location` header. A guest already on file - the same name and phone, or e-mail when there is no phone, as a booking matches them - is answered with `200` and that guest instead of a duplicate, with any of its blank fields filled from the request. That also makes a retry safe without an `Idempotency-Key`. A CPF or CNPJ is checked as the PMS checks it (its check digits, and a Brazilian or blank nationality), and stored as digits only. ### PATCH /v1/guests/{id}/ Change a guest's record. Only the fields sent change; `null` or `""` clears one, except `name`. Needs the guest's current `version` in `If-Match`, as for a reservation: `428` without it, `412 version_mismatch` when stale. The change shows on every reservation the guest is on, but does not move their `modified_at` and sends no webhook. ### PATCH /v1/rooms/{id}/ Set a room's housekeeping status, as the PMS's room list does: {"status": "clean"} `clean`, `dirty`, `inspected`, or `blocked` - out of service, which takes the room off sale on the calendar and every sales channel until it is set back. `occupied` follows the stays and `archived` is the PMS's to set; both are a `400`. Answers with the room. No `If-Match`: the status is the property's latest word on the room, and its stays change it too - checking a guest in makes it `occupied`. An archived room is a `404`. To take a room off sale for some nights only, block those nights with `/v1/blocks/` instead. ### POST /v1/blocks/ Take a room off sale for some nights - for maintenance, say. Closes it on the calendar and on every sales channel. {"room_id": "...", "checkin_date": "2026-11-01", "checkout_date": "2026-11-03", "notes": "Painting"} `checkin_date` is the first night off sale and `checkout_date` the first day the room is for sale again. Answers `201` with the block, which is a reservation with status `blocked` and is listed among the reservations. Refused with `409 room_unavailable` if the room is booked or blocked on any of those nights. Blocking a whole house blocks the rooms inside it. ### DELETE /v1/blocks/{id}/ Lift a block; the room goes back on sale. Answers `204`. The block is deleted, as when the property unblocks dates on its calendar, which sends a `reservation.deleted` webhook. Anything that is not a block is a `404`. ### POST /v1/rates/ Change rate plans' nights, as the property's rates calendar does: their price, minimum stay, stop-sell, closed to arrival or departure - or put them back to the plan's normal values. This is how a revenue-management tool pushes prices. The changes reach the sales channels and Google like the calendar's own. curl -X POST https://api.lodgehog.com/v1/rates/ \ -H "Authorization: Bearer lh_live_..." \ -H "Content-Type: application/json" \ -d '{ "updates": [ {"rate_plan_id": "...", "start_date": "2026-12-01", "end_date": "2026-12-31", "price": "320.00"}, {"rate_plan_id": "...", "start_date": "2026-12-01", "end_date": "2026-12-31", "days_of_week": ["fri", "sat"], "price": "390.00", "min_stay": 2}, {"rate_plan_id": "...", "start_date": "2026-12-24", "end_date": "2026-12-25", "stop_sell": true} ] }' Each update changes one rate plan's nights from `start_date` to `end_date`, both included, and only what it sends: - `days_of_week` - optional, only these nights of the range: `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`. - `price` - the night's rate for the plan's base occupancy, as a string, above 0. The plan's own guest-count and child pricing still apply on top (see `prices_by_guests` in `/v1/rates/`). - `min_stay` - the shortest stay that may include the night, 1 to 365. - `stop_sell` - `true` closes the night, `false` opens it. - `closed_to_arrival`, `closed_to_departure` - `true` or `false`. - `reset` - `true` puts the nights back to the plan's normal values first; anything else the update sends is then applied. Updates apply in order, so where two cover the same night the later one wins: send the broad range first and the exceptions after. Up to 1000 updates and 10000 nights per request (a night of two plans counts twice), at most 366 nights per update. The whole request is written or none of it: an unknown `rate_plan_id` is a `400` naming the update by its position. A value equal to the plan's normal one is not stored as an exception, so setting a night back to the plan's price, minimum stay and open is the same as resetting it. {"nights_changed": 33, "nights_skipped": {"past": 0, "outside_plan_dates": 0}, "warnings": []} - `nights_skipped.past` - nights before today at the property, which are never changed. - `nights_skipped.outside_plan_dates` - nights before the plan's `valid_from` or after its `valid_to`. Those do not sell whatever they are set to; the property changes the plan's dates in the PMS. - `warnings` - things the property should know that did not stop the change: the channel manager could not be reached (the change is saved and goes out with the next sync), or a price is too high for Google to show. No `If-Match` and no `Idempotency-Key`: setting a night to a value is the same however often it is sent. ### Retrying safely: Idempotency-Key A request that times out may or may not have gone through. Send an `Idempotency-Key` header (any unique string up to 255 characters; a UUID is ideal) on every POST. Retrying with the same key and the same body returns what the first request created, recorded or posted - `200` with `Idempotent-Replayed: true` - instead of creating it twice. The same key with a different body is `422 idempotency_key_reused`. Keys are per property and kept as long as what they created exists: once a block has been lifted, replaying its key blocks the room again. PATCH needs no key: its `If-Match` makes a retry that already went through fail with `412` rather than apply twice. `POST /v1/rates/` needs neither: it sets values rather than adding anything. DELETE is harmless to repeat; the second answers `404`. ## Pagination List responses look like: {"next": "", "previous": "", "results": [...]} Follow `next` until it is `null`. The cursor is keyed on creation time, so rows created while you page do not shift the ones you have not read yet - which page numbers would. `rooms`, `room-categories`, `rate-plans`, `accounts`, `items` and a reservation's `payments`, `charges` and `deductions` are not paginated and return a bare JSON array. ## The reservation object A reservation comes back whole. Rooms, guests, charges, payments, deductions and computed totals are embedded, so a list response needs no follow-up calls. { "id": "e38b863a-6d4f-48a2-bb42-fee423076cbb", "booking_code": "845D400246", "status": "confirmed", "source": { "channel_code": "BDC", "channel_name": "Booking.com", "made_by": "channel_manager" }, "checkin_date": "2026-10-10", "checkout_date": "2026-10-11", "nights": 1, "adults": 2, "children": 1, "notes": null, "guest": { "id": "...", "name": "Ana Beatriz Souza", "email": null, "phone": null, "date_of_birth": null, "nationality": null, "identity_type": null, "identity_number": null, "address": null, "company": null, "notes": null, "version": 1 }, "additional_guests": [], "rooms": [ { "room": {"id": "...", "name": "302"}, "room_category": {"id": "...", "name": "Piscina Privativa"}, "booked_room_category": {"id": "...", "name": "Piscina Privativa"}, "rate_plan": {"id": "...", "name": "Tarifa Flexivel"}, "price": "850.00", "price_type": "per_night", "adults": 2, "children": 1, "child_ages": [] } ], "charges": [ {"id": "...", "name": "Minibar", "date": "2026-10-10", "unit_value": "25.00", "quantity": 2, "total": "50.00", "item_id": null, "kind": "extra", "notes": "", "created_by_channel_manager": false, "version": 1} ], "payments": [ {"id": "...", "method": "pix", "value": "850.00", "date": "2026-10-10", "account": {"id": "...", "name": "Main account"}, "billing_id": null, "stripe_payment_intent_id": null, "created_by_channel_manager": false, "version": 1} ], "deductions": [ {"id": "...", "kind": "ota_commission", "description": "", "value": "127.50", "already_deducted": false, "created_by_channel_manager": true, "version": 1} ], "billing": null, "deposit": null, "totals": { "currency": "BRL", "total_price": "850.00", "total_charges": "50.00", "total_payments": "850.00", "total_due": "50.00", "payment_status": "partial", "total_deductions": "127.50", "gross_revenue": "900.00", "net_revenue": "772.50" }, "created_at": "2026-09-23T13:58:05.349707Z", "modified_at": "2026-09-21T13:58:05.348646Z", "version": 1789998138642209 } Field notes: - `id` never changes. A new date, guest or room, whether made at the front desk or sent by the channel, updates the same reservation; so does a cancellation. - `booking_code` is what the property's staff see and quote. It is not the id. For a reservation from a sales channel (`source.made_by` is `channel_manager`) it is the channel's own reference - the Booking.com reservation number, the Airbnb confirmation code - and `source.channel_code` says which channel. For anything else it is a code LodgeHog made up. - `status`: `confirmed`, `checked_in`, `checked_out`, `prereserved`, `cancelled`, `blocked`, `pending_payment`. A cancelled reservation keeps its row and stays readable. Lifting a block deletes it, and only LodgeHog support can delete a reservation outright; either shows up as a `reservation.deleted` webhook with a null `data.reservation`, and never in polling. - `blocked` is not a guest stay - it is the property holding a room out of inventory. `pending_payment` is a booking-engine reservation awaiting payment, which expires on its own if unpaid. - `source.made_by`: `pms`, `booking_engine`, `chatbot`, `channel_manager` or `api` (created through this API). - `rooms` lists what was sold. A whole-house booking carries extra internal rows for the bedrooms inside it; those are not here, because nobody chose or paid for them. - In a room line, `room` and `room_category` are where the guest is now, and change when the property moves them. `booked_room_category` is the category the room was sold as, taken from its rate plan, so it stays put through a move; it is null when the line has no rate plan. The two differ after a move to another category, or when a channel booking arrived with its category full and was put in another room. - Room lines have no id of their own: they are rebuilt whenever the reservation's rooms change. Track the reservation by its `id`. - `price_type` is `per_night` or `total`, and says how to read `price`. - `charges` are everything billed on top of the room rate. `kind` is `extra` for folio extras (minibar, breakfast) or `tax_or_fee` for taxes and fees that are part of the stay's price, such as those a channel booking arrives with. Inclusive taxes are already taken out of the room `price`. - `payments` is money actually received. - `billing` is set when the stay is billed to a company. That is a receivable, not money received, which is why it is not a payment. - `totals.total_due` = `total_price` + `total_charges` - `total_payments`. - `totals.payment_status`: `paid`, `partial`, `unpaid` or `billed`. - `deductions` are what comes off the stay's revenue before the property keeps it: `kind` is `ota_commission`, `host_commission` (e.g. an Airbnb co-host's share), `taxes`, `damages_and_refunds`, `cancellation_fee` or `other`. The guest never sees them, and they do not change `total_due`. For a channel booking the channel manager records the commission the site reports (`created_by_channel_manager`), with Expedia's Accelerator as a second `ota_commission` described "Accelerator", and replaces them with each revision. - `already_deducted` is true when the channel reported the booking's price with that deduction already taken off - Airbnb or Expedia reporting what they pay out rather than what the guest paid. Such a deduction is not inside `total_price`. - `totals.gross_revenue` is what the guest paid for the stay: `total_price` + `total_charges` + the deductions `already_deducted`. `totals.net_revenue` = `gross_revenue` - `total_deductions`, what the property keeps. - `version` increments when the reservation itself is saved. A change to its charges, payments, deductions, rooms or guests does not move it, but does move `modified_at` -- compare `modified_at` to tell whether you have seen a change. PATCH needs the current `version` in `If-Match`. - "Guests" there means which guests are on the reservation. Editing a guest's own record (a corrected name or e-mail) changes neither the reservation nor its `modified_at`; read the guest from `/v1/guests/{id}/` for current details. ## Keeping in sync Store the time you started your last successful poll. Ask for `modified_since=`, walk `next` to the end, then store the new start time. This catches edits and cancellations as well as new bookings, which polling `created_since` alone would miss -- including a charge, payment, deduction, room or guest change, which moves the reservation's `modified_at`. Pass `include_cancelled=true`, or cancellations will not come back. Why the few minutes: `modified_at` is stamped when a change begins, and the change only becomes visible once it is fully written, usually well under a second later but occasionally longer for a large channel import. Overlapping your windows means you will see some reservations twice; keep the one with the later `modified_at`. Walking `next` while changes happen is safe: the cursor is keyed on creation time, which a change does not move, so no row is skipped or repeated within one walk. For near-real-time, subscribe to webhooks and use polling as a backstop. ## Errors Every error has the same shape: {"error": {"code": "invalid_api_key", "message": "Invalid API key."}} - `400` - a bad filter value or request body (`invalid`), or a body the reservation's own checks refused (`invalid_reservation`). `error.details` names the field; for a room line it is keyed by the line's position. - `401` - the key is missing, malformed, unknown or revoked. - `402` - the key is valid but the property's plan does not include API access. The property has to upgrade; retrying will not help. - `403` - `write_access_required`: a read-only key tried to write. - `404` - no such record **for this property**. A reservation belonging to a different property is a 404, not a 403. - `409` - the write conflicts with the property's state: `room_unavailable` (a room is booked, blocked or out of service on one of the nights), `no_availability` (no room of a category is free), `managed_by_channel` (a travel site's reservation), `not_editable` (a block or a pending payment, a payment or charge the channel manager or a payment provider recorded, or one of the property's own taxes), `out_of_stock` (a stocked item has fewer left than a charge asks for). - `412` - `version_mismatch`: the reservation, payment, charge or guest changed since the version in `If-Match`. - `422` - `price_unavailable` (the rate plan cannot price the stay; send a price) or `idempotency_key_reused`. - `428` - `precondition_required`: a PATCH without `If-Match`. - `429` - rate limited. See below. ## Rate limits Each key has a per-minute ceiling, shown next to it in the PMS (120 by default), shared by reads and writes. Every response carries: - `X-RateLimit-Limit` - the ceiling. - `X-RateLimit-Remaining` - what is left in the current minute. - `X-RateLimit-Reset` - Unix epoch seconds when the window resets. Over the limit you get `429` with a `Retry-After` header in seconds. Wait that long rather than retrying immediately. If an integration needs a higher ceiling, the property can ask support to raise it. ## Request ids Every authenticated response carries `X-Request-Id`, the id of our log entry for that request. The property sees the same id under Property settings > API & Webhooks > Request log, with the request and response bodies for writes and errors. Log it with your own records and quote it when asking about a request. ## Webhooks A property can register endpoint URLs under Property settings > API & Webhooks. We POST to them when a reservation changes. Events: `reservation.created`, `reservation.updated`, `reservation.deleted` (a cancellation), and `test.ping` (sent on demand from the settings page). Writes made through the API send them too, including to the integration that made them: match on the reservation `id` the write returned. Anything that changes what the API would return for a reservation - a charge posted, a payment taken, a room swapped, a guest added - is a `reservation.updated` for that reservation. Several such changes made together produce one webhook, not one per change. ### Envelope { "id": "756e4f4b-6656-42df-a417-ee32cb6be9af", "event": "reservation.updated", "api_version": "v1", "created_at": "2026-09-22T12:16:55Z", "hotel_id": "63b0d3e8-923b-445a-8d45-00083b81e757", "data": { "reservation_id": "4c1f0a52-...", "reservation": { ...the same object the API returns... } } } `data.reservation` is null when the reservation no longer exists; `data.reservation_id` is always set, so you can still tell which one it was. For `test.ping`, `data` is `{}`. The body is built when the delivery is sent, not when the change happened, so a retry that lands an hour later carries current data. ### Headers - `X-Lodgehog-Signature` - `t=,v1=` - `X-Lodgehog-Event` - the event name - `X-Lodgehog-Delivery-Id` - matches `id` in the body - `X-Lodgehog-Attempt` - 1 on the first try ### Responding Answer with any `2xx`. Anything else - or a timeout over 10 seconds - is retried with growing backoff for about an hour (8 attempts). An endpoint whose deliveries keep failing is switched off, and the property is told. Deliveries can arrive more than once, so treat `X-Lodgehog-Delivery-Id` as an idempotency key. They can also arrive out of order: trust the reservation's `modified_at`, not the order of arrival. ### Verifying the signature The HMAC is SHA-256 over `"."`, keyed with the endpoint's signing secret. Verify against the raw bytes you received, before parsing, and reject anything older than five minutes. import hashlib, hmac, time def verify(raw_body: bytes, header: str, secret: str) -> bool: parts = dict(p.split("=", 1) for p in header.split(",")) expected = hmac.new( secret.encode(), f'{parts["t"]}.'.encode() + raw_body, hashlib.sha256 ).hexdigest() fresh = abs(time.time() - int(parts["t"])) < 300 return fresh and hmac.compare_digest(expected, parts["v1"]) Requests are never redirected: we do not follow redirects, so the URL you register is the URL that receives the signed body.