Room Categories API
Manage room categories (e.g. Standard, Deluxe, Suite) within an organization.
Authentication
All endpoints require a valid Bearer token in the Authorization header.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/roomcategory/:orgId/create | Create a room category |
GET | /api/roomcategory/:orgId/list | List all room categories |
GET | /api/roomcategory/:orgId/:categoryId | Get category by ID |
PUT | /api/roomcategory/:orgId/:categoryId/update | Update a room category |
DELETE | /api/roomcategory/:orgId/:categoryId/delete | Delete a room category |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
orgId | string | Organization ID |
categoryId | string | Room category document ID |
Create Room Category
POST /api/roomcategory/:orgId/createRequest Body
json
{
"name": "Deluxe Suite",
"description": "Spacious suite with premium amenities and city view",
"basePrice": 12000,
"maxOccupancy": 4,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony"],
"images": [
"https://storage.example.com/rooms/deluxe-1.jpg",
"https://storage.example.com/rooms/deluxe-2.jpg"
]
}Success Response 201
json
{
"success": true,
"message": "Room category created successfully",
"data": {
"_id": "64f1b2c3d4e5f6a7b8c9d0e1",
"name": "Deluxe Suite",
"description": "Spacious suite with premium amenities and city view",
"basePrice": 12000,
"maxOccupancy": 4,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony"],
"images": [
"https://storage.example.com/rooms/deluxe-1.jpg",
"https://storage.example.com/rooms/deluxe-2.jpg"
],
"orgId": "64f1b2c3d4e5f6a7b8c9d0e0",
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-02-20T10:00:00.000Z"
}
}Error Response 400
json
{
"success": false,
"message": "Validation error",
"errors": [
"name is required",
"basePrice must be a positive number"
]
}Error Response 409
json
{
"success": false,
"message": "Room category 'Deluxe Suite' already exists"
}List Room Categories
GET /api/roomcategory/:orgId/listQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 10 | Results per page |
search | string | — | Search by category name |
Success Response 200
json
{
"success": true,
"data": [
{
"_id": "64f1b2c3d4e5f6a7b8c9d0e1",
"name": "Deluxe Suite",
"description": "Spacious suite with premium amenities and city view",
"basePrice": 12000,
"maxOccupancy": 4,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony"],
"roomCount": 15,
"createdAt": "2026-02-20T10:00:00.000Z"
},
{
"_id": "64f1b2c3d4e5f6a7b8c9d0e5",
"name": "Standard",
"description": "Comfortable room with essential amenities",
"basePrice": 4000,
"maxOccupancy": 2,
"amenities": ["wifi", "air-conditioning"],
"roomCount": 20,
"createdAt": "2026-02-18T10:00:00.000Z"
}
],
"pagination": {
"total": 5,
"page": 1,
"limit": 10,
"totalPages": 1
}
}Get Room Category by ID
GET /api/roomcategory/:orgId/:categoryIdSuccess Response 200
json
{
"success": true,
"data": {
"_id": "64f1b2c3d4e5f6a7b8c9d0e1",
"name": "Deluxe Suite",
"description": "Spacious suite with premium amenities and city view",
"basePrice": 12000,
"maxOccupancy": 4,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony"],
"images": [
"https://storage.example.com/rooms/deluxe-1.jpg",
"https://storage.example.com/rooms/deluxe-2.jpg"
],
"orgId": "64f1b2c3d4e5f6a7b8c9d0e0",
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-02-20T10:00:00.000Z"
}
}Error Response 404
json
{
"success": false,
"message": "Room category not found"
}Update Room Category
PUT /api/roomcategory/:orgId/:categoryId/updateRequest Body
json
{
"name": "Deluxe Suite Plus",
"basePrice": 14000,
"maxOccupancy": 5,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony", "jacuzzi"]
}Success Response 200
json
{
"success": true,
"message": "Room category updated successfully",
"data": {
"_id": "64f1b2c3d4e5f6a7b8c9d0e1",
"name": "Deluxe Suite Plus",
"basePrice": 14000,
"maxOccupancy": 5,
"amenities": ["wifi", "minibar", "room-service", "smart-tv", "balcony", "jacuzzi"],
"updatedAt": "2026-02-21T09:00:00.000Z"
}
}Error Response 404
json
{
"success": false,
"message": "Room category not found"
}Delete Room Category
DELETE /api/roomcategory/:orgId/:categoryId/deleteSuccess Response 200
json
{
"success": true,
"message": "Room category deleted successfully"
}Error Response 404
json
{
"success": false,
"message": "Room category not found"
}Error Response 409
json
{
"success": false,
"message": "Cannot delete category with assigned rooms. Remove or reassign rooms first."
}