This endpoint is used to fetch the detailed information of a given booking. The information includes booking ID, check-in and check-out dates, pricing, customer, payment, associated room, etc.
| Method | URI | Headers |
|---|---|---|
| GET | /api/bookings/{booking} | Authorization: Bearer <token> Accept: application/json |
| Param | Description | Type | Required |
|---|---|---|---|
| {booking} | The ID of a given booking | Integer | Yes |
Below are some example responses from the API:
Example request
curl \
--request GET \
--url https://api.luxstay.com/api/bookings/8260 \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>'
--header 'Time-Zone: Europe/Busingen'
Example response
{
"data": {
"booking_id": 8173,
"booking_code": "M5UFOG",
"status": "Cancelled",
"check_in": "2018-10-17T00:00:00+00:00",
"check_out": "2018-10-17T00:00:00+00:00",
"number_of_guest": 3,
"booking_date": "2018-10-10T09:42:43+00:00",
"last_action": "2018-10-18T00:00:05+00:00",
"price": {
"currency_code": "VND",
"total": 860850
},
"customer": {
"first_name": "Tú",
"last_name": "Lê",
"gender": "Female",
"email": "tutu280495@gmail.com",
"phone": "+841682728365"
},
"payment": {
"currency_code": "VND",
"type": "Manual Bank Transfer",
"amount": 860850
},
"room": {
"name": "Le Cadre -BALCONY FLAT, 30s walk to"
}
}
}
Reason invalid access token
Example response
{
"message": "Unauthenticated."
}
Reason unauthorized to access booking
Example response
{
"message": "You are not allowed to access this booking."
}
Reason cannot find the given booking
Example response
{
"message": "Cannot find the given booking"
}