Booking requestsReference Field Reference
Complete field definitions for booking requests and related items
This page documents all fields in booking requests and their related entities.
The main booking request entity.
| Field | Type | Required | Description |
|---|
id | string | Yes | Unique identifier (CUID) |
companyId | string | Yes | ID of the associated company |
requestedByUserId | string | Yes | ID of the user the request is for |
createdByUserId | string | No | ID of the user who created the request (if delegating) |
totalPrice | number | Yes | Total cost of all items |
currency | string | Yes | Currency code (e.g., "IQD", "USD") |
status | enum | Yes | PENDING, COMPLETED, or CANCELLED |
requestNotes | string | No | User or admin notes |
policyId | string | No | ID of the policy that was evaluated |
createdAt | datetime | Yes | When the request was created |
updatedAt | datetime | Yes | When the request was last modified |
Two fields track who is involved in a booking request:
| Field | Meaning | Example |
|---|
requestedByUserId | Whose travel is being booked | The traveler or their manager |
createdByUserId | Who submitted the request | Only set when different from requestedByUserId |
Standard case (user books for themselves):
requestedByUserId: User A
createdByUserId: null
Delegation case (User B books for User A):
requestedByUserId: User A (the traveler)
createdByUserId: User B (the delegate who submitted)
Policy and budget are evaluated for requestedByUserId, ensuring the traveler's rules apply.
| Relation | Type | Description |
|---|
company | Company | The associated company |
requestedBy | User | The user the request is for |
createdBy | User | The user who created the request |
policy | Policy | The policy that was evaluated |
flightItems | FlightItem[] | Flight segments in the request |
hotelItems | HotelItem[] | Hotel bookings in the request |
travelers | Traveler[] | Travelers on the request |
A flight segment within a booking request.
| Field | Type | Required | Description |
|---|
id | string | Yes | Unique identifier |
bookingRequestId | string | Yes | Parent booking request ID |
originLocationId | string | Yes | Origin location ID |
originLocationType | string | Yes | Type: "airport", "city", "country" |
originCode | string | Yes | Airport/city code (e.g., "BGW") |
originName | string | Yes | Location name (e.g., "Baghdad") |
destinationLocationId | string | Yes | Destination location ID |
destinationLocationType | string | Yes | Type: "airport", "city", "country" |
destinationCode | string | Yes | Airport/city code |
destinationName | string | Yes | Location name |
departureDate | date | Yes | Flight departure date |
departureTime | string | Yes | Departure time (HH:MM) |
arrivalDate | date | Yes | Flight arrival date |
arrivalTime | string | Yes | Arrival time (HH:MM) |
airline | string | Yes | Airline name |
airlineCode | string | No | IATA airline code |
flightNumber | string | Yes | Flight number |
cabinClass | string | Yes | Cabin class (Economy, Business, etc.) |
adultsCount | number | Yes | Number of adult passengers |
childrenCount | number | Yes | Number of child passengers |
infantsCount | number | Yes | Number of infant passengers |
price | number | Yes | Flight price |
currency | string | Yes | Price currency |
| Field | Type | Description |
|---|
airlineLogo | string | CDN URL for airline logo |
A hotel booking within a booking request.
| Field | Type | Required | Description |
|---|
id | string | Yes | Unique identifier |
bookingRequestId | string | Yes | Parent booking request ID |
cityId | string | Yes | City ID |
cityCode | string | Yes | City code |
cityName | string | Yes | City name |
hotelId | string | Yes | Hotel ID |
hotelName | string | Yes | Hotel name |
hotelStars | number | No | Hotel star rating (1-5) |
checkInDate | date | Yes | Check-in date |
checkOutDate | date | Yes | Check-out date |
price | number | Yes | Total hotel price |
currency | string | Yes | Price currency |
| Relation | Type | Description |
|---|
roomOccupancy | RoomOccupancy[] | Room configurations |
Room configuration for a hotel booking.
| Field | Type | Required | Description |
|---|
id | string | Yes | Unique identifier |
hotelBookingRequestItemId | string | Yes | Parent hotel item ID |
roomName | string | Yes | Room type name |
boardBasis | string | Yes | Meal plan code (RO, BB, HB, FB, AI) |
adultsCount | number | Yes | Adults in this room |
childrenCount | number | Yes | Children in this room |
childrenAges | number[] | Yes | Ages of children |
A traveler associated with a booking request.
| Field | Type | Required | Description |
|---|
id | string | Yes | Unique identifier |
bookingRequestId | string | Yes | Parent booking request ID |
travelerId | string | Yes | Traveler profile ID |
travelerTypeCode | string | Yes | ADT, CHD, or INF |
createdAt | datetime | Yes | When added to request |
| Relation | Type | Description |
|---|
traveler | Traveler | The traveler profile |
Traveler profile information included with booking requests.
| Field | Type | Required | Description |
|---|
id | string | Yes | Traveler ID |
title | string | Yes | Title (mr, mrs, miss, ms) |
firstName | string | Yes | First name |
lastName | string | Yes | Last name |
emailAddress | string | No | Email address |
phone | string | Yes | Phone number |
birthDate | string | Yes | Birth date (ISO format) |
passports | Passport[] | No | Passport information |
Passport information for a traveler.
| Field | Type | Required | Description |
|---|
id | string | Yes | Passport ID |
passportNumber | string | Yes | Passport number |
nationality | string | Yes | Nationality |
issuingCountry | string | Yes | Issuing country |
issuingDate | string | Yes | Issue date (ISO format) |
expiryDate | string | Yes | Expiry date (ISO format) |
isPrimary | boolean | Yes | Whether this is the primary passport |
Company information included with booking requests.
| Field | Type | Required | Description |
|---|
id | string | Yes | Company ID |
name | string | Yes | Company name |
slug | string | Yes | Company slug |
User information included with booking requests.
| Field | Type | Required | Description |
|---|
id | string | Yes | User ID |
name | string | No | User display name |
email | string | No | User email address |
| Field | Max Length |
|---|
currency | 10 characters |
requestNotes | 5000 characters |
cabinClass | 50 characters |
flightNumber | 20 characters |
| Field | Min | Max |
|---|
totalPrice | 0 | - |
adultsCount | 0 | - |
childrenCount | 0 | - |
infantsCount | 0 | - |
hotelStars | 1 | 5 |
| Rule | Description |
|---|
departureDate ≤ arrivalDate | Departure before arrival |
checkInDate < checkOutDate | Check-in before check-out |
issuingDate < expiryDate | Passport validity |