# Availability Samples

* [Availability by Room Type Code](#availability-by-room-type-code)
* [Availability by Rate Plan Code](#availability-by-rate-plan-code)

### Availability by Room Type Code <a href="#availability-by-room-type-code" id="availability-by-room-type-code"></a>

**Method:** GET\
**Path:** `/publishers/{publisherCode}/hotels/{hotelCode}/roomTypes/{roomTypeCode}/availability?startDate={yyyy-MM-dd}` or\
**Path:** `/publishers/{publisherCode}/hotels/{hotelCode}/roomTypes/{roomTypeCode}/availability?startDate={yyyy-MM-dd}&range={NumberOfDays}`\
**Description:** Get all availability for a publisher, hotel, room type and date range.\
\
**Sample Response**

```json
[
  {
    "hotelCode": "sample",
    "bookingLimit": 3,
    "date": "2018-04-13",
    "ratePlanCode": "BAR",
    "roomTypeCode": "PRES",
    "minLOS": 1,
    "maxLOS": 5,
    "restriction": "Departure",
    "status": "Close"
  },
  {
    "hotelCode": "sample",
    "bookingLimit": 3,
    "date": "2018-04-12",
    "ratePlanCode": "BAR",
    "roomTypeCode": "PRES",
    "minLOS": 1,
    "maxLOS": 5,
    "restriction": "Departure",
    "status": "Close"
  },
  {
    "hotelCode": "sample",
    "bookingLimit": 3,
    "date": "2018-04-11",
    "ratePlanCode": "BAR",
    "roomTypeCode": "PRES",
    "minLOS": 1,
    "maxLOS": 5,
    "restriction": "Departure",
    "status": "Close"
  }
]
```

### Availability by Rate Plan Code <a href="#availability-by-rate-plan-code" id="availability-by-rate-plan-code"></a>

**Method**: GET\
**Path:** `/publishers/{publisherCode}/hotels/{hotelCode}/ratePlans/{ratePlanCode}/availability?startDate={yyyy-MM-dd}` or\
**Path:** `/publishers/{publisherCode}/hotels/{hotelCode}/ratePlans/{ratePlanCode}/availability?startDate={yyyy-MM-dd}&range={NumberOfDays}`\
**Description:** Fetch the availability for a given publisher, hotel, rate plan and date range.

**Sample Response**

```json
[
  {
    "hotelCode": "sample",
    "bookingLimit": 20,
    "date": "2018-04-13",
    "ratePlanCode": "CORP1",
    "roomTypeCode": "EKC",
    "minLOS": 1,
    "maxLOS": 14,
    "restriction": "Master",
    "status": "Open"
  },
  {
    "hotelCode": "sample",
    "bookingLimit": 20,
    "date": "2018-04-12",
    "ratePlanCode": "CORP1",
    "roomTypeCode": "EKC",
    "minLOS": 1,
    "maxLOS": 14,
    "restriction": "Master",
    "status": "Open"
  },
  {
    "hotelCode": "sample",
    "bookingLimit": 20,
    "date": "2018-04-11",
    "ratePlanCode": "CORP1",
    "roomTypeCode": "EKC",
    "minLOS": 1,
    "maxLOS": 14,
    "restriction": "Master",
    "status": "Open"
  }
]
```
