List Bookings

This section details the endpoint for listing all bookings, including customer and skier information, in the hotel management system.

List All Bookings

Request:

GET /bookings/ Example usage:

curl -X GET http://exampledomain.com/api/v1/bookings/ \
    -H "Authorization: Token YOUR_ACCESS_TOKEN"

Response:

Content-Type application/json
200 OK / 400 Bad Request

{
  "status": "success" / "error",
  "data": [
    {
      "booking_id": "unique_booking_id",
      "customer": {
        "name": "Customer Name",
        "surname": "Customer Surname",
        // Other customer details...
      },
      "room_id": "room_number",
      "reservation_id": "reservation_number",
      "hotel_id": "hotel_number",
      "check_in_date": "YYYY-MM-DDTHH:MM:SSZ",
      "check_out_date": "YYYY-MM-DDTHH:MM:SSZ",
      "skiers": [
        {
          "name": "Skier Name",
          "surname": "Skier Surname",
          // Other skier details...
        },
        // More skiers...
      ]
    },
    // More bookings...
  ]
}

Note:

  • Authorization Protected
  • This endpoint retrieves a list of all bookings.
  • Each booking includes details of the customer and associated skiers.
  • A 200 OK response is returned with a list of bookings.
  • If there are any issues with the request, a 400 Bad Request response will be returned, with details about the error.