This endpoint is used to retrieve the calendar of the room in the specified date interval. Calendar provides a lot of details about the state of the room in a specific date or multiple dates. For example, it may show the pricing, the status of the room - Available/Unavailable, and the booking status.
| Method | URI | Headers |
|---|---|---|
| GET | /api/rooms/{room}/calendar | Authorization: Bearer <token> Accept: application/json |
| Param | Description | Type | Required | Notes |
|---|---|---|---|---|
| start_date | The starting point of the date range. | Date | Yes | The date format is d-m-Y |
| end_date | The ending point of the date range. | Date | Yes | The date format is d-m-Y |
| Param | Description | Type | Required |
|---|---|---|---|
| {room} | The ID of a given room. | Integer | Yes |
The calendar for each date includes the information about the price (set by host or referred from the booking), the status (Available, Not available, and Booking),
notes and date information.
Example request
curl \
--request GET \
--url 'https://api.luxstay.com/api/rooms/10777/calendar?start_date=01-10-2018&end_date=05-10-2018' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
Example response
{
"data": [
{
"price": 650000,
"day": 1,
"year": 2018,
"month": 10,
"date": "2018-10-01",
"notes": null,
"currency_code": "VND",
"booking_id": null,
"status": "Available"
},
{
"price": 2500000,
"day": 2,
"year": 2018,
"month": 10,
"date": "2018-10-02",
"notes": "Huong Vu (+84169977889) on",
"currency_code": "VND",
"booking_id": 7313,
"status": "Booking"
},
{
"price": 650000,
"day": 3,
"year": 2018,
"month": 10,
"date": "2018-10-03",
"notes": "Huong Vu (+84169977889) on",
"currency_code": "VND",
"booking_id": 7313,
"status": "Booking"
},
{
"price": 2500000,
"day": 4,
"year": 2018,
"month": 10,
"date": "2018-10-04",
"notes": "Huong Vu (+84169977889) on",
"currency_code": "VND",
"booking_id": 7313,
"status": "Booking"
},
{
"price": 650000,
"day": 5,
"year": 2018,
"month": 10,
"date": "2018-10-05",
"notes": "Huong Vu (+84169977889) on",
"currency_code": "VND",
"booking_id": 7313,
"status": "Booking"
}
]
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason unauthorized to access room calendar
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 invalid query string parameters
Example response
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The start date field is required."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The end date field is required."
]
}
}
{
"message": "The given data was invalid.",
"errors": {
"end_date": [
"The end date must be a date after or equal to start date."
]
}
}