Retrieve a Booking
This section describes the endpoint for retrieving the details of a specific booking, including customer and skier information, in the hotel management system.
Retrieve an Existing Booking
Request:
GET /bookings/{booking_id}/
Example usage:
curl http://exampledomain.com/api/v1/bookings/12345/ \
-H "Authorization: Token YOUR_ACCESS_TOKEN"
Parameters:
booking_id- The unique identifier of the booking to be retrieved.
Response:
Content-Type application/json
200 OK / 404 Not Found
{
"status": "success" / "error",
"message": "Booking retrieved successfully" / "Booking not found",
"data": {
"customer": {
"name": "Customer Name",
"surname": "Customer Surname",
"phone_number": "customer_phone_number",
"email_adress": "customer_email@example.com"
},
"room_id": "room_id",
"reservation_id": "reservation_id",
"hotel_id": "hotel_id",
"check_in_date": "check_in_date",
"check_out_date": "check_out_date",
"skiers": [
// List of skiers...
]
}
}
Note:
- Authorization Protected
- This endpoint retrieves the details of the booking specified by the
booking_id. - A
200 OKresponse is returned upon successful retrieval, along with the booking details. - If the booking does not exist, a
404 Not Foundresponse will be returned.