# Room Type Listing

The Room Type Listing call is used to retrieve the list of Room Types created for existing property. By using this call, PMS will be able to fetch details on the property's existing room types and details related to the room types such as, Name, Type, Min/Max. Occupancy, Status, and Size.

### <mark style="color:yellow;">Endpoint</mark> <a href="#propertylisting-endpoint.1" id="propertylisting-endpoint.1"></a>

<mark style="color:green;background-color:green;">**`POST`**</mark>&#x20;

<div align="left"><figure><img src="https://958347541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FM9bn2UcBkeqtqixkl5eF%2Fuploads%2FHpyoT0sTR5VA3RkkSOl8%2FSandbox%20image.png?alt=media&#x26;token=45811e1e-b22d-413a-a355-32135a85258e" alt="" width="56"><figcaption></figcaption></figure></div>

{% code overflow="wrap" %}
```url
https://connect-sandbox.su-api.com/SUAPI/jservice/roomdetails
```
{% endcode %}

***

#### <mark style="color:yellow;">Attributes</mark> <a href="#propertylisting-attributes.1" id="propertylisting-attributes.1"></a>

`hotelid` <mark style="color:orange;">**string (Required)**</mark>

Hotel id for which you want to retrieve the list of Room Types created for the property.

{% hint style="info" %}
Maximum 20 characters allowed.
{% endhint %}

### <mark style="color:yellow;">Sample Request</mark>

```json
{
   "hotelid": "new1"
}
```

***

### <mark style="color:yellow;">Response</mark> <a href="#propertylisting-response.1" id="propertylisting-response.1"></a>

#### <mark style="color:yellow;">Response Model — No Rooms Found</mark> <a href="#propertylisting-responsemodel-noroomsfound" id="propertylisting-responsemodel-noroomsfound"></a>

In this case there is no Room Type available for the provider based on the request parameters.

<mark style="color:red;">**Sample Error Response (938)**</mark>

```json
{
  "Status": "Fail",
  "Errors": {
    "Code": "938",
    "ShortText": "No rooms found"
  }
}
```

***

#### <mark style="color:green;">Success</mark> <a href="#propertylisting-success.1" id="propertylisting-success.1"></a>

#### <mark style="color:blue;">rooms array</mark> <a href="#propertylisting-roomsarray" id="propertylisting-roomsarray"></a>

rooms array contains all the room in the listing an all the required details for the rooms such as room name, id, occupancy, quantity, and the status of the room.

***

`roomid` <mark style="color:orange;">**string**</mark>

The room ID / Listing ID as assigned by the provider.

***

`roomname` <mark style="color:orange;">**string**</mark>

Name of the room.

***

`roomtype` <mark style="color:orange;">**string**</mark>

Type of the room.

***

`maximumoccupancy` <mark style="color:orange;">**string**</mark>

Maximum occupancy allowed in the room.

***

`status` <mark style="color:orange;">**string**</mark>

Status of the room.

***

`quantity` <mark style="color:orange;">**string**</mark>

Quantity of the room available in the property.

***

`sizemeasurement` <mark style="color:orange;">**string**</mark>

Size of the room.

***

`sizemeasurementunit` <mark style="color:orange;">**string**</mark>

Units which are used to measure the room.

***

`rate` <mark style="color:orange;">**string**</mark>

Rate for the room.

#### <mark style="color:green;">**Sample Success Response**</mark>

{% code overflow="wrap" %}
```json
{
	"rooms": [{
		"roomid": "STD",
		"roomname": "Superior Room with Balcony",
		"roomtype": "Double",
		"maximumoccupancy": "2",
		"status": "Active",
		"quantity": "8",
		"sizemeasurement": "20",
		"sizemeasurementunit": "sqm",
		"rate": "200"
	}, {
		"roomid": "KNG",
		"roomname": "Twin Room",
		"roomtype": "Twin",
		"maximumoccupancy": "4",
		"status": "Active",
		"quantity": "4",
		"sizemeasurement": "20",
		"sizemeasurementunit": "sqm",
		"rate": "200"
	}]
}
```
{% endcode %}

***

#### <mark style="color:red;">Error</mark> <a href="#propertylisting-error.1" id="propertylisting-error.1"></a>

**Errors 400 due to invalid parameters**

This error will be received if allocated with incorrect Hotel/Client id.

#### <mark style="color:red;">**Sample Error Response (400)**</mark>

```json
{
  "Status": "Fail",
  "Errors": {
    "Code": "400",
    "ShortText": "Invalid HotelCode (ne1)"
  }
}
```

