# Availability API

This is a key step before making a hotel booking. Unlike the **MinRate API**, this API provides all available room types and options based on your query. The response from this API is essential to complete the booking process.

## API details

<mark style="color:green;">`POST`</mark> `/api/v1/hotel/booking-api/availability/rooms`

**Headers**

| Name            | Value              |
| --------------- | ------------------ |
| Content-Type    | `application/json` |
| Authorization   | `Bearer <token>`   |
| Accept-Encoding | `gzip`             |

**Body**

| Name           | Type    | Description                    |
| -------------- | ------- | ------------------------------ |
| `hotelIds`     | Array   | Hotel ids in array fomat       |
| `fromDate`     | String  | checkin date                   |
| `toDate`       | String  | checkout date                  |
| `noOfAdults`   | Integer | No of adults in a room         |
| `noOfChildren` | Integer | No of children in a room       |
| `childrenAges` | Array   | Age of each children in a room |
| `nationality`  | String  | nationality of the guest       |

<details>

<summary>Sample Request</summary>

```json
{
    "hotelIds": [100018,100021],
    "fromDate":"2024-10-17",
    "toDate": "2024-10-20",
    "rooms": [
        {
        "noOfAdults": 1,
        "noOfChildren": 0,
        "childrenAges": []
        }
    ],
    "nationality": "UAE"
}
```

</details>

### Response details

**Response General data**

<table><thead><tr><th width="185">Name</th><th width="93">Type</th><th>Description</th></tr></thead><tbody><tr><td>tokenNumber</td><td>String</td><td>Unique code for an availability request. </td></tr><tr><td>fromDate</td><td>String</td><td>Checkin Date</td></tr><tr><td>toDate</td><td>String</td><td>Check out Date</td></tr><tr><td>nationality</td><td>String</td><td>Guest Nationality ISO code</td></tr><tr><td>roomPaxes</td><td>Array</td><td>roomPaxes.noOfAdults<br>roomPaxes.noOfChildren<br>roomPaxes.childrenAges[]</td></tr><tr><td>noOfNights</td><td>Integer</td><td>Total stay nights</td></tr></tbody></table>

#### Response Hotel data

<table><thead><tr><th width="151">Name</th><th width="101">Type</th><th>Description</th></tr></thead><tbody><tr><td>hotelId</td><td>Integer</td><td>Unique Id for the hotel</td></tr><tr><td>hotelName</td><td>String</td><td>Name of the hotel</td></tr></tbody></table>

#### Response Room data

<table><thead><tr><th width="184">Name</th><th width="113">Type</th><th>Description</th></tr></thead><tbody><tr><td>rateKey</td><td>String</td><td>Unique Id for the specific rate</td></tr><tr><td>standardName</td><td>String</td><td>Name of the room provided by room mapping provider</td></tr><tr><td>roomName</td><td>String</td><td>Name of the room provided by supplier</td></tr><tr><td>roomMaster</td><td>Boolean</td><td><code>true</code>: if room details available in room master<br><code>false</code> : If room details not available in room master</td></tr><tr><td>roomMasterCode</td><td>String</td><td>Unique room code for mapping from room master </td></tr><tr><td>boardName</td><td>String</td><td>Name of the board type</td></tr><tr><td>boardMaster</td><td>Boolean</td><td><code>true</code>: if board details available in board master<br><code>false</code> : If board details not available in board master</td></tr><tr><td>boardMasterId</td><td>Integer</td><td>Unique board code for mapping from board master </td></tr><tr><td>occupancies</td><td>Array</td><td>occupancies.name<br>occupancies.maxCount</td></tr><tr><td>netPrice</td><td>Number</td><td>Total price</td></tr></tbody></table>

<details>

<summary>Sample Response </summary>

