---
title: "Planning"
method: POST
path: "/planning"
tags: ["PMS/CM endpoints"]
---

# Planning

`POST /planning`

Synchronizing available rooms, prices and booking restrictions (stop sale, closed arrival/departure, minimal length of stay) Usage:
 - called when new hotel is registered
 - periodical synchronization of available space, prices and restrictions unless push endpoint is used

## Request body

- object
  - `accessToken` string, required — Access token to your API.
  - `hotelId` union, required — Hotel id.
    - string
    - integer
  - `interval` DateInterval, required — DateInterval is [start, end) – end date is exclusive.
    - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
    - `end` string, date, required — End date in the format 'yyyy-mm-dd'. Exclusive.
  - `roomTypeIds` union[] — Requested room type ids. When not provided, return planning for all room types of given hotel.
    - union
      - string
      - integer

## Response `200`

Successful response

- PlanningResponse
  - `planning` PlanningUpdate[], required — List of planning for requested room types.
    - `roomTypeId` union, required — Id of room type.
      - string
      - integer
    - `availability` RoomTypeAvailability[] — List of updated availability.
      - `interval` DateInterval, required — DateInterval is [start, end) – end date is exclusive.
        - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
        - `end` string, date, required — End date in the format 'yyyy-mm-dd'. Exclusive.
      - `availableRooms` integer, required — Count of free rooms in this interval.
    - `rates` RatePlanPlanning[] — List of rates updates.
      - `ratePlanId` union, required — Id of rate plan.
        - string
        - integer
      - `planning` RatePlanPlanningItem[], required
        - `interval` DateInterval — DateInterval is [start, end) – end date is exclusive.
          - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
          - `end` string, date, required — End date in the format 'yyyy-mm-dd'. Exclusive.
        - `perRoomPrice` Price
          - `amount` string, decimal, required — Money amount represented as decimal string with dot as decimal separator.
          - `currency` string, ISO 4271 currency code, required — Currency code.
        - `perPersonPriceMatrix` PerPersonPrice[] — Matrix of prices per person count for given rate plan/room type in given interval. Required if pricing model is `per_person`.
          - `personsCount` integer, required — Count of persons.
          - `price` Price, required
            - `amount` string, decimal, required — Money amount represented as decimal string with dot as decimal separator.
            - `currency` string, ISO 4271 currency code, required — Currency code.
          - `stopSale` boolean, required — Stop sale for given persons count.
        - `perOccupancyPriceMatrix` OccupancyPrice[] — List of prices for different occupancies for given rate plan/room type in given interval. Required if pricing model is `per_occupancy`.
          - `adultsCount` integer, required — Count of adults.
          - `childrenCount` integer, required — Count of children.
          - `price` Price, required
            - `amount` string, decimal, required — Money amount represented as decimal string with dot as decimal separator.
            - `currency` string, ISO 4271 currency code, required — Currency code.
          - `stopSale` boolean — Stop sale for given occupancy.
        - `restrictions` BookingRestriction — Booking restrictions to be applied. Omitted properties are considered unchanged.
          - `closedForArrival` boolean — Room is closed for arrival in given interval
          - `closedForDeparture` boolean — Room is closed for departure in given interval
          - `stopSale` boolean — Room is not available for booking in given interval (arrival or stay is not allowed)
          - `minimalLengthOfStay` integer — Bookings starting in given interval have to have this minimal length of stay. 1 is default.
          - `maximalLengthOfStay` integer, nullable — Bookings starting in given interval have to have this maximal length of stay. Null value means unlimited length of stay, 0 has same effect as closed for arrival.
    - `roomTypeRestrictions` object[] — Room type-level booking restrictions to be applied on given intervals.
      - `interval` DateInterval, required — DateInterval is [start, end) – end date is exclusive.
        - `start` string, date, required — Start date in the format 'yyyy-mm-dd'.
        - `end` string, date, required — End date in the format 'yyyy-mm-dd'. Exclusive.
      - `restrictions` BookingRestriction, required — Booking restrictions to be applied. Omitted properties are considered unchanged.
        - `closedForArrival` boolean — Room is closed for arrival in given interval
        - `closedForDeparture` boolean — Room is closed for departure in given interval
        - `stopSale` boolean — Room is not available for booking in given interval (arrival or stay is not allowed)
        - `minimalLengthOfStay` integer — Bookings starting in given interval have to have this minimal length of stay. 1 is default.
        - `maximalLengthOfStay` integer, nullable — Bookings starting in given interval have to have this maximal length of stay. Null value means unlimited length of stay, 0 has same effect as closed for arrival.

## Other responses

- `400` — Expected error

---

[API](https://skmtc.net/slevomat/apis/termino-hotel-api.md) · [All operations](https://skmtc.net/slevomat/apis/termino-hotel-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/slevomat/termino-hotel-api/versions/776409ba477b/schema)
