v1

latestOpenAPI 3.0.02026-07-17337.2 KB

Book a room

Books a room in a specified hotel.

post/book

Request body

hotel_idinteger required
guest_namestring required
check_in_datestring date required
check_out_datestring date required
num_roomsinteger required

Example request

{
  "hotel_id": 1,
  "guest_name": "John Doe",
  "check_in_date": "2025-10-01",
  "check_out_date": "2025-10-05",
  "num_rooms": 1
}

Response

Booking successful.

errorboolean
messagestring

Example response

{
  "data": {
    "booking_id": "HB-1"
  },
  "message": "Booking successful!"
}