Calendar

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.

Endpoint

Method URI Headers
GET /api/rooms/{room}/calendar Authorization: Bearer <token>
Accept: application/json

URL Params

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

Route Params

Param Description Type Required
{room} The ID of a given room. Integer Yes

Request & Response Examples

Successful Response

200

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>'
1
2
3
4
5

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"
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

Error Response

401

Reason invalid access token

Example response

{
    "message": "Unauthenticated."
}
1
2
3

403

Reason unauthorized to access room calendar

Example response

{
    "message": "You are not allowed to access or change information associated with this room."
}
1
2
3

404

Reason cannot find the given room

Example response

{
    "message": "Cannot find the given room"
}
1
2
3

422

Reason invalid query string parameters

Example response

{
    "message": "The given data was invalid.",
    "errors": {
        "end_date": [
            "The start date field is required."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "end_date": [
            "The end date field is required."
        ]
    }
}
1
2
3
4
5
6
7
8
{
    "message": "The given data was invalid.",
    "errors": {
        "end_date": [
            "The end date must be a date after or equal to start date."
        ]
    }
}
1
2
3
4
5
6
7
8
Last Updated: 11/18/2018, 9:11:26 AM