```json
{
    "success": true,
    "data": {
        "tokenNumber": "RA_1728408897715",
        "fromDate": "2024-10-17",
        "toDate": "2024-10-19",
        "nationality": "UAE",
        "roomPaxes": [
            {
                "noOfAdults": 1,
                "noOfChildren": 0,
                "childrenAges": []
            }
        ],
        "noOfNights": 2,
        "hotels": [
            {
                "hotel": {
                    "hotelId": 1110023,
                    "hotelName": "White Fort Hotel"
                },
                "rooms": [
					{
                        "standardName": "Standard Room",
                        "rates": [
                            {
                                "rateKey": "90a1ed1be35631e1f272ca0b2fd67968",
                                "roomName": "DOUBLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-4879",
                                "boardName": "room only",
                                "boardMaster": true,
                                "boardMasterId": "10003",
                                "occupancies": {
                                    "name": "double standard",
                                    "maxCount": 1
                                },
                                "netPrice": 39.25
                            },
                            {
                                "rateKey": "cc3841de1a85acd43ffefc0d66dcdce2",
                                "roomName": "DOUBLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-4879",
                                "boardName": "Bed and breakfast",
                                "boardMaster": true,
                                "boardMasterId": "10024",
                                "occupancies": {
                                    "name": "double standard",
                                    "maxCount": 1
                                 },
                                 "netPrice": 53.36   
                            },
                            {
                                "rateKey": "cbf503d70a01b8d99c54de3666ca1571",
                                "roomName": "DOUBLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-4879",
                                "boardName": "Bed and breakfast",
                                "boardMaster": true,
                                "boardMasterId": "10014",
                                "occupancies": {
                                    "name": "double standard",
                                    "maxCount": 1
                                 },
                                 "netPrice": 60.40   
                            },
                            {
                                "rateKey": "cbf503d70a01b8d99c54de3666ca1571",
								"roomName": "DOUBLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-4879",
                                "boardName": "half board",
								"boardMaster": true,
                                "boardMasterId": "10011",
                                "occupancies": {
                                    "name": "double standard",
                                    "maxCount": 1
                                },
								"netPrice": 82.41,
                            },
                            {
                                "rateKey": "e8f8c38a1fce369af9092464c4f835b0",
								"roomName": "DOUBLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-4879",
                                "boardName": "full board",
								"boardMaster": true,
                                "boardMasterId": "10020",
                                "occupancies": {
                                    "name": "double standard",
                                    "maxCount": 1
                                },
								"netPrice": 100.68,
                            }
                        ]
                    },
                    {
                        "standardName": "Standard, Single",
                        "rates": [
                            {
                                "rateKey": "805ae708e85296ad8b701e7eed3aba28",
								"roomName": "SINGLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X2-9495",
                                "boardName": "room only",
								"boardMaster": true,
                                "boardMasterId": "10003",
                                "occupancies": {
                                    "name": "single standard",
                                    "maxCount": 1
                                },
								"netPrice": 32.47,
                            },
                            {
                                "rateKey": "c7b96703cb2fd452e47312377ad7bed0",
								"roomName": "SINGLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X1-1095",
                                "boardName": "bed and breakfast",
								"boardMaster": true,
								"boardMasterId": "10014",
                                "occupancies": {
                                    "name": "single standard",
                                    "maxCount": 1
                                }
                                "netPrice": 46.58,
                            },
                            {
                                "rateKey": "92208c46781354d5377b0d11dcb7f46a",
								"roomName": "SINGLE STANDARD",
                                "roomMaster": true,
                                "roomMasterCode": "X1-10095", 
                                "boardName": "half board",
								"boardMaster": true,
								"boardMasterId": "10018",
                                "occupancies": {
                                    "name": "single standard",
                                    "maxCount": 1
                                },
								"netPrice": 53.64,
                            }
                        ]
                    },
                    {
                        "standardName": "Superior, Single",
                        "rates": [
                            {
                                "rateKey": "4f0d1111a4e41a19784d0b7c77d728f6",
								"roomName": "SINGLE SUPERIOR",
                                "roomMaster": false,
                                "roomMasterCode": null,
                                "boardName": "room only",
								"boardMaster": false,
								"boardMasterId": null,
                                "occupancies": {
                                    "name": "single superior",
                                    "maxCount": 1
                                },
								"netPrice": 37.55,
                            }
                        ]
                    }                   
                ]
            }
        ]
    }
}
```

</details>

{% hint style="danger" %}
It is always recommended to request only one hotel per Availability API request. While it is safe to use up to 10 hotels per request, using multiple hotels may occasionally result in the failure to deliver all rates due to limits imposed by the room type aggregation service provider.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.mytravellerschoice.com/hotel-booking-api/booking-api/availability-apis/availability-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
