---
title: "CheckAvailability"
method: POST
path: "/CheckAvailability"
tags: ["Callbacks"]
---

# CheckAvailability

`POST /CheckAvailability`

## Request

- Base URL: `https://api.myallocator.com/callback/ota/replace_with_ota_id/v202203`
- URL: `https://api.myallocator.com/callback/ota/replace_with_ota_id/v202203/CheckAvailability`
- Auth: API key in query parameter `shared_secret`

**Endpoint:** `https://api.myallocator.com/callback/ota/{ota}/v202203` (replace `{ota}` with your channel ID)

Use this callback to check if a room (rateplan) is available for booking.

Although information about specific room (rateplan) availability is supposed to be present locally on a channel side,
we would like to provide an opportunity to double check if a room (rateplan) is available prior to creating a
reservation. Using this callback ensures that due to a possible technical issue leading to a room (rateplan)
availability numbers not having been (or having been incorrectly / not in time) delivered to a channel, the room
is not overbooked and therefore helps avoid both host and guest frustration when such an over-booking has to be canceled by a host
due to physical inability to accomodate.

Identify the property with `ota_property_sub_id` if your OTA supports
multiple properties under one login (see `GetSubProperties`), otherwise
with `ota_property_id`. Exactly one of the two applies to your channel,
and sending only the other one is rejected with error `1187`.

## Request body

- object
  - `ota_property_id` string: Username, login or property ID on the OTA
  - `ota_property_sub_id` string: Property ID on the OTA, if OTA supports multiple properties under one `ota_property_id`/`ota_property_password` combination. See `GetSubProperties` for more details.
  - `ota_room_id` string, required: Room ID on the OTA
  - `ota_rateplan_id` string, required: Room rateplan ID on the OTA (In case OTA supports rateplans)
  - `start_date` string, date, required: Desired check in date
  - `end_date` string, date, required: Desired check out date
  - `unit_type` 'room' | 'guest', required: Room availability can be checked by number of rooms or by number of guests (beds) to stay. We recommend using `guest` in case a room is a dormitory/shared room and is sold by beds.
  - `number_of_units` integer, required: Number of rooms or guests to check availability for
  - `shared_secret` string, required: Authentication between the OTA and the channel. Identical for all requests. Not to be shared with customers.

## Response `200`

CheckAvailability

- union
  - object
    - `Success` true: This field indicates that a request has been processed successfully. The value of this field does NOT indicate room availability.
    - `is_available` boolean: This field indicates whether or not the requested room(s) (rateplan) is(are) available for booking
    - `reasons_unavailable` object[]: If room(s) (rateplan) is(are) is not available for booking, this field contains explanations as to why
      - `text` string: Reason text
      - `related_dates` string[]: Related dates
  - ResponseCallbackError
    - `Success` false, required: Always `false` when the response contains an error.
    - `ErrorCode` integer, required: Error code. Check the "Error Codes" section of the specification for valid codes.
    - `Error` string, required: Human-readable error message.

---

[API](https://skmtc.dev/cloudbeds/apis/cloudbeds-ota-build-to-us-api.md) - [All operations](https://skmtc.dev/cloudbeds/apis/cloudbeds-ota-build-to-us-api/llms.txt) - [OpenAPI document](https://skmtc.dev/cloudbeds/apis/cloudbeds-ota-build-to-us-api/revisions/baef9c11c34d?raw)
