This endpoint is used to update the physical or structural information of a given room including the number of beds, the number of bedrooms and bathrooms, room area, etc.
Method | URI | Headers |
---|---|---|
POST | /api/rooms/{room}/structure | Authorization: Bearer <token> Accept: application/json |
Param | Description | Type | Required |
---|---|---|---|
property_type | The property type of the room. This should be a valid property type ID. | Integer | Yes |
maximum_guests | The maximum number of guests a room may have. | Integer | Yes |
room_type | The type of the room. This should be a valid room type ID. | Integer | Yes |
num_bedrooms | The number of bedrooms. | Integer | Yes |
num_beds | The number of beds | Integer | Yes |
bed_type | The type of beds. This should be a valid bed type ID. | Integer | Yes |
num_bathrooms | The number of bathrooms. | Integer | Yes |
area | The area of the room. | Double | Yes |
Param | Description | Type | Required |
---|---|---|---|
{room} | The ID of a given room. | Integer | Yes |
Example request
curl \
--request POST \
--url https://api.luxstay.com/api/rooms/10000/structure \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--form property_type=28 \
--form room_type=21 \
--form bed_type=4 \
--form maximum_guests=15 \
--form num_bedrooms=5 \
--form num_beds=8 \
--form num_bathrooms=4 \
--form area=120
Example response
{
"data": {
"id": 10000,
"host": 10130,
"name": "Apartment 1",
"num_bedrooms": 5,
"num_bathrooms": 4,
"num_beds": 8,
"standard_guests": 5,
"maximum_guests": 15,
"booking_type": "instant_book",
"status": "Listed",
"submit_status": "Accept",
"cancellation_policy": "Flexible",
"bedType": {
"data": {
"id": 4,
"name": "Couch"
}
},
"roomType": {
"data": {
"id": 21,
"name": "Test",
"description": "Test"
}
},
"propertyType": {
"data": {
"id": 28,
"name": "Studio",
"description": ""
}
}
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason unauthorized to update structure of the room
Example response
{
"message": "You are not allowed to access or change information associated with this room."
}
Reason cannot find the given room
Example response
{
"message": "Cannot find the given room"
}
Reason validation errors
Example response
{
"message": "The given data was invalid.",
"errors": {
"property_type": [
"The selected property type is invalid."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"room_type": [
"The selected room type is invalid."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"bed_type": [
"The selected bed type is invalid."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"area": [
"The area format is invalid."
]
}
}