Create Hotel Room API
Overview
Adds a new room type configuration and inventory allocation to a Hotel Master.
- Endpoint:
/api/hotels/rooms/create - Method:
POST
Request Body Schema
| Field | Type | Required | Description |
|---|---|---|---|
hotelId | String (UUID) | Yes | Target hotel ID reference |
roomType | Enum | No | SINGLE, DOUBLE, TWIN, DELUXE, SUITE, FAMILY, EXECUTIVE, PRESIDENTIAL (Default: DELUXE) |
roomName | String | No | Custom room name |
maxOccupancy | Number | No | Maximum guest capacity (Default: 2) |
bedConfiguration | Enum | No | SINGLE, DOUBLE, TWIN, QUEEN_SIZE, KING_SIZE, SOFA_BED, BUNK_BED |
floorNumber | Number | No | Floor level number |
basePricePerNight | Number | Yes | Base rate per night (>= 0) |
totalRooms | Number | No | Total room inventory count (Default: 1) |
mealPlan | Enum | No | ROOM_ONLY, BREAKFAST, HALF_BOARD, FULL_BOARD, ALL_INCLUSIVE (Default: ROOM_ONLY) |
freeCancellationTillHours | Number | No | Free cancellation window in hours before check-in |
amenities | String | No | Room amenities |
amenitiesList | Array of Objects | No | List of room amenity map objects (each item having optional id and required amenityId). Pass id: null for new entries or existing map ID if updating |
images | String | No | Room photo URLs |
Request Body Example
{
"hotelId": "7a8b9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"roomType": "DELUXE",
"roomName": "Ocean Deluxe Suite",
"maxOccupancy": 3,
"bedConfiguration": "KING_SIZE",
"floorNumber": 4,
"basePricePerNight": 4500.00,
"totalRooms": 10,
"mealPlan": "BREAKFAST",
"freeCancellationTillHours": 24,
"amenities": "Sea View, King Bed, Private Balcony",
"amenitiesList": [
{
"id": null,
"amenityId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"
}
],
"images": "https://example.com/room1.jpg"
}
Response Example (201 Created)
{
"success": true,
"data": {
"id": "11223344-5566-7788-9900-aabbccddeeff",
"hotelId": "7a8b9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
"roomType": "DELUXE",
"roomName": "Ocean Deluxe Suite",
"basePricePerNight": "4500.00",
"totalRooms": 10,
"active": true
},
"message": "Hotel Room created successfully"
}