Complete Booking Flows
This guide shows the complete end-to-end flows for booking tickets and rail passes, from initial search to confirmed purchase.
Ticket Booking Flow
- Search for journeys: Use
getJourneysto find available routes between locations - Select a journey: Choose from the available options (filter by type if needed)
- Get offers: Use
getJourneyOfferto get pricing options for the journey - Create booking: Call
createBookingwith the journey offer ID - Add passengers: Update booking with required passenger information
- Create order: Call
createOrderto pre-book tickets (wallet/invoice) orcreatePayment - Finalize order: Call
finalizeOrderto complete purchase (wallet/invoice), orders created by payment are finalized automatically - Wait for tickets: Tickets are issued automatically (usually within a couple minutes)
- Retrieve tickets: Fetch tickets from the finalized order
Rail Pass Booking Flow
- Search for passes: Use
getPassBundlesto find available rail passes - Select a pass: Choose the pass product, class, and travel days
- Create booking: Call
createBookingwith the pass bundle ID - Add passengers: Update booking with required passenger information
- Create order: Call
createOrderto pre-book tickets (wallet/invoice) orcreatePayment - Finalize order: Call
finalizeOrderto complete purchase (wallet/invoice), orders created by payment are finalized automatically - Wait for codes: Pass codes are issued automatically (usually within 15 minutes)
- Retrieve codes: Fetch pass codes from the finalized order
Payment Flow Comparison
The payment flow differs depending on your payment method:
Wallet Credits Flow
- Create order (pre-books tickets)
- Finalize order (deducts credits, triggers ticket issuance)
Payment Gateway Flow
- Create payment (returns payment URL)
- Redirect customer to All Aboard's payment page
- Customer pays
- Order is automatically finalized
- Tickets issued
Invoice Flow
- Create order (pre-books tickets)
- Finalize order (tracks for monthly invoicing, triggers ticket issuance)
- Monthly invoice for all orders
Common Patterns
Pattern 1: Simple Ticket Booking (Wallet)
Most common pattern for API integrations:
getJourneys→getJourneyOffer→createBookingupdateBooking→createOrder→finalizeOrdernode(poll order status and retrieve tickets)
Best for: Automated systems, high-volume operations
Pattern 2: Customer-Facing Booking (Payment Gateway)
For collecting payment from end customers:
getJourneys→getJourneyOffer→createBookingupdateBooking→createPayment→ Redirect to All Aboard's payment page- Customer pays → Order auto-finalized →
node(poll order status and retrieve tickets)
Best for: Customer-facing booking platforms
Pattern 3: Rail Pass Purchase
Simpler flow since passes don't have seat selection:
getPassBundles→createBookingupdateBooking→createOrder→finalizeOrdernode(poll order status and retrieve pass codes)
Best for: Flexible travel products, multi-city trips
Error Handling
Errors can occur at any step. Searches may fail, offers may be unavailable, or bookings may expire. Check the Error codes reference to identify and handle specific errors in your integration.
Next Steps
- See Finding Journeys for journey search details
- See Booking Tickets for complete booking guide
- See Payments for payment method details
- See Orders for order management