Reservations / Order Creation
Core booking system handling Order creation, lifecycle management, and passenger data. Built on an Order-Centric architecture where the Order is the Single Source of Truth.
Scope
Order-Centric Model (Primary)
The Order replaces the fragmented legacy approach. Every booking is an e-commerce transaction:
┌─────────────────────────────────────────────────────────────────┐
│ ORDER (UUID) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Flight │ │ Seat │ │ Baggage │ │ Meal │ │
│ │ SKU │ │ SKU │ │ SKU │ │ SKU │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │
│ State: OFFERED → PAID → FULFILLED │
│ │
└─────────────────────────────────────────────────────────────────┘
Key Principles:
- Universal Order ID (UUID v7): Primary identifier for all operations
- Seat as SKU: Every product is a line item in the order
- Single Source of Truth: All systems query the Order
- State-Driven: Check-in prohibited unless Order.Status == PAID
Order State Machine
OFFERED ──────────────► PAID ──────────────► FULFILLED
│ │ │
│ (10 min timeout) │ (refund/cancel) │ (post-flight)
▼ ▼ ▼
EXPIRED CANCELLED COMPLETED
| State | Allowed Actions |
|---|---|
| OFFERED | Add/remove items, pay, abandon |
| PAID | Check-in, modify, cancel |
| FULFILLED | Post-service claims |
Booking Flows
- Search → Select → Passenger Details → Ancillaries → Payment → Confirmation
- Multi-city and complex itineraries
- Round-trip and one-way bookings
- Group bookings (10+ passengers)
- Corporate/TMC bookings
Legacy PNR Compatibility
- Record locator (6-char) retained as secondary identifier
- Legacy systems can query by PNR, resolved to Order ID
- PNR generated for backward compatibility only
Research Topics
- Order state machine edge cases
- Booking validation rules
- SSR codes and handling (WCHR, VGML, etc.)
- Order expiration and cleanup
- Split/merge order operations
- Name change policies and implementation
- Multi-currency order handling
Architecture Considerations
Saga Pattern for Order Creation
1. HoldInventory (with compensation: ReleaseInventory)
↓ Order.Status = OFFERED
2. CreateOrder (with compensation: ExpireOrder)
↓
3. ProcessPayment (with compensation: RefundPayment)
↓ Order.Status = PAID
4. ConfirmOrder
↓
5. SendNotification
Order Data Model
Order
├── OrderID (UUID v7) ────────────── Primary identifier
├── RecordLocator (6-char) ───────── Legacy PNR reference
├── Status ───────────────────────── OFFERED | PAID | FULFILLED | etc.
├── ExpiresAt ────────────────────── For OFFERED state (10 min)
│
├── Customer
│ ├── CustomerID, Email, Phone
│ └── LoyaltyID (optional)
│
├── Passengers[]
│ ├── PassengerID, Name, Type (ADT/CHD/INF)
│ ├── Documents[]
│ └── SSRs[]
│
├── Items[] ──────────────────────── Line items (SKUs)
│ ├── SKU, Type (FLIGHT/SEAT/BAGGAGE/SERVICE)
│ ├── PassengerRef, SegmentRef
│ ├── Pricing (Base + Taxes + Total)
│ └── Status (OFFERED/CONFIRMED/DELIVERED)
│
├── Segments[]
│ ├── FlightNumber, Date, Route
│ ├── PriceTier (P1-P5)
│ └── CabinClass
│
├── Payments[]
│ ├── TokenRef (from vault)
│ ├── Amount, Currency
│ └── Status
│
└── History[] ────────────────────── Audit trail
Idempotency Requirements
- Order creation with client-generated request ID
- Payment processing must be idempotent
- Retry-safe inventory holds
- Optimistic locking for concurrent modifications
Integration Points
| System | Direction | Data |
|---|---|---|
| OMS | Central | Order state, all data |
| Inventory | Outbound | Holds, availability |
| Payment Vault | Outbound | Payment tokens |
| NDC | Inbound | Booking requests |
| DCS | Query | Order status for check-in |
| Notification | Outbound | Confirmation emails |
| Loyalty | Bidirectional | FFP numbers, earn/burn |
API Design
Key Endpoints
POST /orders- Create order (returns OFFERED state)GET /orders/{id}- Retrieve order by UUIDGET /orders?pnr={locator}- Retrieve by legacy PNRPUT /orders/{id}- Modify orderPOST /orders/{id}/pay- Process payment (transitions to PAID)DELETE /orders/{id}- Cancel orderPOST /orders/{id}/items- Add line item (SKU)
NDC Message Mapping
| Endpoint | NDC Message |
|---|---|
| Create | OrderCreateRQ/OrderViewRS |
| Retrieve | OrderRetrieveRQ/OrderViewRS |
| Modify | OrderChangeRQ/OrderViewRS |
| Cancel | OrderCancelRQ/RS |
| Pay | OrderPaymentRQ/RS |
Critical Business Rules
Revenue Protection
┌─────────────────────────────────────────────────────────────────┐
│ │
│ CRITICAL: Check-in PROHIBITED unless Order.Status == PAID │
│ │
│ DCS queries OMS in real-time. No passenger boards without │
│ confirmed payment. This eliminates revenue leakage. │
│ │
└─────────────────────────────────────────────────────────────────┘
10-Minute Hold Window
- OFFERED orders expire after 10 minutes
- Inventory automatically released on expiration
- Prevents phantom inventory blocking