{
  "openapi": "3.0.0",
  "paths": {
    "/api/properties/{pcode}/settings/lite": {
      "get": {
        "description": "What an integration needs to know about the property to read its prices and bookings: its name and stars, where it is, the currency and time zone its prices and dates are in, whether those prices include tax, and its default arrival and departure times. The times, as hours of the day, are what applies to a booking that does not state its own: the booking endpoints return per-booking arrival and departure times only when someone has set them, so fall back to these when those come back empty. These two are `HH:mm`, and an empty string when the property has not set them either — then no default time applies. All of it rarely changes — fetch once and keep.",
        "operationId": "SettingsController_getSettingsLite",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSettingsLiteResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get the property's basics",
        "tags": [
          "Properties"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los datos básicos del establecimiento",
            "description": "Lo que una integración necesita saber del establecimiento para leer sus precios y reservas: su nombre y estrellas, dónde está, la moneda y la zona horaria de sus precios y fechas, si esos precios incluyen impuestos, y sus horas de llegada y salida por defecto. Las horas, como horas del día, son las que aplican a una reserva que no indique las suyas: los endpoints de reservas devuelven horas propias de cada reserva solo cuando alguien las ha fijado, así que recurre a estas cuando vengan vacías. Estas dos van en `HH:mm`, y son una cadena vacía cuando el establecimiento tampoco las ha fijado: entonces no hay hora por defecto. Todo cambia rara vez: pídelo una vez y guárdalo."
          }
        }
      }
    },
    "/api/properties/{pcode}/settings/custom-policies": {
      "get": {
        "description": "The cancellation policies this property has defined for itself, each with its ID and its name in every language the panel supports (all nine keys always present; an empty string where it has no translation). Use an ID from here as the `policy` of a room when creating a booking, and to resolve the `policy` that bookings come back with. The two built-in policies are NOT listed, because every property always has them: `4` (flexible cancellation) and `6` (non-refundable). Expect to see those two IDs on bookings even though they never appear in this response. Policies change rarely — fetch once and keep.",
        "operationId": "SettingsController_getCustomPolicies",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetCustomPoliciesResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get custom cancellation policies",
        "tags": [
          "Properties"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar políticas de cancelación propias",
            "description": "Las políticas de cancelación que este establecimiento ha definido por su cuenta, cada una con su ID y su nombre en todos los idiomas del panel (siempre las nueve claves; una cadena vacía donde no tiene traducción). Usa un ID de aquí como `policy` de una habitación al crear una reserva, y para resolver el `policy` con el que vuelven las reservas. Las dos políticas integradas NO aparecen en la lista, porque todo establecimiento las tiene siempre: `4` (cancelación flexible) y `6` (no reembolsable). Espera ver esos dos IDs en las reservas aunque nunca salgan en esta respuesta. Las políticas cambian rara vez: pídelas una vez y guárdalas."
          }
        }
      }
    },
    "/api/v2/rooms/{pcode}/availability": {
      "get": {
        "description": "Which rooms are free for a date range. The answer comes in two maps, both keyed by `roomTypeId`: `availables` holds the types with rooms still free, each listing the rooms themselves, and `notAvailables` holds the types that are fully booked. A type appears in one or the other, never both; a type with no physical rooms appears in neither. It is availability by physical room: a booking occupies the room it is assigned to, so a booking with no room assigned yet takes nothing here, and a room whose only bookings in the range are out-of-order blocks is listed with `locked: true` — present, but not bookable. Dates work the way a hotel night does: a room whose guest leaves on your arrival date, or arrives on your departure date, counts as free — so a stay never blocks the day it ends. Pass `bookingId` when you are changing an existing booking, so its own room is not counted as occupied by itself and shows up as available. Availability is a snapshot and can change between this call and creating the booking; the creation endpoint checks it again — the room, and the units sold per night, which also counts bookings with no room assigned — and rejects the request if it no longer fits.",
        "operationId": "RoomsController_getAvailabilityByPcodeV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": false,
            "in": "query",
            "description": "Exclude this booking's room from the occupied count. Useful when modifying an existing reservation to see which rooms are still available",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "required": true,
            "in": "query",
            "description": "Check-out date (YYYY-MM-DD). A room occupied by a guest checking in on this day is considered available",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": true,
            "in": "query",
            "description": "Check-in date (YYYY-MM-DD). A room occupied by a guest checking out on this day is considered available",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAvailabilityByPcodeV2ResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get room availability",
        "tags": [
          "Rooms"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar disponibilidad",
            "description": "Qué habitaciones están libres en un rango de fechas. La respuesta llega en dos mapas, ambos indexados por `roomTypeId`: `availables` con los tipos que aún tienen habitaciones libres, listando las habitaciones concretas, y `notAvailables` con los tipos completos. Un tipo aparece en uno o en otro, nunca en los dos; un tipo sin habitaciones físicas no aparece en ninguno. Es disponibilidad por habitación física: una reserva ocupa la habitación que tiene asignada, así que una reserva todavía sin habitación no ocupa nada aquí, y una habitación cuyas únicas reservas en el rango son bloqueos fuera de servicio sale con `locked: true`: está en la lista, pero no se puede reservar. Las fechas funcionan como una noche de hotel: una habitación cuyo huésped se va el día de tu llegada, o llega el día de tu salida, cuenta como libre, así que una estancia nunca bloquea el día en que termina. Pasa `bookingId` cuando estés modificando una reserva existente, para que su propia habitación no se cuente como ocupada por ella misma y salga disponible. La disponibilidad es una foto y puede cambiar entre esta llamada y la creación de la reserva; el endpoint de creación la vuelve a comprobar —la habitación, y las unidades vendidas por noche, que sí cuentan las reservas sin habitación asignada— y rechaza la petición si ya no cabe."
          }
        }
      }
    },
    "/api/rooms/{pcode}/types": {
      "get": {
        "description": "The property's inventory: its room types and, inside each, the physical rooms that belong to it. A room type is what is sold (Double Standard, Suite) and carries its name and description in every supported language, its maximum occupancy and its display colour; a room is the physical unit (its number, floor and door) and carries the housekeeping status it is in right now — clean, dirty, inspected or in revision. The response is a map, not a list: keys are `roomTypeId`, and inside each type `rooms` is keyed by room ID. This is where the `roomTypeId` used to check availability and to create a booking comes from. Inventory changes rarely — fetch it once and keep it, but do not cache the housekeeping status, which changes through the day.",
        "operationId": "RoomsController_getRoomTypesByPcode",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "All room types for the property, keyed by roomTypeId. Each room type contains its configuration and a list of physical rooms",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/RoomTypeDto"
                  },
                  "example": {
                    "101": {
                      "id": 101,
                      "name": {
                        "en": "Single Room",
                        "es": "Habitación Individual",
                        "ca": "",
                        "de": "",
                        "it": "",
                        "fr": "Chambre Simple",
                        "eu": "",
                        "gl": "",
                        "pt": ""
                      },
                      "description": {
                        "en": "A room for one person",
                        "es": "Una habitación para una persona",
                        "ca": "",
                        "de": "",
                        "it": "",
                        "fr": "Une chambre pour une personne",
                        "eu": "",
                        "gl": "",
                        "pt": ""
                      },
                      "position": 1,
                      "occupancy": 1,
                      "color": "#FF5733",
                      "splits": {
                        "1": {
                          "name": "Standard",
                          "color": "#33FF57"
                        },
                        "2": {
                          "name": "Deluxe",
                          "color": "#3357FF"
                        }
                      },
                      "rooms": {
                        "1": {
                          "id": 1,
                          "name": "101",
                          "doorNum": "101",
                          "roomTypeId": 101,
                          "status": "dirty",
                          "floor": 1,
                          "position": 1
                        },
                        "2": {
                          "id": 2,
                          "name": "102",
                          "doorNum": "102",
                          "roomTypeId": 101,
                          "status": "ready",
                          "floor": 1,
                          "position": 2,
                          "dateToClean": "2026-01-11",
                          "splitId": 1
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get room types and rooms",
        "tags": [
          "Rooms"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar tipos de habitación y habitaciones",
            "description": "El inventario del establecimiento: sus tipos de habitación y, dentro de cada uno, las habitaciones físicas que le pertenecen. Un tipo de habitación es lo que se vende (Doble Estándar, Suite) y lleva su nombre y descripción en todos los idiomas soportados, su ocupación máxima y su color; una habitación es la unidad física (su número, planta y puerta) y lleva el estado de limpieza en el que está ahora mismo: limpia, sucia, inspeccionada o en revisión. La respuesta es un mapa, no una lista: las claves son `roomTypeId`, y dentro de cada tipo `rooms` va indexado por ID de habitación. De aquí sale el `roomTypeId` que se usa para consultar disponibilidad y para crear una reserva. El inventario cambia rara vez: pídelo una vez y guárdalo, pero no caches el estado de limpieza, que cambia a lo largo del día."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/search": {
      "get": {
        "description": "Search and filter bookings for a property. Returns individual and group bookings together, one entry per booking, each with the same shape as the booking detail minus what only the detail reads. Every filter is optional: free text, room type, exact arrival date, exact departure date and status. Without `status` it returns ready, tentative, cancelled, no-show and temporary-cancelled bookings, never blocks. Results are ordered by booking ID, newest created first. How the free text (`value`) matches: name, surname, full name, email and locator by prefix, and the phone by its end; a term made only of digits matches a booking ID or locator that contains it and, failing that, the end of a phone number. A term that is not numeric and is shorter than 2 characters returns nothing. Three exceptions to keep in mind. First, a term made only of digits that is exactly a booking ID or a locator returns that single booking with `total: 1`, ignoring the room type, the dates and `offset`. Second, a text search looks first only at bookings that departed in the last 36 months, and goes through the whole history only when that finds nothing, no date filter was sent and the term has at least 3 characters or is numeric; a name search also considers at most 150 matching customers, so `total` can fall short of every possible match. Third, the `cancelled` and `no-show` status filters are the same filter: either of them returns both kinds. The response is `{ data, total }`: `data` holds up to **20 bookings** and `total` counts the matches ignoring pagination — walk the pages by adding 20 to `offset` until you have read `total` of them. To search only one kind, use `/search/only-single` or `/search/only-groups`.",
        "operationId": "ImagesController_getBookingsSearchV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "value",
            "required": false,
            "in": "query",
            "description": "Free-text search: holder name, surname, email and locator (by prefix), phone (by its end) and booking ID. See the endpoint description for how it matches",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "roomTypeId",
            "required": false,
            "in": "query",
            "description": "Filter by room type ID. Get available room types from the GET /api/rooms/:pcode/types endpoint",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by one or more booking statuses (ready, tentative, cancelled, no-show, temporary-cancelled). Send multiple values to combine (e.g. status=ready&status=tentative). cancelled and no-show select the same bookings: either one returns both kinds. Default: every status, blocks excluded",
            "schema": {
              "enum": [
                "ready",
                "tentative",
                "cancelled",
                "no-show",
                "temporary-cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "Pagination offset — number of records to skip. Default is 0",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-out date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-in date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBookingSearchResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Search bookings",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Buscar reservas",
            "description": "Busca y filtra reservas de un establecimiento. Devuelve juntas las reservas individuales y las de grupo, una entrada por reserva, cada una con la forma del detalle de reserva salvo lo que solo lee el detalle. Todos los filtros son opcionales: texto libre, tipo de habitación, fecha de llegada exacta, fecha de salida exacta y estado. Sin `status` devuelve las reservas ready, tentative, cancelled, no-show y temporary-cancelled, nunca los bloqueos. Los resultados van por ID de reserva, de la creada más recientemente a la más antigua. Cómo busca el texto libre (`value`): nombre, apellido, nombre completo, email y localizador por el principio, y el teléfono por el final; un término solo de dígitos busca un ID de reserva o un localizador que lo contenga y, si no hay ninguno, el final de un teléfono. Un término que no es numérico y tiene menos de 2 caracteres no devuelve nada. Tres excepciones a tener en cuenta. Primera: un término solo de dígitos que es exactamente un ID de reserva o un localizador devuelve esa única reserva con `total: 1`, sin aplicar el tipo de habitación, las fechas ni `offset`. Segunda: una búsqueda de texto mira primero solo las reservas con salida en los últimos 36 meses, y recorre todo el histórico solo si así no encuentra nada, no se mandó ningún filtro de fecha y el término tiene al menos 3 caracteres o es numérico; una búsqueda por nombre además considera como mucho 150 clientes que coincidan, así que `total` puede quedarse corto. Tercera: los filtros de estado `cancelled` y `no-show` son el mismo filtro: cualquiera de los dos devuelve ambos tipos. La respuesta es `{ data, total }`: `data` trae hasta **20 reservas** y `total` cuenta las coincidencias sin tener en cuenta la paginación; recorre las páginas sumando 20 a `offset` hasta haber leído `total`. Para buscar solo un tipo, usa `/search/only-single` o `/search/only-groups`."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/search/only-single": {
      "get": {
        "description": "Same filters, same rules and same response shape as `/search` (read its description: the exact-ID shortcut, the 36-month window and the shared cancelled / no-show filter apply here too), but it leaves group bookings out: only reservations of a single room. Use it when a group of ten rooms would otherwise flood the results with ten entries that belong together. `data` holds up to **15 bookings** per page — a different page size from `/search`, so do not reuse the same paging step.",
        "operationId": "ImagesController_getBookingsOnlySingleSearchV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "value",
            "required": false,
            "in": "query",
            "description": "Free-text search: holder name, surname, email and locator (by prefix), phone (by its end) and booking ID. See the endpoint description for how it matches",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "roomTypeId",
            "required": false,
            "in": "query",
            "description": "Filter by room type ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by one or more booking statuses. cancelled and no-show select the same bookings: either one returns both kinds. Default: every status, blocks excluded",
            "schema": {
              "enum": [
                "ready",
                "tentative",
                "cancelled",
                "no-show",
                "temporary-cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "Pagination offset — number of records to skip. Default is 0",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-out date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-in date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBookingSearchResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Search individual bookings (no groups)",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Buscar solo reservas individuales",
            "description": "Mismos filtros, mismas reglas y misma forma de respuesta que `/search` (lee su descripción: el atajo del ID exacto, la ventana de 36 meses y el filtro compartido de cancelled / no-show también valen aquí), pero dejando fuera las reservas de grupo: solo reservas de una habitación. Úsalo cuando un grupo de diez habitaciones inundaría los resultados con diez entradas que van juntas. `data` trae hasta **15 reservas** por página, un tamaño distinto al de `/search`, así que no reutilices el mismo salto de paginación."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/search/only-groups": {
      "get": {
        "description": "Same filters as `/search`, but it returns only multi-room reservations — and the response shape is different: each entry of `data` is a **group**, not a booking. A group carries its `groupId`, the bookings it is made of (one per room, sorted by booking ID) and how many there are. `data` holds up to **5 groups** per page, newest created first; `total` counts the matching groups, not the bookings inside them. The filters are matched against the individual bookings, so a group is returned when any of its rooms matches. The free text works differently from `/search`: it looks at the whole history (no 36-month window, no limit of customers), a numeric term matches a booking ID or locator that starts with it or the end of a phone number, and there is no exact-ID shortcut. As in `/search`, a non-numeric term shorter than 2 characters returns nothing, and the `cancelled` and `no-show` status filters both return both kinds.",
        "operationId": "ImagesController_getBookingsOnlyGroupsSearchV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "value",
            "required": false,
            "in": "query",
            "description": "Free-text search: holder name, surname, email and locator (by prefix), phone (by its end) and booking ID. See the endpoint description for how it matches",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "roomTypeId",
            "required": false,
            "in": "query",
            "description": "Filter by room type ID",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter by one or more booking statuses. cancelled and no-show select the same bookings: either one returns both kinds. Default: every status, blocks excluded",
            "schema": {
              "enum": [
                "ready",
                "tentative",
                "cancelled",
                "no-show",
                "temporary-cancelled"
              ],
              "type": "string"
            }
          },
          {
            "name": "offset",
            "required": false,
            "in": "query",
            "description": "Pagination offset — number of records to skip. Default is 0",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "end",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-out date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": false,
            "in": "query",
            "description": "Filter bookings whose check-in date matches this exact date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBookingSearchGroupsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Search group bookings only",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Buscar solo reservas de grupo",
            "description": "Mismos filtros que `/search`, pero devuelve solo reservas de varias habitaciones, y la forma de la respuesta es distinta: cada entrada de `data` es un **grupo**, no una reserva. Un grupo lleva su `groupId`, las reservas que lo componen (una por habitación, ordenadas por ID de reserva) y cuántas son. `data` trae hasta **5 grupos** por página, del creado más recientemente al más antiguo; `total` cuenta los grupos que coinciden, no las reservas que hay dentro. Los filtros se aplican contra las reservas individuales, así que un grupo se devuelve cuando cualquiera de sus habitaciones coincide. El texto libre funciona distinto que en `/search`: mira todo el histórico (sin ventana de 36 meses ni límite de clientes), un término numérico busca un ID de reserva o un localizador que empiece por él o el final de un teléfono, y no hay atajo de ID exacto. Como en `/search`, un término no numérico de menos de 2 caracteres no devuelve nada, y los filtros de estado `cancelled` y `no-show` devuelven los dos tipos."
          }
        }
      }
    },
    "/api/bookings/{pcode}/detail/{bookingId}": {
      "get": {
        "description": "Retrieve everything the PMS holds about one booking: holder and guests, assigned room, dates and times, price and amounts, board and cancellation policy, occupancy, source channel, notes, housekeeping, tasks, the pack it was sold with and its segments. Money is always in the property's own currency. A cancelled booking says when it was cancelled in `cancelledAt`, read from its history. The ID of a block (a room closed by the staff) also answers here: it comes with `bookingType`, no `customer`, `bookingStatus` cancelled and `cancelledAt` `null`. What it does NOT include, because each has its own endpoint: the charge breakdown (`/products`), payments, invoices, proformas and deposits. Booking IDs come from the search endpoints or from the response of the creation endpoint.",
        "operationId": "ImagesController_getBooking",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBookingResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking details",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar el detalle de una reserva",
            "description": "Devuelve todo lo que el PMS guarda de una reserva: titular y huéspedes, habitación asignada, fechas y horas, precio e importes, régimen y política de cancelación, ocupación, canal de origen, notas, limpieza, tareas, el pack con el que se vendió y sus segmentos. El dinero va siempre en la moneda del propio establecimiento. Una reserva cancelada dice cuándo se canceló en `cancelledAt`, leído de su historial. El ID de un bloqueo (una habitación cerrada por el personal) también responde aquí: viene con `bookingType`, sin `customer`, con `bookingStatus` cancelled y `cancelledAt` `null`. Lo que NO incluye, porque cada cosa tiene su endpoint: el desglose de cargos (`/products`), los pagos, las facturas, las proformas y los depósitos. Los IDs de reserva salen de los endpoints de búsqueda o de la respuesta del endpoint de creación."
          }
        }
      }
    },
    "/api/v5/bookings/{pcode}": {
      "post": {
        "description": "Create one or more bookings for a property in a single call. Every entry of `rooms` becomes its own booking, so a request for a double and a single creates two bookings and the response carries two ids, in the same order as they were sent. Availability is checked before the bookings are written: if any of the requested rooms is not available for the date range, the whole request is rejected with `409` `roomsNotAvailable` and nothing is created. The one exception is a booking that says where it was already sold — `settings.otaId` or `settings.locator` sent: it is not checked and is written even over a full night, because refusing it would lose a sale that already happened elsewhere; the overbooking is left to the property. Room types and their ids come from `GET /api/rooms/{pcode}/types`, and availability from `GET /api/v2/rooms/{pcode}/availability`. Send an `Idempotency-Key` header to make retries safe: if the answer is lost (a timeout, a dropped connection), repeating the same request with the same key never creates the bookings twice — it answers `409` `creationInProgress` while the first request is still running and the same ids once it has finished. Reusing a key with a different body answers `422` `idempotencyKeyReused`. When the bookings could not be stored and none was created, the answer is `409` `legacyWriteFailed` with `fault: dependency`: the same request may be sent again, except that a holder company sent as new was already created, so it has to be sent as an existing one.",
        "operationId": "ImagesController_addBookingV5_v5",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional. A value you choose for this attempt (a UUID, 8 to 128 characters of letters, digits, \"-\" or \"_\"), repeated when you retry the same request after a timeout or a lost answer. While the first request is still running, a repeat — same body or not — answers `409` with `creationInProgress`; once it finished, a repeat answers with the same response — the same ids — and creates nothing new (the response carries `Idempotent-Replayed: true`). Kept for 24 hours. Once the first request finished, reusing its key with a different body answers `422` with `idempotencyKeyReused`. A request that failed is not remembered, so it can be retried with the same key.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddBookingDtoV4"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AddBookingResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "roomsNotAvailable: a requested room is not available, nothing was created. creationInProgress: a request with the same Idempotency-Key is still running. legacyWriteFailed: the bookings could not be stored and none was created; the request may be sent again. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "422": {
            "description": "idempotencyKeyReused: the Idempotency-Key was already used with a different body"
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Create booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Crear una reserva",
            "description": "Crea una o varias reservas en un establecimiento en una sola llamada. Cada entrada de `rooms` se convierte en su propia reserva, así que una petición con una doble y una individual crea dos reservas y la respuesta trae dos ids, en el mismo orden en que se enviaron. La disponibilidad se comprueba antes de escribir nada: si alguna de las habitaciones pedidas no está disponible para el rango de fechas, se rechaza la petición entera con `409` `roomsNotAvailable` y no se crea nada. La única excepción es una reserva que dice dónde se vendió ya —con `settings.otaId` o `settings.locator`—: no se comprueba y se escribe aunque la noche esté llena, porque rechazarla perdería una venta que ya se hizo en otro sitio; el overbooking lo resuelve el establecimiento. Los tipos de habitación y sus ids salen de `GET /api/rooms/{pcode}/types`, y la disponibilidad de `GET /api/v2/rooms/{pcode}/availability`. Manda la cabecera `Idempotency-Key` para que reintentar sea seguro: si se pierde la respuesta (un timeout, una conexión cortada), repetir la misma petición con la misma clave nunca crea las reservas dos veces — responde `409` `creationInProgress` mientras la primera sigue en curso y los mismos ids cuando ha terminado. Reutilizar una clave con otro cuerpo responde `422` `idempotencyKeyReused`. Si las reservas no se han podido guardar y no se ha creado ninguna, responde `409` `legacyWriteFailed` con `fault: dependency`: se puede repetir la misma petición, salvo que una empresa titular enviada como nueva ya se ha creado y hay que mandarla como existente."
          }
        }
      }
    },
    "/api/bookings/{pcode}/check-in-out/{bookingId}": {
      "put": {
        "description": "Move one booking to a new check-in state. Send the state you want in `nextStatus`: `waiting-check-in` (the guest has not arrived), `checked-in` (the guest is in the room) or `checked-out` (the stay is over). `cancelled` is a state a booking can show, not one you can move it to here: it answers `400` — cancel a booking by changing its status. It affects this booking only — in a group, each room is checked in on its own. Not every move is allowed: the states follow an order, and one that does not follow it is rejected with `400`. Sending `waiting-check-in` on a booking that is `checked-in` is how you undo a check-in made by mistake. Checking out can be refused with `409` `pendingPayment` while the booking still has money pending, but only if the property turned that check on — so the same request can succeed for one property and fail for another. A partner connection is held to that one only: the invoicing rules of the property are work for reception, so the booking checks out without its invoice and reception issues it afterwards. With the own key of the property, checking out can also be refused with `409` `pendingInvoicePayment` or `pendingInvoice` while invoices are pending, again only if the property turned those checks on. Checking in answers `409` `pendingCheckout` while an earlier booking of the same room is still checked in. With an API key the change is credited to the integration, and the key must have this endpoint granted explicitly: keys issued before endpoint scopes existed answer `403` here. Answers `204` with no body; read the booking back with the detail endpoint if you need its new state. The submission to the authorities runs asynchronously after the check-in, so a guest rejected by them does not fail this call: the per-guest result lands in the booking history.",
        "operationId": "ImagesController_checkInOutBookingV2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckInOutBookingDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "The booking moved to the requested state. No body"
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Check-out refused: pendingPayment, and for the property own key also pendingInvoicePayment or pendingInvoice (only when the property turned those checks on; a partner connection is never refused for invoices). Check-in refused: pendingCheckout, an earlier booking of the same room is still checked in. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Check-in / Check-out booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Hacer check-in o check-out",
            "description": "Mueve una reserva a un nuevo estado de check-in. Manda el estado que quieres en `nextStatus`: `waiting-check-in` (el huésped no ha llegado), `checked-in` (el huésped está en la habitación) o `checked-out` (la estancia ha terminado). `cancelled` es un estado que una reserva puede mostrar, no uno al que se la pueda mover aquí: responde `400` — para cancelar una reserva, cambia su estado. Afecta solo a esa reserva: en un grupo, cada habitación se registra por su cuenta. No todos los movimientos valen: los estados siguen un orden y uno que no lo respete se rechaza con `400`. Mandar `waiting-check-in` sobre una reserva que está en `checked-in` es la forma de deshacer un check-in hecho por error. El check-out puede rechazarse con `409` `pendingPayment` mientras la reserva tenga dinero pendiente, pero solo si el establecimiento activó esa comprobación, así que la misma petición puede funcionar en uno y fallar en otro. A una conexión de partner solo se le aplica esa: las reglas de facturación del establecimiento son trabajo de recepción, así que la reserva sale sin su factura y recepción la emite después. Con la clave propia del establecimiento, el check-out también puede rechazarse con `409` `pendingInvoicePayment` o `pendingInvoice` mientras haya facturas pendientes, también solo si el establecimiento activó esas comprobaciones. El check-in responde `409` `pendingCheckout` mientras una reserva anterior de la misma habitación siga con check-in. Con API key, el cambio queda a nombre de la integración, y la clave tiene que tener este endpoint concedido expresamente: las claves emitidas antes de que existieran los permisos por endpoint responden `403` aquí. Responde `204` sin cuerpo; si necesitas el estado nuevo, vuelve a leer la reserva con el endpoint de detalle. El envío a las autoridades va por su cuenta después del check-in, así que un huésped rechazado por ellas no hace fallar esta llamada: el resultado de cada huésped queda en el historial de la reserva."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/payments/{bookingId}": {
      "get": {
        "description": "Retrieve every payment registered against a booking, whoever took it: cash and card at reception, bank transfer, and online payments through the gateways the property has connected. When the booking is part of a group, the payments of every booking in the group come back — including those of bookings in other properties, when the group spans several: each payment carries its own `bookingId` and `pcode`, so filter on them to keep the ones of a single booking. `type` says how it was paid, as the property named it, and `providerType` which gateway handled it; it is absent when the payment was taken by hand. A refunded payment stays in the list and is marked as such, so the list is the history, not the balance — add the amounts to get what has actually been collected. Amounts are in the property's currency. Money held as a guarantee rather than collected is not here: see `/deposits`.",
        "operationId": "PaymentsController_getBookingPaymentsV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetBookingPaymentResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking payments",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los pagos de una reserva",
            "description": "Devuelve todos los pagos registrados en una reserva, los cobrara quien los cobrara: efectivo y tarjeta en recepción, transferencia bancaria y pagos online por las pasarelas que el establecimiento tenga conectadas. Si la reserva forma parte de un grupo, llegan los pagos de todas las reservas del grupo, también los de reservas de otros establecimientos cuando el grupo abarca varios: cada pago lleva su propio `bookingId` y su `pcode`, así que filtra por ellos para quedarte con los de una sola reserva. `type` dice cómo se pagó, con el nombre que le dio el establecimiento, y `providerType` qué pasarela lo gestionó; no viene cuando el pago se registró a mano. Un pago devuelto sigue en la lista y viene marcado como tal, así que la lista es el historial, no el saldo: suma los importes para saber qué se ha cobrado de verdad. Los importes van en la moneda del establecimiento. El dinero retenido como garantía en lugar de cobrado no está aquí: ver `/deposits`."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/invoices/{bookingId}": {
      "get": {
        "description": "Retrieve the invoices issued for a booking and, when it is part of a group, for every booking of the group in the same property; batch invoices that bill a line of any of them come too. These are the final, legally numbered documents: once issued they are not edited, and a correction is made by issuing a credit note against them. Credit notes come back in the same list, with `type: refund` and the invoice they correct pointing at them through `refundId` — so the amount actually invoiced is the sum of the invoices minus the sum of the credit notes, not the sum of everything. Each entry carries its series and number, date, total, the line items it bills with the tax rate of each, and the customer or company it was billed to; tax bases and tax amounts are not broken out. Amounts are in the currency the invoice was issued in, given in `coin` as it was stored. A booking may have no invoices yet, several, or one per guest when the bill was split. Quotes sent before invoicing are a different document: see `/proformas`.",
        "operationId": "InvoicesController_getBookingInvoicesV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetBookingInvoicesResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking invoices",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar las facturas de una reserva",
            "description": "Devuelve las facturas emitidas de una reserva y, si forma parte de un grupo, las de todas las reservas del grupo en el mismo establecimiento; también llegan las facturas de lote que facturan alguna línea de cualquiera de ellas. Son los documentos definitivos, con numeración legal: una vez emitidos no se editan, y una corrección se hace emitiendo un abono contra ellos. Los abonos vienen en la misma lista, con `type: refund`, y la factura que corrigen apunta a ellos con `refundId`, así que lo realmente facturado es la suma de las facturas menos la suma de los abonos, no la suma de todo. Cada entrada lleva su serie y número, fecha, total, las líneas que factura con el tipo de impuesto de cada una y el cliente o empresa al que se facturó; las bases y cuotas de impuesto no vienen desglosadas. Los importes van en la moneda en que se emitió la factura, que `coin` da tal como se guardó. Una reserva puede no tener ninguna factura todavía, tener varias, o una por huésped si se dividió la cuenta. Los presupuestos que se mandan antes de facturar son otro documento: ver `/proformas`."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/proformas/{bookingId}": {
      "get": {
        "description": "Retrieve the proformas issued for a booking. A proforma is a quote in the shape of an invoice: it is sent to the guest or the company before the stay to state what it will cost, and it has no accounting value — it does not use the invoice numbering and it settles nothing. The real document is the invoice (`/invoices`), which may be issued later for a different amount if the stay changed. When the booking is part of a group, the proformas of every booking of the group in the same property come too. Each entry carries its series and number, date, total, line items and the customer or company it was addressed to. Amounts are in the currency the proforma was issued in, given in `coin` as it was stored.",
        "operationId": "ProformasController_getBookingProformasV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetBookingProformasResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking proformas",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar las proformas de una reserva",
            "description": "Devuelve las proformas emitidas de una reserva. Una proforma es un presupuesto con forma de factura: se manda al huésped o a la empresa antes de la estancia para decir cuánto va a costar, y no tiene valor contable, no usa la numeración de facturas y no salda nada. El documento real es la factura (`/invoices`), que puede emitirse después por un importe distinto si la estancia cambió. Si la reserva forma parte de un grupo, llegan también las proformas de todas las reservas del grupo en el mismo establecimiento. Cada entrada lleva su serie y número, fecha, total, líneas y el cliente o empresa al que iba dirigida. Los importes van en la moneda en que se emitió la proforma, que `coin` da tal como se guardó."
          }
        }
      }
    },
    "/api/v2/bookings/{pcode}/products/{bookingId}": {
      "get": {
        "description": "Retrieve everything charged to a booking, plus a breakdown of what was booked. When the booking is part of a group, the charges of every booking of the group come back, one set of entries per booking — including bookings of other properties when the group spans several. `breakdown` summarises a group by room type — how many rooms and for what occupancy — and is an empty array for a booking on its own. `items` carries the charges themselves, grouped by where they came from: each entry has exactly one key, `booking` for the lines produced by the PMS (the accommodation, the tourist tax and the extras), `experticket` for the tickets sold through the Experticket integration, or `revo`, `agora`, `spalopia` or `ticksy` for charges imported from the corresponding POS integration. Lines returned by a credit note are left out of `booking` and kept in the POS groups; lines of the retired Tiller integration are not returned. The `experticket` entry of a booking comes right after its `booking` entry, and its lines are no longer part of `booking.total`. Each ticket line carries its sale under `experticket`; when the request is authenticated with an API key, the ticket PDF link (`sale.documentUrl`), the access codes (`sale.accessCode`, `sale.tickets[].accessCode`) and the billing codes (`sale.tickets[].billingCode`) come back as null, and the guest answers (`answers`) are omitted. A line already billed carries the `invoiceId` of its invoice; a line still pending invoicing has none.",
        "operationId": "ProductsController_getBookingProductsV2_v2",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBookingProductsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking products",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los cargos de una reserva",
            "description": "Devuelve todo lo cargado a una reserva, más un desglose de lo reservado. Si la reserva forma parte de un grupo, llegan los cargos de todas las reservas del grupo, un juego de entradas por reserva, también de reservas de otros establecimientos cuando el grupo abarca varios. `breakdown` resume un grupo por tipo de habitación (cuántas habitaciones y con qué ocupación) y es un array vacío en una reserva suelta. `items` trae los cargos en sí, agrupados por su procedencia: cada entrada tiene exactamente una clave, `booking` para las líneas que genera el PMS (el alojamiento, la tasa turística y los extras), `experticket` para las entradas vendidas con la integración de Experticket, o `revo`, `agora`, `spalopia` o `ticksy` para los cargos importados de la integración de TPV correspondiente. Las líneas devueltas por un abono se quedan fuera de `booking` y se mantienen en los grupos de TPV; las líneas de la antigua integración de Tiller no se devuelven. La entrada `experticket` de una reserva va justo después de su entrada `booking`, y sus líneas ya no suman en `booking.total`. Cada línea de entradas lleva su venta en `experticket`; si la petición se autentica con una API key, el enlace al PDF de las entradas (`sale.documentUrl`), los códigos de acceso (`sale.accessCode`, `sale.tickets[].accessCode`) y los códigos de facturación (`sale.tickets[].billingCode`) llegan a null, y las respuestas del huésped (`answers`) se omiten. Una línea ya facturada lleva el `invoiceId` de su factura; una línea aún pendiente de facturar no lleva ninguno."
          }
        }
      }
    },
    "/api/bookings/{pcode}/deposits/{bookingId}": {
      "get": {
        "description": "Retrieve the security deposits held against a booking. A deposit is money taken as a guarantee, not as payment for the stay: it is returned at check-out unless it is converted into a payment. That is what `type` says — `deposit` for money taken, `refund` for money given back — so a deposit that was returned appears as two entries, the `refund` one with the amount negative. A deposit converted into a payment carries the `paymentId` it became; a returned one carries the `refundId` of its `refund` entry. Each entry gives its currency in `currency`, as it was stored. Payments for the stay itself are a different endpoint: `/payments`.",
        "operationId": "DepositsController_getBookingDeposits",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetBookingDepositsResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking deposits",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los depósitos de una reserva",
            "description": "Devuelve las fianzas retenidas sobre una reserva. Un depósito es dinero tomado como garantía, no como pago de la estancia: se devuelve al hacer el check-out salvo que se convierta en pago. Eso es lo que dice `type`: `deposit` para el dinero tomado y `refund` para el devuelto, así que un depósito que se devolvió aparece como dos entradas, la de `refund` con el importe en negativo. Un depósito convertido en pago lleva el `paymentId` en el que se convirtió; uno devuelto lleva el `refundId` de su entrada `refund`. Cada entrada da su moneda en `currency`, tal como se guardó. Los pagos de la estancia en sí son otro endpoint: `/payments`."
          }
        }
      }
    },
    "/api/bookings/{pcode}/customer-image/{hash}": {
      "get": {
        "description": "Download a scan of a guest's identity document — passport, ID card or residence permit — or the guest's signature, as binary image data. The `hash` is not something you build: read it from the booking detail, as the last segment of the customer fields `documentPortraitImagePath`, `documentFrontImagePath`, `documentBackImagePath` or `signatureImagePath`, which hold the whole path of this endpoint. A guest who never uploaded a document has none, and there is nothing to fetch. Responses carry a strong `ETag` and may be cached for 10 minutes; send the ETag back as `If-None-Match` and you get `304 Not Modified`, with no body, instead of the bytes. The same document keeps the same hash even if the guest replaces the file, so rely on the ETag rather than the URL to tell whether it changed. With an API key, this endpoint counts against the key's quota like any other. This is personal data: the response is marked as privately cacheable so no shared cache keeps a copy. Store it accordingly, or not at all.",
        "operationId": "ImagesController_getImageFromCustomer",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "hash",
            "required": true,
            "in": "path",
            "description": "Identifier of the document image: the last segment of the path in the customer fields `documentPortraitImagePath`, `documentFrontImagePath`, `documentBackImagePath` or `signatureImagePath` of the booking detail. Take it from there rather than building it",
            "schema": {
              "example": "MTAyMzpkb2N1bWVudC1mcm9udDo3Nw",
              "type": "string"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "The `ETag` of the copy you already have. When it still matches, the answer is `304 Not Modified` without the bytes",
            "required": false,
            "schema": {
              "type": "string",
              "example": "\"5d41402abc4b2a76b9719d911017c592\""
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The document image, as binary data. The content type is the one the file was stored with: `image/jpg` for documents scanned in the PMS (a non-standard spelling of JPEG; treat it as `image/jpeg`), `application/octet-stream` for older ones uploaded through the legacy panel, and `image/png` or `image/jpeg` when the file was stored that way. Read the bytes rather than trusting the type",
            "headers": {
              "ETag": {
                "description": "Strong validator derived from the image bytes. Send it back as `If-None-Match` to get `304 Not Modified` while the image is unchanged",
                "schema": {
                  "type": "string",
                  "example": "\"5d41402abc4b2a76b9719d911017c592\""
                }
              },
              "Cache-Control": {
                "description": "`private, max-age=600`: the image may be kept 10 minutes, and only by the client that fetched it, never by a shared cache",
                "schema": {
                  "type": "string",
                  "example": "private, max-age=600"
                }
              }
            },
            "content": {
              "image/jpg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified: the `If-None-Match` sent matches the current `ETag`. No body; keep using the copy you have",
            "headers": {
              "ETag": {
                "description": "Strong validator derived from the image bytes. Send it back as `If-None-Match` to get `304 Not Modified` while the image is unchanged",
                "schema": {
                  "type": "string",
                  "example": "\"5d41402abc4b2a76b9719d911017c592\""
                }
              },
              "Cache-Control": {
                "description": "`private, max-age=600`: the image may be kept 10 minutes, and only by the client that fetched it, never by a shared cache",
                "schema": {
                  "type": "string",
                  "example": "private, max-age=600"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too many requests: the rate limit of the API key (or of the session) was hit"
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get customer document image",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Descargar el documento de identidad de un huésped",
            "description": "Descarga el escaneo del documento de identidad de un huésped —pasaporte, DNI o permiso de residencia— o su firma, como imagen binaria. El `hash` no es algo que construyas tú: se lee del detalle de la reserva, como el último segmento de los campos del cliente `documentPortraitImagePath`, `documentFrontImagePath`, `documentBackImagePath` o `signatureImagePath`, que llevan la ruta completa de este endpoint. Un huésped que nunca subió un documento no tiene ninguno, y no hay nada que descargar. Las respuestas llevan un `ETag` fuerte y se pueden cachear 10 minutos; devuelve el ETag en `If-None-Match` y recibirás un `304 Not Modified`, sin cuerpo, en lugar de los bytes. El mismo documento conserva el mismo hash aunque el huésped sustituya el fichero, así que fíate del ETag y no de la URL para saber si cambió. Con una API key, este endpoint cuenta para la cuota de la clave como cualquier otro. Esto son datos personales: la respuesta se marca como cacheable solo en privado para que ninguna caché compartida guarde una copia. Guárdalo en consecuencia, o no lo guardes."
          }
        }
      }
    },
    "/api/otas": {
      "get": {
        "description": "The catalogue of sales channels the PMS knows about — Booking.com, Expedia, Airbnb and the rest — with the ID, name and display colour of each. Use it to resolve the `otaId` that bookings carry into a channel name: that field is a number, and this is the only place that says what it means. The list is sorted by name; `0` is the property itself (a sale at reception), and a channel withdrawn from the catalogue is not listed, so an old booking may carry an `otaId` that is not here. The catalogue is the same for every property, so this is the one endpoint with no `pcode` in its path — any valid API key can read it. It changes very rarely: fetch it once and keep it, rather than on every booking.",
        "operationId": "MiscController_getOtas",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetOtasResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "List OTAs (Online Travel Agencies)",
        "tags": [
          "Misc"
        ],
        "x-translations": {
          "es": {
            "summary": "Listar OTAs (agencias de viaje online)",
            "description": "El catálogo de canales de venta que conoce el PMS —Booking.com, Expedia, Airbnb y el resto— con el ID, el nombre y el color de cada uno. Úsalo para traducir el `otaId` que llevan las reservas a un nombre de canal: ese campo es un número, y este es el único sitio que dice qué significa. La lista va ordenada por nombre; el `0` es el propio establecimiento (una venta en recepción), y un canal retirado del catálogo no aparece, así que una reserva antigua puede llevar un `otaId` que no está aquí. El catálogo es el mismo para todos los establecimientos, así que este es el único endpoint sin `pcode` en la ruta: lo puede leer cualquier clave de API válida. Cambia muy poco: pídelo una vez y guárdalo, en lugar de llamarlo en cada reserva."
          }
        }
      }
    },
    "/api/integrations/{pcode}/crm/booking-changes": {
      "get": {
        "description": "What changed since you last asked. Every booking whose row changed at or after `since` — created, edited, moved, cancelled — oldest change first, 50 per page. The first call fixes a window, from `since` to `until` (the moment it was answered), and every page of it answers that same `until`. While `nextCursor` is not null, call again with `cursor=<nextCursor>` (`since` is ignored then); once it is null, wait and poll again with `since=<until>`. It is null on a page with fewer than 50 bookings: a last page of exactly 50 still carries a cursor, and the page it leads to comes empty. Send `since` with its zone; a value without one is read as UTC, and a bare date as that day's midnight in UTC. A booking that changes while you page leaves the window and comes in your next poll, so nothing is skipped. Changes are compared to the second, so a booking changed in the same second as `until` comes again in the next poll: keep the latest version of each booking by its id. A cursor that was not issued by the feed is refused with 400 `bookingChangesCursorInvalid`: start again from your last `until`. A change to something hanging off a booking that does not touch the booking itself (a payment, an edit of the guest record) does not bring it back. Cancelled bookings come too: a cancellation is a change.\n\nEach item carries the booking, its guest, the property and the room under the field names of the legacy CRM export (`/panel/thirdPart/clientify`, `/panel/thirdPart/crm`), plus `last_modified`, the instant of the change in UTC. Numbers come as JSON numbers — all but `num_property`, the street number, which is text — and a missing date as `null`. `country` and `nationality` are names, as the guest record holds them, not codes. Phone and email come in clear, as the property recorded them, and `marketing` says whether the guest accepted marketing: the property decides what is done with it.\n\nLeft out on purpose, because a CRM has no use for them: the hotel's internal notes (`private_notes`), the identity document dates (`issue_date`, `date_of_expiry`), the guest webapp link (`app_url`, which carries the guest's access token), `ancillary`, and the room's door, lock, position and location.",
        "operationId": "CrmController_getBookingChanges",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "since",
            "required": false,
            "in": "query",
            "description": "An instant with its time and zone (ISO 8601): the bookings whose row changed at or after it. On the first poll, the moment you start; after that, the `until` of your last poll. Without a zone it is read as UTC, and a bare date (`2026-10-15`) as that day’s midnight in UTC. Required unless `cursor` is sent; ignored when it is",
            "schema": {
              "example": "2026-10-15T08:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "The `nextCursor` of the previous page, as it came. It carries the window of the first page, so `since` is ignored with it. A cursor that was not issued by this feed is refused with 400 `bookingChangesCursorInvalid`",
            "schema": {
              "example": "eyJ2IjoxLCJzIjoiMjAyNi0xMC0xNVQwODowMDowMC4wMDBaIn0",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetCrmBookingChangesResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request: neither `since` nor `cursor` was sent, `since` is not an ISO 8601 date or date-time (a `validation` list names it; one without a zone is accepted and read as UTC), or the `cursor` was not issued by this feed (`bookingChangesCursorInvalid`: start again from your last `until` as `since`)."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get the bookings changed since an instant, with their guests",
        "tags": [
          "CRM"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar las reservas cambiadas desde un instante, con sus huéspedes",
            "description": "Lo que ha cambiado desde la última vez que preguntaste. Cada reserva cuya fila cambió en `since` o después —creada, editada, movida, cancelada—, el cambio más antiguo primero, 50 por página. La primera llamada fija una ventana, de `since` a `until` (el momento en que se respondió), y todas sus páginas responden ese mismo `until`. Mientras `nextCursor` no sea null, vuelve a llamar con `cursor=<nextCursor>` (`since` se ignora entonces); cuando sea null, espera y vuelve a consultar con `since=<until>`. Es null en una página con menos de 50 reservas: una última página de justo 50 aún trae cursor, y la página a la que lleva llega vacía. Manda `since` con su zona; un valor sin ella se lee como UTC, y una fecha sola como la medianoche UTC de ese día. Una reserva que cambia mientras paginas sale de la ventana y llega en tu siguiente consulta, así que no se salta ninguna. Los cambios se comparan al segundo, así que una reserva cambiada en el mismo segundo que `until` vuelve en la siguiente consulta: quédate con la versión más reciente de cada reserva por su id. Un cursor que no emitió el feed se rechaza con 400 `bookingChangesCursorInvalid`: vuelve a empezar desde tu último `until`. Un cambio en algo que cuelga de una reserva y no toca la reserva en sí (un pago, una edición de la ficha del huésped) no la vuelve a traer. Las reservas canceladas también vienen: una cancelación es un cambio.\n\nCada elemento lleva la reserva, su huésped, el establecimiento y la habitación con los nombres de campo de la exportación CRM del legacy (`/panel/thirdPart/clientify`, `/panel/thirdPart/crm`), más `last_modified`, el instante del cambio en UTC. Los números llegan como números JSON —todos menos `num_property`, el número de la calle, que es texto— y una fecha que falta como `null`. `country` y `nationality` son nombres, como los guarda la ficha del huésped, no códigos. El teléfono y el email llegan en claro, como los registró el establecimiento, y `marketing` dice si el huésped aceptó comunicaciones comerciales: qué se hace con ello lo decide el establecimiento.\n\nSe dejan fuera a propósito, porque un CRM no los necesita: las notas internas del hotel (`private_notes`), las fechas del documento de identidad (`issue_date`, `date_of_expiry`), el enlace a la webapp del huésped (`app_url`, que lleva su token de acceso), `ancillary`, y la puerta, la cerradura, la posición y la ubicación de la habitación."
          }
        }
      }
    },
    "/api/integrations/{pcode}/house-keeping/room-status": {
      "put": {
        "description": "For a housekeeping system (a phone system on which housekeeping dials the state of the room, a housekeeping app): sets the state one room is in now, the one the property's rack and room list show and `GET /rooms/{pcode}/types` returns. Name the room by its door number, as text: `{ \"doorNum\": \"101\", \"status\": \"clean\" }`. `status` is `ready` (cleaned and inspected, ready for the next guest), `clean` (cleaned, waiting to be inspected) or `dirty` (to be cleaned); `revision` is not one you can write. The state is saved as the property's own change would be: the next cleaning date of the guest in the room follows it, it goes in the room's housekeeping history as a partner's report, and the property's screens and the guest app of whoever is in the room are updated. Idempotent: a room already in that state is left alone and answers `changed: false`, so it is safe to retry. When the property has your integration switched on, the states the property sets itself are sent to your system too: one you have just reported may come back to you, and reporting it again writes nothing. Answers `400` `housekeepingRoomStatusRequestInvalid` when the door number is not text of 1 to 80 characters or the state is not one of the three; `404` `housekeepingRoomNotFound` when no room of the property has that door number; and `409` `housekeepingRoomAmbiguous` when more than one does, which the property has to fix by giving each room its own. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "HousekeepingRoomStatusController_setRoomStatus",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRoomStatusDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetRoomStatusResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Refused, nothing written: `housekeepingRoomStatusRequestInvalid`"
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "No room of the property has that door number: `housekeepingRoomNotFound`"
          },
          "409": {
            "description": "Refused, nothing written: more than one room has that door number, `housekeepingRoomAmbiguous`. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Set the housekeeping state of a room",
        "tags": [
          "Rooms"
        ],
        "x-translations": {
          "es": {
            "summary": "Escribir el estado de limpieza de una habitación",
            "description": "Para un sistema de housekeeping (una centralita en la que el personal de pisos marca el estado de la habitación, una app de pisos): pone el estado en que está ahora una habitación, el que enseñan el rack y el listado de habitaciones del establecimiento y devuelve `GET /rooms/{pcode}/types`. La habitación se nombra por su número de puerta, como texto: `{ \"doorNum\": \"101\", \"status\": \"clean\" }`. `status` es `ready` (limpia e inspeccionada, lista para el siguiente huésped), `clean` (limpia, pendiente de inspección) o `dirty` (por limpiar); `revision` no se puede escribir. El estado se guarda como se guardaría el cambio del propio establecimiento: la próxima fecha de limpieza del huésped de la habitación lo sigue, queda en el historial de limpieza de la habitación como aviso de un partner, y se actualizan las pantallas del establecimiento y la app del huésped que esté en ella. Idempotente: una habitación que ya está en ese estado no se toca y responde `changed: false`, así que se puede reintentar sin riesgo. Cuando el establecimiento tiene tu integración activada, los estados que pone él también se mandan a tu sistema: uno que acabas de escribir puede volverte, y escribirlo otra vez no cambia nada. Responde `400` `housekeepingRoomStatusRequestInvalid` si el número de puerta no es un texto de 1 a 80 caracteres o el estado no es uno de los tres; `404` `housekeepingRoomNotFound` si ninguna habitación del establecimiento tiene ese número de puerta; y `409` `housekeepingRoomAmbiguous` si lo tiene más de una, que el establecimiento tiene que arreglar dando a cada habitación el suyo. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/kiosk/guests/{bookingId}": {
      "post": {
        "description": "Saves one guest of the booking from the identity document the kiosk read: one call per guest, before checking the booking in with `PUT /api/bookings/{pcode}/check-in-out/{bookingId}`, which sends them to the police registration. Send `holder: true` for the guest the booking is for: their record on the booking is completed with the document instead of a second one being added. A companion goes to the first companion place, taking it over when the booking holds it by name only, or to the next free one. Only the people already on this booking are matched by their document, and sending a guest again updates them in place and answers the same `guestId`: it is safe to retry. The booking history credits each guest to your partner name. Fields you leave out keep what the booking already had. Dates go as `YYYY-MM-DD` and countries as ISO 3166-1 alpha-3. The signature and the document images are optional JPEGs as data URIs; the document images are kept only while the property stores them. Answers `409` `kioskBookingCheckedOut` once the booking is checked out, `409` `kioskBookingNotActive` for a cancelled booking, a no-show or a block, and `409` `kioskInProgress` while another kiosk write for the same booking runs — retry in a moment. The images go through an antivirus scan before anything is saved: `422` `fileBlocked` with its `reason` when it refuses one, `409` `fileScanUnavailable` when the scan cannot be done and `429` `fileScanBusy` with `Retry-After` when it is busy; nothing is saved in any of them. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "KioskController_registerGuest",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterKioskGuestDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterKioskGuestResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Refused, nothing written: `kioskBookingCheckedOut`, `kioskBookingNotActive`, `kioskInProgress` (retry in a moment) or `fileScanUnavailable` (retry later). When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Register a guest of a booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Registrar un huésped de una reserva",
            "description": "Guarda un huésped de la reserva a partir del documento de identidad que leyó el kiosco: una llamada por huésped, antes de hacer el check-in de la reserva con `PUT /api/bookings/{pcode}/check-in-out/{bookingId}`, que es lo que los envía al registro de viajeros de la policía. Manda `holder: true` para el huésped a cuyo nombre está la reserva: se completa su ficha en la reserva con el documento en vez de añadir otra. Un acompañante va al primer sitio de acompañante, y lo ocupa si la reserva lo tiene solo con un nombre, o al siguiente libre. Solo se casa por documento con las personas que ya están en esta reserva, y mandar otra vez un huésped lo actualiza en su sitio y responde el mismo `guestId`: se puede reintentar sin riesgo. El historial de la reserva atribuye cada huésped a tu nombre de partner. Los campos que no mandes conservan lo que la reserva ya tenía. Las fechas van como `YYYY-MM-DD` y los países en ISO 3166-1 alfa-3. La firma y las imágenes del documento son opcionales, en JPEG como data URI; las imágenes del documento solo se guardan si el establecimiento las conserva. Responde `409` `kioskBookingCheckedOut` cuando la reserva ya tiene el check-out hecho, `409` `kioskBookingNotActive` si está cancelada, es un no-show o un bloqueo, y `409` `kioskInProgress` mientras se escribe otra cosa del kiosco en la misma reserva: reintenta en un momento. Las imágenes pasan por un antivirus antes de guardar nada: `422` `fileBlocked` con su `reason` si rechaza una, `409` `fileScanUnavailable` si no se puede analizar y `429` `fileScanBusy` con `Retry-After` si está ocupado; en ninguno se guarda nada. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/kiosk/payments/{bookingId}": {
      "post": {
        "description": "Records on the booking a payment the kiosk has already collected, by card or in cash, as reception would: it counts towards what the booking has paid, and the invoice is issued by the property as usual — this call does not invoice. Read what is due first with `GET /api/v2/bookings/{pcode}/payments/{bookingId}` and the booking detail. `collectedAt` dates the payment on that day in the property time zone. `transactionId` is stored as the payment reference behind your partner slug (`<slug>:<transactionId>`, which is how it reads in the booking payments) and makes it safe to retry: sending a transaction of yours that is already on the booking writes nothing and answers `200` with what is there and `replayed: true`; the same `transactionId` with a different amount answers `409` `kioskPaymentIdReused`, and so does the same `transactionId` already recorded on another booking of the same group, whatever the amount. Only your own payments are matched: another kiosk’s, or reception’s, with the same reference never are. A checked-out booking still takes it. Answers `409` `kioskBookingNotActive` for a cancelled booking, a no-show or a block, and `409` `kioskInProgress` while another kiosk write for the same booking runs — retry in a moment. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "KioskController_addPayment",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddKioskPaymentDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddKioskPaymentResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Refused, nothing written: `kioskPaymentIdReused`, `kioskBookingNotActive` or `kioskInProgress` (retry in a moment). When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Record a payment collected at the kiosk",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Registrar un cobro hecho en el kiosco",
            "description": "Registra en la reserva un cobro que el kiosco ya ha hecho, con tarjeta o en efectivo, como lo haría recepción: cuenta en lo pagado de la reserva, y la factura la emite el establecimiento como siempre — esta llamada no factura. Consulta antes lo pendiente con `GET /api/v2/bookings/{pcode}/payments/{bookingId}` y el detalle de la reserva. `collectedAt` fecha el cobro en ese día, en la zona horaria del establecimiento. `transactionId` se guarda como referencia del cobro detrás de tu slug de partner (`<slug>:<transactionId>`, que es como se lee en los pagos de la reserva) y permite reintentar sin riesgo: mandar una transacción tuya que ya está en la reserva no escribe nada y responde `200` con lo que hay y `replayed: true`; el mismo `transactionId` con otro importe responde `409` `kioskPaymentIdReused`, y también el mismo `transactionId` ya registrado en otra reserva del mismo grupo, sea cual sea el importe. Solo se comparan tus propios cobros: los de otro kiosco, o los de recepción, con la misma referencia nunca. Una reserva con el check-out hecho también lo admite. Responde `409` `kioskBookingNotActive` si está cancelada, es un no-show o un bloqueo, y `409` `kioskInProgress` mientras se escribe otra cosa del kiosco en la misma reserva: reintenta en un momento. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/kiosk/door-keys/{bookingId}": {
      "get": {
        "description": "The key of the booking room door, for the kiosk to give the guest at the end of the check-in: whichever lock system the property has, the PIN it issued for this booking is stored here. Only once the booking is checked in: check it in first with `PUT /api/bookings/{pcode}/check-in-out/{bookingId}`; before that it answers `409` `kioskBookingNotCheckedIn`, whatever the booking holds, so it never tells whether a booking still to arrive has a PIN. `status` says what there is: `pin` with the PIN in `pin`, as a string with its leading zeros; `keyWithoutPin` when the booking has a key but no PIN to give (a card, a link, the fixed code of the room, or a lock system that did not return one), so send the guest to reception; and `none` when no key was issued for the booking or its room has no lock. `pin` is null unless `status` is `pin`. A PIN is usually issued on the arrival day, so a booking checked in without one may get it later: read it again rather than keep it. One booking is one room: in a group, read each booking with its own id. Answers `409` `kioskBookingCheckedOut` once the booking is checked out, and `409` `kioskBookingNotActive` for a cancelled booking, a no-show or a block. Every read is recorded in the booking history under your partner name, with the status and never the PIN. The answer is never cached (`Cache-Control: no-store`): do not store the PIN beyond handing it to the guest. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "KioskController_getDoorKey",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetKioskDoorKeyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "No booking with this id in this property"
          },
          "409": {
            "description": "Refused, no key read: `kioskBookingNotCheckedIn` (check the booking in first), `kioskBookingCheckedOut` or `kioskBookingNotActive`. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get the door key of a checked-in booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar la llave de la puerta de una reserva con check-in",
            "description": "La llave de la puerta de la habitación de la reserva, para que el kiosco se la dé al huésped al terminar el check-in: tenga el establecimiento el sistema de cerraduras que tenga, el PIN que emitió para esta reserva se guarda aquí. Solo cuando la reserva ya tiene el check-in hecho: hazlo antes con `PUT /api/bookings/{pcode}/check-in-out/{bookingId}`; hasta entonces responde `409` `kioskBookingNotCheckedIn`, tenga la reserva lo que tenga, así que nunca dice si una reserva que aún no ha llegado tiene PIN. `status` dice lo que hay: `pin` con el PIN en `pin`, como texto y con sus ceros a la izquierda; `keyWithoutPin` cuando la reserva tiene llave pero no un PIN que dar (una tarjeta, un enlace, el código fijo de la habitación o un sistema de cerraduras que no lo devolvió), así que manda al huésped a recepción; y `none` cuando no se emitió llave para la reserva o su habitación no tiene cerradura. `pin` es null salvo que `status` sea `pin`. El PIN suele emitirse el día de llegada, así que una reserva con check-in y sin PIN puede tenerlo más tarde: vuelve a consultarlo en vez de guardarlo. Una reserva es una habitación: en un grupo, consulta cada reserva con su propio id. Responde `409` `kioskBookingCheckedOut` cuando la reserva ya tiene el check-out hecho, y `409` `kioskBookingNotActive` si está cancelada, es un no-show o un bloqueo. Cada consulta queda en el historial de la reserva a tu nombre de partner, con el estado y nunca con el PIN. La respuesta no se guarda en caché (`Cache-Control: no-store`): no guardes el PIN más allá de dárselo al huésped. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/locks/door-keys/{bookingId}": {
      "put": {
        "description": "For a lock system that issues the PIN itself: stores the key of the booking room door where every reader takes it from — the guest webapp, which shows it to the guest when the property chose to, the arrivals report and the self check-in kiosks. Send `{ \"pin\": \"0427\" }` with the PIN as text (digits only, 4 to 8, leading zeros kept); `{ \"state\": \"keyWithoutPin\" }` when the booking has a key but no PIN to give the guest; or `{ \"state\": \"none\" }` to remove the key, when the booking is cancelled or moved to a room the PIN does not open. Exactly one of `pin` and `state`. Only a booking still to come or in house: cancelled bookings, no-shows, blocks and checked-out bookings are refused, removing the key included — nothing reads the key of a stay that is over. Idempotent: sending the key the booking already has writes nothing and answers `changed: false`, so it is safe to retry. The answer says the status the booking has now and never repeats the PIN. Every change goes in the booking history under your partner name, with the status before and after and never the PIN. Hotelgest sends the guest no email with the PIN. One booking is one room: in a group, write each booking with its own id. Answers `400` `doorKeyPinInvalid` for a PIN that is not 4 to 8 digits sent as text, or is all zeros or zeros ending in 1 (`0000`, `0001`), which older readers of the booking take for \"no key\"; `400` `doorKeyRequestInvalid` when the body is not exactly one of `pin` and `state`; `409` `doorKeyBookingNotActive` for a cancelled booking, a no-show or a block; `409` `doorKeyBookingCheckedOut` once the booking is checked out; and `404` for a booking that is not of this property. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "LockDoorKeysController_setDoorKey",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDoorKeyDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetDoorKeyResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Refused, nothing written: `doorKeyPinInvalid` or `doorKeyRequestInvalid`"
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "No booking with this id in this property"
          },
          "409": {
            "description": "Refused, nothing written: `doorKeyBookingNotActive` or `doorKeyBookingCheckedOut`. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Set the door key of a booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Escribir la llave de la puerta de una reserva",
            "description": "Para un sistema de cerraduras que emite el PIN él mismo: guarda la llave de la puerta de la habitación de la reserva donde la leen todos — la webapp del huésped, que se la enseña cuando el establecimiento lo eligió, el informe de llegadas y los kioscos de autocheck-in. Manda `{ \"pin\": \"0427\" }` con el PIN como texto (solo dígitos, de 4 a 8, con sus ceros a la izquierda); `{ \"state\": \"keyWithoutPin\" }` cuando la reserva tiene llave pero no un PIN que dar al huésped; o `{ \"state\": \"none\" }` para quitar la llave, cuando la reserva se cancela o pasa a una habitación que el PIN no abre. Exactamente uno de `pin` y `state`. Solo una reserva por llegar o en casa: se rechazan las canceladas, los no-show, los bloqueos y las que tienen el check-out hecho, también para quitar la llave — nadie lee la llave de una estancia que ya terminó. Idempotente: mandar la llave que la reserva ya tiene no escribe nada y responde `changed: false`, así que se puede reintentar sin riesgo. La respuesta dice el estado que tiene ahora la reserva y nunca repite el PIN. Cada cambio queda en el historial de la reserva a tu nombre de partner, con el estado de antes y el de después y nunca con el PIN. Hotelgest no manda al huésped ningún correo con el PIN. Una reserva es una habitación: en un grupo, escribe cada reserva con su propio id. Responde `400` `doorKeyPinInvalid` si el PIN no son de 4 a 8 dígitos enviados como texto, o son todo ceros o ceros acabados en 1 (`0000`, `0001`), que los lectores antiguos de la reserva toman por «sin llave»; `400` `doorKeyRequestInvalid` si el cuerpo no lleva exactamente uno de `pin` y `state`; `409` `doorKeyBookingNotActive` si está cancelada, es un no-show o un bloqueo; `409` `doorKeyBookingCheckedOut` cuando ya tiene el check-out hecho; y `404` si la reserva no es de este establecimiento. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/pos/in-house": {
      "get": {
        "description": "The bookings whose guest is in the property right now: checked in, not yet checked out, and today (in the property time zone) between arrival and departure, both included. It is the list a POS charges rooms against: each entry carries the `bookingId` to post a ticket to with `POST /api/integrations/{pcode}/pos/tickets/{bookingId}`, the room with its door number, the board and the booking holder. It takes one optional filter, `room`: the exact door number, compared as text (`201`, not `201.0`), which narrows the list to that one room — no booking there answers an empty list, not a `404`. It returns only these fields — no contact details, documents or prices. Sorted by door number as text (`10` before `9`), bookings without a room first. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "PosController_getInHouseBookings",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "room",
            "required": false,
            "in": "query",
            "description": "Exact door number to filter by, compared as text. Omit for every room.",
            "schema": {
              "example": "201",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetInHouseBookingsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "List the guests staying now",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Listar los huéspedes alojados ahora",
            "description": "Las reservas cuyo huésped está ahora en el establecimiento: con el check-in hecho, sin check-out y con el día de hoy (en la zona horaria del establecimiento) entre la llegada y la salida, ambas incluidas. Es la lista contra la que un TPV carga a habitación: cada entrada trae el `bookingId` al que mandar el ticket con `POST /api/integrations/{pcode}/pos/tickets/{bookingId}`, la habitación con su número de puerta, el régimen y el titular de la reserva. Admite un filtro opcional, `room`: el número de puerta exacto, comparado como texto (`201`, no `201.0`), que reduce la lista a esa única habitación; si no hay ninguna reserva ahí, devuelve una lista vacía, no un `404`. Devuelve solo estos campos: ni datos de contacto, ni documentos, ni precios. Ordenada por número de puerta como texto (`10` antes que `9`), primero las reservas sin habitación. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/pos/tickets/{bookingId}": {
      "post": {
        "description": "Posts a restaurant or bar ticket paid as a room charge. Each line becomes a charge of the booking, billed with the rest of the stay at check-out, and shows up in the booking products like any other charge. Send prices with taxes included and the tax rate as a percentage; `consumedAt` dates the charge on that day in the property time zone. `ticketId` makes it safe to retry: sending a ticket that is already on the booking writes nothing and answers `200` with what is stored and `replayed: true` — the line names as stored (an apostrophe `'` is stored as `´`) and each unit price worked back from the stored net price, which can differ from what you sent by a cent; the same `ticketId` with a different total answers `409` `posTicketIdReused`. Find the guests staying now with `GET /api/integrations/{pcode}/pos/in-house`. Answers `409` `posTicketBookingCheckedOut` once the booking is checked out, `409` `posTicketBookingNotActive` for a cancelled booking, a no-show or a block, and `409` `posTicketInProgress` while another ticket for the same booking is being written — retry in a moment. Partner keys only, with this endpoint granted to the connection.",
        "operationId": "PosController_addPosTicket",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "bookingId",
            "required": true,
            "in": "path",
            "description": "Booking ID. Obtained from the search endpoints (`GET /api/v2/bookings/{pcode}/search`) or returned by the booking creation endpoint.",
            "schema": {
              "example": 789,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddPosTicketDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddPosTicketResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Refused, nothing written: `posTicketIdReused`, `posTicketBookingCheckedOut`, `posTicketBookingNotActive` or `posTicketInProgress` (retry in a moment). When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Charge a POS ticket to a booking",
        "tags": [
          "Bookings"
        ],
        "x-translations": {
          "es": {
            "summary": "Cargar un ticket de TPV a una reserva",
            "description": "Envía un ticket de restaurante o bar pagado con cargo a la habitación. Cada línea queda como un cargo de la reserva, se factura con el resto de la estancia en el check-out y aparece en los cargos de la reserva como cualquier otro. Manda los precios con impuestos incluidos y el impuesto como porcentaje; `consumedAt` fecha el cargo en ese día, en la zona horaria del establecimiento. `ticketId` permite reintentar sin riesgo: mandar un ticket que ya está en la reserva no escribe nada y responde `200` con lo guardado y `replayed: true` —los nombres de línea como se guardaron (un apóstrofo `'` se guarda como `´`) y cada precio unitario recalculado desde el neto guardado, que puede diferir en un céntimo de lo que mandaste—; el mismo `ticketId` con otro total responde `409` `posTicketIdReused`. Los huéspedes alojados ahora se sacan con `GET /api/integrations/{pcode}/pos/in-house`. Responde `409` `posTicketBookingCheckedOut` cuando la reserva ya tiene el check-out hecho, `409` `posTicketBookingNotActive` si está cancelada, es un no-show o un bloqueo, y `409` `posTicketInProgress` mientras se escribe otro ticket de la misma reserva: reintenta en un momento. Solo con clave de partner, con este endpoint concedido a la conexión."
          }
        }
      }
    },
    "/api/integrations/{pcode}/rms/on-the-books": {
      "get": {
        "description": "What an RMS reads to know how the property is doing, in the shape of the legacy export (`/panel/thirdPart/revbell`), field names included. `rsvList` holds the bookings — with `dfrom` and `dto`, those arriving in the range; with `dfrom` alone, those received that day — each with its nights and their prices in `PrecioNoche`, channel, segment, country, age and status; cancelled, no-show and tentative ones included, each with its `bookingStatus`, and a cancelled one with when it was cancelled in `Fecha_Anulacion`; blocked ones not, nor a booking whose room type is not sold on the booking engine or no longer exists, nor one with no priced night. `capList` holds each day and room type sold on the booking engine: rooms sold (confirmed bookings only: a tentative one is neither sold nor taken from the free rooms), blocked, free and in total, one row per room type name, so two room types with the same name come as one row. With `article`, `productionList` holds the articles sold: one row per invoice line, its units and amounts prorated to the days inside the range. `dto` at most 366 days after `dfrom`. Unlike the legacy, a call without dates is refused: there it matched almost nothing; and `Fecha_Anulacion` is when the booking was cancelled, read from its history, where the legacy gave its last change.",
        "operationId": "RmsController_onTheBooks",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "dfrom",
            "required": true,
            "in": "query",
            "description": "With `dto`, the first arrival date of the bookings and the first day of the capacity. Alone, the day the bookings were received on, and the one day of capacity",
            "schema": {
              "example": "2026-10-01",
              "type": "string"
            }
          },
          {
            "name": "dto",
            "required": false,
            "in": "query",
            "description": "Last arrival date and last day of capacity, at most 366 days after `dfrom`",
            "schema": {
              "example": "2026-10-31",
              "type": "string"
            }
          },
          {
            "name": "article",
            "required": false,
            "in": "query",
            "description": "Also return `productionList`: the articles sold day by day in the same range",
            "schema": {
              "example": true,
              "type": "boolean"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RmsOnTheBooksResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get what the property has sold and has left",
        "tags": [
          "RMS"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar lo vendido y lo que queda",
            "description": "Lo que lee un RMS para saber cómo va el establecimiento, con la forma de la exportación del legacy (`/panel/thirdPart/revbell`), nombres de campo incluidos. `rsvList` lleva las reservas —con `dfrom` y `dto`, las que llegan en el rango; con `dfrom` solo, las recibidas ese día—, cada una con sus noches y sus precios en `PrecioNoche`, canal, segmento, país, edad y estado; incluye las canceladas, los no-show y las provisionales, cada una con su `bookingStatus`, y una cancelada con el momento en que se canceló en `Fecha_Anulacion`; no los bloqueos, ni una reserva cuyo tipo de habitación no se vende en el motor de reservas o ya no existe, ni una sin ninguna noche con precio. `capList` lleva cada día y tipo de habitación que se vende en el motor de reservas: habitaciones vendidas (solo reservas confirmadas: una provisional ni se cuenta como vendida ni se resta de las libres), bloqueadas, libres y en total, una fila por nombre de tipo de habitación, así que dos tipos con el mismo nombre llegan en una sola fila. Con `article`, `productionList` lleva los artículos vendidos: una fila por línea de factura, con sus unidades e importes prorrateados a los días que caen en el rango. `dto` como mucho 366 días después de `dfrom`. A diferencia del legacy, una llamada sin fechas se rechaza: allí no devolvía casi nada; y `Fecha_Anulacion` es el momento en que se canceló la reserva, leído de su historial, donde el legacy daba su último cambio."
          }
        }
      }
    },
    "/api/integrations/{pcode}/rms/rates": {
      "get": {
        "description": "Every rate of the property a push may name: the base rate of its own sale (`main`), each channel’s base rate (`mainchannel`) and the channel rates (`planchannel`), with its room type, channel, board, policy and guests. Price modifiers are not listed: they derive from one of these, so you push the one they derive from. Inactive rates are listed and can be pushed, as on the legacy channel.",
        "operationId": "RmsController_listRates",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/RmsPushableRateDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "List the rates you can push to",
        "tags": [
          "RMS"
        ],
        "x-translations": {
          "es": {
            "summary": "Listar las tarifas a las que puedes enviar",
            "description": "Todas las tarifas del establecimiento que un envío puede nombrar: la base de su venta propia (`main`), la base de cada canal (`mainchannel`) y las tarifas de canal (`planchannel`), con su tipo de habitación, canal, régimen, política y huéspedes. Los modificadores de precio no salen: derivan de una de estas, así que se envía aquella de la que derivan. Las tarifas inactivas salen y se pueden enviar, como en el canal del legacy."
          }
        }
      }
    },
    "/api/integrations/{pcode}/rms/prices": {
      "get": {
        "description": "The price each rate of `rms/rates` sells at, night by night from `start` to `end` (both included), as Hotelgest prices it: the rate’s base, a channel rate’s derived from its channel base, the price set for a night on top of it, and a linked rate (`anchored`) worked out from the rate it follows unless that night has a price of its own. For a channel rate it is what the legacy `/v1/booking/price` gave with `channel=1` in `rateChannel[…].priceList`; unlike there, a channel rate comes whether or not its room type is on the booking engine, and `main` and `mainchannel` come too. A night with no price comes with `price: null`, never `0`.\n\nEach rate carries its `roomTypeId`, and each night also carries, as the legacy `/v1/booking/price` did: `availability`, the free rooms of that room type (the legacy `availabilityList`), which can be `0` (full) or negative (overbooked) and is `null` only when there are no rooms to read; and the stay restrictions `minStay` (the legacy `minstay`, `1` when none is set), `maxStay` (`0` when there is no maximum), `closed`, `closedToArrival` and `closedToDeparture`. A channel rate’s restrictions come from its OTA’s own calendar; the legacy read them all from the direct-sale one.\n\n`end` at most 366 days after `start`; a wider range is refused with `rmsDateRangeTooLong`. Narrow it with `rateId`, with `roomTypeId`, or with both (an intersection); an id that is not one of `rms/rates` is left out.",
        "operationId": "RmsController_getPrices",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "start",
            "required": true,
            "in": "query",
            "description": "First night",
            "schema": {
              "example": "2026-12-01",
              "type": "string"
            }
          },
          {
            "name": "end",
            "required": true,
            "in": "query",
            "description": "Last night, included. At most 366 days after `start`",
            "schema": {
              "example": "2026-12-31",
              "type": "string"
            }
          },
          {
            "name": "rateId",
            "required": false,
            "in": "query",
            "description": "Only these rates, by the `id` of `rms/rates`: repeat it (`rateId=1&rateId=2`) or separate them with commas. Without it, every rate",
            "schema": {
              "example": [
                48122
              ],
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          {
            "name": "roomTypeId",
            "required": false,
            "in": "query",
            "description": "Only rates of these room types, by the `roomTypeId` of `rms/rates`: repeat it (`roomTypeId=1&roomTypeId=2`) or separate them with commas. Combined with `rateId` as an intersection — a rate must match both. An id that is not a room type of this property is left out, as with `rateId`",
            "schema": {
              "example": [
                101
              ],
              "type": "array",
              "items": {
                "type": "number"
              }
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RmsRatePricesResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "A date that is not `YYYY-MM-DD`, `end` before `start` (`invalidDateRange`) or more than the allowed days after it (`rmsDateRangeTooLong`)"
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get the daily price of the rates you can push to",
        "tags": [
          "RMS"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar el precio diario de las tarifas a las que puedes enviar",
            "description": "El precio al que vende cada tarifa de `rms/rates`, noche a noche de `start` a `end` (ambas incluidas), tal como lo calcula Hotelgest: la base de la tarifa, el de una tarifa de canal derivado de la base de su canal, el precio puesto a una noche por encima, y una tarifa enlazada (`anchored`) calculada a partir de la que sigue salvo que esa noche tenga precio propio. Para una tarifa de canal es lo que daba el `/v1/booking/price` del legacy con `channel=1` en `rateChannel[…].priceList`; a diferencia de allí, una tarifa de canal viene esté o no su tipo de habitación en el motor de reservas, y vienen también las `main` y `mainchannel`. Una noche sin precio llega con `price: null`, nunca `0`.\n\nCada tarifa lleva su `roomTypeId`, y cada noche lleva además, como daba el `/v1/booking/price` del legacy: `availability`, las habitaciones libres de ese tipo (el `availabilityList` del legacy), que puede ser `0` (lleno) o negativa (sobreventa) y es `null` solo cuando no hay habitaciones que leer; y las restricciones de estancia `minStay` (el `minstay` del legacy, `1` cuando no hay ninguna puesta), `maxStay` (`0` cuando no hay máximo), `closed`, `closedToArrival` y `closedToDeparture`. Las restricciones de una tarifa de canal salen del calendario de su propia OTA; el legacy las leía todas del de venta directa.\n\n`end` como mucho 366 días después de `start`; un rango mayor se rechaza con `rmsDateRangeTooLong`. Acótala con `rateId`, con `roomTypeId` o con ambos (intersección); un id que no sea de `rms/rates` se deja fuera."
          }
        }
      }
    },
    "/api/integrations/{pcode}/rms/push": {
      "post": {
        "description": "Prices or restrictions for one rate, as tranches of dates. Dates go from yesterday to 700 days ahead, and prices and restrictions travel in separate pushes. The property must have its rates on Unified; otherwise the push is refused with 409 `rmsPropertyNotOnUnified`.\n\n**The queue is not the legacy one.** If you push to the legacy API today, these are the differences that change what you see:\n\n- **Applied within the minute, not hours later.** The legacy kept a push in a queue a cron drained hours after; here the push itself wakes the writer, and a watchdog picks up anything left within 60 seconds. The answer still comes as soon as the push is queued, not once it is written.\n- **The newest value of a day wins, not every push in turn.** Each push is split into its days and a day keeps only the last value sent for it. Resending a whole calendar costs nothing, and an older value never reappears after a newer one.\n- **Inside a push, the later tranche wins.** Where two tranches of the same push share days, the one further down the array wins. The legacy sorted them by start date first, so an earlier element starting later could win there.\n- **A late retry can be refused.** Across pushes the last to arrive wins; send `sentAt` and a push built before the last accepted one for the same rate is refused with 409 `rmsPushStale` instead of overwriting it.\n- **Full or down means 429, and nothing was stored.** Resend after the `Retry-After` seconds. The legacy took every push and fell behind instead.\n- **What is not applied is said.** Closures (`stop_sell`) and maximum stays (`max_stay`) are accepted and not applied for now, as on the legacy, but the answer lists them in `ignored` instead of a bare success.\n- **A write that fails is retried, then reported.** A day that cannot be written is retried a few times and then set aside and reported to us, rather than lost silently.",
        "operationId": "RmsController_push",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerRmsPushDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartnerRmsPushResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Refused, nothing stored: `rmsPushStale` (a `sentAt` older than the last push accepted for the rate) or `rmsPropertyNotOnUnified` (the property does not have its rates on Unified). When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Nothing was stored. `rmsQueueFull` or `rmsQueueUnavailable` (with `fault: dependency`): the queue is full or did not answer; resend after the `Retry-After` seconds. With no code, a rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header.",
            "headers": {
              "Retry-After": {
                "description": "Seconds to wait before resending",
                "schema": {
                  "type": "integer",
                  "example": 60
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Push prices or restrictions",
        "tags": [
          "RMS"
        ],
        "x-translations": {
          "es": {
            "summary": "Enviar precios o restricciones",
            "description": "Precios o restricciones de una tarifa, en tramos de fechas. Las fechas van de ayer a 700 días vista, y precios y restricciones viajan en envíos separados. El establecimiento tiene que tener sus tarifas en Unified; si no, el envío se rechaza con 409 `rmsPropertyNotOnUnified`.\n\n**La cola no es la del legacy.** Si hoy envías a la API del legacy, estas son las diferencias que cambian lo que ves:\n\n- **Se aplica en el minuto, no horas después.** El legacy dejaba el envío en una cola que un cron vaciaba horas más tarde; aquí el propio envío despierta al escritor, y un vigilante recoge lo que quede en 60 segundos. La respuesta sigue llegando en cuanto el envío queda encolado, no cuando se escribe.\n- **Gana el valor más nuevo de cada día, no cada envío por turno.** Cada envío se parte en sus días y un día solo guarda el último valor recibido. Reenviar el calendario entero no cuesta nada, y un valor viejo nunca reaparece tras uno nuevo.\n- **Dentro de un envío gana el tramo posterior.** Donde dos tramos del mismo envío comparten días, gana el que va más abajo en la lista. El legacy los ordenaba antes por fecha de inicio, así que allí podía ganar un elemento anterior que empezaba más tarde.\n- **Un reintento tardío se puede rechazar.** Entre envíos gana el último en llegar; manda `sentAt` y un envío construido antes del último aceptado para la misma tarifa se rechaza con 409 `rmsPushStale` en vez de pisarlo.\n- **Lleno o caído es un 429, y no se ha guardado nada.** Reenvía pasados los segundos de `Retry-After`. El legacy lo aceptaba todo y se iba retrasando.\n- **Lo que no se aplica se dice.** Los cierres (`stop_sell`) y las estancias máximas (`max_stay`) se aceptan y de momento no se aplican, como en el legacy, pero la respuesta los lista en `ignored` en vez de un éxito sin más.\n- **Una escritura que falla se reintenta y luego se avisa.** Un día que no se puede escribir se reintenta unas veces y después se aparta y se nos notifica, en vez de perderse sin rastro."
          }
        }
      }
    },
    "/api/integrations/{pcode}/rms/booking-changes": {
      "get": {
        "description": "What changed since you last asked. Every booking whose row changed at or after `since` — created, edited, moved, cancelled — oldest change first, 50 per page. The first call fixes a window, from `since` to `until` (the moment it was answered), and every page of it answers that same `until`. While `nextCursor` is not null, call again with `cursor=<nextCursor>` (`since` is ignored then); once it is null, wait and poll again with `since=<until>`. It is null on a page with fewer than 50 bookings: a last page of exactly 50 still carries a cursor, and the page it leads to comes empty. Send `since` with its zone; a value without one is read as UTC, and a bare date as that day's midnight in UTC. A booking that changes while you page leaves the window and comes in your next poll, so nothing is skipped. Changes are compared to the second, so a booking changed in the same second as `until` comes again in the next poll: keep the latest version of each booking by its id. A cursor that was not issued by the feed is refused with 400 `bookingChangesCursorInvalid`: start again from your last `until`. A change to something hanging off a booking that does not touch the booking itself (a payment, an edit of the guest record) does not bring it back. Cancelled bookings come too: a cancellation is a change.\n\nEach item carries what an RMS reads of a booking: its status, channel, dates and nights, room type and room, guests counted by age, board, policy and rate, and its amounts. It carries no personal data beyond the holder's `country`, `nationality` and `language`: no name, contact, identity document, notes, guest list, to-dos or company.",
        "operationId": "RmsController_getBookingChanges",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "since",
            "required": false,
            "in": "query",
            "description": "An instant with its time and zone (ISO 8601): the bookings whose row changed at or after it. On the first poll, the moment you start; after that, the `until` of your last poll. Without a zone it is read as UTC, and a bare date (`2026-10-15`) as that day’s midnight in UTC. Required unless `cursor` is sent; ignored when it is",
            "schema": {
              "example": "2026-10-15T08:00:00Z",
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "required": false,
            "in": "query",
            "description": "The `nextCursor` of the previous page, as it came. It carries the window of the first page, so `since` is ignored with it. A cursor that was not issued by this feed is refused with 400 `bookingChangesCursorInvalid`",
            "schema": {
              "example": "eyJ2IjoxLCJzIjoiMjAyNi0xMC0xNVQwODowMDowMC4wMDBaIn0",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetRmsBookingChangesResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request: neither `since` nor `cursor` was sent, `since` is not an ISO 8601 date or date-time (a `validation` list names it; one without a zone is accepted and read as UTC), or the `cursor` was not issued by this feed (`bookingChangesCursorInvalid`: start again from your last `until` as `since`)."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get the bookings changed since an instant",
        "tags": [
          "RMS"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar las reservas cambiadas desde un instante",
            "description": "Lo que ha cambiado desde la última vez que preguntaste. Cada reserva cuya fila cambió en `since` o después —creada, editada, movida, cancelada—, el cambio más antiguo primero, 50 por página. La primera llamada fija una ventana, de `since` a `until` (el momento en que se respondió), y todas sus páginas responden ese mismo `until`. Mientras `nextCursor` no sea null, vuelve a llamar con `cursor=<nextCursor>` (`since` se ignora entonces); cuando sea null, espera y vuelve a consultar con `since=<until>`. Es null en una página con menos de 50 reservas: una última página de justo 50 aún trae cursor, y la página a la que lleva llega vacía. Manda `since` con su zona; un valor sin ella se lee como UTC, y una fecha sola como la medianoche UTC de ese día. Una reserva que cambia mientras paginas sale de la ventana y llega en tu siguiente consulta, así que no se salta ninguna. Los cambios se comparan al segundo, así que una reserva cambiada en el mismo segundo que `until` vuelve en la siguiente consulta: quédate con la versión más reciente de cada reserva por su id. Un cursor que no emitió el feed se rechaza con 400 `bookingChangesCursorInvalid`: vuelve a empezar desde tu último `until`. Un cambio en algo que cuelga de una reserva y no toca la reserva en sí (un pago, una edición de la ficha del huésped) no la vuelve a traer. Las reservas canceladas también vienen: una cancelación es un cambio.\n\nCada elemento lleva lo que un RMS lee de una reserva: su estado, canal, fechas y noches, tipo de habitación y habitación, huéspedes contados por edad, régimen, política y tarifa, y sus importes. No lleva más datos personales que el `country`, la `nationality` y el `language` del titular: ni nombre, ni contacto, ni documento de identidad, ni notas, ni lista de huéspedes, ni tareas, ni empresa."
          }
        }
      }
    },
    "/api/webhooks/{pcode}": {
      "get": {
        "description": "The outgoing webhooks configured for a property. Each one is a URL of yours that the PMS calls with an HTTP POST when an event it subscribes to happens, and each shows whether it is currently enabled. The Basic password is never returned, only whether one is stored (`passwordSet`). The only event available today is `bookings-added`, sent when bookings are created. Requires an admin user and a subscription with the API add-on; without either, every endpoint in this section answers 403.",
        "operationId": "OutgoingController_getWebhooksByPcode",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetWebhooksResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "List all webhooks",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Listar webhooks",
            "description": "Los webhooks salientes configurados en un establecimiento. Cada uno es una URL tuya a la que el PMS llama con un HTTP POST cuando ocurre un evento al que está suscrito, e indica si está activo ahora mismo. La contraseña Basic nunca se devuelve, solo si hay una guardada (`passwordSet`). El único evento disponible hoy es `bookings-added`, que se envía al crearse reservas. Requiere un usuario administrador y una suscripción con el complemento de API; sin cualquiera de las dos cosas, todos los endpoints de esta sección responden 403."
          }
        }
      },
      "post": {
        "description": "Register a URL to be called when an event happens. It starts receiving deliveries immediately. What to expect on your endpoint: a POST with a JSON body, `Content-Type: application/json`, and an `Authorization: Basic` header when you configure credentials here. Redirects are not followed — register the final URL, not one that redirects to it — and **a failed delivery is not retried**: it is recorded in the delivery log and dropped, so treat the webhook as a notification to act on, not as a guaranteed feed. There is no delivery timeout, and the deliveries of one property go out one after another, so a slow answer delays the next webhook: answer quickly and do your work afterwards. Use `/test` once the webhook exists to check its URL is reachable before relying on it.",
        "operationId": "OutgoingController_addWebhook",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddWebhookDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created."
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Create webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Crear un webhook",
            "description": "Registra una URL para que se llame cuando ocurra un evento. Empieza a recibir entregas de inmediato. Qué esperar en tu endpoint: un POST con cuerpo JSON, `Content-Type: application/json` y una cabecera `Authorization: Basic` si configuras credenciales aquí. No se siguen redirecciones —registra la URL final, no una que redirija a ella— y **una entrega fallida no se reintenta**: queda anotada en el registro de entregas y se descarta, así que trata el webhook como un aviso sobre el que actuar, no como un flujo garantizado. No hay tiempo máximo de entrega, y las entregas de un establecimiento salen una detrás de otra, así que una respuesta lenta retrasa el siguiente webhook: responde rápido y haz el trabajo después. Usa `/test` una vez creado el webhook para comprobar que su URL responde antes de depender de ella."
          }
        }
      },
      "put": {
        "description": "Change an existing webhook's URL, subscribed events, name or authentication. The ID goes in the request body, not in the path — unlike delete, enable and disable, which take it in the path. The change applies to the next delivery; deliveries already sent are not affected. The Basic password is never returned: send it empty to keep the stored one, which is only kept while the URL origin and the username stay the same.",
        "operationId": "OutgoingController_updateWebhook",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Update webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Actualizar un webhook",
            "description": "Cambia la URL, los eventos suscritos, el nombre o la autenticación de un webhook existente. El ID va en el cuerpo de la petición, no en la ruta, a diferencia de borrar, activar y desactivar, que lo llevan en la ruta. El cambio se aplica a la siguiente entrega; las ya enviadas no se ven afectadas. La contraseña Basic nunca se devuelve: envíala vacía para conservar la guardada, que solo se conserva mientras el origen de la URL y el usuario sigan siendo los mismos."
          }
        }
      }
    },
    "/api/webhooks/{pcode}/{id}": {
      "delete": {
        "description": "Permanently delete a webhook. Deliveries stop immediately and the configuration is gone — to stop them for a while and keep the setup, disable it instead. Its delivery log is not recoverable through the API afterwards.",
        "operationId": "OutgoingController_deleteWebhook",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID, as returned by `GET /api/webhooks/{pcode}`.",
            "schema": {
              "example": "65f1c2a9b4d3e2f1a0c9b8d7",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Delete webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Eliminar un webhook",
            "description": "Borra un webhook definitivamente. Las entregas paran de inmediato y la configuración desaparece; si lo que quieres es pararlas un tiempo y conservar el montaje, desactívalo en su lugar. Su registro de entregas no se puede recuperar después por la API."
          }
        }
      }
    },
    "/api/webhooks/{pcode}/{id}/enable": {
      "patch": {
        "description": "Re-enable a disabled webhook. Deliveries resume with the next event; nothing that happened while it was disabled is replayed.",
        "operationId": "OutgoingController_setWebhookEnabled",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID, as returned by `GET /api/webhooks/{pcode}`.",
            "schema": {
              "example": "65f1c2a9b4d3e2f1a0c9b8d7",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Enable webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Activar un webhook",
            "description": "Reactiva un webhook desactivado. Las entregas se reanudan con el siguiente evento; no se reenvía nada de lo que ocurrió mientras estuvo desactivado."
          }
        }
      }
    },
    "/api/webhooks/{pcode}/{id}/disable": {
      "patch": {
        "description": "Stop deliveries without deleting the webhook, keeping its URL and settings for later. Events that happen while it is disabled are lost, not queued — they are not delivered when you enable it again. Use it while your endpoint is down or being deployed.",
        "operationId": "OutgoingController_setWebhookDisable",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID, as returned by `GET /api/webhooks/{pcode}`.",
            "schema": {
              "example": "65f1c2a9b4d3e2f1a0c9b8d7",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content."
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Disable webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Desactivar un webhook",
            "description": "Para las entregas sin borrar el webhook, conservando su URL y sus ajustes para más adelante. Los eventos que ocurran mientras está desactivado se pierden, no se encolan: no se entregan al volver a activarlo. Úsalo mientras tu endpoint está caído o desplegándose."
          }
        }
      }
    },
    "/api/webhooks/{pcode}/test": {
      "post": {
        "description": "Send a sample delivery to the URL of a webhook you already created — the body names it by `id` — and report back what happened: the outcome Hotelgest recorded, how long it took, and the error if it failed. Any 2xx comes back as `200`; no response at all (network error, or a URL refused because it resolves to a private network) comes back as `500` with the reason in `errorMessage`. The body is the same envelope a real delivery has, with a fixed sample booking, so your endpoint can be tested against the real shape. The webhook is tested whether it is enabled or not. A test does not appear in the delivery log. An unknown `id` answers 404.",
        "operationId": "OutgoingController_testWebhook",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestWebhookDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestWebhookResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Test webhook",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Probar un webhook",
            "description": "Envía una entrega de prueba a la URL de un webhook ya creado —el cuerpo lo indica por su `id`— y cuenta qué pasó: el resultado que anotó Hotelgest, cuánto tardó y el error si falló. Cualquier 2xx vuelve como `200`; sin respuesta (error de red, o una URL rechazada porque resuelve a una red privada) vuelve como `500` con el motivo en `errorMessage`. El cuerpo es el mismo sobre que una entrega real, con una reserva de ejemplo fija, así que puedes probar tu endpoint contra la forma real. El webhook se prueba esté activado o no. Una prueba no aparece en el registro de entregas. Un `id` que no existe responde 404."
          }
        }
      }
    },
    "/api/webhooks/{pcode}/{id}/logs": {
      "get": {
        "description": "The delivery history of one webhook, newest first: for each attempt, the event, the payload sent (keys that were missing when it was sent are stored as `null`), the outcome, how long it took and the error if there was one. Any 2xx is recorded as `200`; a delivery that never got a response — a network error, or a URL refused because it resolves to a private network — is recorded as `500` with the reason in its message. This is the place to look when an event you expected never arrived — and, since failures are not retried, the only record that it was attempted. **Entries are kept for 30 days** and then deleted automatically, so pull anything you need to keep before then.",
        "operationId": "OutgoingController_getWebhookLogsByWebhookId",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "description": "Webhook ID, as returned by `GET /api/webhooks/{pcode}`.",
            "schema": {
              "example": "65f1c2a9b4d3e2f1a0c9b8d7",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/GetWebhookLogsResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get webhook delivery logs",
        "tags": [
          "Webhooks"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar las entregas de un webhook",
            "description": "El historial de entregas de un webhook, de la más reciente a la más antigua: por cada intento, el evento, el payload que se envió (las claves que faltaban al enviarlo se guardan como `null`), el resultado, cuánto tardó y el error si lo hubo. Cualquier 2xx se anota como `200`; una entrega que nunca obtuvo respuesta —error de red, o una URL rechazada porque resuelve a una red privada— se anota como `500` con el motivo en el mensaje. Este es el sitio donde mirar cuando un evento que esperabas no llegó y, como los fallos no se reintentan, el único registro de que se intentó. **Las entradas se conservan 30 días** y luego se borran solas, así que descarga lo que necesites guardar antes."
          }
        }
      }
    },
    "/api/direct-booking/{pcode}/prices": {
      "get": {
        "description": "What each room type costs for a stay, rate by rate, with the availability and the restrictions that decide whether it can be sold. Keyed by room type id; each room type carries the lowest price of all its rates for the whole stay and every rate under `rate`, with the price of each night in `priceList`. It is the answer Hotelgest's own booking engine prices with. A rate with `_closed` = `1`, or a stay shorter than `_minstay` or longer than `_maxstay` (when not `0`), cannot be booked, and neither can a stay starting on a date of `closedarrival` or ending on one of `closeddeparture`; leave out the rates with `motor_excl` = `1`, which the hotel keeps off its engine. The room type `price` does NOT leave any of those out: recompute it from the rates you keep. `availability` is negative when the room type is overbooked. Ask for at most 365 days: a wider range answers with that window instead of an error. An arrival before yesterday or a stay ending more than 730 days ahead answers `{}`, and so does a property with nothing to sell or one whose prices could not be built — an empty answer is not proof that there is no availability.",
        "operationId": "BookingEnginePublicController_getPrices",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "end",
            "required": true,
            "in": "query",
            "description": "Departure date (YYYY-MM-DD). The night before it is the last one priced",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "start",
            "required": true,
            "in": "query",
            "description": "Arrival date (YYYY-MM-DD)",
            "schema": {
              "example": "YYYY-MM-DD",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Keyed by room type id. A room type with no availability data, or with no rate that has a price for the stay, is left out; a property with nothing to sell answers `{}`",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/BookingEngineRoomTypePricesDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking engine prices",
        "tags": [
          "BookingEngine"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los precios del motor de reservas",
            "description": "Lo que cuesta cada tipo de habitación para una estancia, tarifa a tarifa, con la disponibilidad y las restricciones que deciden si se puede vender. Indexado por id de tipo de habitación; cada tipo lleva el precio más bajo de todas sus tarifas para toda la estancia y cada tarifa dentro de `rate`, con el precio de cada noche en `priceList`. Es la respuesta con la que tarifica el propio motor de reservas de Hotelgest. Una tarifa con `_closed` = `1`, o una estancia más corta que `_minstay` o más larga que `_maxstay` (si no es `0`), no se puede reservar, y tampoco una estancia que empiece en una fecha de `closedarrival` o acabe en una de `closeddeparture`; deja fuera las tarifas con `motor_excl` = `1`, que el hotel aparta de su motor. El `price` del tipo de habitación NO descarta ninguna de ellas: recalcúlalo con las tarifas que conserves. `availability` es negativa cuando el tipo está sobrevendido. Pide como mucho 365 días: un rango mayor responde con esa ventana en lugar de un error. Una llegada anterior a ayer o una estancia que acabe a más de 730 días responde `{}`, igual que un establecimiento sin nada que vender o uno cuyos precios no se pudieron calcular: una respuesta vacía no prueba que no haya disponibilidad."
          }
        }
      }
    },
    "/api/direct-booking/{pcode}/packs": {
      "get": {
        "description": "The packs the property sells on its booking engine: an offer tied to room types, a date window and a minimum stay, sometimes with products included. It is the list Hotelgest's own booking engine offers; packs whose last day is before yesterday, and packs the hotel hides from its engine, are left out. `name` and `text` carry only the languages the hotel wrote, and are an empty object when it wrote none.",
        "operationId": "BookingEnginePublicController_getPacks",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BookingEnginePackDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Get booking engine packs",
        "tags": [
          "BookingEngine"
        ],
        "x-translations": {
          "es": {
            "summary": "Consultar los packs del motor de reservas",
            "description": "Los packs que el establecimiento vende en su motor de reservas: una oferta atada a tipos de habitación, una ventana de fechas y una estancia mínima, a veces con productos incluidos. Es la lista que ofrece el propio motor de reservas de Hotelgest; se dejan fuera los packs cuyo último día es anterior a ayer y los que el hotel oculta en su motor. `name` y `text` llevan solo los idiomas que escribió el hotel, y son un objeto vacío cuando no escribió ninguno."
          }
        }
      }
    },
    "/api/direct-booking/{pcode}/promo-codes": {
      "get": {
        "description": "Whether a promo code a guest typed exists, and what it takes off. Answers a list with the promotion when the code matches one the hotel shows on its engine — compared without case — and an empty list when it does not, or when the code has used up all its uses. Several promotions can share a code, and then all of them come. Check `dfrom` and `dto` against the stay: the code is returned whatever the dates.",
        "operationId": "BookingEnginePublicController_checkPromoCode",
        "parameters": [
          {
            "name": "pcode",
            "required": true,
            "in": "path",
            "description": "Property code. Identifies the property (hotel, apartment building, hostel) the request applies to. It must match the property your API key was issued for.",
            "schema": {
              "example": 123456,
              "type": "number"
            }
          },
          {
            "name": "code",
            "required": true,
            "in": "query",
            "description": "The code the guest typed",
            "schema": {
              "example": "SUMMER27",
              "type": "string"
            }
          },
          {
            "name": "x-api-key",
            "in": "header",
            "description": "Your API key for authentication. You can generate API keys from the hotelgest dashboard under Settings > API. Each API key is scoped to a specific property.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ok. If your API key answers encrypted — every key issued now does, and every partner credential — this body arrives as the encryption envelope ({ crypto, protected, wrappedKey, iv, payload, tag }, a compact JWE), and the schema below is what its `payload` decrypts to. See https://public-api.hotelgest.com/public/guides/encryption",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BookingEnginePromoCodeDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request was invalid or cannot be served."
          },
          "401": {
            "description": "Unauthorized. Invalid or missing API key."
          },
          "403": {
            "description": "Forbidden. You do not have permission to access this resource."
          },
          "404": {
            "description": "Not Found. The requested resource could not be found."
          },
          "409": {
            "description": "Conflict. The request clashes with the current state; `message` carries the code. When a system the API depends on failed (the legacy platform, a provider, a queue), the body also carries `fault`: `dependency` means nothing was done — retry in a few seconds; `outcomeUnknown` means it may have been done — check before repeating it."
          },
          "429": {
            "description": "Too Many Requests. A rate limit of the key, the property or the IP was exceeded; wait the seconds in the `Retry-After-<limit>` header before retrying."
          },
          "500": {
            "description": "Internal Server Error. An unexpected error occurred on the server."
          }
        },
        "security": [
          {
            "ApiKey-auth": []
          }
        ],
        "summary": "Check a promo code",
        "tags": [
          "BookingEngine"
        ],
        "x-translations": {
          "es": {
            "summary": "Comprobar un código promocional",
            "description": "Si existe un código promocional que ha escrito un huésped, y qué descuenta. Responde una lista con la promoción cuando el código coincide con uno que el hotel muestra en su motor —sin distinguir mayúsculas— y una lista vacía cuando no, o cuando el código ya agotó sus usos. Varias promociones pueden compartir código, y entonces vienen todas. Comprueba `dfrom` y `dto` contra la estancia: el código se devuelve sean cuales sean las fechas."
          }
        }
      }
    }
  },
  "info": {
    "title": "Hotelgest Partner API",
    "description": "The endpoints a partner credential can reach: the shared surface plus the ones reserved for the partner programme. A property own API key is refused on the reserved ones, so they are not part of the public document. Which of these a given connection may call is decided per property when it connects the partner. Every JSON body a partner credential receives is encrypted: it arrives as the envelope described in https://public-api.hotelgest.com/public/guides/encryption, and each response schema below is what its `payload` decrypts to.",
    "version": "1.0",
    "contact": {
      "name": "Hotelgest Integrations",
      "url": "https://hotelgest.com",
      "email": "integrations@hotelgest.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://hotelgest.com/disclaimer"
    }
  },
  "tags": [
    {
      "name": "Properties",
      "description": "What a property has configured about itself: its check-in and check-out times, and the cancellation policies it sells under. Both change rarely — read them once and keep them.",
      "x-label": "Properties",
      "x-order": 10,
      "x-translations": {
        "es": {
          "label": "Establecimientos",
          "description": "Lo que un establecimiento tiene configurado sobre sí mismo: sus horas de entrada y salida, y las políticas de cancelación con las que vende. Ambas cosas cambian poco: léelas una vez y guárdalas."
        }
      }
    },
    {
      "name": "Rooms",
      "description": "The inventory and what is free. Room types are what you sell, rooms are the physical units inside them, and availability says which are open for a date range. Start here: the ids everything else takes come from this group.",
      "x-label": "Rooms",
      "x-order": 20,
      "x-translations": {
        "es": {
          "label": "Habitaciones",
          "description": "El inventario y lo que está libre. Los tipos de habitación son lo que se vende, las habitaciones son las unidades físicas que hay dentro, y la disponibilidad dice cuáles quedan abiertas en un rango de fechas. Empieza aquí: los ids que pide todo lo demás salen de este grupo."
        }
      }
    },
    {
      "name": "Bookings",
      "description": "The stay itself, and everything hanging off it: search and detail, creation, check-in and check-out, and the money — charges, payments, invoices, proformas and deposits, each with its own endpoint.",
      "x-label": "Bookings",
      "x-order": 30,
      "x-translations": {
        "es": {
          "label": "Reservas",
          "description": "La estancia en sí y todo lo que cuelga de ella: búsqueda y detalle, creación, check-in y check-out, y el dinero — cargos, pagos, facturas, proformas y depósitos, cada uno con su endpoint."
        }
      }
    },
    {
      "name": "Webhooks",
      "description": "Being told when something happens, instead of asking every minute. Register a URL, choose the events, and read the delivery log when one does not arrive.",
      "x-label": "Webhooks",
      "x-order": 40,
      "x-translations": {
        "es": {
          "label": "Webhooks",
          "description": "Que te avisen cuando pasa algo, en vez de preguntar cada minuto. Registras una URL, eliges los eventos, y consultas el registro de entregas cuando alguna no llega."
        }
      }
    },
    {
      "name": "Misc",
      "description": "Catalogues that are the same for every property and change very rarely. Fetch them once and keep them, rather than on every booking.",
      "x-label": "Reference data",
      "x-order": 50,
      "x-translations": {
        "es": {
          "label": "Datos de referencia",
          "description": "Catálogos iguales para todos los establecimientos y que cambian muy poco. Pídelos una vez y guárdalos, en lugar de llamarlos en cada reserva."
        }
      }
    },
    {
      "name": "BookingEngine",
      "description": "Search, price and confirm a direct booking from your own front end.",
      "x-label": "Booking engine",
      "x-order": 70,
      "x-translations": {
        "es": {
          "label": "Motor de reservas",
          "description": "Busca, tarifica y confirma una reserva directa desde tu propio front end."
        }
      }
    },
    {
      "name": "RMS",
      "description": "For revenue management systems: the rates of a property you may price, their price night by night, and the push of prices and restrictions onto them. A push is queued and applied within the minute, as Hotelgest applies its own.",
      "x-label": "RMS",
      "x-order": 80,
      "x-translations": {
        "es": {
          "label": "RMS",
          "description": "Para sistemas de revenue management: las tarifas de un establecimiento que puedes tarificar, su precio noche a noche y el envío de precios y restricciones sobre ellas. Un envío se encola y se aplica en el minuto, como aplica Hotelgest los suyos."
        }
      }
    },
    {
      "name": "CRM",
      "description": "For CRMs: the bookings of a property that changed since your last call, each with its guest, so your contacts stay in step with the stays.",
      "x-label": "CRM",
      "x-order": 90,
      "x-translations": {
        "es": {
          "label": "CRM",
          "description": "Para CRMs: las reservas de un establecimiento que han cambiado desde tu última llamada, cada una con su huésped, para que tus contactos vayan al paso de las estancias."
        }
      }
    }
  ],
  "servers": [
    {
      "url": "https://uni-api.hotelgest.com",
      "description": "Production Server"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey-auth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key",
        "description": "Your API Key"
      }
    },
    "schemas": {
      "GetSettingsLiteResponseDto": {
        "type": "object",
        "properties": {
          "arrivalHour": {
            "type": "string",
            "example": "15:00",
            "description": "Default check-in time configured for the property (HH:mm). Empty string when the property has not set one"
          },
          "departureHour": {
            "type": "string",
            "example": "11:00",
            "description": "Default check-out time configured for the property (HH:mm). Empty string when the property has not set one"
          },
          "name": {
            "type": "string",
            "example": "Hotel Demo",
            "description": "Name of the property"
          },
          "stars": {
            "type": "number",
            "example": 4,
            "nullable": true,
            "description": "Star rating, when set"
          },
          "currency": {
            "type": "string",
            "example": "EUR",
            "description": "Currency of its prices (ISO 4217). `EUR` when the property has none set"
          },
          "currencySymbol": {
            "type": "string",
            "example": "€",
            "description": "Symbol of that currency, as the property shows it"
          },
          "timezone": {
            "type": "string",
            "example": "Europe/Madrid",
            "description": "Time zone of the property (IANA). Dates without a time, such as stay nights, are in it. `Europe/Madrid` when the property has none set"
          },
          "pricesIncludeTax": {
            "type": "boolean",
            "example": true,
            "description": "Whether the prices the property sets include tax. When false, tax is added on top"
          },
          "taxRate": {
            "type": "number",
            "example": 10,
            "nullable": true,
            "description": "VAT rate of the stay, in percent, when the property set one"
          },
          "country": {
            "type": "string",
            "example": "ESP",
            "nullable": true,
            "description": "Country (ISO 3166-1 alpha-3, as stored for the property). Null when not set"
          },
          "province": {
            "type": "string",
            "example": "Málaga",
            "nullable": true,
            "description": "Province or region"
          },
          "city": {
            "type": "string",
            "example": "Nerja",
            "nullable": true,
            "description": "City"
          },
          "address": {
            "type": "string",
            "example": "Calle Mayor 1",
            "nullable": true,
            "description": "Street address"
          },
          "postalCode": {
            "type": "string",
            "example": "29780",
            "nullable": true,
            "description": "Postal code"
          },
          "latitude": {
            "type": "number",
            "example": 36.74518,
            "nullable": true,
            "description": "Latitude, in decimal degrees"
          },
          "longitude": {
            "type": "number",
            "example": -3.8818377,
            "nullable": true,
            "description": "Longitude, in decimal degrees"
          }
        },
        "required": [
          "arrivalHour",
          "departureHour",
          "name",
          "stars",
          "currency",
          "currencySymbol",
          "timezone",
          "pricesIncludeTax",
          "taxRate",
          "country",
          "province",
          "city",
          "address",
          "postalCode",
          "latitude",
          "longitude"
        ]
      },
      "PolicyDescriptionDto": {
        "type": "object",
        "properties": {
          "ca": {
            "type": "string",
            "example": "Cancel·lació gratuïta fins a 7 dies abans",
            "description": "Policy name in Catalan"
          },
          "de": {
            "type": "string",
            "example": "Kostenlose Stornierung bis 7 Tage vorher",
            "description": "Policy name in German"
          },
          "en": {
            "type": "string",
            "example": "Free cancellation up to 7 days before",
            "description": "Policy name in English"
          },
          "es": {
            "type": "string",
            "example": "Cancelación gratuita hasta 7 días antes",
            "description": "Policy name in Spanish"
          },
          "eu": {
            "type": "string",
            "example": "Doan gabeko bertan behera uztea 7 egun lehenago",
            "description": "Policy name in Basque"
          },
          "fr": {
            "type": "string",
            "example": "Annulation gratuite jusqu'à 7 jours avant",
            "description": "Policy name in French"
          },
          "gl": {
            "type": "string",
            "example": "Cancelación gratuíta ata 7 días antes",
            "description": "Policy name in Galician"
          },
          "it": {
            "type": "string",
            "example": "Cancellazione gratuita fino a 7 giorni prima",
            "description": "Policy name in Italian"
          },
          "ru": {
            "type": "string",
            "example": "Бесплатная отмена за 7 дней",
            "description": "Policy name in Russian"
          }
        },
        "required": [
          "ca",
          "de",
          "en",
          "es",
          "eu",
          "fr",
          "gl",
          "it",
          "ru"
        ]
      },
      "GetCustomPoliciesResponseDto": {
        "type": "object",
        "properties": {
          "policy": {
            "type": "string",
            "example": "7",
            "description": "Unique identifier of the custom cancellation policy. Note: built-in policies \"4\" (Flexible Cancellation) and \"6\" (Non-Refundable) are always available and will not appear in this list."
          },
          "name": {
            "description": "Policy name in every panel language. All nine keys are always present; a language with no translation is an empty string",
            "allOf": [
              {
                "$ref": "#/components/schemas/PolicyDescriptionDto"
              }
            ]
          }
        },
        "required": [
          "policy",
          "name"
        ]
      },
      "AvailabilityRoomItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 1,
            "description": "Unique ID of the physical room"
          },
          "locked": {
            "type": "boolean",
            "example": false,
            "description": "True when every booking on this room in the range is an out-of-order block: the room is listed, but it cannot be booked. False when the room is free"
          }
        },
        "required": [
          "id",
          "locked"
        ]
      },
      "AvailabilityRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 101,
            "description": "Room type ID"
          },
          "rooms": {
            "description": "The rooms of this type that are free in the requested date range, plus the ones blocked out of order (`locked: true`), which are listed but cannot be booked",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailabilityRoomItemDto"
            }
          }
        },
        "required": [
          "id",
          "rooms"
        ]
      },
      "NotAvailableRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 201,
            "description": "Room type ID that has no availability for the requested date range"
          }
        },
        "required": [
          "id"
        ]
      },
      "GetAvailabilityByPcodeV2ResponseDto": {
        "type": "object",
        "properties": {
          "availables": {
            "type": "object",
            "description": "Room types with at least one room that is not taken by a booking in the range, keyed by roomTypeId. Each entry lists those rooms; a room with `locked: true` is blocked out of order and cannot be booked, so a type can be here with nothing bookable. Empty object when there is none",
            "additionalProperties": {
              "$ref": "#/components/schemas/AvailabilityRoomDto"
            },
            "example": {
              "101": {
                "id": 101,
                "rooms": [
                  {
                    "id": 1,
                    "locked": false
                  },
                  {
                    "id": 2,
                    "locked": true
                  }
                ]
              },
              "102": {
                "id": 102,
                "rooms": [
                  {
                    "id": 3,
                    "locked": false
                  }
                ]
              }
            }
          },
          "notAvailables": {
            "type": "object",
            "description": "Room types whose every room is taken by a booking in the requested date range, keyed by roomTypeId. Empty object when there is none",
            "additionalProperties": {
              "$ref": "#/components/schemas/NotAvailableRoomDto"
            },
            "example": {
              "201": {
                "id": 201
              },
              "202": {
                "id": 202
              }
            }
          }
        },
        "required": [
          "availables",
          "notAvailables"
        ]
      },
      "RoomTypeTranslationsDto": {
        "type": "object",
        "properties": {
          "en": {
            "type": "string",
            "description": "English. Empty string when not translated",
            "example": "Double Room"
          },
          "es": {
            "type": "string",
            "description": "Spanish. Empty string when not translated",
            "example": "Habitación Doble"
          },
          "ca": {
            "type": "string",
            "description": "Catalan. Empty string when not translated",
            "example": "Habitació Doble"
          },
          "de": {
            "type": "string",
            "description": "German. Empty string when not translated",
            "example": "Doppelzimmer"
          },
          "it": {
            "type": "string",
            "description": "Italian. Empty string when not translated",
            "example": "Camera Doppia"
          },
          "fr": {
            "type": "string",
            "description": "French. Empty string when not translated",
            "example": "Chambre Double"
          },
          "eu": {
            "type": "string",
            "description": "Basque. Empty string when not translated",
            "example": "Logela Bikoitza"
          },
          "gl": {
            "type": "string",
            "description": "Galician. Empty string when not translated",
            "example": "Cuarto Dobre"
          },
          "pt": {
            "type": "string",
            "description": "Portuguese. Empty string when not translated",
            "example": ""
          }
        },
        "required": [
          "en",
          "es",
          "ca",
          "de",
          "it",
          "fr",
          "eu",
          "gl",
          "pt"
        ]
      },
      "RoomTypeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of this room type",
            "example": 101
          },
          "name": {
            "description": "Room type name in every supported language (en, es, ca, de, it, fr, eu, gl, pt). All nine keys are always present; a language with no translation is an empty string",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoomTypeTranslationsDto"
              }
            ]
          },
          "description": {
            "description": "Room type description in every supported language (en, es, ca, de, it, fr, eu, gl, pt). All nine keys are always present; a language with no translation is an empty string",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoomTypeTranslationsDto"
              }
            ]
          },
          "position": {
            "type": "number",
            "description": "Display position/order of this room type in listings. 0 when not set",
            "example": 1
          },
          "occupancy": {
            "type": "number",
            "description": "Maximum occupancy (number of guests) for this room type",
            "example": 2
          },
          "color": {
            "type": "string",
            "description": "Display color for this room type in the calendar view, usually a hex code. Absent when not set",
            "example": "#FF5733"
          },
          "splits": {
            "type": "object",
            "description": "Split/connecting room configurations available for this room type, keyed by split ID. Empty object when there are none",
            "additionalProperties": {
              "$ref": "#/components/schemas/SplitDto"
            }
          },
          "rooms": {
            "type": "object",
            "description": "Physical rooms belonging to this room type, keyed by room ID. Empty object when the type has no rooms",
            "additionalProperties": {
              "$ref": "#/components/schemas/RoomDto"
            }
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "position",
          "occupancy",
          "splits",
          "rooms"
        ]
      },
      "RoomStatus": {
        "type": "string",
        "enum": [
          "ready",
          "dirty",
          "clean",
          "revision"
        ],
        "description": "Current housekeeping status of the room: ready (inspected), dirty, clean, or revision"
      },
      "RoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the physical room",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Display name of the room (e.g. \"101\", \"Suite A\"). Empty string when not set",
            "example": "101"
          },
          "doorNum": {
            "type": "string",
            "description": "Door number or label as displayed on the physical door. Empty string when not set",
            "example": "101"
          },
          "roomTypeId": {
            "type": "number",
            "description": "ID of the room type this room belongs to",
            "example": 101
          },
          "status": {
            "description": "Current housekeeping status of the room: ready (inspected), dirty, clean, or revision",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoomStatus"
              }
            ]
          },
          "floor": {
            "type": "number",
            "description": "Floor number where the room is located. 0 when not set",
            "example": 1
          },
          "position": {
            "type": "number",
            "description": "Display position/order of the room within its type. 0 when not set",
            "example": 1
          },
          "dateToClean": {
            "type": "string",
            "description": "Next scheduled cleaning date (YYYY-MM-DD format). Absent when none is scheduled",
            "example": "2026-01-11"
          },
          "splitId": {
            "type": "number",
            "description": "ID of the split configuration (connecting rooms) this room is part of: a key of the room type `splits`. Absent when the room is not part of one",
            "example": 1
          },
          "color": {
            "type": "string",
            "description": "Display color for this room in the calendar/planning view, usually a hex code. Absent when not set",
            "example": "#FF5733"
          },
          "nrua": {
            "type": "string",
            "description": "Tourist registry number of the room, where the region requires one. Absent when not set",
            "example": "VT-1234-A"
          },
          "cru": {
            "type": "string",
            "description": "Regional tourist registry code of the room, where the region requires one. Absent when not set",
            "example": "CRU-9876"
          }
        },
        "required": [
          "id",
          "name",
          "doorNum",
          "roomTypeId",
          "status",
          "floor",
          "position"
        ]
      },
      "SplitDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the split/connecting room configuration",
            "example": "Standard"
          },
          "color": {
            "type": "string",
            "description": "Display color for this split, usually a hex code. Absent when not set",
            "example": "#33FF57"
          }
        },
        "required": [
          "name"
        ]
      },
      "BookingBoard": {
        "type": "string",
        "enum": [
          "nb",
          "bb",
          "hb",
          "fb",
          "ai",
          "pack"
        ],
        "description": "Meal plan / board type: nb (no board), bb (bed & breakfast), hb (half board), fb (full board), ai (all inclusive). A booking the legacy recorded as sold inside a pack may carry `pack` instead"
      },
      "gbrRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the assigned physical room. Null if no specific room has been assigned yet",
            "nullable": true,
            "example": 12
          },
          "roomTypeId": {
            "type": "number",
            "description": "ID of the room type for this booking. Use the GET /api/rooms/:pcode/types endpoint to get room type details",
            "example": 1,
            "nullable": true
          },
          "originalRoomTypeId": {
            "type": "number",
            "description": "Room type the booking was created with (before any room type change). Same as `roomTypeId` when it never changed",
            "example": 1,
            "nullable": true
          }
        },
        "required": [
          "id",
          "roomTypeId",
          "originalRoomTypeId"
        ]
      },
      "gbrPackProductDto": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "number",
            "description": "ID of the product included in the pack",
            "example": 15
          },
          "value": {
            "type": "number",
            "description": "Value of the product inside the pack",
            "example": 30
          }
        },
        "required": [
          "productId",
          "value"
        ]
      },
      "gbrPackInfoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Pack ID (the same as `packId`)",
            "example": 7
          },
          "translations": {
            "type": "object",
            "description": "Pack name and description, keyed by the language code of each translation",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Pack name. Empty string when not set"
                },
                "description": {
                  "type": "string",
                  "description": "Pack description. Empty string when not set"
                }
              },
              "required": [
                "name",
                "description"
              ]
            },
            "example": {
              "en": {
                "name": "Romantic getaway",
                "description": "Two nights with dinner included"
              }
            }
          },
          "dtype": {
            "type": "number",
            "description": "How the pack modifies the price: 0 fixed price, -1 percentage discount, -2 fixed discount, 1 percentage increase, 2 fixed increase",
            "enum": [
              0,
              -1,
              -2,
              1,
              2
            ],
            "example": -1
          },
          "value": {
            "type": "number",
            "description": "Amount or percentage applied, depending on `dtype`",
            "example": 10
          },
          "price": {
            "type": "number",
            "description": "Price of the pack. 0 when not set",
            "example": 0
          },
          "weekday": {
            "type": "array",
            "description": "Week days the pack applies to. Absent when it applies every day",
            "example": [
              "Fri",
              "Sat"
            ],
            "items": {
              "type": "string",
              "enum": [
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
              ]
            }
          },
          "products": {
            "description": "Products included in the pack",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrPackProductDto"
            }
          }
        },
        "required": [
          "id",
          "translations",
          "dtype",
          "value",
          "price",
          "products"
        ]
      },
      "gbrCustomerDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the customer record. Null only for a booking whose holder record is missing",
            "example": 1234,
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "First name. Empty string when it was not given",
            "example": "John"
          },
          "surname": {
            "type": "string",
            "description": "Last name / surname",
            "example": "Doe"
          },
          "documentType": {
            "type": "string",
            "enum": [
              "P",
              "D",
              "C",
              "MI",
              "I",
              "N",
              "X",
              "E",
              "IDX",
              "ID",
              "50"
            ],
            "description": "Type of identity document: P (passport), D (DNI), C (driving license), I (identity card), N (Spanish residence permit), X (foreign residence permit), MI (minor undocumented), E (other), IDX (foreigner ID), ID (identity card, legacy code), 50 (foreign tax ID). Absent when none of these was recorded",
            "example": "D"
          },
          "documentNumber": {
            "type": "string",
            "description": "Identity document number",
            "example": "A12345678"
          },
          "address": {
            "type": "string",
            "description": "Street address",
            "example": "123 Main St"
          },
          "city": {
            "type": "string",
            "description": "City of residence",
            "example": "New York"
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code",
            "example": "10001"
          },
          "country": {
            "type": "string",
            "description": "Country code as stored, in uppercase. Usually ISO 3166-1 alpha-3 (ESP, USA, FRA); older records may hold another code",
            "example": "ESP"
          },
          "province": {
            "type": "string",
            "description": "Province or state, in lowercase",
            "example": "madrid"
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "john.doe@example.com"
          },
          "phone": {
            "type": "string",
            "description": "Phone number as entered (may include the country code)",
            "example": "+1 (555) 123-4567"
          },
          "language": {
            "type": "string",
            "pattern": "^[a-z]{2}$",
            "description": "Preferred language of the person, as a lowercase ISO 639-1 code. Usually one of ca, de, en, es, eu, fr, gl, it, ru, but any two-letter code the guest gave can appear (pt, nl, zh…). Absent when it is not known",
            "example": "es"
          },
          "documentPortrait": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the portrait image exists. Download it from `documentPortraitImagePath` instead",
            "example": "/document-portrait/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentFront": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the document front image exists. Download it from `documentFrontImagePath` instead",
            "example": "/document-front/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentBack": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the document back image exists. Download it from `documentBackImagePath` instead",
            "example": "/document-back/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentPortraitImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the portrait photo of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LXBvcnRyYWl0OjEyMzQ"
          },
          "documentFrontImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the front side of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LWZyb250OjEyMzQ"
          },
          "documentBackImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the back side of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LWJhY2s6MTIzNA"
          },
          "notes": {
            "type": "string",
            "description": "Free-text internal notes kept on the customer record",
            "example": "VIP customer"
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking this record was read for",
            "example": 789
          },
          "loyalty": {
            "type": "string",
            "description": "Loyalty / membership programme the holder belongs to, as the channel sent it. Only in the booking detail and in `/search/only-groups`; never in `/search` or `/search/only-single`",
            "example": "GOLD-123"
          }
        },
        "required": [
          "id",
          "name",
          "bookingId"
        ]
      },
      "gbrNotesDto": {
        "type": "object",
        "properties": {
          "request": {
            "type": "string",
            "description": "Guest request notes. Empty string when there are none",
            "example": "Late check-in, extra pillow"
          },
          "internal": {
            "type": "string",
            "description": "Internal staff notes (only visible to hotel staff). Empty string when there are none",
            "example": "Guest prefers a quiet room"
          },
          "flat": {
            "type": "string",
            "description": "Housekeeping notes. Empty string when there are none",
            "example": "No special requests"
          }
        },
        "required": [
          "request",
          "internal",
          "flat"
        ]
      },
      "gbrOccupancyDto": {
        "type": "object",
        "properties": {
          "adults": {
            "type": "number",
            "description": "Number of adult guests",
            "example": 2
          },
          "children": {
            "type": "number",
            "description": "Number of child guests",
            "example": 2
          },
          "babies": {
            "type": "number",
            "description": "Number of baby/infant guests",
            "example": 1
          },
          "total": {
            "type": "number",
            "description": "Total number of guests (adults + children + babies)",
            "example": 5
          }
        },
        "required": [
          "adults",
          "children",
          "babies",
          "total"
        ]
      },
      "CheckInStatus": {
        "type": "string",
        "enum": [
          "waiting-check-in",
          "checked-in",
          "checked-out",
          "cancelled"
        ],
        "description": "Check-in status: waiting-check-in, checked-in, checked-out, or cancelled (every booking whose `bookingStatus` is cancelled, blocks included)"
      },
      "BookingStatus": {
        "type": "string",
        "enum": [
          "ready",
          "tentative",
          "cancelled",
          "no-show",
          "temporary-cancelled"
        ],
        "description": "Booking status: ready (confirmed), tentative (held until its release date), cancelled, no-show, or temporary-cancelled. A block (see `bookingType`) also reads cancelled"
      },
      "VirtualPaymentType": {
        "type": "string",
        "enum": [
          "directPayment",
          "prePayment",
          "partPayment"
        ],
        "description": "Type of virtual payment: directPayment, prePayment, or partPayment"
      },
      "gbrVirtualPaymentDto": {
        "type": "object",
        "properties": {
          "type": {
            "description": "Type of virtual payment: directPayment, prePayment, or partPayment",
            "allOf": [
              {
                "$ref": "#/components/schemas/VirtualPaymentType"
              }
            ]
          },
          "amount": {
            "type": "number",
            "description": "Amount collected by the channel, in the property currency. 0 for directPayment. Null when the channel did not report it",
            "example": 100,
            "nullable": true
          }
        },
        "required": [
          "type",
          "amount"
        ]
      },
      "PaymentStatus": {
        "type": "string",
        "enum": [
          "no-paid",
          "parcial-paid",
          "paid",
          "over-paid"
        ],
        "description": "Overall payment status: no-paid, parcial-paid, paid, or over-paid"
      },
      "InvoiceStatus": {
        "type": "string",
        "enum": [
          "no-invoiced",
          "parcial-invoiced",
          "invoiced"
        ],
        "description": "Invoice status: no-invoiced, parcial-invoiced, or invoiced"
      },
      "BookingTypeV2": {
        "type": "string",
        "enum": [
          "blocked-out-order",
          "blocked-out-service"
        ],
        "description": "Block type: blocked-out-order (room blocked by staff) or blocked-out-service (room out of service)"
      },
      "gbrBookingTypeDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Reason the room was blocked, as the staff wrote it. Empty string when none",
            "example": "Painting"
          },
          "type": {
            "type": "string",
            "description": "Legacy block type. Use typeV2 instead",
            "enum": [
              "bloqued-out-order",
              "bloqued_out_service"
            ],
            "deprecated": true
          },
          "typeV2": {
            "description": "Block type: blocked-out-order (room blocked by staff) or blocked-out-service (room out of service)",
            "allOf": [
              {
                "$ref": "#/components/schemas/BookingTypeV2"
              }
            ]
          }
        },
        "required": [
          "label",
          "type",
          "typeV2"
        ]
      },
      "gbrToDoDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the task",
            "example": 1
          },
          "pcode": {
            "type": "number",
            "description": "Property code this task belongs to",
            "example": 123456
          },
          "name": {
            "type": "string",
            "description": "Task name / description",
            "example": "Prepare welcome gift"
          },
          "active": {
            "type": "string",
            "description": "Date the task was completed (YYYY-MM-DD). Absent while it is pending — see `checked`",
            "example": "2026-01-01"
          },
          "start": {
            "type": "string",
            "description": "Start date of the task (YYYY-MM-DD)",
            "example": "2026-01-01"
          },
          "end": {
            "type": "string",
            "description": "End date / due date of the task (YYYY-MM-DD)",
            "example": "2026-01-02"
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking this task is linked to",
            "example": 1
          },
          "checked": {
            "type": "boolean",
            "description": "Whether this task has been completed",
            "example": true
          }
        },
        "required": [
          "id",
          "pcode",
          "name",
          "start",
          "end",
          "checked"
        ]
      },
      "gbrToDosDto": {
        "type": "object",
        "properties": {
          "data": {
            "title": "To-Do",
            "description": "Tasks linked to this booking. Empty when there are none",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrToDoDto"
            }
          },
          "pendings": {
            "type": "number",
            "description": "Number of tasks still pending (not yet completed)",
            "example": 5
          },
          "total": {
            "type": "number",
            "description": "Total number of tasks for this booking",
            "example": 10
          }
        },
        "required": [
          "data",
          "pendings",
          "total"
        ]
      },
      "gbrGuestDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the customer record. Null only for a booking whose holder record is missing",
            "example": 1234,
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "First name. Empty string when it was not given",
            "example": "John"
          },
          "surname": {
            "type": "string",
            "description": "Last name / surname",
            "example": "Doe"
          },
          "documentType": {
            "type": "string",
            "enum": [
              "P",
              "D",
              "C",
              "MI",
              "I",
              "N",
              "X",
              "E",
              "IDX",
              "ID",
              "50"
            ],
            "description": "Type of identity document: P (passport), D (DNI), C (driving license), I (identity card), N (Spanish residence permit), X (foreign residence permit), MI (minor undocumented), E (other), IDX (foreigner ID), ID (identity card, legacy code), 50 (foreign tax ID). Absent when none of these was recorded",
            "example": "D"
          },
          "documentNumber": {
            "type": "string",
            "description": "Identity document number",
            "example": "A12345678"
          },
          "address": {
            "type": "string",
            "description": "Street address",
            "example": "123 Main St"
          },
          "city": {
            "type": "string",
            "description": "City of residence",
            "example": "New York"
          },
          "postalCode": {
            "type": "string",
            "description": "Postal / ZIP code",
            "example": "10001"
          },
          "country": {
            "type": "string",
            "description": "Country code as stored, in uppercase. Usually ISO 3166-1 alpha-3 (ESP, USA, FRA); older records may hold another code",
            "example": "ESP"
          },
          "province": {
            "type": "string",
            "description": "Province or state, in lowercase",
            "example": "madrid"
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "example": "john.doe@example.com"
          },
          "phone": {
            "type": "string",
            "description": "Phone number as entered (may include the country code)",
            "example": "+1 (555) 123-4567"
          },
          "language": {
            "type": "string",
            "pattern": "^[a-z]{2}$",
            "description": "Preferred language of the person, as a lowercase ISO 639-1 code. Usually one of ca, de, en, es, eu, fr, gl, it, ru, but any two-letter code the guest gave can appear (pt, nl, zh…). Absent when it is not known",
            "example": "es"
          },
          "documentPortrait": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the portrait image exists. Download it from `documentPortraitImagePath` instead",
            "example": "/document-portrait/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentFront": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the document front image exists. Download it from `documentFrontImagePath` instead",
            "example": "/document-front/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentBack": {
            "type": "string",
            "description": "Deprecated: a retired relative path (`/document-…/<base64 of the customer id>.jpg`) that no endpoint serves any more. Present only when the document back image exists. Download it from `documentBackImagePath` instead",
            "example": "/document-back/MTIzNA==.jpg",
            "deprecated": true
          },
          "documentPortraitImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the portrait photo of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LXBvcnRyYWl0OjEyMzQ"
          },
          "documentFrontImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the front side of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LWZyb250OjEyMzQ"
          },
          "documentBackImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the back side of the identity document image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OmRvY3VtZW50LWJhY2s6MTIzNA"
          },
          "notes": {
            "type": "string",
            "description": "Free-text internal notes kept on the customer record",
            "example": "VIP customer"
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking this record was read for",
            "example": 789
          },
          "sex": {
            "type": "string",
            "enum": [
              "M",
              "F",
              "O"
            ],
            "description": "Sex: M (male), F (female), O (other)",
            "example": "M"
          },
          "nationality": {
            "type": "string",
            "description": "Nationality code, as stored (usually ISO 3166-1 alpha-3)",
            "example": "ESP"
          },
          "issuingState": {
            "type": "string",
            "description": "Code of the state that issued the identity document, as stored",
            "example": "ESP"
          },
          "birthDate": {
            "type": "string",
            "description": "Date of birth (YYYY-MM-DD)",
            "example": "1985-04-12"
          },
          "placeOfBirth": {
            "type": "string",
            "description": "Place of birth",
            "example": "Barcelona"
          },
          "expirationDate": {
            "type": "string",
            "description": "Expiry date of the identity document (YYYY-MM-DD)",
            "example": "2030-04-12"
          },
          "issueDate": {
            "type": "string",
            "description": "Issue date of the identity document (YYYY-MM-DD)",
            "example": "2020-04-12"
          },
          "municipality": {
            "type": "string",
            "description": "Municipality, in lowercase",
            "example": "barcelona"
          },
          "placeOfOrigin": {
            "type": "string",
            "description": "Where the guest travels from, as recorded at check-in",
            "example": "Madrid"
          },
          "destinationPlace": {
            "type": "string",
            "description": "Where the guest travels to after the stay, as recorded at check-in",
            "example": "Valencia"
          },
          "position": {
            "type": "number",
            "description": "Order of the guest within the booking. The list is sorted by it",
            "example": 1
          },
          "documentSupport": {
            "type": "string",
            "description": "Support number of the identity document (the Spanish DNI \"IDESP\" number)",
            "example": "BAA123456"
          },
          "relationship": {
            "type": "string",
            "enum": [
              "AB",
              "BA",
              "BN",
              "CY",
              "CD",
              "HR",
              "HJ",
              "PM",
              "NI",
              "SB",
              "SG",
              "TI",
              "YN",
              "TU",
              "OT"
            ],
            "description": "Relationship of this guest to the holder: AB (grandparent), BA (great-grandparent), BN (great-grandchild), CY (spouse), CD (brother/sister-in-law), HR (sibling), HJ (child), PM (parent), NI (grandchild), SB (nephew/niece), SG (parent-in-law), TI (uncle/aunt), YN (son/daughter-in-law), TU (guardian), OT (other)",
            "example": "HJ"
          },
          "signatureImagePath": {
            "type": "string",
            "description": "Path on this API from which to download the guest's signature image: `/api/bookings/{pcode}/customer-image/{hash}`. Call it on the API host with the same credentials. Present only when the image exists",
            "example": "/api/bookings/123456/customer-image/Nzg5OnNpZ25hdHVyZToxMjM0"
          }
        },
        "required": [
          "id",
          "name",
          "bookingId",
          "position"
        ]
      },
      "gbrWeekDaysCleanDto": {
        "type": "object",
        "properties": {
          "mon": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Monday",
            "example": true
          },
          "tue": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Tuesday",
            "example": true
          },
          "wed": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Wednesday",
            "example": true
          },
          "thu": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Thursday",
            "example": true
          },
          "fri": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Friday",
            "example": true
          },
          "sat": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Saturday",
            "example": true
          },
          "sun": {
            "type": "boolean",
            "description": "Indicates if the room is cleaned on Sunday",
            "example": true
          }
        },
        "required": [
          "mon",
          "tue",
          "wed",
          "thu",
          "fri",
          "sat",
          "sun"
        ]
      },
      "gbrHousekeepingDto": {
        "type": "object",
        "properties": {
          "dateToClean": {
            "type": "string",
            "description": "Next scheduled cleaning date (YYYY-MM-DD). In the booking detail and `/search/only-groups` it is the room's own date when it has one, otherwise the booking's; in `/search` and `/search/only-single` only the booking's. Absent when none is scheduled",
            "example": "2026-10-01"
          },
          "quantityNightsClean": {
            "type": "number",
            "description": "Clean the room every N nights (e.g. 2 = clean every other night). Absent when not set",
            "example": 2
          },
          "weekDaysClean": {
            "description": "Weekly cleaning schedule — which days of the week the room should be cleaned. Absent when not set",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrWeekDaysCleanDto"
              }
            ]
          }
        }
      },
      "gbrSegmentRefDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Segment ID",
            "example": 3
          },
          "name": {
            "type": "string",
            "description": "Segment name",
            "example": "Corporate"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "GetBookingResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique booking ID",
            "example": 789
          },
          "pcode": {
            "type": "number",
            "description": "Property code (identifies which hotel/property this booking belongs to)",
            "example": 123456
          },
          "groupId": {
            "type": "number",
            "description": "Group ID if this booking is part of a multi-room group reservation. All bookings in the same group share this ID. Absent for an individual booking",
            "example": 4521
          },
          "groupPrice": {
            "type": "number",
            "description": "Total of the whole group reservation, extras included, as the legacy stores it on each member. Only on group bookings",
            "example": 200
          },
          "groupQuantity": {
            "type": "number",
            "description": "Number of rooms in the group reservation. Only on group bookings",
            "example": 2
          },
          "start": {
            "type": "string",
            "description": "Check-in date (YYYY-MM-DD)",
            "example": "2026-10-01"
          },
          "end": {
            "type": "string",
            "description": "Check-out date (YYYY-MM-DD)",
            "example": "2026-10-05"
          },
          "arrivalHour": {
            "type": "string",
            "description": "Expected arrival time as the guest or channel wrote it. Usually HH:mm, but it is free text: it may be H:mm, HH:mm:ss or a sentence that contains a time. Absent when the field holds no time at all",
            "example": "14:00"
          },
          "departureHour": {
            "type": "string",
            "description": "Expected departure time, same rules as `arrivalHour`. Absent when the field holds no time at all",
            "example": "12:00"
          },
          "nights": {
            "type": "number",
            "description": "Total number of nights for the stay",
            "example": 4
          },
          "appUrl": {
            "type": "string",
            "description": "Deprecated: the link to the previous guest web app, retired in November 2026. It no longer opens the booking: it leads to a page that offers the guest, once verified, the link to the new guest web app by email. It will be removed. The new link carries access to the stay, so no API hands it out: the property sends it to the guest.",
            "example": "https://guest.hotelgest.com/?t=AbCdEf123",
            "deprecated": true
          },
          "createdAt": {
            "type": "string",
            "description": "Date the booking was received (YYYY-MM-DD), without time",
            "example": "2026-09-30",
            "nullable": true
          },
          "resource": {
            "type": "string",
            "description": "Internal planning key, `<roomTypeId>_<roomId>`, or `<roomTypeId>_PLAYGROUND` when no room is assigned. Read `room` instead",
            "example": "1_12",
            "deprecated": true
          },
          "price": {
            "type": "number",
            "description": "Price of this booking. For an individual booking it is the booking total as the legacy stores it (accommodation plus extras and taxes); for a member of a group it is the accommodation of this room. Use `accommodationPrice` for the accommodation alone",
            "example": 100
          },
          "accommodationPrice": {
            "type": "number",
            "description": "Accommodation price of this booking, without extras, for both individual and group bookings. Null when the legacy holds no amount",
            "example": 100,
            "nullable": true
          },
          "paid": {
            "type": "number",
            "description": "Amount already paid. On a group booking it is the paid amount of the whole group, repeated on every member. Null when the legacy holds no value",
            "example": 100,
            "nullable": true
          },
          "totalExtras": {
            "type": "number",
            "description": "Total of the extra services/products. On a group booking it is the total of the whole group, repeated on every member",
            "example": 20
          },
          "canceledCost": {
            "type": "number",
            "description": "Amount the hotel keeps from a cancelled or no-show booking, or from an early departure (a confirmed booking with a value above 0). Absent when the booking has none",
            "example": 45
          },
          "earlyDepartureOriginalEnd": {
            "type": "string",
            "description": "Departure date (YYYY-MM-DD) the booking had before an early departure shortened it. Only in the booking detail, and only for a confirmed booking with a retained amount whose history records it",
            "example": "2026-10-07"
          },
          "cancelledAt": {
            "type": "string",
            "nullable": true,
            "description": "When the booking was cancelled, ISO 8601 in UTC; on a cancelled, no-show or temporary-cancelled booking; `null` on any other, and on a block, although a block reads `bookingStatus` cancelled. When it entered the cancellation it is in now: the first cancellation its history records after the last status change that brought it back, so a cancellation recorded again later (a channel manager notifying it twice) does not move it; never later than the last change of the booking. A booking whose history records no cancellation (some imported or very old ones) gives its last change instead, which any edit after the cancellation moves. Only in the booking detail",
            "example": "2026-09-21T08:00:00.000Z"
          },
          "locked": {
            "type": "boolean",
            "description": "Whether the booking is locked (prevents modifications)",
            "example": false
          },
          "color": {
            "type": "string",
            "description": "Display color for this booking in the calendar view (hex code). Absent when not set",
            "example": "#FF5733"
          },
          "imported": {
            "type": "boolean",
            "description": "Whether this booking was imported from an external system or channel manager",
            "example": false
          },
          "board": {
            "description": "Meal plan / board type: nb (no board), bb (bed & breakfast), hb (half board), fb (full board), ai (all inclusive). A booking the legacy recorded as sold inside a pack may carry `pack` instead",
            "allOf": [
              {
                "$ref": "#/components/schemas/BookingBoard"
              }
            ]
          },
          "policy": {
            "type": "string",
            "description": "Cancellation policy ID, as a string: 4 (flexible cancellation) and 6 (non-refundable) are the built-in ones; any other value is a custom policy of the property (see `GET /api/properties/{pcode}/settings/custom-policies`). Absent when the booking has none",
            "example": "4"
          },
          "room": {
            "description": "Room assignment details (room ID, room type ID)",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrRoomDto"
              }
            ]
          },
          "locator": {
            "type": "string",
            "description": "Booking locator / confirmation code — the channel reservation code shared with the guest and OTAs. Absent when there is none",
            "example": "HG-4F7A2C"
          },
          "packId": {
            "type": "number",
            "description": "ID of the pack the booking was sold with. Only in the booking detail and in `/search/only-groups`; never in `/search` or `/search/only-single`",
            "example": 7
          },
          "packInfo": {
            "description": "The pack the booking was sold with. Only in the booking detail, and only when `packId` points to a pack that still exists",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrPackInfoDto"
              }
            ]
          },
          "customer": {
            "description": "Main guest / booking holder. Absent on a block (see `bookingType`)",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrCustomerDto"
              }
            ]
          },
          "companyId": {
            "type": "number",
            "description": "ID of the company associated with this booking (for corporate/business bookings). Absent when there is none",
            "example": 12
          },
          "notes": {
            "description": "Notes associated with the booking (guest requests, internal notes)",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrNotesDto"
              }
            ]
          },
          "occupancy": {
            "description": "Number of guests for this individual room (adults, children, babies)",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrOccupancyDto"
              }
            ]
          },
          "groupOccupancy": {
            "description": "Total occupancy across all rooms in the group. Only on group bookings",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrOccupancyDto"
              }
            ]
          },
          "otaId": {
            "type": "number",
            "description": "OTA / channel the booking came from. Use the GET /api/otas endpoint to get its name. Null when the legacy holds no channel",
            "example": 3,
            "nullable": true
          },
          "checkInStatus": {
            "description": "Check-in status: waiting-check-in, checked-in, checked-out, or cancelled (every booking whose `bookingStatus` is cancelled, blocks included)",
            "example": "checked-in",
            "allOf": [
              {
                "$ref": "#/components/schemas/CheckInStatus"
              }
            ]
          },
          "bookingStatus": {
            "description": "Booking status: ready (confirmed), tentative (held until its release date), cancelled, no-show, or temporary-cancelled. A block (see `bookingType`) also reads cancelled",
            "example": "ready",
            "allOf": [
              {
                "$ref": "#/components/schemas/BookingStatus"
              }
            ]
          },
          "releaseDateTentative": {
            "type": "string",
            "description": "Date and time (YYYY-MM-DD HH:mm) at which a tentative booking is released if not confirmed. Only on tentative bookings",
            "example": "2026-10-01 18:00"
          },
          "virtualPayment": {
            "description": "Virtual payment details (e.g. virtual credit card from an OTA). Absent when the booking has none",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrVirtualPaymentDto"
              }
            ]
          },
          "paymentStatus": {
            "description": "Overall payment status: no-paid, parcial-paid, paid, or over-paid",
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentStatus"
              }
            ]
          },
          "invoiceStatus": {
            "description": "Invoice status: no-invoiced, parcial-invoiced, or invoiced",
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceStatus"
              }
            ]
          },
          "bookingType": {
            "description": "Present only on a block — a room closed by the staff, not a sale. Absent on every booking",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrBookingTypeDto"
              }
            ]
          },
          "toDos": {
            "description": "Tasks/to-do items linked to this booking (e.g. prepare welcome gift, arrange transfer)",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrToDosDto"
              }
            ]
          },
          "guests": {
            "title": "Guest",
            "description": "Guests registered on this booking, sorted by `position`. Empty when there are none. Each one carries personal data from the identity document",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrGuestDto"
            }
          },
          "isSaleDirect": {
            "type": "boolean",
            "description": "Whether this is a direct sale (booked directly with the hotel, not through an OTA)",
            "example": true
          },
          "housekeeping": {
            "description": "Housekeeping schedule and cleaning configuration for this booking",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbrHousekeepingDto"
              }
            ]
          },
          "segmentsOnBooking": {
            "description": "Segments assigned to the booking itself. Only in the booking detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrSegmentRefDto"
            }
          },
          "segmentsOnCustomer": {
            "description": "Segments assigned to the holder and guests of the booking. Only in the booking detail",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrSegmentRefDto"
            }
          },
          "segmentApplyScope": {
            "type": "string",
            "description": "Where the segments of the booking apply: booking, customer or both. Only in the booking detail, where it is null when the booking has no segments",
            "enum": [
              "booking",
              "customer",
              "both"
            ],
            "nullable": true
          }
        },
        "required": [
          "id",
          "pcode",
          "start",
          "end",
          "nights",
          "appUrl",
          "createdAt",
          "resource",
          "price",
          "accommodationPrice",
          "paid",
          "totalExtras",
          "locked",
          "imported",
          "board",
          "room",
          "notes",
          "occupancy",
          "otaId",
          "checkInStatus",
          "bookingStatus",
          "paymentStatus",
          "invoiceStatus",
          "toDos",
          "guests",
          "isSaleDirect",
          "housekeeping"
        ]
      },
      "GetBookingSearchResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "title": "Booking",
            "description": "Bookings of this page, newest created first. Same shape as the booking detail, without what only the detail reads: no `packId`, `packInfo`, segments, `earlyDepartureOriginalEnd` nor the holder `loyalty`, and `housekeeping.dateToClean` is only the booking's own date. Empty when nothing matches",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBookingResponseDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Number of bookings matching the search, ignoring pagination. With a free-text search it can fall short of every possible match (see the endpoint description); an exact booking ID or locator answers 1",
            "example": 10
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "GetBookingSearchGroupDto": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "number",
            "description": "ID shared by every booking of this group. It is the `groupId` seen on the bookings themselves",
            "example": 4521
          },
          "bookings": {
            "description": "The bookings that make up the group, one per room, sorted by booking ID. Same shape as the booking detail except `packInfo`, segments and `earlyDepartureOriginalEnd`, which only the detail reads",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBookingResponseDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Number of bookings in this group",
            "example": 3
          }
        },
        "required": [
          "groupId",
          "bookings",
          "total"
        ]
      },
      "GetBookingSearchGroupsResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Groups matching the search criteria, up to 5 per page",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GetBookingSearchGroupDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Total number of groups matching the search criteria, ignoring pagination. Divide by the page size to know how many pages there are",
            "example": 12
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "Dates": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "example": "2024-12-20",
            "description": "Check-in date"
          },
          "to": {
            "type": "string",
            "example": "2024-12-25",
            "description": "Check-out date"
          }
        },
        "required": [
          "from",
          "to"
        ]
      },
      "DocumentType": {
        "type": "string",
        "enum": [
          "P",
          "D",
          "C",
          "MI",
          "I",
          "N",
          "X",
          "E",
          "IDX",
          "ID",
          "50"
        ],
        "description": "Document type of the host"
      },
      "Sex": {
        "type": "string",
        "enum": [
          "M",
          "F",
          "O"
        ],
        "description": "Sex of the host"
      },
      "CustomerType": {
        "type": "string",
        "enum": [
          "particular",
          "company",
          "agency"
        ],
        "description": "Type of customer"
      },
      "Company": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Company Ltd.",
            "description": "Name of the company"
          },
          "documentNumber": {
            "type": "string",
            "example": "123456789",
            "description": "Document number of the company"
          },
          "phone": {
            "type": "string",
            "example": "+1 234 567 8900",
            "description": "Phone number of the company"
          },
          "address": {
            "type": "string",
            "example": "123 Main St.",
            "description": "Address of the company"
          },
          "city": {
            "type": "string",
            "example": "Cityville",
            "description": "City of the company"
          },
          "postalCode": {
            "type": "string",
            "example": "12345",
            "description": "Postal code of the company"
          },
          "country": {
            "type": "string",
            "example": "Countryland",
            "description": "Country of the company"
          },
          "province": {
            "type": "string",
            "example": "Provinceland",
            "description": "Province of the company"
          }
        },
        "required": [
          "name",
          "documentNumber"
        ]
      },
      "Host": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "John",
            "description": "First name of the host"
          },
          "surname": {
            "type": "string",
            "example": "Doe",
            "description": "Last name of the host"
          },
          "phone": {
            "type": "string",
            "example": "+1 234 567 8900",
            "description": "Phone number of the host"
          },
          "email": {
            "type": "string",
            "example": "john.doe@example.com",
            "description": "Email address of the host"
          },
          "documentType": {
            "example": "D",
            "description": "Document type of the host",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ]
          },
          "sex": {
            "description": "Sex of the host",
            "allOf": [
              {
                "$ref": "#/components/schemas/Sex"
              }
            ]
          },
          "documentNumber": {
            "type": "string",
            "example": "12345678A",
            "description": "Document number of the host"
          },
          "city": {
            "type": "string",
            "example": "Cityville",
            "description": "City of the host"
          },
          "address": {
            "type": "string",
            "example": "123 Main St.",
            "description": "Address of the host"
          },
          "postalCode": {
            "type": "string",
            "example": "12345",
            "description": "Postal code of the host"
          },
          "country": {
            "type": "string",
            "example": "Countryland",
            "description": "Country of the host"
          },
          "province": {
            "type": "string",
            "example": "Provinceland",
            "description": "Province of the host"
          },
          "notes": {
            "type": "string",
            "example": "Some notes about the booking",
            "description": "Additional notes about the booking"
          },
          "customerType": {
            "example": "particular",
            "description": "Type of customer",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerType"
              }
            ]
          },
          "companyId": {
            "type": "number",
            "example": 123,
            "description": "Company ID, required if isNewCompany is false and customerType is Agency or Company"
          },
          "isNewCompany": {
            "type": "boolean",
            "description": "Whether the company billed for this booking has to be created from `company` (true) or already exists and is referenced by `companyId` (false). Only read when `customerType` is Agency or Company",
            "example": true
          },
          "company": {
            "description": "Company to create. Required if isNewCompany is true",
            "allOf": [
              {
                "$ref": "#/components/schemas/Company"
              }
            ]
          },
          "language": {
            "type": "string",
            "example": "en",
            "description": "Preferred language of the host, as an ISO 639-1 code"
          }
        },
        "required": [
          "name",
          "surname",
          "customerType",
          "isNewCompany",
          "language"
        ]
      },
      "Board": {
        "type": "string",
        "enum": [
          "nb",
          "bb",
          "hb",
          "fb",
          "ai"
        ],
        "description": "Board"
      },
      "PromoCodeManual": {
        "type": "object",
        "properties": {
          "isActive": {
            "type": "boolean",
            "example": true,
            "description": "Whether a manual promo code is applied"
          },
          "type": {
            "type": "string",
            "example": "fbn",
            "enum": [
              "fbn",
              "pbn",
              "ta"
            ],
            "description": "Required if isActive is true"
          },
          "value": {
            "type": "number",
            "example": 20.5,
            "description": "Required if isActive is true"
          }
        },
        "required": [
          "isActive",
          "type",
          "value"
        ]
      },
      "Room": {
        "type": "object",
        "properties": {
          "boardId": {
            "example": "hb",
            "description": "Board",
            "allOf": [
              {
                "$ref": "#/components/schemas/Board"
              }
            ]
          },
          "politicId": {
            "type": "string",
            "example": "4",
            "description": "Policy"
          },
          "pax": {
            "type": "string",
            "example": "2",
            "description": "Pax (total occupancy). Kept for backwards compatibility."
          },
          "adults": {
            "type": "number",
            "example": 2,
            "description": "Number of adults in this room. Optional; when omitted, `pax` is used as adults for backwards compatibility."
          },
          "children": {
            "type": "number",
            "example": 1,
            "description": "Number of children in this room. Optional; defaults to 0 when omitted."
          },
          "babies": {
            "type": "number",
            "example": 0,
            "description": "Number of babies (under 2 years) in this room. Optional; defaults to 0 when omitted."
          },
          "rtcode": {
            "type": "string",
            "example": "11111",
            "description": "Room type ID"
          },
          "rcode": {
            "type": "string",
            "example": "22222",
            "description": "Room ID, a room of the room type `rtcode`. Omit it, or send '', '0' or '-1', to leave the booking without a room assigned. Any other value that is not a room of the property answers 404 `roomNotFound` and nothing is created."
          },
          "ancillary": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "example": {
              "2025-01-01": 100
            },
            "description": "Prices by day"
          },
          "ancillaryWithDiscount": {
            "type": "object",
            "additionalProperties": {
              "type": "number"
            },
            "example": {
              "2025-01-01": 80
            },
            "description": "Prices with discount by day"
          },
          "promoCode": {
            "type": "string",
            "example": "PROMO-123",
            "description": "Promo code in the format type-value-id-code"
          },
          "promoCodeManual": {
            "description": "Manual promo code application",
            "allOf": [
              {
                "$ref": "#/components/schemas/PromoCodeManual"
              }
            ]
          }
        },
        "required": [
          "boardId",
          "politicId",
          "pax",
          "rtcode",
          "rcode",
          "ancillary",
          "ancillaryWithDiscount",
          "promoCodeManual"
        ]
      },
      "Tentative": {
        "type": "object",
        "properties": {
          "isActive": {
            "type": "boolean",
            "example": true,
            "description": "Whether the release date is tentative"
          },
          "releaseDateTentative": {
            "type": "string",
            "example": "2025-01-01",
            "description": "Required if isActive is true"
          }
        },
        "required": [
          "isActive",
          "releaseDateTentative"
        ]
      },
      "Settings": {
        "type": "object",
        "properties": {
          "tentative": {
            "description": "Settings related to tentative release date",
            "allOf": [
              {
                "$ref": "#/components/schemas/Tentative"
              }
            ]
          },
          "hidePrices": {
            "type": "boolean",
            "example": false,
            "description": "Whether to hide prices"
          },
          "sendEmail": {
            "type": "boolean",
            "example": true,
            "description": "Whether to send a confirmation email to the host"
          },
          "locator": {
            "type": "string",
            "example": "ABC123",
            "description": "Locator code for the booking"
          },
          "otaId": {
            "type": "number",
            "example": 1,
            "description": "OTA ID associated with the booking"
          },
          "arrivalHour": {
            "type": "string",
            "example": "15:00",
            "description": "Arrival hour for the booking"
          },
          "departureHour": {
            "type": "string",
            "example": "18:00",
            "description": "Departure hour for the booking. With the same arrival and departure date it makes a stay of some hours"
          },
          "requestNotes": {
            "type": "string",
            "example": "Please prepare a crib for the baby.",
            "description": "Special requests or notes from the host"
          },
          "internalNotes": {
            "type": "string",
            "example": "Internal notes about the booking",
            "description": "Internal notes for the booking"
          }
        },
        "required": [
          "tentative",
          "hidePrices"
        ]
      },
      "DiscountType": {
        "type": "string",
        "enum": [
          "f",
          "p"
        ],
        "description": "Type of discount applied to the product"
      },
      "ExperticketAnswer": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "example": "5df8t6ku41djh",
            "description": "Questions profile the question belongs to"
          },
          "level": {
            "type": "string",
            "enum": [
              "ticket",
              "provider",
              "sale",
              "client"
            ],
            "description": "What the question is asked about: each ticket, the provider, the sale or the client"
          },
          "ticketId": {
            "type": "string",
            "description": "Ticket the answer belongs to, on ticket-level profiles"
          },
          "questionId": {
            "type": "string",
            "example": "nr1k8sehrno3a",
            "description": "Question being answered"
          },
          "value": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "The answer: text, a number, a yes/no, or a list of texts for multiple choice"
          }
        },
        "required": [
          "profileId",
          "level",
          "questionId",
          "value"
        ]
      },
      "ExperticketLine": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "example": "idft1of16amcg",
            "description": "Experticket product identifier"
          },
          "sessionId": {
            "type": "string",
            "description": "Chosen time slot, for products sold by session"
          },
          "saleKey": {
            "type": "string",
            "example": "3f9c0a7d12e44b6a",
            "description": "Same for every attempt at one purchase and for every line of it: a retry never buys twice"
          },
          "answers": {
            "description": "Answers to the questions the venue asks before it reserves",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExperticketAnswer"
            }
          }
        },
        "required": [
          "productId",
          "saleKey"
        ]
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 1,
            "description": "Product ID"
          },
          "quantity": {
            "type": "number",
            "example": 1,
            "description": "Quantity of the product"
          },
          "start": {
            "type": "string",
            "example": "2024-12-20",
            "description": "Start date of the product"
          },
          "end": {
            "type": "string",
            "example": "2024-12-25",
            "description": "End date of the product"
          },
          "startTime": {
            "type": "string",
            "example": "14:00",
            "description": "Start time of the product"
          },
          "endTime": {
            "type": "string",
            "example": "16:00",
            "description": "End time of the product"
          },
          "tax": {
            "type": "number",
            "example": 10.5,
            "description": "Tax applied to the product"
          },
          "price": {
            "type": "number",
            "example": 100,
            "description": "Price of the product"
          },
          "name": {
            "type": "string",
            "example": "Sample Product",
            "description": "Name of the product"
          },
          "description": {
            "type": "string",
            "example": "This is a sample product description.",
            "description": "Description of the product"
          },
          "discountType": {
            "example": "p",
            "description": "Type of discount applied to the product",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountType"
              }
            ]
          },
          "discountValue": {
            "type": "number",
            "example": 15,
            "description": "Value of the discount applied to the product"
          },
          "discountCalculated": {
            "type": "number",
            "example": 15,
            "description": "Calculated discount amount for the product"
          },
          "productType": {
            "type": "string",
            "example": "pbd",
            "description": "Type of the product",
            "enum": [
              "pbd",
              "pbpd",
              "pbb",
              "pbp"
            ]
          },
          "accounting": {
            "type": "number",
            "example": 12,
            "description": "Accounting category ID bound to this line. Meant for custom products, which have no catalog article to inherit the accounting account from."
          },
          "experticket": {
            "description": "Present only on Experticket sales",
            "allOf": [
              {
                "$ref": "#/components/schemas/ExperticketLine"
              }
            ]
          }
        },
        "required": [
          "id",
          "quantity",
          "start",
          "end",
          "tax",
          "price",
          "name",
          "productType"
        ]
      },
      "AddBookingDtoV4": {
        "type": "object",
        "properties": {
          "date": {
            "description": "Booking dates",
            "allOf": [
              {
                "$ref": "#/components/schemas/Dates"
              }
            ]
          },
          "host": {
            "description": "Host information",
            "allOf": [
              {
                "$ref": "#/components/schemas/Host"
              }
            ]
          },
          "rooms": {
            "description": "Rooms information",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            }
          },
          "settings": {
            "description": "Settings information",
            "allOf": [
              {
                "$ref": "#/components/schemas/Settings"
              }
            ]
          },
          "products": {
            "description": "Products information",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "groupId": {
            "type": "number",
            "description": "Group ID",
            "example": 123
          },
          "segmentIds": {
            "description": "Market segment ids to attach",
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "segmentApplyScope": {
            "type": "string",
            "enum": [
              "booking",
              "customer",
              "both"
            ],
            "deprecated": true,
            "description": "Deprecated and ignored. segmentIds always apply to the reservation."
          },
          "packId": {
            "type": "number",
            "description": "Pack/Promotion ID (code_pack)",
            "example": 456
          }
        },
        "required": [
          "date",
          "host",
          "rooms",
          "settings",
          "products"
        ]
      },
      "AddBookingResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the created booking. Use it against the booking endpoints (`GET /api/bookings/{pcode}/detail/{bookingId}`)",
            "example": 789
          }
        },
        "required": [
          "id"
        ]
      },
      "CheckInOutBookingDto": {
        "type": "object",
        "properties": {
          "nextStatus": {
            "description": "Target check-in state for the booking. Allowed values follow the check-in state machine.",
            "example": "checked-in",
            "allOf": [
              {
                "$ref": "#/components/schemas/CheckInStatus"
              }
            ]
          }
        },
        "required": [
          "nextStatus"
        ]
      },
      "GetBookingPaymentResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the payment",
            "example": 101
          },
          "invoiceId": {
            "type": "number",
            "description": "ID of the invoice this payment is linked to. Absent while it is on no invoice",
            "example": 450
          },
          "reference": {
            "type": "string",
            "description": "Reference of the payment as it was recorded: free text typed at reception, or the identifier of the gateway or channel that took it (for example the Paycomet order or the channel payment ID). Empty string when there is none. It is not generated by Hotelgest and is not unique",
            "example": "1023-pay-1736935320"
          },
          "amountAuth": {
            "type": "number",
            "description": "Amount authorized by the payment provider (may differ from the captured amount for card payments). 0 when there was no authorization",
            "example": 120.5
          },
          "amount": {
            "type": "number",
            "description": "Actual amount captured/received",
            "example": 120.5
          },
          "date": {
            "type": "string",
            "description": "Date the payment was made (YYYY-MM-DD)",
            "example": "2025-01-15"
          },
          "paymentType": {
            "type": "string",
            "description": "Same value as `type`. Kept for older integrations: read `type` instead",
            "deprecated": true,
            "example": "Cash"
          },
          "type": {
            "type": "string",
            "description": "Payment method, as the property named it. It is free text, not a closed list: besides the usual Cash, Credit Card, Credit Card2, Bank Transfer, Virtual POS, bizum, PayPal, Paycomet, Monei, Stripe, Amex, Paycheck, CashDro and others, a property can record its own names (for example \"TPV BBVA\", \"Booking.com\", \"VISA\", \"Bank Transfer booking\"), and Hotelgest itself writes \"Preauthorization\" for a captured card pre-authorisation and \"credit\" for a payment recorded against a company account",
            "example": "Cash"
          },
          "providerType": {
            "type": "string",
            "description": "Online payment gateway that took the payment: paycomet, monei or stripe. Absent when it was recorded by hand or came through any other way",
            "enum": [
              "paycomet",
              "monei",
              "stripe"
            ]
          },
          "notes": {
            "type": "string",
            "description": "Free-text notes about the payment. Empty string when there are none",
            "example": "Paid via virtual POS"
          },
          "userId": {
            "type": "number",
            "description": "ID of the user who registered this payment. 0 when it was not registered by a person (a gateway, a channel or an integration)",
            "example": 12
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking this payment belongs to",
            "example": 999
          },
          "pcode": {
            "type": "number",
            "description": "Property code of the booking the payment belongs to. In a group that spans several properties it can be another property than the one in the path",
            "example": 123456
          },
          "createdAt": {
            "type": "string",
            "description": "When the payment was recorded, as an ISO 8601 date-time. The value is Spain local time (Europe/Madrid) written with a `Z` suffix: read the digits as Madrid wall-clock time, not as UTC",
            "example": "2025-01-15T10:22:00.000Z"
          },
          "prePay": {
            "type": "boolean",
            "description": "Whether this is a pre-payment (advance payment before check-in, typically from OTA or booking engine)",
            "example": false
          },
          "prePayChannel": {
            "type": "number",
            "description": "A 0/1 flag, not a channel ID: 1 on a payment the sales channel (OTA) collected and on a captured card pre-authorisation, 0 otherwise",
            "example": 0
          },
          "transactionType": {
            "type": "string",
            "description": "Kind of transaction, as the numeric code the legacy stores, in text: \"0\" for an ordinary payment (almost all of them), \"1\" and \"2\" for card operations handled by a gateway. Absent when the row has no code",
            "example": "0"
          },
          "isRefunded": {
            "type": "boolean",
            "description": "Whether this payment has been refunded",
            "example": false
          },
          "isAdvancePayment": {
            "type": "boolean",
            "description": "Whether this payment already is an advance payment (\"pago a cuenta\"), so it cannot be converted again",
            "example": false
          },
          "locator": {
            "type": "string",
            "description": "The booking code on the channel the reservation of this payment came from. Absent when it has none",
            "example": "4417230981"
          },
          "authCode": {
            "type": "string",
            "description": "Authorization code the card gateway returned for the payment. Absent on payments that did not go through a gateway",
            "example": "123456"
          }
        }
      },
      "InvoiceType": {
        "type": "string",
        "enum": [
          "invoice",
          "refund",
          "deposit",
          "service"
        ],
        "description": "Invoice type: invoice, refund (a credit note) or deposit. Invoices and credit notes of the services module (POS) also come as invoice and refund; `servicesDocument` tells them apart. The value service is listed by the enum but never returned here"
      },
      "DigitalSignatureStatus": {
        "type": "string",
        "enum": [
          "processing",
          "signed",
          "error"
        ],
        "description": "Where an asynchronous signature of an unsigned invoice stands: processing, signed or error. Absent when no signature is in flight"
      },
      "GetBookingInvoicesResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the invoice",
            "example": 1
          },
          "pcode": {
            "type": "number",
            "description": "Property code this invoice belongs to",
            "example": 123456
          },
          "coin": {
            "type": "string",
            "description": "Currency of the invoice as it was stored when it was issued: the symbol for most properties (€), an ISO 4217 code for some others (COP, MAD). Not normalised",
            "example": "€"
          },
          "date": {
            "type": "string",
            "description": "Invoice issue date (YYYY-MM-DD)",
            "example": "2025-01-20"
          },
          "prefix": {
            "type": "string",
            "description": "Invoice series prefix (e.g. INV, F, RE) as configured in the property settings",
            "example": "INV"
          },
          "prefixAdditional": {
            "type": "number",
            "description": "Additional numeric prefix for sub-series. Absent when the invoice has none",
            "example": 2
          },
          "reference": {
            "type": "integer",
            "description": "Sequential number of the invoice within its series, as a number. The series is in `prefix` (and `prefixAdditional`): the printed reference is the two together",
            "example": 1
          },
          "total": {
            "type": "number",
            "description": "Total amount of the invoice (including taxes)",
            "example": 450.75
          },
          "refundId": {
            "type": "number",
            "description": "ID of the credit note that refunds this invoice. Absent when it was not refunded",
            "example": 99
          },
          "paymentsIds": {
            "description": "List of payment IDs linked to this invoice",
            "example": [
              10,
              11
            ],
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "totalPaid": {
            "type": "number",
            "description": "Total amount already paid towards this invoice",
            "example": 300.5
          },
          "isCredit": {
            "type": "boolean",
            "description": "Whether the invoice was issued on credit, to be paid later. It does not mark a credit note: a credit note is `type: refund`",
            "example": false
          },
          "invoiceWasSent": {
            "type": "string",
            "description": "Day the invoice was emailed (YYYY-MM-DD). Absent when it was never sent",
            "example": "2025-01-21"
          },
          "type": {
            "description": "Invoice type: invoice, refund (a credit note) or deposit. Invoices and credit notes of the services module (POS) also come as invoice and refund; `servicesDocument` tells them apart. The value service is listed by the enum but never returned here",
            "example": "invoice",
            "allOf": [
              {
                "$ref": "#/components/schemas/InvoiceType"
              }
            ]
          },
          "bookingsIds": {
            "description": "List of booking IDs included in this invoice (an invoice can cover multiple bookings)",
            "example": [
              1001,
              1002
            ],
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "items": {
            "type": "object",
            "description": "Line items breakdown. Keyed by item ID, each entry shows the booking it belongs to, tax percentage, and total amount; `type` is the kind of line as stored — an open set: `main` for the stay, `tax` for the tourist tax, and others such as `prePay`, `refund`, `tax2` or the type of a POS integration; absent when the line has none — and `start`/`end` the first and last night it covers (YYYY-MM-DD) when it has them. Taxes come only as a rate per line: the invoice carries no tax bases or tax amounts",
            "example": {
              "1": {
                "bookingId": 1001,
                "tax": 10,
                "total": 100,
                "type": "main",
                "start": "2026-01-10",
                "end": "2026-01-11"
              },
              "2": {
                "bookingId": 1002,
                "tax": 10,
                "total": 200
              }
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "bookingId": {
                  "type": "number",
                  "description": "Booking the line belongs to"
                },
                "tax": {
                  "type": "number",
                  "description": "Tax rate of the line, in percent"
                },
                "total": {
                  "type": "number",
                  "description": "Total amount of the line"
                },
                "type": {
                  "type": "string",
                  "description": "Kind of line as stored, an open set: `main` for the stay, `tax` for the tourist tax, others for extras, pre-payments and POS lines"
                },
                "start": {
                  "type": "string",
                  "description": "First night it covers (YYYY-MM-DD)"
                },
                "end": {
                  "type": "string",
                  "description": "Last night it covers (YYYY-MM-DD)"
                }
              }
            }
          },
          "customerType": {
            "description": "Billing customer type: particular, company, or agency",
            "example": "particular",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerType"
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "Billing customer first name. For a particular it is every word of the billing name but the last; for a company or an agency it is the whole billing name",
            "example": "John"
          },
          "surname": {
            "type": "string",
            "description": "Billing customer last name: the last word of the billing name for a particular (empty when the name is one word), and always empty for a company or an agency",
            "example": "Doe"
          },
          "documentType": {
            "description": "Billing customer document type: P (passport), D (DNI), C (driving license), I (identity card), N (Spanish residence permit), X (foreign residence permit), MI (minor undocumented), E (other), IDX (foreigner ID), ID (identity card, legacy code), 50 (foreign tax ID). P when the stored type is missing or not one of these",
            "example": "D",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ]
          },
          "documentNumber": {
            "type": "string",
            "description": "Billing customer document number. Absent when it was not recorded",
            "example": "X1234567"
          },
          "phone": {
            "type": "string",
            "description": "Billing customer phone number. Absent when empty",
            "example": "+34 600 123 456"
          },
          "address": {
            "type": "string",
            "description": "Billing address. Absent when empty",
            "example": "Main Street 123"
          },
          "postalCode": {
            "type": "string",
            "description": "Billing postal code. Absent when empty",
            "example": "08001"
          },
          "city": {
            "type": "string",
            "description": "Billing city. Absent when empty",
            "example": "Barcelona"
          },
          "country": {
            "type": "string",
            "description": "Billing country code as stored: almost always ISO 3166-1 alpha-3, a two-letter code on a few older invoices. Absent when empty",
            "example": "ESP"
          },
          "province": {
            "type": "string",
            "description": "Billing province or state. Absent when empty",
            "example": "Barcelona"
          },
          "observations": {
            "type": "string",
            "description": "Additional notes or observations on the invoice. Absent when empty",
            "example": "Customer requested digital invoice"
          },
          "signed": {
            "type": "boolean",
            "description": "Whether the invoice carries the verification URL of a fiscal digital signature (TicketBAI or Veri*factu): see `fiscalUrl`",
            "example": true
          },
          "fiscalUrl": {
            "type": "string",
            "description": "Verification URL of the fiscal digital signature (TicketBAI or Veri*factu) the invoice was signed with. Absent when it is not signed",
            "example": "https://batuz.eus/QRTBAI/?id=TBAI-00000000A-010126-btFpwP8dcLGAF-237"
          },
          "error": {
            "type": "string",
            "description": "Why the fiscal digital signature failed, on an invoice that is not signed. Absent on a signed invoice and when nothing failed",
            "example": "Invalid tax calculation"
          },
          "errorProvider": {
            "type": "string",
            "description": "Signature provider that reported `error`. Absent when there is no error",
            "enum": [
              "ticketbai",
              "verifactu"
            ],
            "example": "verifactu"
          },
          "errorCode": {
            "type": "string",
            "description": "The provider's own code for `error` (for example B4_1000002). Absent when the provider gave none",
            "example": "B4_1000002"
          },
          "signStatus": {
            "description": "Where an asynchronous signature of an unsigned invoice stands: processing, signed or error. Absent when no signature is in flight",
            "example": "processing",
            "allOf": [
              {
                "$ref": "#/components/schemas/DigitalSignatureStatus"
              }
            ]
          },
          "companyId": {
            "type": "number",
            "description": "ID of the billing customer record (company, agency or particular) the invoice was issued to",
            "example": 12
          },
          "countryName": {
            "type": "string",
            "description": "Country name of the billing customer as it was typed (for example \"france\"), the text the invoice prints. Absent when empty",
            "example": "france"
          },
          "irpf": {
            "type": "number",
            "description": "Withholding tax rate (IRPF) of the invoice, in percent. 0 when there is none",
            "example": 0
          },
          "servicesDocument": {
            "type": "boolean",
            "description": "true on the invoices and credit notes of the services module (POS sales billed on their own series). Absent on every other invoice",
            "example": true
          },
          "bookingTotal": {
            "type": "number",
            "description": "Only on an invoice that bills bookings outside the group of the one asked for (a batch invoice): what this booking owes on it. `total` keeps meaning the whole invoice",
            "example": 180
          },
          "bookingPaid": {
            "type": "number",
            "description": "Only on a batch invoice, with `bookingTotal`: what has been paid for this booking on it. `totalPaid` keeps meaning the whole invoice",
            "example": 180
          }
        },
        "required": [
          "irpf"
        ]
      },
      "GetBookingProformasResponseDto": {
        "type": "object",
        "properties": {
          "coin": {
            "type": "string",
            "description": "Currency of the proforma as it was stored when it was issued: the symbol for most properties (€, $, S./), an ISO 4217 code for some others (COP, MAD, PHP). Not normalised; null on a few old proformas that stored none",
            "nullable": true,
            "example": "€"
          },
          "date": {
            "type": "string",
            "description": "Proforma issue date (YYYY-MM-DD)",
            "example": "2025-02-10"
          },
          "id": {
            "type": "number",
            "description": "Unique ID of the proforma",
            "example": 50
          },
          "prefix": {
            "type": "string",
            "description": "Proforma series prefix (e.g. PRO) as configured in the property settings",
            "example": "PRO"
          },
          "reference": {
            "type": "string",
            "description": "Number of the proforma within its series, as text. The series is in `prefix`: the printed reference is the two together",
            "example": "45"
          },
          "total": {
            "type": "number",
            "description": "Total amount of the proforma (including taxes)",
            "example": 325
          },
          "isCredit": {
            "type": "boolean",
            "description": "Always false: proformas have no credit flag. Kept so that the shape matches the invoices one",
            "example": false
          },
          "proformaWasSent": {
            "type": "string",
            "description": "Day the proforma was emailed (YYYY-MM-DD). Absent when it was never sent",
            "example": "2025-02-10"
          },
          "bookingsIds": {
            "description": "List of booking IDs included in this proforma",
            "example": [
              1001,
              1005
            ],
            "type": "array",
            "items": {
              "type": "number"
            }
          },
          "items": {
            "type": "object",
            "description": "Line items breakdown. Keyed by item ID, each entry shows the booking it belongs to, tax percentage, and total amount",
            "example": {
              "1": {
                "bookingId": 1001,
                "tax": 10,
                "total": 150
              },
              "2": {
                "bookingId": 1005,
                "tax": 10,
                "total": 175
              }
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "bookingId": {
                  "type": "number",
                  "description": "Booking the line belongs to"
                },
                "tax": {
                  "type": "number",
                  "description": "Tax rate of the line, in percent"
                },
                "total": {
                  "type": "number",
                  "description": "Total amount of the line"
                }
              }
            }
          },
          "customerType": {
            "description": "Billing customer type: particular, company, or agency",
            "example": "particular",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerType"
              }
            ]
          },
          "name": {
            "type": "string",
            "description": "Billing customer first name. For a particular it is every word of the billing name but the last; for a company or an agency it is the whole billing name",
            "example": "John"
          },
          "surname": {
            "type": "string",
            "description": "Billing customer last name: the last word of the billing name for a particular (empty when the name is one word), and always empty for a company or an agency",
            "example": "Doe"
          },
          "documentType": {
            "description": "Billing customer document type: P (passport), D (DNI), C (driving license), I (identity card), N (Spanish residence permit), X (foreign residence permit), MI (minor undocumented), E (other), IDX (foreigner ID), ID (identity card, legacy code), 50 (foreign tax ID). P when the stored type is missing or not one of these",
            "example": "D",
            "allOf": [
              {
                "$ref": "#/components/schemas/DocumentType"
              }
            ]
          },
          "documentNumber": {
            "type": "string",
            "description": "Billing customer document number. Absent when it was not recorded",
            "example": "X9876543"
          },
          "phone": {
            "type": "string",
            "description": "Billing customer phone number. Absent when empty",
            "example": "+34 600 123 456"
          },
          "address": {
            "type": "string",
            "description": "Billing address. Absent when empty",
            "example": "Main Street 123"
          },
          "postalCode": {
            "type": "string",
            "description": "Billing postal code. Absent when empty",
            "example": "08001"
          },
          "city": {
            "type": "string",
            "description": "Billing city. Absent when empty",
            "example": "Barcelona"
          },
          "country": {
            "type": "string",
            "description": "Billing country code as stored: almost always ISO 3166-1 alpha-3, a two-letter code on a few older documents. Absent when empty",
            "example": "ESP"
          },
          "province": {
            "type": "string",
            "description": "Billing province or state. Absent when empty",
            "example": "Barcelona"
          },
          "observations": {
            "type": "string",
            "description": "Additional notes or observations on the proforma. Absent when empty",
            "example": "Client requested summary breakdown."
          },
          "countryName": {
            "type": "string",
            "description": "Country name of the billing customer as it was typed (for example \"france\"), the text the proforma prints. Absent when empty",
            "example": "france"
          }
        }
      },
      "gbpOccupancyDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "description": "Total number of guests (adults + children + babies)",
            "example": 3
          },
          "adults": {
            "type": "number",
            "description": "Number of adults",
            "example": 2
          },
          "children": {
            "type": "number",
            "description": "Number of children",
            "example": 1
          },
          "babies": {
            "type": "number",
            "description": "Number of babies (not counted towards capacity)",
            "example": 0
          }
        },
        "required": [
          "total",
          "adults",
          "children",
          "babies"
        ]
      },
      "gbpBreakdownDto": {
        "type": "object",
        "properties": {
          "quantity": {
            "type": "number",
            "description": "Number of rooms booked of this room type",
            "example": 2
          },
          "roomTypeId": {
            "type": "number",
            "description": "Room type ID. Resolve it against `GET /api/rooms/{pcode}/types`",
            "example": 101
          },
          "occupancy": {
            "description": "Combined occupancy across the rooms of this room type",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpOccupancyDto"
              }
            ]
          }
        },
        "required": [
          "quantity",
          "roomTypeId",
          "occupancy"
        ]
      },
      "gbpRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the physical room assigned to the line. 0 when no room is assigned yet",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "Display name of the assigned room. Empty string when none is assigned",
            "example": "101"
          },
          "doorNum": {
            "type": "string",
            "description": "Door number of the assigned room. Empty string when none is assigned",
            "example": "101"
          },
          "roomTypeId": {
            "type": "number",
            "description": "ID of the room type of the line",
            "example": 101
          },
          "floor": {
            "type": "number",
            "description": "Always 0: this read does not load the floor. Use `GET /api/rooms/{pcode}/types`",
            "example": 0
          },
          "position": {
            "type": "number",
            "description": "Always 0: this read does not load the position. Use `GET /api/rooms/{pcode}/types`",
            "example": 0
          }
        },
        "required": [
          "id",
          "name",
          "doorNum",
          "roomTypeId",
          "floor",
          "position"
        ]
      },
      "gbpPackRoomDto": {
        "type": "object",
        "properties": {
          "roomTypeId": {
            "type": "number",
            "description": "Room type ID included in the pack",
            "example": 101
          },
          "occupancy": {
            "type": "number",
            "description": "Occupancy the pack prices this room type for",
            "example": 2
          },
          "board": {
            "description": "Board included: nb, bb (bed & breakfast), hb (half), fb (full) or ai (all-in)",
            "example": "bb",
            "allOf": [
              {
                "$ref": "#/components/schemas/Board"
              }
            ]
          },
          "policy": {
            "type": "string",
            "description": "Cancellation policy ID applied to this room inside the pack",
            "example": "4"
          },
          "id": {
            "type": "number",
            "description": "ID of the room line inside the pack",
            "example": 1
          }
        },
        "required": [
          "roomTypeId",
          "occupancy",
          "board",
          "policy",
          "id"
        ]
      },
      "gbpPackDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the pack",
            "example": 7
          },
          "room": {
            "description": "Rooms bundled into the pack",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpPackRoomDto"
            }
          },
          "name": {
            "type": "object",
            "description": "Pack name, keyed by panel language",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "en": "Romantic getaway",
              "es": "Escapada romántica"
            }
          },
          "text": {
            "type": "object",
            "description": "Pack description, keyed by panel language",
            "additionalProperties": {
              "type": "string"
            },
            "example": {
              "en": "Two nights with dinner included",
              "es": "Dos noches con cena incluida"
            }
          }
        },
        "required": [
          "id",
          "room",
          "name",
          "text"
        ]
      },
      "gbpPriceDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "Night this price belongs to (YYYY-MM-DD)",
            "example": "2026-01-10"
          },
          "price": {
            "type": "number",
            "description": "Price for that night, taxes included",
            "example": 120
          },
          "priceWithoutTaxes": {
            "type": "number",
            "description": "Price for that night before taxes, when the property breaks taxes out",
            "example": 109.09
          }
        },
        "required": [
          "date",
          "price"
        ]
      },
      "gbpProductDiscountDto": {
        "type": "object",
        "properties": {
          "type": {
            "description": "How the discount applies: f (fixed amount) or p (percentage)",
            "example": "p",
            "allOf": [
              {
                "$ref": "#/components/schemas/DiscountType"
              }
            ]
          },
          "value": {
            "type": "number",
            "description": "Discount value — an amount when `type` is f, a percentage when `type` is p",
            "example": 10
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "gbpProductDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the product in the property catalogue",
            "example": 42
          },
          "name": {
            "type": "string",
            "description": "Product name as charged to the booking",
            "example": "Breakfast"
          },
          "translate": {
            "type": "boolean",
            "description": "Set to true only on the tourist tax line, whose `name` is then the name the property gave the tax or, when it gave none, the Spanish \"Tasa turística\". Absent on every other line",
            "example": true
          },
          "price": {
            "type": "number",
            "description": "In the `booking` and `experticket` groups, the unit price in the property currency, taxes included (before the line discount). In the POS groups (`agora`, `spalopia`, `ticksy`) it is the TOTAL of the line, quantity included; in `revo` with ticket grouping it is the total of the ticket",
            "example": 12.5
          },
          "tax": {
            "type": "number",
            "description": "Tax rate applied to this product, as a percentage. 0 on a Revo ticket grouped by the POS settings, whose lines may carry different rates",
            "example": 10
          },
          "isTuristicTax": {
            "type": "boolean",
            "description": "Whether this line is the tourist tax generated by the PMS rather than a product sold by the property",
            "example": false
          },
          "start": {
            "type": "string",
            "description": "First day the product applies to (YYYY-MM-DD)",
            "example": "2026-01-10"
          },
          "end": {
            "type": "string",
            "description": "Last day the product applies to (YYYY-MM-DD)",
            "example": "2026-01-12"
          },
          "startTime": {
            "type": "string",
            "description": "Start time of the service (HH:mm)",
            "example": "08:00"
          },
          "endTime": {
            "type": "string",
            "description": "End time of the service (HH:mm)",
            "example": "10:30"
          },
          "discount": {
            "description": "Discount applied to this product line, when there is one",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDiscountDto"
              }
            ]
          }
        },
        "required": [
          "name",
          "price",
          "tax"
        ]
      },
      "PromoCodeType": {
        "type": "string",
        "enum": [
          "fbn",
          "pbn",
          "ta"
        ],
        "description": "How the promo code applies: fbn (fixed amount per night), pbn (percentage per night) or ta (fixed amount over the total)"
      },
      "gbpPromoDiscountDto": {
        "type": "object",
        "properties": {
          "originalTotal": {
            "type": "number",
            "description": "Line total before the promo code was applied",
            "example": 400
          },
          "type": {
            "description": "How the promo code applies: fbn (fixed amount per night), pbn (percentage per night) or ta (fixed amount over the total)",
            "example": "pbn",
            "allOf": [
              {
                "$ref": "#/components/schemas/PromoCodeType"
              }
            ]
          },
          "value": {
            "type": "number",
            "description": "Promo code value — an amount or a percentage, depending on `type`",
            "example": 15
          },
          "code": {
            "type": "string",
            "description": "Promo code entered by the guest",
            "example": "SUMMER26"
          }
        },
        "required": [
          "originalTotal",
          "type",
          "value"
        ]
      },
      "gbpExperticketAnswerDto": {
        "type": "object",
        "properties": {
          "question": {
            "type": "string",
            "description": "Question the venue asks about the guest",
            "example": "Height (cm)"
          },
          "answer": {
            "description": "What was answered: text, or a boolean for a yes/no question",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "boolean"
              }
            ],
            "example": "140"
          }
        },
        "required": [
          "question",
          "answer"
        ]
      },
      "gbpExperticketTicketDto": {
        "type": "object",
        "properties": {
          "ticketId": {
            "type": "string",
            "description": "Ticket ID at Experticket",
            "example": "T-1029384"
          },
          "accessCode": {
            "type": "string",
            "description": "Barcode the venue's turnstile reads. Null until the venue issues it, and always null when the request is authenticated with an API key",
            "nullable": true,
            "example": null
          },
          "billingCode": {
            "type": "string",
            "description": "Ticket identifier shared by the PMS and Experticket, unique per ticket. Null when the request is authenticated with an API key",
            "nullable": true,
            "example": null
          },
          "sessionId": {
            "type": "string",
            "description": "Time slot of the ticket at the venue, when the product has slots",
            "nullable": true,
            "example": "S-5521"
          },
          "sessionTime": {
            "type": "string",
            "description": "Start of the time slot (HH:mm), as the venue confirmed it",
            "nullable": true,
            "example": "10:30"
          },
          "accessDate": {
            "type": "string",
            "description": "First day the ticket opens the gate (YYYY-MM-DD)",
            "nullable": true,
            "example": "2026-01-11"
          },
          "accessEndDate": {
            "type": "string",
            "description": "Last day the ticket opens the gate (YYYY-MM-DD)",
            "nullable": true,
            "example": "2026-01-11"
          }
        },
        "required": [
          "ticketId",
          "accessCode",
          "billingCode",
          "sessionId",
          "sessionTime",
          "accessDate",
          "accessEndDate"
        ]
      },
      "gbpExperticketSaleDto": {
        "type": "object",
        "properties": {
          "saleId": {
            "type": "string",
            "description": "Sale ID at the venue",
            "example": "8120034"
          },
          "partnerSaleId": {
            "type": "string",
            "description": "Sale ID the PMS gave the sale at Experticket, unique for good",
            "example": "hg245x88121a7c"
          },
          "reservationId": {
            "type": "string",
            "description": "Reservation ID at Experticket the sale confirmed. Empty when the PMS does not know it: a sale recovered on a retry, whose reservation the venue does not list, or a stored line that lacks it. Use saleId to match a sale",
            "example": "R-77120"
          },
          "status": {
            "type": "number",
            "description": "Status of the sale at the venue: 1 started, 2 confirmed, 4 cancelled, 7 in progress (the venue has to process it before issuing the tickets)",
            "enum": [
              1,
              2,
              4,
              7
            ],
            "nullable": true,
            "example": 2
          },
          "transactionDateTime": {
            "type": "string",
            "description": "When the venue registered the sale, as the venue reports it",
            "nullable": true,
            "example": "2026-01-08T12:00:00"
          },
          "documentUrl": {
            "type": "string",
            "description": "Link to the PDF with the tickets. It can take a moment to exist after the sale, and it is always null when the request is authenticated with an API key",
            "nullable": true,
            "example": null
          },
          "accessCode": {
            "type": "string",
            "description": "Barcode of the product itself, when the venue issues one per person instead of one per ticket. Null when the request is authenticated with an API key",
            "nullable": true,
            "example": null
          },
          "tickets": {
            "description": "Tickets the venue issued for the line",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpExperticketTicketDto"
            }
          }
        },
        "required": [
          "saleId",
          "partnerSaleId",
          "reservationId",
          "status",
          "transactionDateTime",
          "documentUrl",
          "accessCode",
          "tickets"
        ]
      },
      "gbpExperticketLineDto": {
        "type": "object",
        "properties": {
          "productId": {
            "type": "string",
            "description": "Experticket product ID",
            "example": "idft1of16amcg"
          },
          "providerId": {
            "type": "string",
            "description": "ID of the venue that sells the product",
            "example": "prov01"
          },
          "providerName": {
            "type": "string",
            "description": "Name of the venue that sells the product",
            "example": "Caldea"
          },
          "productName": {
            "type": "string",
            "description": "The venue's own name for the product, whatever the line is called on the invoice",
            "example": "Inuu 3h"
          },
          "sessionId": {
            "type": "string",
            "description": "Time slot booked, when the product has slots",
            "example": "S-5521"
          },
          "sessionTime": {
            "type": "string",
            "description": "Start of the time slot (HH:mm)",
            "example": "10:30"
          },
          "answers": {
            "description": "Answers to the questions the venue asks about the guest. Omitted when the request is authenticated with an API key",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpExperticketAnswerDto"
            }
          },
          "sale": {
            "description": "The sale at Experticket the line belongs to. Absent until the venue has sold it",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpExperticketSaleDto"
              }
            ]
          }
        },
        "required": [
          "productId"
        ]
      },
      "gbpRevoTicketLineDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the stored line (`invoice_has_items`)",
            "example": 15342
          },
          "quantity": {
            "type": "number",
            "description": "Units of the line",
            "example": 2
          },
          "invoiceId": {
            "type": "number",
            "description": "Invoice the line is on. 0 while it is pending invoicing",
            "example": 0
          }
        },
        "required": [
          "id",
          "quantity",
          "invoiceId"
        ]
      },
      "gbpBaseDataDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the stored line (`invoice_has_items`). Lines the PMS derives instead of storing carry a fixed value: 1 on an accommodation line, -1 on a tourist tax line — so it is not unique, and a group holds several 1s. On a Revo ticket grouped by the POS settings it is the ID of the first line of the ticket",
            "example": 15342
          },
          "quantity": {
            "type": "number",
            "description": "Number of units charged on this line; it can be decimal on POS lines sold by portion (0.25, 0.75). Always 1 on a Revo ticket grouped by the POS settings",
            "example": 1
          },
          "room": {
            "description": "Room assigned to this accommodation line. Absent on product lines",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpRoomDto"
              }
            ]
          },
          "pack": {
            "description": "Pack this line belongs to, when the rate was sold as a bundle",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpPackDto"
              }
            ]
          },
          "occupancy": {
            "description": "Guests this accommodation line is priced for",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpOccupancyDto"
              }
            ]
          },
          "board": {
            "description": "Board of the accommodation line: nb, bb, hb, fb or ai",
            "example": "bb",
            "allOf": [
              {
                "$ref": "#/components/schemas/Board"
              }
            ]
          },
          "policy": {
            "type": "string",
            "description": "Cancellation policy of the accommodation line. Besides the built-in 4 (flexible) and 6 (non-refundable), a property can define its own — see `GET /api/properties/{pcode}/settings/custom-policies`",
            "example": "4"
          },
          "invoiceId": {
            "type": "number",
            "description": "ID of the invoice this line was billed on. Absent while the line is still pending invoicing",
            "example": 3021
          },
          "start": {
            "type": "string",
            "description": "First night of the accommodation line (YYYY-MM-DD)",
            "example": "2026-01-10"
          },
          "end": {
            "type": "string",
            "description": "Departure day of the accommodation line (YYYY-MM-DD)",
            "example": "2026-01-12"
          },
          "prices": {
            "description": "Price per night of the accommodation line",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpPriceDto"
            }
          },
          "product": {
            "description": "Product charged on this line. Always present on POS and extra lines",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDto"
              }
            ]
          },
          "discount": {
            "description": "Promo code applied to this line, when there is one",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpPromoDiscountDto"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "When the line was recorded, as stored: `YYYY-MM-DD HH:MM:SS` in Spain local time (Europe/Madrid), without a time zone. Absent on the lines the PMS derives (accommodation and tourist tax)",
            "example": "2026-01-08 12:00:00"
          },
          "externalOrder": {
            "type": "string",
            "description": "POS delivery note or ticket reference (for example the Agora series and number)",
            "example": "A/000123"
          },
          "parentItemId": {
            "type": "number",
            "description": "ID of the line this one hangs from — the menu header of its delivery note. Absent when the line is not part of a menu. A parent that is not among the lines received is stale, and the line should be rendered on its own",
            "example": 15340
          },
          "refundInvoiceId": {
            "type": "number",
            "description": "ID of the credit note that put this line back on the account: rectifying an invoice returns its lines as pending ones, and each keeps the credit note it came back with. Absent on lines no credit note returned",
            "example": 3022
          },
          "experticket": {
            "description": "Present on the lines of the `experticket` group: the ticket product, its slot and the sale at the venue. When the request is authenticated with an API key, the ticket PDF link and the access and billing codes come back as null and `answers` is omitted",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpExperticketLineDto"
              }
            ]
          },
          "paymentId": {
            "type": "number",
            "description": "ID of the payment the guest paid this line with from the guest web app, while that payment stands. The line may still be on no invoice. Absent otherwise",
            "example": 101
          },
          "itemType": {
            "type": "string",
            "description": "Kind of line as stored (`invoice_has_items.type`), an open set: for example `prePay` for the pair of lines a deposit invoice writes, which add up to zero and are no charge. Absent when the line has none",
            "example": "prePay"
          },
          "accountUnassigned": {
            "type": "boolean",
            "description": "true when the line goes to the default accounting account because its product has no account, or it has no product. Absent otherwise",
            "example": true
          },
          "invoiceItems": {
            "description": "Only on a Revo ticket grouped by the POS settings: the stored lines the ticket is made of",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpRevoTicketLineDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Line total in the property currency, taxes and discounts included",
            "example": 25
          }
        },
        "required": [
          "quantity",
          "total"
        ]
      },
      "gbpBookingDataDto": {
        "type": "object",
        "properties": {
          "values": {
            "description": "Full booking the accommodation lines belong to — same shape as the booking detail",
            "allOf": [
              {
                "$ref": "#/components/schemas/GetBookingResponseDto"
              }
            ]
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking. Read it from `values.id` instead",
            "deprecated": true,
            "example": 789
          },
          "customer": {
            "type": "object",
            "description": "Holder of the booking. Read it from `values.customer` instead",
            "deprecated": true,
            "properties": {
              "name": {
                "type": "string",
                "description": "First name"
              },
              "surname": {
                "type": "string",
                "description": "Last name"
              }
            },
            "example": {
              "name": "John",
              "surname": "Doe"
            }
          },
          "companyId": {
            "type": "number",
            "description": "Company billed for the booking. Read it from `values.companyId` instead",
            "deprecated": true,
            "example": 12
          },
          "guests": {
            "description": "Guests staying in the room. Read them from the booking detail endpoint instead",
            "deprecated": true,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbrGuestDto"
            }
          },
          "data": {
            "description": "Every line of the booking that no integration owns: the accommodation, the tourist tax, the extras of the catalogue, and the pre-payment and discount lines. Lines returned by a credit note are left out",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpBaseDataDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Sum of the lines in `data`",
            "example": 240
          },
          "invoicedStayDifference": {
            "type": "number",
            "description": "What the stay is worth now minus what its accommodation lines add up to (invoiced plus pending), taxes included. Present only when the two differ, which happens when the stay changed after it was invoiced: positive when part of the stay is on no invoice, negative when the invoice charges more than the stay is worth now. Never present for a cancelled or no-show booking charged only the amount it keeps, which is invoiced against that amount",
            "example": 35.5
          }
        },
        "required": [
          "values",
          "bookingId",
          "data",
          "total"
        ]
      },
      "gbpProductDataDto": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "number",
            "description": "ID of the booking these lines were charged to",
            "example": 789
          },
          "data": {
            "description": "Product lines of this integration",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpBaseDataDto"
            }
          },
          "total": {
            "type": "number",
            "description": "Sum of the lines in `data`",
            "example": 74.3
          }
        },
        "required": [
          "bookingId",
          "data",
          "total"
        ]
      },
      "gbpItemDto": {
        "type": "object",
        "properties": {
          "booking": {
            "description": "Accommodation charges, produced by the PMS",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpBookingDataDto"
              }
            ]
          },
          "experticket": {
            "description": "Tickets sold through the Experticket integration. One entry per booking, right after that booking's `booking` entry; these lines are not part of `booking.total`",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDataDto"
              }
            ]
          },
          "revo": {
            "description": "Charges imported from the Revo POS integration. Unlike the `booking` group, lines returned by a credit note are included",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDataDto"
              }
            ]
          },
          "agora": {
            "description": "Charges imported from the Ágora POS integration. Unlike the `booking` group, lines returned by a credit note are included",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDataDto"
              }
            ]
          },
          "spalopia": {
            "description": "Charges imported from the Spalopia spa integration. Unlike the `booking` group, lines returned by a credit note are included",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDataDto"
              }
            ]
          },
          "ticksy": {
            "description": "Charges imported from the Ticksy activities integration. Unlike the `booking` group, lines returned by a credit note are included",
            "allOf": [
              {
                "$ref": "#/components/schemas/gbpProductDataDto"
              }
            ]
          }
        }
      },
      "GetBookingProductsResponseDto": {
        "type": "object",
        "properties": {
          "breakdown": {
            "description": "What was booked, grouped by room type: how many rooms of each type and the occupancy they were priced for. Filled only for a booking that is part of a group; an empty array for a booking on its own",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpBreakdownDto"
            }
          },
          "items": {
            "description": "Charge groups. Each entry has exactly one key, naming where the charges came from: `booking` for the accommodation itself, `experticket` for the tickets sold through Experticket, or one of the POS integrations. In a group, there is one set of entries per booking of the group, which may belong to other properties when the group spans several. Lines of the retired Tiller integration (none since 2022) are not returned",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/gbpItemDto"
            }
          }
        },
        "required": [
          "breakdown",
          "items"
        ]
      },
      "DepositType": {
        "type": "string",
        "enum": [
          "deposit",
          "refund"
        ],
        "description": "Type of deposit: deposit (money received) or refund (money returned)"
      },
      "GetBookingDepositsResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "Unique ID of the deposit",
            "example": 1
          },
          "pcode": {
            "type": "number",
            "description": "Property code this deposit belongs to",
            "example": 123456
          },
          "bookingId": {
            "type": "number",
            "description": "ID of the booking this deposit is linked to",
            "example": 789
          },
          "amount": {
            "type": "number",
            "description": "Amount of the entry, in the currency given by `currency`: positive on a `deposit`, negative on the `refund` that gave it back",
            "example": 150
          },
          "currency": {
            "type": "string",
            "description": "Currency of the deposit as it was stored: the currency symbol (€) for deposits recorded in the PMS, the ISO 4217 code for some recorded by the legacy panel. Not normalised",
            "example": "€"
          },
          "date": {
            "type": "string",
            "description": "Date the deposit was taken (YYYY-MM-DD). Null when it was recorded without one",
            "nullable": true,
            "example": "2025-01-10"
          },
          "observations": {
            "type": "string",
            "description": "Free-text notes about this deposit. Null when none were written",
            "nullable": true,
            "example": "Deposit made at check-in"
          },
          "createdAt": {
            "type": "string",
            "description": "When the deposit was recorded, as an ISO 8601 date-time with a `Z` suffix. Deposits recorded in the PMS hold UTC; older ones recorded by the legacy panel hold Spain local time (Europe/Madrid) under the same suffix",
            "example": "2025-01-10T12:00:00.000Z"
          },
          "paymentId": {
            "type": "number",
            "description": "ID of the payment this deposit was converted into. Absent when it was not converted",
            "example": 101
          },
          "refundId": {
            "type": "number",
            "description": "On a `deposit` entry that was given back, the ID of its `refund` entry. Absent when it was not returned",
            "example": 12
          },
          "type": {
            "description": "Type of deposit: deposit (money received) or refund (money returned)",
            "example": "deposit",
            "allOf": [
              {
                "$ref": "#/components/schemas/DepositType"
              }
            ]
          }
        }
      },
      "GetOtasResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 1,
            "description": "Unique identifier of the OTA. Use this value to match the `otaId` field in booking responses. `0` is the property itself (direct sale at reception)"
          },
          "name": {
            "type": "string",
            "example": "Booking.com",
            "description": "Display name of the OTA (e.g. Booking.com, Expedia, Airbnb)"
          },
          "color": {
            "type": "string",
            "example": "#1E90FF",
            "description": "Brand color of the OTA for UI display, usually a hex code. Empty string when the channel has none"
          }
        },
        "required": [
          "id",
          "name",
          "color"
        ]
      },
      "RmsPushItemDto": {
        "type": "object",
        "properties": {
          "StartUtc": {
            "type": "string",
            "example": "2026-08-25",
            "description": "First day of the range (YYYY-MM-DD), from yesterday onwards"
          },
          "EndUtc": {
            "type": "string",
            "example": "2026-08-31",
            "description": "Last day of the range (YYYY-MM-DD), included and not before `StartUtc`. `Endutc` is accepted too"
          },
          "Value": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "example": "129.90",
            "description": "Price of each day of the range, up to two decimals. `0` clears the price of those days"
          },
          "stop_sell": {
            "oneOf": [
              {
                "type": "number",
                "enum": [
                  0,
                  1
                ]
              },
              {
                "type": "boolean"
              }
            ],
            "example": 1,
            "description": "Closes (`1`) or opens (`0`) sale on those days. Accepted but not applied yet: it comes back in `ignored`"
          },
          "min_stay": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "example": 2,
            "description": "Minimum stay in nights, 0 to 999. `min_stay_through` wins when both are sent"
          },
          "min_stay_through": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "example": 2,
            "description": "Minimum stay in nights for any stay that includes those days, 0 to 999"
          },
          "max_stay": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "example": 14,
            "description": "Maximum stay in nights, 0 to 999. Accepted but not applied yet: it comes back in `ignored`"
          }
        },
        "required": [
          "StartUtc",
          "EndUtc"
        ]
      },
      "CrmBookingChangeDto": {
        "type": "object",
        "properties": {
          "pcode": {
            "type": "number",
            "example": 114,
            "description": "Property code"
          },
          "rscode": {
            "type": "number",
            "example": 52341,
            "description": "Booking id. `reservation_id` and `id` carry the same value, as in the legacy export"
          },
          "reservation_id": {
            "type": "number",
            "example": 52341,
            "description": "Booking id, same as `rscode`"
          },
          "id": {
            "type": "number",
            "example": 52341,
            "description": "Booking id, same as `rscode`"
          },
          "extcode": {
            "type": "number",
            "example": 1873,
            "description": "Booking number the property sees (`reservation_code`)"
          },
          "correlative": {
            "type": "number",
            "nullable": true,
            "example": null,
            "description": "Correlative number of the booking"
          },
          "multibook": {
            "type": "number",
            "nullable": true,
            "example": null,
            "description": "Group the booking belongs to, when it is part of one"
          },
          "channelcode": {
            "type": "string",
            "nullable": true,
            "example": "4417230981",
            "description": "Booking code on the channel it came from"
          },
          "channel_reservation_code": {
            "type": "string",
            "nullable": true,
            "example": "4417230981",
            "description": "Same value as `channelcode`"
          },
          "rcode": {
            "type": "number",
            "nullable": true,
            "example": 1551809177,
            "description": "Room assigned, or `null` while none is"
          },
          "rtcode": {
            "type": "number",
            "nullable": true,
            "example": 101,
            "description": "Room type"
          },
          "subroom": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "Sub-room of the room assigned"
          },
          "amount": {
            "type": "number",
            "nullable": true,
            "example": 240,
            "description": "Amount of the booking"
          },
          "orig_amount": {
            "type": "number",
            "nullable": true,
            "example": 260,
            "description": "Amount before the discount"
          },
          "discount": {
            "type": "number",
            "nullable": true,
            "example": 20,
            "description": "Discount applied"
          },
          "discount_type": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "How `discount` reads: `1` a percentage per night, `2` an amount on the whole stay, any other value an amount per night"
          },
          "price": {
            "type": "number",
            "nullable": true,
            "example": 240,
            "description": "Price of the stay"
          },
          "pay": {
            "type": "number",
            "nullable": true,
            "example": 100,
            "description": "Amount paid"
          },
          "date_received": {
            "type": "string",
            "nullable": true,
            "example": "2026-10-01",
            "description": "Day the booking was received, `YYYY-MM-DD`"
          },
          "date_arrival": {
            "type": "string",
            "nullable": true,
            "example": "2026-11-05",
            "description": "Arrival, `YYYY-MM-DD`"
          },
          "date_departure": {
            "type": "string",
            "nullable": true,
            "example": "2026-11-07",
            "description": "Departure, `YYYY-MM-DD`"
          },
          "arrival_hour": {
            "type": "string",
            "nullable": true,
            "example": "16:00",
            "description": "Arrival time the guest gave"
          },
          "board": {
            "type": "string",
            "nullable": true,
            "example": "bb",
            "description": "`nb` room only, `bb` breakfast, `hb` half board, `fb` full board, `ai` all inclusive"
          },
          "policy": {
            "type": "number",
            "nullable": true,
            "example": 4,
            "description": "Cancellation policy id"
          },
          "roomnight": {
            "type": "number",
            "nullable": true,
            "example": 2,
            "description": "Nights"
          },
          "checkin": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "`1` once the guest checked in"
          },
          "checkout": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "`1` once the guest checked out"
          },
          "promo_code": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Promo code used"
          },
          "men": {
            "type": "number",
            "nullable": true,
            "example": 2,
            "description": "Adults; `-1` when the booking does not say"
          },
          "person": {
            "type": "number",
            "nullable": true,
            "example": 2,
            "description": "Guests (`occupancy`)"
          },
          "children": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "Children"
          },
          "device": {
            "type": "number",
            "nullable": true,
            "example": null,
            "description": "Device the booking was made from, when known"
          },
          "customer_notes": {
            "type": "string",
            "nullable": true,
            "example": "Late arrival",
            "description": "Notes the guest left on the booking"
          },
          "customer_holder": {
            "type": "string",
            "nullable": true,
            "example": "Jane Doe",
            "description": "Name the booking is held under"
          },
          "host_name": {
            "type": "string",
            "nullable": true,
            "example": "Jane",
            "description": "First name of the guest staying"
          },
          "host_surname": {
            "type": "string",
            "nullable": true,
            "example": "Doe",
            "description": "Surname of the guest staying"
          },
          "customer_language_iso": {
            "type": "string",
            "nullable": true,
            "example": "en",
            "description": "Language of the booking, ISO 639-1"
          },
          "bussines": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "`1` for a business booking"
          },
          "pack": {
            "type": "number",
            "nullable": true,
            "example": null,
            "description": "Pack booked, when one was"
          },
          "id_channel": {
            "type": "number",
            "nullable": true,
            "example": 9,
            "description": "Channel id; `0` is the property’s own sale"
          },
          "ota": {
            "type": "string",
            "nullable": true,
            "example": "Booking.com",
            "description": "Channel name"
          },
          "status": {
            "type": "number",
            "nullable": true,
            "example": 1,
            "description": "Legacy status code: `1` confirmed, `2` temporarily cancelled, `4` tentative, `5` cancelled"
          },
          "booked_rate": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Rate booked, as the channel named it"
          },
          "preCheckin": {
            "type": "number",
            "nullable": true,
            "example": 0,
            "description": "`1` once the guest completed the online check-in"
          },
          "customer_id": {
            "type": "number",
            "nullable": true,
            "example": 880123,
            "description": "Guest id"
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Jane",
            "description": "Guest first name"
          },
          "surname": {
            "type": "string",
            "nullable": true,
            "example": "Doe",
            "description": "Guest surname"
          },
          "email": {
            "type": "string",
            "nullable": true,
            "example": "guest@example.invalid",
            "description": "Guest email"
          },
          "phone": {
            "type": "string",
            "nullable": true,
            "example": "+34600000000",
            "description": "Guest phone"
          },
          "province": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Guest province"
          },
          "country": {
            "type": "string",
            "nullable": true,
            "example": "España",
            "description": "Guest country, by name as the guest record holds it (the guest form and the kiosk store the name, e.g. `España`). Not a code: older records may hold anything typed by hand"
          },
          "city": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Guest city"
          },
          "address": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Guest address"
          },
          "zip": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Guest postcode"
          },
          "notes": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Notes on the guest record"
          },
          "type_vat": {
            "type": "string",
            "nullable": true,
            "example": "D",
            "description": "Type of the guest’s identity document, as the booking detail’s `documentType` (`P` passport, `D` DNI, `I` identity card…); older records may hold another value"
          },
          "vat": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Number of the guest’s identity document (or tax id), as `type_vat` says"
          },
          "birthdate": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Date of birth, `YYYY-MM-DD`; `null` when unknown"
          },
          "language": {
            "type": "number",
            "nullable": true,
            "example": 2,
            "description": "Guest language, legacy id"
          },
          "language_iso": {
            "type": "string",
            "nullable": true,
            "example": "en",
            "description": "Guest language, ISO 639-1"
          },
          "sex": {
            "type": "string",
            "nullable": true,
            "example": "F",
            "description": "Sex"
          },
          "nationality": {
            "type": "string",
            "nullable": true,
            "example": "España",
            "description": "Nationality, by name as the guest record holds it, like `country`. Not a code"
          },
          "marketing": {
            "type": "number",
            "nullable": true,
            "example": 1,
            "description": "`1` when the guest accepted marketing communications, `0` when not. Passed through as the property recorded it: what to do with it is the property’s decision"
          },
          "name_property": {
            "type": "string",
            "nullable": true,
            "example": "Hotel Demo",
            "description": "Property name"
          },
          "address_property": {
            "type": "string",
            "nullable": true,
            "example": "Calle Mayor",
            "description": "Property street"
          },
          "num_property": {
            "type": "string",
            "nullable": true,
            "example": "1",
            "description": "Property street number, as text: the property types it (`12`, `12 B`, `s/n`). The one number of the feed that is not a JSON number"
          },
          "zip_property": {
            "type": "string",
            "nullable": true,
            "example": "28001",
            "description": "Property postcode"
          },
          "city_property": {
            "type": "string",
            "nullable": true,
            "example": "Madrid",
            "description": "Property city"
          },
          "province_property": {
            "type": "string",
            "nullable": true,
            "example": "Madrid",
            "description": "Property province"
          },
          "sub_name_property": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "Property secondary name"
          },
          "name_room": {
            "type": "string",
            "nullable": true,
            "example": "Double 101",
            "description": "Room name"
          },
          "shortname": {
            "type": "string",
            "nullable": true,
            "example": "101",
            "description": "Room short name"
          },
          "last_modified": {
            "type": "string",
            "example": "2026-10-15T08:59:12.000Z",
            "description": "When the booking row last changed, ISO 8601 in UTC, to the second. Not in the legacy export: the order of the feed"
          }
        },
        "required": [
          "pcode",
          "rscode",
          "reservation_id",
          "id",
          "extcode",
          "correlative",
          "multibook",
          "channelcode",
          "channel_reservation_code",
          "rcode",
          "rtcode",
          "subroom",
          "amount",
          "orig_amount",
          "discount",
          "discount_type",
          "price",
          "pay",
          "date_received",
          "date_arrival",
          "date_departure",
          "arrival_hour",
          "board",
          "policy",
          "roomnight",
          "checkin",
          "checkout",
          "promo_code",
          "men",
          "person",
          "children",
          "device",
          "customer_notes",
          "customer_holder",
          "host_name",
          "host_surname",
          "customer_language_iso",
          "bussines",
          "pack",
          "id_channel",
          "ota",
          "status",
          "booked_rate",
          "preCheckin",
          "customer_id",
          "name",
          "surname",
          "email",
          "phone",
          "province",
          "country",
          "city",
          "address",
          "zip",
          "notes",
          "type_vat",
          "vat",
          "birthdate",
          "language",
          "language_iso",
          "sex",
          "nationality",
          "marketing",
          "name_property",
          "address_property",
          "num_property",
          "zip_property",
          "city_property",
          "province_property",
          "sub_name_property",
          "name_room",
          "shortname",
          "last_modified"
        ]
      },
      "GetCrmBookingChangesResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "The bookings changed in the window, oldest change first, 50 per page, each with its guest, its property and its room under the legacy CRM export field names",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmBookingChangeDto"
            }
          },
          "until": {
            "type": "string",
            "example": "2026-10-15T09:00:00.000Z",
            "description": "The end of the window, ISO in UTC, fixed by the first page and the same on every page of it. Once `nextCursor` is null, it is the `since` of your next poll"
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "eyJ2IjoxLCJzIjoiMjAyNi0xMC0xNVQwODowMDowMC4wMDBaIn0",
            "description": "Pass it as `cursor` to read the next page of the same window. `null` when this page came with fewer than 50 bookings; a last page of exactly 50 still carries a cursor, and the page it leads to comes empty with `null`"
          }
        },
        "required": [
          "data",
          "until",
          "nextCursor"
        ]
      },
      "PartnerRoomStatus": {
        "type": "string",
        "enum": [
          "ready",
          "clean",
          "dirty"
        ],
        "description": "The state the room is in now. `ready`: cleaned and inspected, ready for the next guest. `clean`: cleaned, waiting to be inspected. `dirty`: to be cleaned"
      },
      "SetRoomStatusDto": {
        "type": "object",
        "properties": {
          "doorNum": {
            "type": "string",
            "example": "101",
            "maxLength": 80,
            "description": "The door number of the room, as text and as the property wrote it: the `doorNum` of the room in `GET /rooms/{pcode}/types`. Never a JSON number. Blanks around it do not count"
          },
          "status": {
            "example": "clean",
            "description": "The state the room is in now. `ready`: cleaned and inspected, ready for the next guest. `clean`: cleaned, waiting to be inspected. `dirty`: to be cleaned",
            "allOf": [
              {
                "$ref": "#/components/schemas/PartnerRoomStatus"
              }
            ]
          }
        },
        "required": [
          "doorNum",
          "status"
        ]
      },
      "SetRoomStatusResponseDto": {
        "type": "object",
        "properties": {
          "roomId": {
            "type": "number",
            "example": 2014,
            "description": "ID of the room the door number names"
          },
          "doorNum": {
            "type": "string",
            "example": "101",
            "description": "Door number of the room, as the property wrote it"
          },
          "status": {
            "example": "clean",
            "description": "The state the room is in now, as `GET /rooms/{pcode}/types` returns it: the one that was sent",
            "allOf": [
              {
                "$ref": "#/components/schemas/RoomStatus"
              }
            ]
          },
          "changed": {
            "type": "boolean",
            "example": true,
            "description": "False when the room was already in that state: nothing was written, so a request can be safely sent again"
          }
        },
        "required": [
          "roomId",
          "doorNum",
          "status",
          "changed"
        ]
      },
      "RegisterKioskGuestDto": {
        "type": "object",
        "properties": {
          "holder": {
            "type": "boolean",
            "example": true,
            "description": "This guest is who the booking is for. Their record on the booking is completed with the document, and the booking is put in their name. Leave it out, or `false`, for everybody else."
          },
          "name": {
            "type": "string",
            "example": "Lucía",
            "description": "Given name, as the document prints it"
          },
          "surname": {
            "type": "string",
            "example": "García López",
            "description": "Surnames, as the document prints them"
          },
          "documentType": {
            "type": "string",
            "enum": [
              "P",
              "D",
              "C",
              "MI",
              "I",
              "N",
              "X",
              "E",
              "IDX",
              "ID",
              "50"
            ],
            "example": "P",
            "description": "`P` passport, `D` Spanish DNI, `I` identity card of another country, `N` Spanish residence permit (NIE), `X` foreign residence permit, `C` driving licence, `MI` undocumented minor"
          },
          "documentNumber": {
            "type": "string",
            "example": "XDC123456",
            "description": "Number of the document, up to 15 characters. Required except for `MI`"
          },
          "documentSupport": {
            "type": "string",
            "example": "BAA000589",
            "description": "Support number of a Spanish DNI or NIE. The police registration refuses an adult with one of those documents without it"
          },
          "issuingState": {
            "type": "string",
            "example": "ESP",
            "description": "Country that issued the document, ISO 3166-1 alpha-3"
          },
          "issueDate": {
            "type": "string",
            "example": "2021-05-19",
            "description": "Issue date, `YYYY-MM-DD`"
          },
          "expirationDate": {
            "type": "string",
            "example": "2031-05-19",
            "description": "Expiry date, `YYYY-MM-DD`"
          },
          "sex": {
            "type": "string",
            "enum": [
              "M",
              "F",
              "O"
            ],
            "example": "F",
            "description": "As the document prints it: `M` male, `F` female, `O` other"
          },
          "birthDate": {
            "type": "string",
            "example": "1988-02-14",
            "description": "Date of birth, `YYYY-MM-DD`"
          },
          "nationality": {
            "type": "string",
            "example": "ESP",
            "description": "Nationality, ISO 3166-1 alpha-3"
          },
          "country": {
            "type": "string",
            "example": "ESP",
            "description": "Country of residence, ISO 3166-1 alpha-3. The nationality when left out"
          },
          "address": {
            "type": "string",
            "example": "Calle Mayor 1, 2º B"
          },
          "postalCode": {
            "type": "string",
            "example": "28013"
          },
          "city": {
            "type": "string",
            "example": "Madrid"
          },
          "province": {
            "type": "string",
            "example": "Madrid",
            "description": "Province, for a residence in Spain"
          },
          "municipality": {
            "type": "string",
            "example": "Madrid",
            "description": "Municipality, for a residence in Spain"
          },
          "email": {
            "type": "string",
            "example": "lucia@example.com"
          },
          "phone": {
            "type": "string",
            "example": "+34600000000"
          },
          "relationship": {
            "type": "string",
            "enum": [
              "AB",
              "BA",
              "BN",
              "CY",
              "CD",
              "HR",
              "HJ",
              "PM",
              "NI",
              "SB",
              "SG",
              "TI",
              "YN",
              "TU",
              "OT"
            ],
            "description": "Relationship to the holder, which the police registration asks for a minor: `PM` parent, `TU` guardian, `HJ` child, `OT` other…"
          },
          "signatureImage": {
            "type": "string",
            "description": "The guest’s signature, a JPEG as a data URI"
          },
          "documentFrontImage": {
            "type": "string",
            "description": "Front of the document, a JPEG as a data URI. Kept only while the property stores document images"
          },
          "documentBackImage": {
            "type": "string",
            "description": "Back of the document, a JPEG as a data URI. Kept only while the property stores document images"
          },
          "documentPortraitImage": {
            "type": "string",
            "description": "Photo of the document holder, a JPEG as a data URI. Kept only while the property stores document images"
          }
        },
        "required": [
          "name",
          "surname",
          "documentType",
          "sex",
          "birthDate",
          "nationality"
        ]
      },
      "RegisterKioskGuestResponseDto": {
        "type": "object",
        "properties": {
          "guestId": {
            "type": "number",
            "example": 4471203,
            "description": "ID of the guest on the booking. The same one when the document was already on it: sending a guest again updates them in place"
          }
        },
        "required": [
          "guestId"
        ]
      },
      "AddKioskPaymentDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "example": "RMK-20261103-000123",
            "description": "The kiosk's own id for the transaction, 1 to 50 characters: letters, digits, `.`, `_`, `/` or `-`. It is stored as the payment's reference behind your partner slug (`<slug>:<transactionId>`), and sending the same transaction again never records it twice."
          },
          "amount": {
            "type": "number",
            "example": 246,
            "description": "Amount collected, in the property currency, more than 0, up to two decimals"
          },
          "method": {
            "type": "string",
            "enum": [
              "card",
              "cash"
            ],
            "example": "card",
            "description": "How the guest paid: `card` or `cash`"
          },
          "collectedAt": {
            "type": "string",
            "example": "2026-11-03T15:10:00+01:00",
            "description": "When it was collected, ISO 8601 with its offset. The payment is dated on that day, in the property time zone"
          }
        },
        "required": [
          "transactionId",
          "amount",
          "method",
          "collectedAt"
        ]
      },
      "AddKioskPaymentResponseDto": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "example": "RMK-20261103-000123",
            "description": "The kiosk’s own id for the transaction, as it was sent"
          },
          "replayed": {
            "type": "boolean",
            "description": "True when the payment was already on the booking and nothing was written this time: a resend of the same transaction",
            "example": false
          },
          "paymentId": {
            "type": "number",
            "description": "ID of the payment on the booking, as `GET /api/v2/bookings/{pcode}/payments/{bookingId}` lists it",
            "example": 13214021
          },
          "amount": {
            "type": "number",
            "description": "Amount recorded",
            "example": 246
          }
        },
        "required": [
          "transactionId",
          "replayed",
          "paymentId",
          "amount"
        ]
      },
      "KioskDoorKeyStatus": {
        "type": "string",
        "enum": [
          "none",
          "keyWithoutPin",
          "pin"
        ],
        "description": "`pin`: the PIN of the room door is in `pin`. `keyWithoutPin`: the booking has a key but no PIN to give the guest (a card, a link, the fixed code of the room, or a lock system that did not return one): reception hands it. `none`: no key was issued for the booking, or its room has no lock"
      },
      "GetKioskDoorKeyResponseDto": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "number",
            "example": 789,
            "description": "ID of the booking, as it was asked for"
          },
          "status": {
            "example": "pin",
            "description": "`pin`: the PIN of the room door is in `pin`. `keyWithoutPin`: the booking has a key but no PIN to give the guest (a card, a link, the fixed code of the room, or a lock system that did not return one): reception hands it. `none`: no key was issued for the booking, or its room has no lock",
            "allOf": [
              {
                "$ref": "#/components/schemas/KioskDoorKeyStatus"
              }
            ]
          },
          "pin": {
            "type": "string",
            "nullable": true,
            "example": "0482",
            "description": "The PIN as the lock system issued it: a string, digits with their leading zeros. Null unless `status` is `pin`"
          }
        },
        "required": [
          "bookingId",
          "status",
          "pin"
        ]
      },
      "DoorKeyWriteState": {
        "type": "string",
        "enum": [
          "keyWithoutPin",
          "none"
        ],
        "description": "`keyWithoutPin`: the booking has a key, but no PIN to give the guest (a card, a link); the guest is sent to reception. `none`: the booking has no key any more, e.g. it was cancelled or moved to a room your PIN does not open. Send either `pin` or `state`, not both"
      },
      "SetDoorKeyDto": {
        "type": "object",
        "properties": {
          "pin": {
            "type": "string",
            "pattern": "^\\d{4,8}$",
            "minLength": 4,
            "maxLength": 8,
            "example": "0427",
            "description": "The PIN your system issued for this booking, as text: digits only, 4 to 8 of them, leading zeros kept. Never a JSON number. All zeros and zeros ending in 1 (`0000`, `0001`) are refused: older readers of the booking take them for \"no key\". Send either `pin` or `state`, not both"
          },
          "state": {
            "example": "none",
            "description": "`keyWithoutPin`: the booking has a key, but no PIN to give the guest (a card, a link); the guest is sent to reception. `none`: the booking has no key any more, e.g. it was cancelled or moved to a room your PIN does not open. Send either `pin` or `state`, not both",
            "allOf": [
              {
                "$ref": "#/components/schemas/DoorKeyWriteState"
              }
            ]
          }
        }
      },
      "SetDoorKeyResponseDto": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "number",
            "example": 789,
            "description": "ID of the booking, as it was sent"
          },
          "status": {
            "example": "pin",
            "description": "The key the booking has now, as every reader of the door key sees it: `pin` (a PIN is stored), `keyWithoutPin` (a key that carries no PIN) or `none` (no key). The PIN itself is never sent back",
            "allOf": [
              {
                "$ref": "#/components/schemas/KioskDoorKeyStatus"
              }
            ]
          },
          "changed": {
            "type": "boolean",
            "example": true,
            "description": "False when the booking already had exactly this key: nothing was written and nothing was recorded, so a request can be safely sent again"
          }
        },
        "required": [
          "bookingId",
          "status",
          "changed"
        ]
      },
      "InHouseOccupancyDto": {
        "type": "object",
        "properties": {
          "adults": {
            "type": "number",
            "example": 2,
            "description": "Adults in the room; `-1` when the booking does not say"
          },
          "children": {
            "type": "number",
            "example": 0,
            "description": "Children in the room"
          }
        },
        "required": [
          "adults",
          "children"
        ]
      },
      "InHouseRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the room",
            "example": 1619202529,
            "nullable": true
          },
          "roomTypeId": {
            "type": "number",
            "description": "ID of its room type",
            "example": 101,
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "Name of the room",
            "example": "Suite 203",
            "nullable": true
          },
          "doorNum": {
            "type": "string",
            "description": "Door number, as the staff knows the room",
            "example": "203",
            "nullable": true
          }
        },
        "required": [
          "id",
          "roomTypeId",
          "name",
          "doorNum"
        ]
      },
      "InHouseGuestDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Laura",
            "description": "First name"
          },
          "surname": {
            "type": "string",
            "example": "García",
            "description": "Last name"
          }
        },
        "required": [
          "name",
          "surname"
        ]
      },
      "InHouseBookingDto": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "number",
            "description": "ID of the booking: the one a POS ticket is posted to",
            "example": 789
          },
          "start": {
            "type": "string",
            "description": "Arrival date (YYYY-MM-DD)",
            "example": "2026-10-06"
          },
          "end": {
            "type": "string",
            "description": "Departure date (YYYY-MM-DD)",
            "example": "2026-10-09"
          },
          "board": {
            "type": "string",
            "enum": [
              "nb",
              "bb",
              "hb",
              "fb",
              "ai",
              "pack"
            ],
            "description": "Board of the stay: `nb` room only, `bb` breakfast, `hb` half board, `fb` full board, `ai` all inclusive; `pack` on the rare booking whose board is the one of the pack it was booked with",
            "example": "hb"
          },
          "occupancy": {
            "$ref": "#/components/schemas/InHouseOccupancyDto"
          },
          "room": {
            "$ref": "#/components/schemas/InHouseRoomDto"
          },
          "guest": {
            "description": "The booking holder",
            "allOf": [
              {
                "$ref": "#/components/schemas/InHouseGuestDto"
              }
            ]
          }
        },
        "required": [
          "bookingId",
          "start",
          "end",
          "board",
          "occupancy",
          "room",
          "guest"
        ]
      },
      "GetInHouseBookingsResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "The bookings in house, sorted by door number as text (`10` before `9`), bookings without a room first",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InHouseBookingDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "PosTicketLineDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "Menú del día",
            "description": "What was served, as the ticket prints it"
          },
          "quantity": {
            "type": "number",
            "example": 2,
            "description": "Units, more than 0, up to two decimals"
          },
          "unitPrice": {
            "type": "number",
            "example": 18.5,
            "description": "Price of one unit, taxes included, up to two decimals. 0 or more"
          },
          "taxRate": {
            "type": "number",
            "example": 10,
            "description": "Tax rate as a percentage (10 for 10 %), 0 to 99.99"
          }
        },
        "required": [
          "name",
          "quantity",
          "unitPrice",
          "taxRate"
        ]
      },
      "AddPosTicketDto": {
        "type": "object",
        "properties": {
          "ticketId": {
            "type": "string",
            "example": "T-2026-000123",
            "description": "The POS's own id for the ticket, 1 to 22 characters: letters, digits, `.`, `_`, `/` or `-`. Sending the same ticket again never charges it twice."
          },
          "consumedAt": {
            "type": "string",
            "example": "2026-10-07T21:34:00+02:00",
            "description": "When the ticket was closed, ISO 8601 with its offset. The charge is dated on that day, in the property time zone"
          },
          "lines": {
            "description": "The lines of the ticket, 1 to 200",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PosTicketLineDto"
            }
          }
        },
        "required": [
          "ticketId",
          "consumedAt",
          "lines"
        ]
      },
      "AddPosTicketItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "description": "ID of the charge on the booking",
            "example": 22898324
          },
          "name": {
            "type": "string",
            "example": "Menú del día",
            "description": "Name of the line: as the POS sent it on the first answer; on a resend (`replayed: true`) as it was stored, where an apostrophe `'` becomes `´`"
          },
          "quantity": {
            "type": "number",
            "example": 2,
            "description": "Units charged"
          },
          "unitPrice": {
            "type": "number",
            "description": "Price of one unit, taxes included. On a resend it is worked back from the stored net price, and can differ from what was sent by a cent",
            "example": 18.5
          },
          "taxRate": {
            "type": "number",
            "description": "Tax rate as a percentage",
            "example": 10
          }
        },
        "required": [
          "id",
          "name",
          "quantity",
          "unitPrice",
          "taxRate"
        ]
      },
      "AddPosTicketResponseDto": {
        "type": "object",
        "properties": {
          "ticketId": {
            "type": "string",
            "example": "T-2026-000123",
            "description": "The POS’s own id for the ticket, as it was sent"
          },
          "replayed": {
            "type": "boolean",
            "description": "True when the ticket was already on the booking and nothing was written this time: a resend of the same ticket",
            "example": false
          },
          "total": {
            "type": "number",
            "description": "Sum of the lines, taxes included",
            "example": 37
          },
          "items": {
            "description": "One charge per line of the ticket",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AddPosTicketItemDto"
            }
          }
        },
        "required": [
          "ticketId",
          "replayed",
          "total",
          "items"
        ]
      },
      "RmsOnTheBooksNightDto": {
        "type": "object",
        "properties": {
          "day": {
            "type": "string",
            "example": "2026-10-05",
            "description": "Night"
          },
          "price": {
            "type": "number",
            "example": 92.5,
            "description": "Price of the night: the room with its board, as the rate sold it. Extras are not in it: they come in `extras` and `extras_excl_tax`"
          },
          "board": {
            "type": "string",
            "example": "bb",
            "nullable": true,
            "description": "Board of the night"
          },
          "extras_excl_tax": {
            "type": "string",
            "example": "0.0000",
            "nullable": true,
            "description": "Extras of the night without tax, a decimal as text with four decimals"
          },
          "extras": {
            "type": "string",
            "example": "0.0000",
            "nullable": true,
            "description": "Extras of the night, a decimal as text with four decimals"
          },
          "netPrice": {
            "type": "number",
            "example": 84.09,
            "description": "The night without tax (`price` / (1 + `taxRate` / 100)); `price` itself when the property enters its prices without tax. Extras excluded: the night without tax plus its extras without tax is `netPrice` + `extras_excl_tax`"
          }
        },
        "required": [
          "day",
          "price",
          "board",
          "extras_excl_tax",
          "extras",
          "netPrice"
        ]
      },
      "RmsOnTheBooksExtraDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 512340,
            "description": "Id of the item on the booking"
          },
          "productId": {
            "type": "number",
            "example": 87,
            "nullable": true,
            "description": "Product sold"
          },
          "name": {
            "type": "string",
            "example": "Parking",
            "description": "What was sold"
          },
          "category": {
            "type": "string",
            "example": "Services",
            "nullable": true,
            "description": "Its category"
          },
          "dateFrom": {
            "type": "string",
            "example": "2026-10-05",
            "nullable": true,
            "description": "First day"
          },
          "dateTo": {
            "type": "string",
            "example": "2026-10-07",
            "nullable": true,
            "description": "Last day"
          },
          "units": {
            "type": "number",
            "example": 2,
            "description": "Units sold"
          },
          "unitPrice": {
            "type": "number",
            "example": 10,
            "description": "Price of one unit, without tax"
          },
          "netPrice": {
            "type": "number",
            "example": 20,
            "description": "`units` × `unitPrice`, without tax"
          },
          "pvpPrice": {
            "type": "number",
            "example": 24.2,
            "description": "What the guest pays for it, tax included"
          },
          "taxRate": {
            "type": "number",
            "example": 21,
            "description": "Tax of the item, a percentage"
          }
        },
        "required": [
          "id",
          "productId",
          "name",
          "category",
          "dateFrom",
          "dateTo",
          "units",
          "unitPrice",
          "netPrice",
          "pvpPrice",
          "taxRate"
        ]
      },
      "RmsOnTheBooksBookingDto": {
        "type": "object",
        "properties": {
          "Fecha_Estancia": {
            "type": "string",
            "example": "2026-10-05",
            "description": "One night of the stay, not a specific one: which night is not fixed, as in the legacy export. Read the nights from `PrecioNoche`"
          },
          "Importe": {
            "type": "number",
            "example": 185,
            "description": "Sum of the prices of every night of the booking (`PrecioNoche`), whatever the date range asked for"
          },
          "PrecioNoche": {
            "description": "Every night with its price",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsOnTheBooksNightDto"
            }
          },
          "Hotel": {
            "type": "string",
            "example": "Hotel Demo",
            "description": "Property name"
          },
          "pcode": {
            "type": "number",
            "example": 1234,
            "description": "Property code"
          },
          "Reserva_ID": {
            "type": "number",
            "example": 100684613,
            "description": "Booking id"
          },
          "Fecha_Reserva": {
            "type": "string",
            "example": "2026-09-20",
            "nullable": true,
            "description": "Date received"
          },
          "Fecha_Llegada": {
            "type": "string",
            "example": "2026-10-05",
            "nullable": true,
            "description": "Arrival"
          },
          "Fecha_Salida": {
            "type": "string",
            "example": "2026-10-07",
            "nullable": true,
            "description": "Departure"
          },
          "Fecha_Anulacion": {
            "type": "string",
            "example": "",
            "nullable": true,
            "description": "YYYY-MM-DD HH:MM:SS, the server time in Spain; empty on a confirmed booking. On a cancelled booking (`Estado` `anulada`), when it was cancelled. When it entered the cancellation it is in now: the first cancellation its history records after the last status change that brought it back, so a cancellation recorded again later (a channel manager notifying it twice) does not move it; never later than the last change of the booking. A booking whose history records no cancellation (some imported or very old ones) gives its last change instead, which any edit after the cancellation moves. On any other booking that is not confirmed, its last change"
          },
          "Pension": {
            "type": "string",
            "example": "bb",
            "description": "Board"
          },
          "Provincia": {
            "type": "string",
            "example": "Madrid",
            "nullable": true,
            "description": "Guest province"
          },
          "Adultos": {
            "type": "number",
            "example": 2,
            "description": "Adults; `-1` when the booking does not say"
          },
          "Ninos": {
            "type": "number",
            "example": 0,
            "description": "Children"
          },
          "Estado": {
            "type": "string",
            "example": "confirmada",
            "enum": [
              "confirmada",
              "anulada",
              "cancelacion temporal",
              ""
            ],
            "description": "Status as the legacy export names it: `anulada` covers cancelled, no-show and temporarily cancelled bookings, and a tentative one comes empty. Read `bookingStatus` to tell them apart"
          },
          "Habitacion": {
            "type": "string",
            "example": "Double room",
            "nullable": true,
            "description": "Room type"
          },
          "Agencia": {
            "type": "string",
            "example": "Booking.com",
            "description": "Channel, by the name the channel list gives it. The property’s own sale is channel `0`, which comes with its name in that list (`Recepcion`); `WebPage` only when the channel is not in the list"
          },
          "Segmento": {
            "type": "string",
            "example": "Leisure",
            "nullable": true,
            "description": "Market segment"
          },
          "Customer_type": {
            "type": "string",
            "example": "individuales",
            "enum": [
              "bloques",
              "individuales"
            ],
            "description": "`bloques` when the booking is part of a group"
          },
          "Pais": {
            "type": "string",
            "example": "ES",
            "description": "Guest nationality, ISO 3166-1 alpha-2; an empty string when the guest record has none or holds something that is not a country code"
          },
          "Edad": {
            "type": "string",
            "example": "41",
            "nullable": true,
            "description": "Guest age in years"
          },
          "Rate_Code": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "enum": [
                  ""
                ]
              }
            ],
            "example": 48123,
            "description": "The channel rate of its occupancy, board, policy and channel (the `id` in `GET /api/integrations/{pcode}/rms/rates`, what a push names in `rateId`), or an empty string when there is none"
          },
          "roomTypeId": {
            "type": "number",
            "example": 1551809814,
            "description": "The room type booked: `Codigo_habitacion` in `capList`, `roomTypeId` in the rest of the API"
          },
          "currency": {
            "type": "string",
            "example": "EUR",
            "description": "ISO 4217 code of the currency every amount is in"
          },
          "commission": {
            "type": "number",
            "example": 33.3,
            "description": "The channel's commission on the whole booking, an amount in `currency`"
          },
          "taxRate": {
            "type": "number",
            "example": 10,
            "nullable": true,
            "description": "The property's tax on the stay, a percentage; null when it has none set"
          },
          "extras": {
            "description": "What the booking sold besides the stay",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsOnTheBooksExtraDto"
            }
          },
          "bookingStatus": {
            "type": "string",
            "enum": [
              "ready",
              "tentative",
              "cancelled",
              "no-show",
              "temporary-cancelled"
            ],
            "example": "ready",
            "description": "Status of the booking, as the rest of the API names it"
          }
        },
        "required": [
          "Fecha_Estancia",
          "Importe",
          "PrecioNoche",
          "Hotel",
          "pcode",
          "Reserva_ID",
          "Fecha_Reserva",
          "Fecha_Llegada",
          "Fecha_Salida",
          "Fecha_Anulacion",
          "Pension",
          "Provincia",
          "Adultos",
          "Ninos",
          "Estado",
          "Habitacion",
          "Agencia",
          "Segmento",
          "Customer_type",
          "Pais",
          "Edad",
          "Rate_Code",
          "roomTypeId",
          "currency",
          "commission",
          "taxRate",
          "extras",
          "bookingStatus"
        ]
      },
      "RmsOnTheBooksCapacityDto": {
        "type": "object",
        "properties": {
          "Hotel": {
            "type": "string",
            "example": "Hotel Demo",
            "description": "Property name"
          },
          "pcode": {
            "type": "number",
            "example": 1234,
            "description": "Property code, as a number (as in `rsvList`)"
          },
          "Fecha": {
            "type": "string",
            "example": "2026-10-05",
            "description": "Day"
          },
          "Habitacion": {
            "type": "string",
            "example": "Double room",
            "description": "Room type, by name. Rows are per name: two room types with the same name come as one row"
          },
          "Codigo_habitacion": {
            "type": "string",
            "example": "101",
            "description": "Room type id, as text. On a row that folds two room types of the same name, one of them"
          },
          "Vendidas": {
            "type": "string",
            "example": "7",
            "description": "Rooms sold that day, as text: confirmed bookings only. A tentative booking is neither sold nor taken from `Disponibles`"
          },
          "Bloqueadas": {
            "type": "string",
            "example": "1",
            "description": "Rooms blocked that day, as text"
          },
          "Disponibles": {
            "type": "string",
            "example": "2",
            "description": "Rooms free that day, as text"
          },
          "Total_fisicas": {
            "type": "string",
            "example": "10",
            "description": "Physical rooms of the type, as text"
          }
        },
        "required": [
          "Hotel",
          "pcode",
          "Fecha",
          "Habitacion",
          "Codigo_habitacion",
          "Vendidas",
          "Bloqueadas",
          "Disponibles",
          "Total_fisicas"
        ]
      },
      "RmsOnTheBooksProductionDto": {
        "type": "object",
        "properties": {
          "invoiceRef": {
            "type": "string",
            "example": "F2026-0012",
            "nullable": true,
            "description": "Invoice"
          },
          "category": {
            "type": "string",
            "example": "Restaurant",
            "nullable": true,
            "description": "Category"
          },
          "name": {
            "type": "string",
            "example": "Dinner",
            "description": "Article"
          },
          "type": {
            "type": "string",
            "example": "product",
            "description": "Line type"
          },
          "reservation_ID": {
            "type": "string",
            "example": "100684613",
            "nullable": true,
            "description": "Booking id"
          },
          "refound": {
            "type": "number",
            "example": 0,
            "description": "`1` when it is a refund"
          },
          "issue_date": {
            "type": "string",
            "example": "2026-10-07",
            "nullable": true,
            "description": "Invoice date"
          },
          "created_at": {
            "type": "string",
            "example": "2026-10-05",
            "description": "When it was added, or `--`"
          },
          "date_service": {
            "type": "string",
            "example": "2026-10-05",
            "nullable": true,
            "description": "Service date"
          },
          "date_service_end": {
            "type": "string",
            "example": "",
            "description": "Last service date, or empty for one day"
          },
          "units_sold": {
            "type": "number",
            "example": 2,
            "description": "Units of the line that fall in the range: a line that spans several days is prorated by its days, and only the days inside the range count"
          },
          "base": {
            "type": "number",
            "example": 40,
            "description": "Base amount of `units_sold`, prorated as they are"
          },
          "taxes": {
            "type": "number",
            "example": 4,
            "description": "Taxes of `units_sold`, prorated as they are"
          },
          "type_tax": {
            "type": "number",
            "example": 10,
            "description": "Tax rate"
          },
          "total": {
            "type": "number",
            "example": 44,
            "description": "Total"
          },
          "account": {
            "type": "number",
            "example": 70500000,
            "description": "Accounting account"
          },
          "id": {
            "type": "number",
            "example": 5521,
            "description": "Invoice line id: one row per line"
          }
        },
        "required": [
          "invoiceRef",
          "category",
          "name",
          "type",
          "reservation_ID",
          "refound",
          "issue_date",
          "created_at",
          "date_service",
          "date_service_end",
          "units_sold",
          "base",
          "taxes",
          "type_tax",
          "total",
          "account",
          "id"
        ]
      },
      "RmsOnTheBooksResponseDto": {
        "type": "object",
        "properties": {
          "rsvList": {
            "description": "The bookings",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsOnTheBooksBookingDto"
            }
          },
          "capList": {
            "description": "Capacity per day and room type",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsOnTheBooksCapacityDto"
            }
          },
          "productionList": {
            "description": "Articles sold, one row per invoice line with its units and amounts prorated to the days inside the range; only when `article` is asked for",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsOnTheBooksProductionDto"
            }
          }
        },
        "required": [
          "rsvList",
          "capList"
        ]
      },
      "RmsPushableRateDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 48122,
            "description": "The rate id: what a push names in `rateId`"
          },
          "roomName": {
            "type": "string",
            "example": "Double room",
            "nullable": true,
            "description": "Room type of the rate"
          },
          "ota": {
            "type": "string",
            "example": "Booking.com",
            "description": "Channel the rate sells on, by the name the channel list gives it. The property’s own sale is channel `0`, which comes with its name in that list (`Recepcion`); `direct` only when the channel is not in the list"
          },
          "otaId": {
            "type": "number",
            "example": 0,
            "description": "Channel id; `0` is the property’s own sale"
          },
          "board": {
            "type": "string",
            "example": "bb",
            "nullable": true,
            "description": "`nb` room only, `bb` breakfast, `hb` half board, `fb` full board, `ai` all inclusive"
          },
          "policy": {
            "type": "string",
            "example": "4",
            "nullable": true,
            "description": "Cancellation policy id"
          },
          "typechannel": {
            "type": "string",
            "example": "wubook",
            "nullable": true,
            "description": "Channel manager the rate is mapped through, as stored (`wubook`, `SiteMinder`, `YieldPlanet`, `Channex`, `Neobookings`, `Pghc`); `wubook` unless the property set another"
          },
          "type": {
            "type": "string",
            "example": "main",
            "enum": [
              "main",
              "mainchannel",
              "planchannel"
            ],
            "description": "`main` is the base rate of the property’s own sale, `mainchannel` a channel’s own base rate and `planchannel` a channel rate"
          },
          "roomTypeId": {
            "type": "number",
            "example": 101,
            "description": "Room type id (`roomTypeId` elsewhere). Not in the legacy `/panel/channel/rate`"
          },
          "occupancy": {
            "type": "number",
            "example": 2,
            "description": "Guests the price is for. Not in the legacy answer"
          },
          "active": {
            "type": "boolean",
            "example": true,
            "description": "Whether the rate is on sale. Not in the legacy answer"
          },
          "anchored": {
            "type": "number",
            "example": 0,
            "description": "`0` when the rate sets its own price; otherwise the `id` of the rate it follows, because the hotel linked it to that one (the same `anchored` the legacy `/v1/booking/price` gave in `rateChannel`). Any type can be linked, `planchannel` included. A linked rate can still be pushed, but a pushed price gives it a price of its own for those days and it stops following its rate there; to keep the hotel’s link, push to the rate it follows"
          }
        },
        "required": [
          "id",
          "roomName",
          "ota",
          "otaId",
          "board",
          "policy",
          "typechannel",
          "type",
          "roomTypeId",
          "occupancy",
          "active",
          "anchored"
        ]
      },
      "RmsRatePriceDayDto": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "example": "2026-12-01",
            "description": "Night"
          },
          "price": {
            "type": "number",
            "example": 112.5,
            "nullable": true,
            "description": "What the rate sells at that night, in the property’s currency and as you push it. `null` when it has no price that night: the rate is inactive, the rate it follows has no price that night or cannot be resolved, it is a channel rate with no channel base to derive from, or it works out at 0 or less. Never `0` for “no price”"
          },
          "origin": {
            "type": "string",
            "example": "static",
            "nullable": true,
            "enum": [
              "main",
              "static",
              "clone"
            ],
            "description": "`static`: a price set for that night (by the hotel or by a push). `main`: the rate’s base price — for a `planchannel`, derived from its channel’s base. `clone`: derived from the rate it follows (`anchored`) with the hotel’s modifier. `null` exactly when `price` is"
          },
          "availability": {
            "type": "number",
            "example": 3,
            "nullable": true,
            "description": "Free rooms of the rate’s room type that night, the legacy `availabilityList[dt]`: the room type’s rooms less the confirmed and blocked bookings covering the night. `0` is full and a negative number is overbooked, as on the legacy. `null` only when the room type has no rooms to read — never `0` for “unknown”"
          },
          "minStay": {
            "type": "number",
            "example": 2,
            "description": "Minimum nights to stay over that night, the legacy `minstay[dt]`. `1` when no restriction is set for the night, as the legacy returned for a day with no row"
          },
          "maxStay": {
            "type": "number",
            "example": 0,
            "description": "Maximum nights, the legacy `maxstay[dt]`. `0` when there is no maximum"
          },
          "closed": {
            "type": "boolean",
            "example": false,
            "description": "The night is closed to sale (the legacy `closed[dt]`)"
          },
          "closedToArrival": {
            "type": "boolean",
            "example": false,
            "description": "No stay may start on the night. Only ever `true` where the property has the columns for it"
          },
          "closedToDeparture": {
            "type": "boolean",
            "example": false,
            "description": "No stay may end on the night. Only ever `true` where the property has the columns for it"
          }
        },
        "required": [
          "date",
          "price",
          "origin",
          "availability",
          "minStay",
          "maxStay",
          "closed",
          "closedToArrival",
          "closedToDeparture"
        ]
      },
      "RmsRatePricesDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 48122,
            "description": "The rate id, the `id` of `rms/rates`"
          },
          "type": {
            "type": "string",
            "example": "planchannel",
            "enum": [
              "main",
              "mainchannel",
              "planchannel"
            ]
          },
          "roomTypeId": {
            "type": "number",
            "example": 101,
            "description": "The room type the rate prices, as `rms/rates` gives it"
          },
          "active": {
            "type": "boolean",
            "example": true,
            "description": "Whether the rate is on sale. An inactive rate has `price: null` every night"
          },
          "anchored": {
            "type": "number",
            "example": 0,
            "description": "`0` when the rate sets its own price; otherwise the `id` of the rate it follows. Its nights with `origin: clone` move when that rate’s do"
          },
          "prices": {
            "description": "Every night from `start` to `end`, in order",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsRatePriceDayDto"
            }
          }
        },
        "required": [
          "id",
          "type",
          "roomTypeId",
          "active",
          "anchored",
          "prices"
        ]
      },
      "RmsRatePricesResponseDto": {
        "type": "object",
        "properties": {
          "start": {
            "type": "string",
            "example": "2026-12-01",
            "description": "First night, as asked"
          },
          "end": {
            "type": "string",
            "example": "2026-12-31",
            "description": "Last night, as asked (included)"
          },
          "rates": {
            "description": "The rates of `rms/rates` (or the ones asked for in `rateId`), in the same order",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsRatePricesDto"
            }
          }
        },
        "required": [
          "start",
          "end",
          "rates"
        ]
      },
      "PartnerRmsPushDto": {
        "type": "object",
        "properties": {
          "rateId": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Id of the rate being pushed: the `id` of `GET /integrations/{pcode}/rms/rates`",
            "example": 48122
          },
          "roomId": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Room type a restriction lands on, when it is not the rate’s own. Prices ignore it.",
            "example": 1551809177
          },
          "sentAt": {
            "type": "string",
            "description": "When you built this push (ISO 8601). A push sent before the last one accepted for the same rate is refused with 409 `rmsPushStale` instead of overwriting newer values. Leave it out and the last push to arrive wins.",
            "example": "2026-10-15T08:30:00Z"
          },
          "rate": {
            "description": "The tranches. Either all prices (`Value`) or all restrictions (`stop_sell`, `min_stay_through`, `min_stay`, `max_stay`): never both in one push.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsPushItemDto"
            }
          }
        },
        "required": [
          "rateId",
          "rate"
        ]
      },
      "PartnerRmsPushResponseDto": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "example": "9b2f6c1e-1d1a-4f6a-9a55-0e3c3c2f4a71",
            "description": "Id of the push, to quote it to support"
          },
          "ignored": {
            "type": "array",
            "example": [],
            "description": "Fields you sent that are accepted and NOT applied: closures and maximum stays are switched off on the platform for now. Empty when everything you sent is applied.",
            "items": {
              "type": "string",
              "enum": [
                "stop_sell",
                "max_stay"
              ]
            }
          }
        },
        "required": [
          "requestId",
          "ignored"
        ]
      },
      "RmsBookingChangeRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "nullable": true,
            "example": 345,
            "description": "Room assigned, or `null` while none is"
          },
          "roomTypeId": {
            "type": "number",
            "example": 101,
            "description": "Room type"
          },
          "originalRoomTypeId": {
            "type": "number",
            "example": 101,
            "description": "Room type the booking was made for, before any move"
          },
          "roomTypeName": {
            "type": "string",
            "nullable": true,
            "example": "Double room",
            "description": "Name of the room type"
          }
        },
        "required": [
          "id",
          "roomTypeId",
          "originalRoomTypeId",
          "roomTypeName"
        ]
      },
      "RmsBookingChangeOccupancyDto": {
        "type": "object",
        "properties": {
          "total": {
            "type": "number",
            "example": 2,
            "description": "`adults` + `children` + `babies`"
          },
          "adults": {
            "type": "number",
            "example": 2,
            "description": "Adults; `-1` when the booking does not say"
          },
          "children": {
            "type": "number",
            "example": 0
          },
          "babies": {
            "type": "number",
            "example": 0
          }
        },
        "required": [
          "total",
          "adults",
          "children",
          "babies"
        ]
      },
      "RmsBookingChangeCustomerDto": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "example": "ES",
            "description": "Country of the holder, ISO 3166-1 alpha-2. Absent when the guest record has none or holds something that is not a country code"
          },
          "nationality": {
            "type": "string",
            "example": "ES",
            "description": "Nationality of the holder, ISO 3166-1 alpha-2. Absent when the guest record has none or holds something that is not a country code"
          },
          "language": {
            "type": "string",
            "example": "en",
            "description": "Language of the holder, ISO 639-1"
          }
        }
      },
      "RmsBookingChangeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number",
            "example": 52341,
            "description": "Booking id"
          },
          "pcode": {
            "type": "number",
            "example": 114,
            "description": "Property code"
          },
          "locator": {
            "type": "string",
            "example": "4417230981",
            "description": "The booking code on the channel it came from"
          },
          "groupId": {
            "type": "number",
            "example": 52340,
            "description": "The group the booking belongs to, when it is part of one"
          },
          "start": {
            "type": "string",
            "example": "2026-11-05",
            "description": "Arrival, `YYYY-MM-DD`"
          },
          "end": {
            "type": "string",
            "example": "2026-11-07",
            "description": "Departure, `YYYY-MM-DD`"
          },
          "nights": {
            "type": "number",
            "example": 2,
            "description": "Nights"
          },
          "createdAt": {
            "type": "string",
            "nullable": true,
            "example": "2026-10-01",
            "description": "Day the booking was received, `YYYY-MM-DD`"
          },
          "bookingStatus": {
            "type": "string",
            "enum": [
              "ready",
              "tentative",
              "cancelled",
              "no-show",
              "temporary-cancelled"
            ],
            "example": "ready",
            "description": "Status of the booking"
          },
          "releaseDateTentative": {
            "type": "string",
            "example": "2026-10-03 12:00",
            "description": "When a tentative booking lapses, `YYYY-MM-DD HH:mm`"
          },
          "board": {
            "type": "string",
            "enum": [
              "nb",
              "bb",
              "hb",
              "fb",
              "ai",
              "pack"
            ],
            "nullable": true,
            "example": "bb",
            "description": "Board: `nb` room only, `bb` breakfast, `hb` half board, `fb` full board, `ai` all inclusive; `pack` on the rare booking whose board is the one of the pack it was booked with"
          },
          "policy": {
            "type": "string",
            "nullable": true,
            "example": "4",
            "description": "Cancellation policy id"
          },
          "bookedRate": {
            "type": "string",
            "nullable": true,
            "example": null,
            "description": "The rate as the channel named it, when it did"
          },
          "price": {
            "type": "number",
            "example": 240,
            "description": "Price of the stay (of the whole group, on a group booking)"
          },
          "accommodationPrice": {
            "type": "number",
            "example": 220,
            "description": "Accommodation alone"
          },
          "paid": {
            "type": "number",
            "example": 100,
            "description": "Amount paid"
          },
          "totalExtras": {
            "type": "number",
            "example": 20,
            "description": "Extras"
          },
          "canceledCost": {
            "type": "number",
            "example": 0,
            "description": "What the hotel keeps from a cancellation, no-show or early departure"
          },
          "room": {
            "$ref": "#/components/schemas/RmsBookingChangeRoomDto"
          },
          "occupancy": {
            "$ref": "#/components/schemas/RmsBookingChangeOccupancyDto"
          },
          "otaId": {
            "type": "number",
            "example": 9,
            "description": "Channel id; `0` is the property’s own sale"
          },
          "otaName": {
            "type": "string",
            "nullable": true,
            "example": "Booking.com",
            "description": "Channel name"
          },
          "isSaleDirect": {
            "type": "boolean",
            "example": false,
            "description": "Whether the booking is the property’s own sale"
          },
          "customer": {
            "description": "Market data of the booking’s holder, each only when known. Nothing else of the guest travels",
            "allOf": [
              {
                "$ref": "#/components/schemas/RmsBookingChangeCustomerDto"
              }
            ]
          },
          "lastModified": {
            "type": "string",
            "example": "2026-10-15T08:59:12.000Z",
            "description": "When the booking row last changed, ISO 8601 in UTC, to the second"
          }
        },
        "required": [
          "id",
          "pcode",
          "start",
          "end",
          "nights",
          "createdAt",
          "bookingStatus",
          "board",
          "policy",
          "bookedRate",
          "price",
          "accommodationPrice",
          "paid",
          "totalExtras",
          "room",
          "occupancy",
          "otaId",
          "otaName",
          "isSaleDirect",
          "customer",
          "lastModified"
        ]
      },
      "GetRmsBookingChangesResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "The bookings changed in the window, oldest change first, 50 per page",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RmsBookingChangeDto"
            }
          },
          "until": {
            "type": "string",
            "example": "2026-10-15T09:00:00.000Z",
            "description": "The end of the window, ISO in UTC, fixed by the first page and the same on every page of it. Once `nextCursor` is null, it is the `since` of your next poll"
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "example": "eyJ2IjoxLCJzIjoiMjAyNi0xMC0xNVQwODowMDowMC4wMDBaIn0",
            "description": "Pass it as `cursor` to read the next page of the same window. `null` when this page came with fewer than 50 bookings; a last page of exactly 50 still carries a cursor, and the page it leads to comes empty with `null`"
          }
        },
        "required": [
          "data",
          "until",
          "nextCursor"
        ]
      },
      "WebhookAuthenticationDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true,
            "description": "Whether deliveries carry an `Authorization: Basic` header"
          },
          "username": {
            "type": "string",
            "example": "myUser",
            "description": "Username for basic authentication. Only validated, and only meaningful, when `status` is true"
          },
          "password": {
            "type": "string",
            "example": "",
            "description": "Always empty: the password is never returned. `passwordSet` says whether one is stored"
          },
          "passwordSet": {
            "type": "boolean",
            "example": true,
            "description": "Whether a password is stored. To keep it when updating the webhook, send `password` empty with the same URL origin and username"
          }
        },
        "required": [
          "status"
        ]
      },
      "GetWebhooksResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "65f1c2a9b4d3e2f1a0c9b8d7",
            "description": "Unique identifier of the webhook (a 24-character hex id)"
          },
          "pcode": {
            "type": "number",
            "example": 1010,
            "description": "Property code the webhook belongs to"
          },
          "name": {
            "type": "string",
            "example": "Booking Created Webhook",
            "description": "Name of the webhook"
          },
          "url": {
            "type": "string",
            "example": "https://myapp.com/webhooks",
            "description": "URL of the webhook"
          },
          "eventTypes": {
            "type": "array",
            "example": [
              "bookings-added"
            ],
            "description": "Event types that trigger a delivery",
            "items": {
              "type": "string",
              "enum": [
                "bookings-added"
              ]
            }
          },
          "authentication": {
            "description": "Authentication sent with each delivery",
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookAuthenticationDto"
              }
            ]
          },
          "isAvailable": {
            "type": "boolean",
            "example": true,
            "description": "Whether the webhook is enabled"
          },
          "createdAt": {
            "type": "string",
            "example": "2025-01-10T14:35:00.000Z",
            "description": "When the webhook was created (ISO 8601)",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "pcode",
          "name",
          "url",
          "eventTypes",
          "authentication",
          "isAvailable"
        ]
      },
      "Authentication": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true,
            "description": "status"
          },
          "username": {
            "type": "string",
            "example": "myUser",
            "description": "username"
          },
          "password": {
            "type": "string",
            "example": "myPassword",
            "description": "Password for basic authentication. Required to create one. On update, empty keeps the stored password, if the URL origin and the username are the ones it was stored with"
          }
        },
        "required": [
          "status",
          "username"
        ]
      },
      "AddWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "My Webhook",
            "description": "Name"
          },
          "url": {
            "type": "string",
            "example": "https://mywebhook.com",
            "description": "Url"
          },
          "eventTypes": {
            "type": "array",
            "example": [
              "bookings-added"
            ],
            "description": "List of event types",
            "items": {
              "type": "string",
              "enum": [
                "bookings-added"
              ]
            }
          },
          "authentication": {
            "description": "Authentication details",
            "allOf": [
              {
                "$ref": "#/components/schemas/Authentication"
              }
            ]
          }
        },
        "required": [
          "name",
          "url",
          "eventTypes",
          "authentication"
        ]
      },
      "UpdateWebhookDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "example": "My Webhook",
            "description": "Name"
          },
          "url": {
            "type": "string",
            "example": "https://mywebhook.com",
            "description": "Url"
          },
          "eventTypes": {
            "type": "array",
            "example": [
              "bookings-added"
            ],
            "description": "List of event types",
            "items": {
              "type": "string",
              "enum": [
                "bookings-added"
              ]
            }
          },
          "authentication": {
            "description": "Authentication details",
            "allOf": [
              {
                "$ref": "#/components/schemas/Authentication"
              }
            ]
          },
          "id": {
            "type": "string",
            "example": "60d21b4667d0d8992e610c85",
            "description": "Webhook ID"
          }
        },
        "required": [
          "name",
          "url",
          "eventTypes",
          "authentication",
          "id"
        ]
      },
      "TestWebhookDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "60d21b4667d0d8992e610c85",
            "description": "Webhook ID"
          },
          "eventType": {
            "type": "string",
            "example": "bookings-added",
            "description": "Webhook Event Type",
            "enum": [
              "bookings-added"
            ]
          }
        },
        "required": [
          "id",
          "eventType"
        ]
      },
      "TestWebhookResponseDto": {
        "type": "object",
        "properties": {
          "pcode": {
            "type": "number",
            "description": "Property code",
            "example": 1010
          },
          "webhookId": {
            "type": "string",
            "description": "ID of the webhook that was tested",
            "example": "65f1c2a9b4d3e2f1a0c9b8d7"
          },
          "url": {
            "type": "string",
            "description": "URL the test delivery was sent to: the one configured on the webhook",
            "example": "https://myapp.com/webhooks"
          },
          "eventType": {
            "type": "string",
            "description": "Event type of the sample payload",
            "enum": [
              "bookings-added"
            ],
            "example": "bookings-added"
          },
          "payload": {
            "type": "object",
            "description": "The JSON body POSTed to your URL: `{ \"eventType\": \"bookings-added\", \"data\": { \"bookings\": [ … ] } }`. Each item of `data.bookings` has the shape `GET /api/bookings/{pcode}/detail/{bookingId}` answers. Keys whose value was missing when it was sent can hold `null` here. For a test, the bookings are a fixed sample, not real ones.",
            "example": {
              "eventType": "bookings-added",
              "data": {
                "bookings": [
                  {
                    "id": 12345,
                    "pcode": 1010,
                    "groupId": 987,
                    "groupPrice": 950,
                    "groupQuantity": 3,
                    "start": "2025-11-10",
                    "end": "2025-11-13",
                    "arrivalHour": "15:00",
                    "departureHour": "11:00",
                    "nights": 3,
                    "appUrl": "https://app.example.com/booking/12345",
                    "createdAt": "2025-10-26T16:00:00.000Z",
                    "resource": "room-101",
                    "text": "",
                    "board": "hb",
                    "policy": "4",
                    "price": 1200,
                    "paid": 600,
                    "totalExtras": 100,
                    "locked": false,
                    "color": "#ffcc00",
                    "imported": false,
                    "room": {
                      "id": 101,
                      "roomTypeId": 2,
                      "originalRoomTypeId": 2
                    },
                    "locator": "ABC123XYZ",
                    "customer": {
                      "id": 1,
                      "name": "Test",
                      "surname": "User",
                      "documentType": "D",
                      "documentNumber": "A12345678",
                      "phone": "+34911111222",
                      "email": "agustin@example.com",
                      "address": "Calle Falsa 123",
                      "city": "Barcelona",
                      "postalCode": "08001",
                      "country": "ES",
                      "province": "Barcelona",
                      "notes": "Vegetariano",
                      "language": "es"
                    },
                    "companyId": 42,
                    "notes": {
                      "request": "Cuna para bebé, por favor.",
                      "internal": "Cliente frecuente – revisar upgrade",
                      "flat": "Ninguna"
                    },
                    "occupancy": {
                      "total": 3,
                      "adults": 2,
                      "children": 1,
                      "babies": 0
                    },
                    "groupOccupancy": {
                      "total": 9,
                      "adults": 6,
                      "children": 2,
                      "babies": 1
                    },
                    "otaId": 3,
                    "checkInStatus": "checked-in",
                    "bookingStatus": "ready",
                    "virtualPayment": {
                      "type": "directPayment",
                      "amount": 600
                    },
                    "paymentStatus": "no-paid",
                    "invoiceStatus": "no-invoiced",
                    "bookingType": {
                      "label": "Oferta larga estancia",
                      "type": "bloqued-out-order",
                      "typeV2": "blocked-out-order"
                    },
                    "toDos": {
                      "data": [],
                      "pendings": 0,
                      "total": 0
                    },
                    "guests": [
                      {
                        "id": 2,
                        "name": "Test",
                        "surname": "User",
                        "documentType": "D",
                        "documentNumber": "98765432A",
                        "phone": "+34666666666",
                        "email": "laura@example.com",
                        "address": "Calle Real 45",
                        "city": "Madrid",
                        "postalCode": "28001",
                        "country": "ES",
                        "province": "Madrid",
                        "notes": "",
                        "language": "es"
                      }
                    ],
                    "isSaleDirect": true,
                    "housekeeping": {
                      "dateToClean": "2025-11-11",
                      "quantityNightsClean": 2,
                      "weekDaysClean": {
                        "mon": true,
                        "tue": false,
                        "wed": true,
                        "thu": false,
                        "fri": false,
                        "sat": false,
                        "sun": false
                      }
                    }
                  }
                ]
              }
            }
          },
          "statusCode": {
            "type": "number",
            "description": "Outcome of the delivery as Hotelgest records it: `200` for any 2xx answer from your endpoint (the exact 2xx is not kept), the status your endpoint answered for any other response (redirects are not followed, so a 3xx is recorded as is), and `500` when there was no response at all — a network error, a TLS failure, or a URL refused because it resolves to a private network. In that last case the `500` is Hotelgest's, not your endpoint's.",
            "example": 200
          },
          "errorMessage": {
            "type": "string",
            "description": "Why the delivery failed: the HTTP client's message (e.g. `Request failed with status code 404`, `connect ECONNREFUSED 203.0.113.10:443`) or the reason the URL was refused. `null` or absent when the delivery succeeded.",
            "example": "Request failed with status code 404",
            "nullable": true
          },
          "durationMs": {
            "type": "number",
            "description": "Duration of the test delivery in milliseconds",
            "example": 87
          }
        },
        "required": [
          "pcode",
          "webhookId",
          "url",
          "eventType",
          "payload",
          "statusCode",
          "durationMs"
        ]
      },
      "GetWebhookLogsResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier of the log entry (a 24-character hex id)",
            "example": "6735b0e1c2a9b4d3e2f1a0c9"
          },
          "pcode": {
            "type": "number",
            "description": "Property code",
            "example": 1010
          },
          "webhookId": {
            "type": "string",
            "description": "ID of the webhook this delivery belongs to",
            "example": "65f1c2a9b4d3e2f1a0c9b8d7"
          },
          "url": {
            "type": "string",
            "description": "URL the delivery was sent to, as the webhook had it at that moment",
            "example": "https://myapp.com/webhooks"
          },
          "eventType": {
            "type": "string",
            "description": "Event type that triggered the delivery",
            "enum": [
              "bookings-added"
            ],
            "example": "bookings-added"
          },
          "payload": {
            "type": "object",
            "description": "The JSON body POSTed to your URL: `{ \"eventType\": \"bookings-added\", \"data\": { \"bookings\": [ … ] } }`. Each item of `data.bookings` has the shape `GET /api/bookings/{pcode}/detail/{bookingId}` answers. Keys whose value was missing when it was sent can hold `null` here.",
            "example": {
              "eventType": "bookings-added",
              "data": {
                "bookings": [
                  {
                    "id": 12345,
                    "pcode": 1010,
                    "groupId": 987,
                    "groupPrice": 950,
                    "groupQuantity": 3,
                    "start": "2025-11-10",
                    "end": "2025-11-13",
                    "arrivalHour": "15:00",
                    "departureHour": "11:00",
                    "nights": 3,
                    "appUrl": "https://app.example.com/booking/12345",
                    "createdAt": "2025-10-26T16:00:00.000Z",
                    "resource": "room-101",
                    "text": "",
                    "board": "hb",
                    "policy": "4",
                    "price": 1200,
                    "paid": 600,
                    "totalExtras": 100,
                    "locked": false,
                    "color": "#ffcc00",
                    "imported": false,
                    "room": {
                      "id": 101,
                      "roomTypeId": 2,
                      "originalRoomTypeId": 2
                    },
                    "locator": "ABC123XYZ",
                    "customer": {
                      "id": 1,
                      "name": "Test",
                      "surname": "User",
                      "documentType": "D",
                      "documentNumber": "A12345678",
                      "phone": "+34911111222",
                      "email": "agustin@example.com",
                      "address": "Calle Falsa 123",
                      "city": "Barcelona",
                      "postalCode": "08001",
                      "country": "ES",
                      "province": "Barcelona",
                      "notes": "Vegetariano",
                      "language": "es"
                    },
                    "companyId": 42,
                    "notes": {
                      "request": "Cuna para bebé, por favor.",
                      "internal": "Cliente frecuente – revisar upgrade",
                      "flat": "Ninguna"
                    },
                    "occupancy": {
                      "total": 3,
                      "adults": 2,
                      "children": 1,
                      "babies": 0
                    },
                    "groupOccupancy": {
                      "total": 9,
                      "adults": 6,
                      "children": 2,
                      "babies": 1
                    },
                    "otaId": 3,
                    "checkInStatus": "checked-in",
                    "bookingStatus": "ready",
                    "virtualPayment": {
                      "type": "directPayment",
                      "amount": 600
                    },
                    "paymentStatus": "no-paid",
                    "invoiceStatus": "no-invoiced",
                    "bookingType": {
                      "label": "Oferta larga estancia",
                      "type": "bloqued-out-order",
                      "typeV2": "blocked-out-order"
                    },
                    "toDos": {
                      "data": [],
                      "pendings": 0,
                      "total": 0
                    },
                    "guests": [
                      {
                        "id": 2,
                        "name": "Test",
                        "surname": "User",
                        "documentType": "D",
                        "documentNumber": "98765432A",
                        "phone": "+34666666666",
                        "email": "laura@example.com",
                        "address": "Calle Real 45",
                        "city": "Madrid",
                        "postalCode": "28001",
                        "country": "ES",
                        "province": "Madrid",
                        "notes": "",
                        "language": "es"
                      }
                    ],
                    "isSaleDirect": true,
                    "housekeeping": {
                      "dateToClean": "2025-11-11",
                      "quantityNightsClean": 2,
                      "weekDaysClean": {
                        "mon": true,
                        "tue": false,
                        "wed": true,
                        "thu": false,
                        "fri": false,
                        "sat": false,
                        "sun": false
                      }
                    }
                  }
                ]
              }
            }
          },
          "statusCode": {
            "type": "number",
            "description": "Outcome of the delivery as Hotelgest records it: `200` for any 2xx answer from your endpoint (the exact 2xx is not kept), the status your endpoint answered for any other response (redirects are not followed, so a 3xx is recorded as is), and `500` when there was no response at all — a network error, a TLS failure, or a URL refused because it resolves to a private network. In that last case the `500` is Hotelgest's, not your endpoint's.",
            "example": 200
          },
          "errorMessage": {
            "type": "string",
            "description": "Why the delivery failed: the HTTP client's message (e.g. `Request failed with status code 404`, `connect ECONNREFUSED 203.0.113.10:443`) or the reason the URL was refused. `null` or absent when the delivery succeeded.",
            "example": null,
            "nullable": true
          },
          "durationMs": {
            "type": "number",
            "description": "Duration of the delivery in milliseconds",
            "example": 154
          },
          "createdAt": {
            "type": "string",
            "description": "When the delivery was made (ISO 8601). Entries are deleted 30 days after it",
            "example": "2025-01-10T14:35:00.000Z",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "pcode",
          "webhookId",
          "url",
          "eventType",
          "payload",
          "statusCode",
          "durationMs",
          "createdAt"
        ]
      },
      "BookingEnginePriceDayDto": {
        "type": "object",
        "properties": {
          "dt": {
            "type": "string",
            "example": "2027-03-02",
            "description": "Night the price applies to (YYYY-MM-DD)"
          },
          "price": {
            "type": "number",
            "example": 89.5,
            "description": "Price of the night, taxes included"
          },
          "type": {
            "type": "string",
            "example": "main",
            "enum": [
              "main",
              "static",
              "clone"
            ],
            "description": "Where the price comes from: `main` is set on the rate itself, `static` a fixed price for that night, `clone` derived from another rate"
          },
          "id": {
            "type": "string",
            "example": "88213",
            "description": "Id of the fixed price, present only on `static` nights"
          }
        },
        "required": [
          "dt",
          "price",
          "type"
        ]
      },
      "BookingEngineGuestSupplementDto": {
        "type": "object",
        "properties": {
          "board": {
            "type": "string",
            "example": "bb",
            "description": "Board of the rates it adds to"
          },
          "policy": {
            "type": "string",
            "example": "4",
            "description": "Cancellation policy id of the rates it adds to"
          },
          "children": {
            "type": "number",
            "example": 1,
            "description": "Children the supplement prices, all of them together. `0` on a baby supplement"
          },
          "babies": {
            "type": "number",
            "example": 0,
            "description": "Babies the supplement prices, all of them together. `0` on a child supplement"
          },
          "priceList": {
            "description": "What the supplement adds on each night of the stay. Like a rate, it can arrive as an object keyed by position",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEnginePriceDayDto"
            }
          }
        },
        "required": [
          "board",
          "policy",
          "children",
          "babies",
          "priceList"
        ]
      },
      "BookingEngineRoomTypePricesDto": {
        "type": "object",
        "properties": {
          "price": {
            "type": "number",
            "example": 179,
            "description": "Lowest price for the whole stay across ALL the rates under `rate`, including closed ones and those with `motor_excl` = `1`. To show the price a guest can book, recompute it from the rates you keep"
          },
          "availability": {
            "type": "string",
            "example": "3",
            "description": "Rooms of this type free on every night of the stay. Negative when the type is overbooked"
          },
          "rate": {
            "type": "object",
            "description": "Every rate of this room type, keyed by its `key`",
            "additionalProperties": {
              "$ref": "#/components/schemas/BookingEngineRateDto"
            }
          },
          "supplements": {
            "description": "Child and baby supplements of the direct sale, when the hotel has any. Each one prices exactly its count of children, or of babies, and is added to the adult rate of the same board and policy; the Hotelgest booking engine applies them only while the property enables children in it.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEngineGuestSupplementDto"
            }
          }
        },
        "required": [
          "price",
          "availability",
          "rate"
        ]
      },
      "BookingEngineRateDto": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "example": "101-bb-4-2",
            "description": "Rate key: `roomTypeId-board-policy-occupancy`. The key of this entry in `rate`"
          },
          "keyPrice": {
            "type": "string",
            "example": "101-0-bb-4-2",
            "description": "Key of this rate in the price calendar: `roomTypeId-0-board-policy-occupancy` (`0` is the direct-sale channel)"
          },
          "rateId": {
            "type": "number",
            "example": 5521,
            "description": "Rate id"
          },
          "rtcode": {
            "type": "string",
            "example": "101",
            "description": "Room type id (`roomTypeId` elsewhere in the API)"
          },
          "board": {
            "type": "string",
            "example": "bb",
            "description": "Board: `nb` room only, `bb` bed and breakfast, `hb` half board, `fb` full board, `ai` all inclusive"
          },
          "policy": {
            "type": "string",
            "example": "4",
            "description": "Cancellation policy id. `4` flexible and `6` non-refundable are built in; the rest come from `GET /properties/{pcode}/settings/custom-policies`"
          },
          "occupancy": {
            "type": "number",
            "example": 2,
            "description": "Guests the price is for"
          },
          "basePrice": {
            "type": "number",
            "example": 79,
            "description": "Base price of the rate before the price calendar"
          },
          "priceList": {
            "description": "Price of each night of the stay, in order. Add them up for the price of the stay. Always a list",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEnginePriceDayDto"
            }
          },
          "availability": {
            "type": "string",
            "example": "3",
            "description": "Rooms of this type free on EVERY night of the stay: the lowest of `availabilityList`. `0` when a restriction (closed, minimum or maximum stay) rules the stay out. Negative when the type is overbooked"
          },
          "availabilityList": {
            "type": "object",
            "example": {
              "2027-03-02": "3",
              "2027-03-03": "5"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Free rooms of this type per night, keyed by date"
          },
          "_closed": {
            "type": "string",
            "example": "0",
            "description": "`1` when the rate is closed on some night of the stay"
          },
          "_minstay": {
            "type": "string",
            "example": "2",
            "description": "Longest minimum stay across the nights"
          },
          "_maxstay": {
            "type": "string",
            "example": "0",
            "description": "Maximum stay across the nights (`0` means no limit)"
          },
          "_releasestay": {
            "type": "string",
            "example": "0",
            "description": "Days in advance the stay has to be booked (`0` means none)"
          },
          "closed": {
            "type": "object",
            "example": {
              "2027-03-02": "0",
              "2027-03-03": "1"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "`1` on each night the rate is closed, keyed by date. Present with the other restriction fields (`_closed`, `_minstay`…)"
          },
          "minstay": {
            "type": "object",
            "example": {
              "2027-03-02": "2",
              "2027-03-03": "1"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Minimum stay of each night, keyed by date"
          },
          "maxstay": {
            "type": "object",
            "example": {
              "2027-03-02": "0",
              "2027-03-03": "0"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Maximum stay of each night (`0` means no limit), keyed by date"
          },
          "releasestay": {
            "type": "object",
            "example": {
              "2027-03-02": "0",
              "2027-03-03": "0"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Days in advance each night has to be booked, keyed by date"
          },
          "closedarrival": {
            "type": "object",
            "example": {
              "2027-03-02": "1"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Nights a stay cannot START on, keyed by date (value always `1`). Present only when the rate has some closure to arrival or departure in the range; check `start` against it"
          },
          "closeddeparture": {
            "type": "object",
            "example": {
              "2027-03-05": "1"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Days a stay cannot END on, keyed by date (value always `1`), the departure day included. Present only when the rate has some closure to arrival or departure in the range; check `end` against it"
          },
          "motor_excl": {
            "type": "string",
            "example": "0",
            "description": "`1` when the hotel keeps this rate off its booking engine. It still comes in this answer: leave it out of what you show, as Hotelgest's own booking engine does"
          },
          "segment": {
            "type": "string",
            "example": "normal",
            "enum": [
              "normal",
              "bussines",
              "exclude_motor"
            ],
            "description": "Segment the rate is for, as the legacy stores it (`bussines` is its spelling): `normal` for everyone, `bussines` for companies, `exclude_motor` kept off the booking engine"
          },
          "anchored": {
            "type": "number",
            "example": 0,
            "description": "Id of the rate rule this rate hangs from (its price follows that one), `0` when it stands on its own"
          }
        },
        "required": [
          "key",
          "keyPrice",
          "rateId",
          "rtcode",
          "board",
          "policy",
          "occupancy",
          "basePrice",
          "priceList",
          "availability",
          "availabilityList",
          "motor_excl",
          "segment",
          "anchored"
        ]
      },
      "BookingEnginePackRoomDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "481",
            "description": "Id of this row of the pack: what a booking of the pack refers to"
          },
          "rtcode": {
            "type": "string",
            "example": "101",
            "description": "Room type the row sells"
          },
          "occupancy": {
            "type": "string",
            "example": "2",
            "description": "Guests"
          },
          "board": {
            "type": "string",
            "example": "bb",
            "description": "Board"
          },
          "policy": {
            "type": "string",
            "example": "4",
            "description": "Cancellation policy id"
          }
        },
        "required": [
          "id",
          "rtcode",
          "occupancy",
          "board",
          "policy"
        ]
      },
      "BookingEnginePackProductDto": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "number",
            "example": 33,
            "description": "Product included in the pack"
          },
          "value": {
            "type": "number",
            "example": 1,
            "description": "Units included"
          }
        },
        "required": [
          "product_id",
          "value"
        ]
      },
      "BookingEnginePackDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "12",
            "description": "Pack id"
          },
          "room": {
            "description": "The room type, occupancy, board and policy combinations the pack is sold on",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEnginePackRoomDto"
            }
          },
          "name": {
            "type": "object",
            "example": {
              "es": "Escapada romántica",
              "en": "Romantic getaway"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Pack name per language, keyed by language code. Only the languages the hotel wrote; an empty object when it wrote none"
          },
          "text": {
            "type": "object",
            "example": {
              "es": "Dos noches con cena",
              "en": "Two nights with dinner"
            },
            "additionalProperties": {
              "type": "string"
            },
            "description": "Pack description per language, keyed by language code. Only the languages the hotel wrote; an empty object when it wrote none"
          },
          "board": {
            "type": "string",
            "example": "bb",
            "description": "Board of the pack (that of its last room row)"
          },
          "type": {
            "type": "string",
            "example": null,
            "nullable": true,
            "description": "Kind of pack, as the legacy stores it"
          },
          "weekday": {
            "type": "string",
            "example": null,
            "nullable": true,
            "description": "Weekdays the pack is restricted to, as the legacy stores them. Null or empty when any day"
          },
          "match_weekday": {
            "type": "number",
            "example": 0,
            "description": "How `weekday` applies, as the legacy stores it: `0` when it does not restrict"
          },
          "iframe": {
            "type": "string",
            "example": "0",
            "description": "Whether the pack is kept off the booking engine, as the legacy stores it: always `0` or lower here, because packs hidden from it are left out"
          },
          "extcode": {
            "type": "string",
            "example": null,
            "nullable": true,
            "description": "External code the hotel gave the pack, if any"
          },
          "promo_code_excl": {
            "type": "string",
            "example": "0",
            "description": "`1` when promo codes cannot be combined with the pack"
          },
          "dfrom": {
            "type": "string",
            "example": "2027-01-01",
            "description": "First day the pack can be booked"
          },
          "dto": {
            "type": "string",
            "example": "2027-12-31",
            "description": "Last day the pack can be booked"
          },
          "price": {
            "type": "number",
            "example": 240,
            "description": "Price of the pack"
          },
          "dtype": {
            "type": "string",
            "example": "-1",
            "description": "How `value` applies: `0` replaces the price with `value`, `-1` takes `value` % off, `-2` takes `value` off, `1` adds `value` %, `2` adds `value`"
          },
          "value": {
            "type": "string",
            "example": "10",
            "description": "Amount or percentage `dtype` applies"
          },
          "min_stay": {
            "type": "string",
            "example": "2",
            "description": "Minimum nights"
          },
          "max_stay": {
            "type": "string",
            "example": "0",
            "description": "Maximum nights (`0` means no limit)"
          },
          "pack_prod": {
            "description": "Products included in the pack, when it includes any",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BookingEnginePackProductDto"
            }
          }
        },
        "required": [
          "id",
          "room",
          "name",
          "text",
          "board",
          "type",
          "weekday",
          "match_weekday",
          "iframe",
          "extcode",
          "promo_code_excl",
          "dfrom",
          "dto",
          "price",
          "dtype",
          "value",
          "min_stay",
          "max_stay"
        ]
      },
      "BookingEnginePromoCodeDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "7",
            "description": "Promotion id"
          },
          "code": {
            "type": "string",
            "example": "SUMMER27",
            "description": "The code, as the hotel created it"
          },
          "dfrom": {
            "type": "string",
            "example": "2027-06-01 00:00:00",
            "description": "Start of the validity of the code (`YYYY-MM-DD HH:mm:ss`)"
          },
          "dto": {
            "type": "string",
            "example": "2027-09-30 00:00:00",
            "description": "End of the validity of the code (`YYYY-MM-DD HH:mm:ss`)"
          },
          "dtype": {
            "type": "string",
            "example": "-1",
            "description": "How `value` applies: `0` takes `value` off each night, `-1` takes `value` % off the stay, `-2` takes `value` off the stay. When booking, send them as `fbn`, `pbn` and `ta`"
          },
          "value": {
            "type": "string",
            "example": "10.00",
            "description": "Amount or percentage `dtype` applies, with two decimals"
          },
          "name": {
            "type": "string",
            "example": "Summer offer",
            "description": "Name of the promotion"
          }
        },
        "required": [
          "id",
          "code",
          "dfrom",
          "dto",
          "dtype",
          "value",
          "name"
        ]
      }
    }
  },
  "externalDocs": {
    "description": "Guides, live console and changelog",
    "url": "https://public-api.hotelgest.com/partner"
  }
}