Booking API¶
Overview¶
The Booking API provides endpoints for managing hotel reservations including creation, modification, and retrieval of booking information.
Base Path¶
All booking endpoints are prefixed with /booking
Authentication¶
All booking endpoints require authentication. Some endpoints require admin privileges.
Booking Workflow¶
The booking process follows these steps:
- Availability Check: Client checks room availability for dates
- Rate Calculation: System calculates rates based on dates and room types
- Booking Creation: Client creates booking with guest and payment information
- Confirmation: System confirms booking and sends confirmation
- Modification (optional): Booking may be modified if needed
- Cancellation (optional): Booking may be cancelled according to policies
Endpoints¶
Get Booking Information¶
Retrieves booking details for a specific reservation.
Endpoint: GET /booking/{id}
Parameters:
- id
(path) - The booking identifier
Response: Returns booking details including guest information, room details, dates, and pricing.
Status Codes:
- 200 OK
- Booking found and returned
- 404 Not Found
- Booking not found
- 401 Unauthorized
- Authentication required
Create Booking¶
Creates a new hotel reservation.
Endpoint: POST /booking
Request Body: Booking creation request with guest details, room selection, dates, and preferences.
Response: Returns the created booking with confirmation number and details.
Status Codes:
- 201 Created
- Booking created successfully
- 400 Bad Request
- Invalid booking data
- 401 Unauthorized
- Authentication required
Update Booking¶
Modifies an existing booking.
Endpoint: PUT /booking/{id}
Parameters:
- id
(path) - The booking identifier
Request Body: Updated booking information.
Response: Returns the updated booking details.
Status Codes:
- 200 OK
- Booking updated successfully
- 400 Bad Request
- Invalid update data
- 404 Not Found
- Booking not found
- 401 Unauthorized
- Authentication required
Cancel Booking¶
Cancels an existing booking.
Endpoint: DELETE /booking/{id}
Parameters:
- id
(path) - The booking identifier
Response: Returns cancellation confirmation.
Status Codes:
- 200 OK
- Booking cancelled successfully
- 404 Not Found
- Booking not found
- 401 Unauthorized
- Authentication required
Business Rules¶
Booking Creation¶
- All required guest information must be provided
- Room availability is checked before booking creation
- Pricing is calculated based on current rates and policies
Booking Modification¶
- Modifications are subject to hotel policies
- Price adjustments may apply for date or room changes
- Some modifications may require admin approval
Booking Cancellation¶
- Cancellation policies apply based on booking terms
- Refunds are processed according to payment policies
- Cancellation fees may apply based on timing
Integration Points¶
The Booking API integrates with: - Payment processing systems - Property management systems - Email notification services - CMS for confirmation templates