Bookings API
Full booking lifecycle — creation, availability checks, room management, check-in, checkout, and cancellation.
Authentication
All booking endpoints require a valid PASETO token:
Authorization: Bearer <token>Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/bookings/:orgId/create | Create a new booking |
GET | /api/bookings/:orgId/list | List bookings (paginated) |
GET | /api/bookings/:orgId/overview | Booking overview / dashboard stats |
GET | /api/bookings/:orgId/by-code/:code | Get booking by code |
POST | /api/bookings/:orgId/check-availability | Check room availability |
GET | /api/bookings/:orgId/:bookingId | Get booking by ID |
PUT | /api/bookings/:orgId/:bookingId/stay | Update stay details |
PUT | /api/bookings/:orgId/:bookingId/arrival | Update arrival details |
POST | /api/bookings/:orgId/:bookingId/add-room | Add room to booking |
POST | /api/bookings/:orgId/:bookingId/checkout-rooms | Checkout specific rooms |
PUT | /api/bookings/:orgId/:bookingId/update-guest | Update guest information |
PUT | /api/bookings/:orgId/:bookingId/checkout | Full checkout |
POST | /api/bookings/:orgId/:bookingId/arrival | Record guest arrival |
PUT | /api/bookings/:orgId/:bookingId/cancel | Cancel booking |
PUT | /api/bookings/:orgId/:bookingId/change-guest | Change primary guest |
Common Path Parameters
| Parameter | Type | Description |
|---|---|---|
orgId | string | Organisation ID |
bookingId | string | Booking document ID |
code | string | Human-readable booking code (e.g. BK-0042) |
POST /api/bookings/:orgId/create
Create a new booking.
Request Body
{
"guestId": "guest_abc123",
"guestName": "Jane Smith",
"guestEmail": "jane@example.com",
"guestPhone": "+919876543210",
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"rooms": [
{
"roomId": "room_101",
"roomNumber": "101",
"roomType": "Deluxe",
"ratePerNight": 3500,
"adults": 2,
"children": 1
}
],
"source": "walk-in",
"notes": "Early check-in requested",
"specialRequests": "Extra pillows",
"mealPlan": "CP",
"totalAmount": 10500,
"advanceAmount": 3000,
"paymentMethod": "cash"
}| Field | Type | Required | Description |
|---|---|---|---|
guestId | string | No | Existing guest ID (omit to create new) |
guestName | string | Yes | Guest full name |
guestEmail | string | No | Guest email |
guestPhone | string | Yes | Guest phone number |
checkIn | string | Yes | Check-in date (YYYY-MM-DD) |
checkOut | string | Yes | Check-out date (YYYY-MM-DD) |
rooms | array | Yes | Array of room objects |
rooms[].roomId | string | Yes | Room ID |
rooms[].roomNumber | string | Yes | Display room number |
rooms[].roomType | string | Yes | Room type / category |
rooms[].ratePerNight | number | Yes | Nightly rate |
rooms[].adults | number | Yes | Number of adults |
rooms[].children | number | No | Number of children |
source | string | No | Booking source (walk-in, phone, online, ota) |
notes | string | No | Internal notes |
specialRequests | string | No | Guest special requests |
mealPlan | string | No | Meal plan code (EP, CP, MAP, AP) |
totalAmount | number | No | Total booking amount |
advanceAmount | number | No | Advance payment received |
paymentMethod | string | No | Payment method for advance |
Response — 201 Created
{
"success": true,
"message": "Booking created successfully",
"data": {
"bookingId": "bk_xyz789",
"code": "BK-0042",
"status": "confirmed",
"guestName": "Jane Smith",
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"rooms": [
{
"roomId": "room_101",
"roomNumber": "101",
"roomType": "Deluxe",
"ratePerNight": 3500
}
],
"totalAmount": 10500,
"createdAt": "2026-02-23T10:30:00.000Z"
}
}Error — 400 Bad Request
{
"success": false,
"message": "Validation failed: checkIn must be before checkOut"
}GET /api/bookings/:orgId/list
List bookings with pagination and optional filters.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | number | 1 | Page number |
limit | number | 20 | Items per page |
status | string | — | Filter by status (confirmed, checked-in, checked-out, cancelled) |
from | string | — | Filter check-in from date (YYYY-MM-DD) |
to | string | — | Filter check-in to date (YYYY-MM-DD) |
search | string | — | Search by guest name, code, or phone |
Response — 200 OK
{
"success": true,
"data": [
{
"bookingId": "bk_xyz789",
"code": "BK-0042",
"guestName": "Jane Smith",
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"status": "confirmed",
"rooms": ["101"],
"totalAmount": 10500
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 87,
"totalPages": 5
}
}GET /api/bookings/:orgId/overview
Get booking summary statistics for the dashboard.
Response — 200 OK
{
"success": true,
"data": {
"today": {
"arrivals": 5,
"departures": 3,
"stayovers": 12,
"available": 8
},
"occupancy": {
"occupied": 20,
"total": 28,
"percentage": 71.4
},
"revenue": {
"today": 45000,
"month": 1250000
}
}
}GET /api/bookings/:orgId/by-code/:code
Retrieve a booking using its human-readable code.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
code | string | Booking code (e.g. BK-0042) |
Response — 200 OK
{
"success": true,
"data": {
"bookingId": "bk_xyz789",
"code": "BK-0042",
"guestName": "Jane Smith",
"guestEmail": "jane@example.com",
"guestPhone": "+919876543210",
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"status": "confirmed",
"rooms": [
{
"roomId": "room_101",
"roomNumber": "101",
"roomType": "Deluxe",
"ratePerNight": 3500,
"adults": 2,
"children": 1
}
],
"totalAmount": 10500,
"advanceAmount": 3000,
"balanceDue": 7500,
"source": "walk-in",
"notes": "Early check-in requested",
"createdAt": "2026-02-23T10:30:00.000Z"
}
}Error — 404 Not Found
{
"success": false,
"message": "Booking not found"
}POST /api/bookings/:orgId/check-availability
Check room availability for a given date range.
Request Body
{
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"roomType": "Deluxe"
}| Field | Type | Required | Description |
|---|---|---|---|
checkIn | string | Yes | Start date (YYYY-MM-DD) |
checkOut | string | Yes | End date (YYYY-MM-DD) |
roomType | string | No | Filter by room type |
Response — 200 OK
{
"success": true,
"data": {
"available": true,
"rooms": [
{
"roomId": "room_101",
"roomNumber": "101",
"roomType": "Deluxe",
"ratePerNight": 3500,
"status": "available"
},
{
"roomId": "room_102",
"roomNumber": "102",
"roomType": "Deluxe",
"ratePerNight": 3500,
"status": "available"
}
]
}
}GET /api/bookings/:orgId/:bookingId
Retrieve full booking details by ID.
Response — 200 OK
{
"success": true,
"data": {
"bookingId": "bk_xyz789",
"code": "BK-0042",
"guestName": "Jane Smith",
"guestEmail": "jane@example.com",
"guestPhone": "+919876543210",
"checkIn": "2026-03-15",
"checkOut": "2026-03-18",
"status": "confirmed",
"rooms": [
{
"roomId": "room_101",
"roomNumber": "101",
"roomType": "Deluxe",
"ratePerNight": 3500,
"adults": 2,
"children": 1
}
],
"totalAmount": 10500,
"advanceAmount": 3000,
"balanceDue": 7500,
"source": "walk-in",
"mealPlan": "CP",
"notes": "Early check-in requested",
"specialRequests": "Extra pillows",
"createdAt": "2026-02-23T10:30:00.000Z",
"updatedAt": "2026-02-23T10:30:00.000Z"
}
}PUT /api/bookings/:orgId/:bookingId/stay
Update stay details (dates, rooms, meal plan).
Request Body
{
"checkIn": "2026-03-15",
"checkOut": "2026-03-20",
"mealPlan": "MAP",
"notes": "Extended stay — 2 extra nights"
}| Field | Type | Required | Description |
|---|---|---|---|
checkIn | string | No | Updated check-in date |
checkOut | string | No | Updated check-out date |
mealPlan | string | No | Updated meal plan |
notes | string | No | Updated notes |
Response — 200 OK
{
"success": true,
"message": "Stay details updated successfully",
"data": {
"bookingId": "bk_xyz789",
"checkIn": "2026-03-15",
"checkOut": "2026-03-20",
"mealPlan": "MAP"
}
}PUT /api/bookings/:orgId/:bookingId/arrival
Update expected arrival information.
Request Body
{
"expectedArrivalTime": "14:00",
"transportMode": "flight",
"transportDetails": "AI-302, arriving 13:30"
}| Field | Type | Required | Description |
|---|---|---|---|
expectedArrivalTime | string | No | Expected arrival time (HH:mm) |
transportMode | string | No | Mode of transport |
transportDetails | string | No | Flight/train number, etc. |
Response — 200 OK
{
"success": true,
"message": "Arrival details updated"
}POST /api/bookings/:orgId/:bookingId/add-room
Add an additional room to an existing booking.
Request Body
{
"roomId": "room_205",
"roomNumber": "205",
"roomType": "Suite",
"ratePerNight": 6000,
"adults": 2,
"children": 0
}| Field | Type | Required | Description |
|---|---|---|---|
roomId | string | Yes | Room ID to add |
roomNumber | string | Yes | Room number |
roomType | string | Yes | Room type |
ratePerNight | number | Yes | Nightly rate |
adults | number | Yes | Number of adults |
children | number | No | Number of children |
Response — 200 OK
{
"success": true,
"message": "Room added to booking",
"data": {
"bookingId": "bk_xyz789",
"rooms": [
{ "roomNumber": "101", "roomType": "Deluxe" },
{ "roomNumber": "205", "roomType": "Suite" }
]
}
}Error — 400 Bad Request
{
"success": false,
"message": "Room 205 is not available for the selected dates"
}POST /api/bookings/:orgId/:bookingId/checkout-rooms
Checkout specific rooms from a multi-room booking without closing the entire booking.
Request Body
{
"roomIds": ["room_101"],
"reason": "Early departure for room 101"
}| Field | Type | Required | Description |
|---|---|---|---|
roomIds | string[] | Yes | Array of room IDs to checkout |
reason | string | No | Reason for partial checkout |
Response — 200 OK
{
"success": true,
"message": "Rooms checked out successfully",
"data": {
"checkedOutRooms": ["101"],
"remainingRooms": ["205"]
}
}PUT /api/bookings/:orgId/:bookingId/update-guest
Update guest details on a booking.
Request Body
{
"guestName": "Jane M. Smith",
"guestEmail": "jane.smith@newmail.com",
"guestPhone": "+919876543210",
"idType": "passport",
"idNumber": "P1234567"
}| Field | Type | Required | Description |
|---|---|---|---|
guestName | string | No | Updated full name |
guestEmail | string | No | Updated email |
guestPhone | string | No | Updated phone |
idType | string | No | ID document type |
idNumber | string | No | ID document number |
Response — 200 OK
{
"success": true,
"message": "Guest information updated"
}PUT /api/bookings/:orgId/:bookingId/checkout
Perform full checkout for the booking.
Request Body
{
"checkoutTime": "2026-03-18T11:00:00.000Z",
"finalAmount": 10500,
"settlementMethod": "card",
"remarks": "Smooth checkout"
}| Field | Type | Required | Description |
|---|---|---|---|
checkoutTime | string | No | Actual checkout timestamp (defaults to now) |
finalAmount | number | No | Final settled amount |
settlementMethod | string | No | Payment method for settlement |
remarks | string | No | Checkout remarks |
Response — 200 OK
{
"success": true,
"message": "Booking checked out successfully",
"data": {
"bookingId": "bk_xyz789",
"status": "checked-out",
"checkoutTime": "2026-03-18T11:00:00.000Z"
}
}POST /api/bookings/:orgId/:bookingId/arrival
Record that the guest has arrived.
Request Body
{
"arrivalTime": "2026-03-15T14:30:00.000Z",
"remarks": "Guest arrived on time"
}| Field | Type | Required | Description |
|---|---|---|---|
arrivalTime | string | No | Actual arrival timestamp (defaults to now) |
remarks | string | No | Arrival remarks |
Response — 200 OK
{
"success": true,
"message": "Guest arrival recorded",
"data": {
"bookingId": "bk_xyz789",
"status": "checked-in",
"arrivalTime": "2026-03-15T14:30:00.000Z"
}
}PUT /api/bookings/:orgId/:bookingId/cancel
Cancel a booking.
Request Body
{
"reason": "Guest requested cancellation",
"cancellationCharge": 1500,
"refundAmount": 1500
}| Field | Type | Required | Description |
|---|---|---|---|
reason | string | Yes | Cancellation reason |
cancellationCharge | number | No | Cancellation fee |
refundAmount | number | No | Amount to refund |
Response — 200 OK
{
"success": true,
"message": "Booking cancelled",
"data": {
"bookingId": "bk_xyz789",
"status": "cancelled",
"cancellationCharge": 1500,
"refundAmount": 1500
}
}PUT /api/bookings/:orgId/:bookingId/change-guest
Change the primary guest on a booking.
Request Body
{
"newGuestId": "guest_def456",
"newGuestName": "Robert Johnson",
"newGuestEmail": "robert@example.com",
"newGuestPhone": "+919123456789"
}| Field | Type | Required | Description |
|---|---|---|---|
newGuestId | string | No | Existing guest ID (omit to provide details inline) |
newGuestName | string | Yes | New guest full name |
newGuestEmail | string | No | New guest email |
newGuestPhone | string | Yes | New guest phone |
Response — 200 OK
{
"success": true,
"message": "Primary guest changed",
"data": {
"bookingId": "bk_xyz789",
"previousGuest": "Jane Smith",
"newGuest": "Robert Johnson"
}
}Error — 404 Not Found
{
"success": false,
"message": "Booking not found"
}