---
title: "Create/update reservation"
method: POST
path: "/reservation"
tags: ["Pull endpoints"]
---

# Create/update reservation

`POST /reservation`

Creating new reservations, updating reservations, canceling reservations.

Behavior of this endpoint heavily depends on the agreed scheme of communication:

### 1 - Reservation Statuses:
The default scheme is "dual requests" - the first request contains `status: option` and does not contain customer data. The second request contains `status: confirmed` and includes customer data. This scheme allows more gradual control of the state of the reservation. **Both statuses are expected to block the room for the reservation.**

The second option is "single request" - in this scheme, even the first request with `status: option` contains all customer data and the voucher code. The confirmation request is sent also with the same data but does not have to be relayed to the hotel. Single-request mode is more suited for systems which do not support modifying existing reservations without canceling them and creating a new one (OTA-like behavior). You should specify which behavior better suits your system capabilities when consulting the integration with Termino.

### 2 - Reservation ID:
For referencing reservations between Termino and your system, either your ID or our ID can be used. In case your ID is used, the first (`option`) request does not contain the property `id`. You have to generate and send it in response.

In case our ID is used, the first (`option`) request contains the property `id` with our ID. You have to store it and use it in all subsequent requests.

Using your ID can be problematic in case communication during the first request fails due to any unexpected error (timeout, outage, etc.). This may cause a reservation being created in your system, but not in Termino. That's why we prefer using our ID, which we can use to check and remove such un-synced reservation.

**Termino expects the room to be blocked for reservation when the `option` request is successfully processed.**

### Usage:

 - Called with status `option` and then `confirmed` when creating a new reservation (see above)
 - Called with `canceled` status to cancel the reservation
 - Called when changing booking date on customer's request

Grouped reservations are currently not implemented; one request always contains only one reservation. Reservation group ID is the same as reservation ID. Reservation response should contain the same data as the request.

## Request body

- ReservationRequest
  - `accessToken` string, required — Access token to your API.
  - `hotelId` union, required — Your hotel id.
    - string
    - integer
  - `reservationGroup` ReservationGroup, required
    - `id` union, required — Reservation group id.
      - string
      - integer
    - `description` string, required — Textual description of the package bought.
    - `reservations` Reservation[], required
      - `id` union, required — Id of reservation.
        - string
        - integer
      - `status` 'option' | 'confirmed' | 'canceled' | 'modified', required — Reservation status.
      - `roomTypeId` union, required — Id of room type.
        - string
        - integer
      - `roomId` union — Id of room.
        - string
        - integer
      - `term` DateInterval, required
        - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
        - `end` string, date, required — End date in the format 'yyyy-mm-dd'.
      - `price` Price, required
        - `amount` string, decimal, required — Money amount in basic units.
        - `currency` string, ISO 4271 currency code, required — Currency code.
      - `meal` 'breakfast' | 'halfBoard' | 'fullBoard' | 'allInclusive' — Meal type included in package.
      - `adultsCount` integer, required — Count of adults.
      - `childrenCount` integer — Count of children (with or without bed entitlement). This is deprecated, use children instead.
      - `children` object[], nullable — List of children ages and bed entitlement.
        - `age` integer — Age of child.
        - `bedEntitlement` boolean
      - `guestNote` string, nullable — Customers note related to reservation. May be an empty string.
      - `voucher` string, nullable — Slevomat voucher code for customer/hotel.
      - `contact` object — Contact to guest/customer.
        - `name` string, required — Contact person name.
        - `phone` string, required — Contact person phone number.
    - `totalPrice` Price, required
      - `amount` string, decimal, required — Money amount in basic units.
      - `currency` string, ISO 4271 currency code, required — Currency code.

## Response `200`

Successful response

- ReservationResponse
  - `reservation` ReservationGroup
    - `id` union, required — Reservation group id.
      - string
      - integer
    - `description` string, required — Textual description of the package bought.
    - `reservations` Reservation[], required
      - `id` union, required — Id of reservation.
        - string
        - integer
      - `status` 'option' | 'confirmed' | 'canceled' | 'modified', required — Reservation status.
      - `roomTypeId` union, required — Id of room type.
        - string
        - integer
      - `roomId` union — Id of room.
        - string
        - integer
      - `term` DateInterval, required
        - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
        - `end` string, date, required — End date in the format 'yyyy-mm-dd'.
      - `price` Price, required
        - `amount` string, decimal, required — Money amount in basic units.
        - `currency` string, ISO 4271 currency code, required — Currency code.
      - `meal` 'breakfast' | 'halfBoard' | 'fullBoard' | 'allInclusive' — Meal type included in package.
      - `adultsCount` integer, required — Count of adults.
      - `childrenCount` integer — Count of children (with or without bed entitlement). This is deprecated, use children instead.
      - `children` object[], nullable — List of children ages and bed entitlement.
        - `age` integer — Age of child.
        - `bedEntitlement` boolean
      - `guestNote` string, nullable — Customers note related to reservation. May be an empty string.
      - `voucher` string, nullable — Slevomat voucher code for customer/hotel.
      - `contact` object — Contact to guest/customer.
        - `name` string, required — Contact person name.
        - `phone` string, required — Contact person phone number.
    - `totalPrice` Price, required
      - `amount` string, decimal, required — Money amount in basic units.
      - `currency` string, ISO 4271 currency code, required — Currency code.

## Other responses

- `400` — Expected error

## Changes

- **2023-10-30** `e19082e0fb0f` — 4 breaking, 5 warning, 7 info
  - removed the enum value `all_inclusive` of the request property `reservationGroup/reservations/items/meal`
  - removed the enum value `full_board` of the request property `reservationGroup/reservations/items/meal`
  - removed the enum value `half_board` of the request property `reservationGroup/reservations/items/meal`
  - removed the enum value `none` of the request property `reservationGroup/reservations/items/meal`
  - …12 more

[Change history](https://skmtc.dev/slevomat/apis/termino-hotel-api/changes/reservation/post.md)

---

[API](https://skmtc.dev/slevomat/apis/termino-hotel-api.md) · [All operations](https://skmtc.dev/slevomat/apis/termino-hotel-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/slevomat/termino-hotel-api/revisions/e19082e0fb0f/schema)
