This endpoint is used to list or unlist a given room. This is just a way to toggle the available status of the room.
Method | URI | Headers |
---|---|---|
PATCH | /api/rooms/{room}/status | Authorization: Bearer <token> Accept: application/json |
Param | Description | Type | Required |
---|---|---|---|
status | The status of the room. Available statuses are Listed and Unlisted. | String | Yes |
Param | Description | Type | Required |
---|---|---|---|
{room} | The ID of a given room. | Integer | Yes |
Example request
curl \
--request PATCH \
--url https://api.luxstay.com/api/rooms/10000/status \
--header 'Accept: application/json' \
--header 'Accept-Language: en' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data status=Listed
Example response
{
"data": {
"id": 10000,
"host": 10130,
"name": "Apartment 1",
"num_bedrooms": 2,
"num_bathrooms": 2,
"num_beds": 2,
"standard_guests": 5,
"maximum_guests": 8,
"booking_type": "request_to_book",
"status": "Unlisted",
"submit_status": "Accept",
"cancellation_policy": "Flexible",
"bedType": {
"data": {
"id": 4,
"name": "Couch"
}
},
"roomType": {
"data": {
"id": 2,
"name": "Private room",
"description": "Private room"
}
},
"propertyType": {
"data": {
"id": 1,
"name": "Apartment",
"description": "Apartment"
}
}
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason invalid previous status
Example response
{
"message": "This room must be accepted by Luxstay before changing its status"
}
Reason validation errors
Example response
{
"message": "The given data was invalid.",
"errors": {
"status": [
"The status field is required."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"status": [
"The selected status is invalid."
]
}
}
Reason unauthorized to update 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"
}