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

  1. Search for journeys: Use getJourneys to find available routes between locations
  2. Select a journey: Choose from the available options (filter by type if needed)
  3. Get offers: Use getJourneyOffer to get pricing options for the journey
  4. Create booking: Call createBooking with the journey offer ID
  5. Add passengers: Update booking with required passenger information
  6. Create order: Call createOrder to pre-book tickets (wallet/invoice) or createPayment
  7. Finalize order: Call finalizeOrder to complete purchase (wallet/invoice), orders created by payment are finalized automatically
  8. Wait for tickets: Tickets are issued automatically (usually within a couple minutes)
  9. Retrieve tickets: Fetch tickets from the finalized order

Rail Pass Booking Flow

  1. Search for passes: Use getPassBundles to find available rail passes
  2. Select a pass: Choose the pass product, class, and travel days
  3. Create booking: Call createBooking with the pass bundle ID
  4. Add passengers: Update booking with required passenger information
  5. Create order: Call createOrder to pre-book tickets (wallet/invoice) or createPayment
  6. Finalize order: Call finalizeOrder to complete purchase (wallet/invoice), orders created by payment are finalized automatically
  7. Wait for codes: Pass codes are issued automatically (usually within 15 minutes)
  8. Retrieve codes: Fetch pass codes from the finalized order

Payment Flow Comparison

The payment flow differs depending on your payment method:

Wallet Credits Flow

  1. Create order (pre-books tickets)
  2. Finalize order (deducts credits, triggers ticket issuance)

Payment Gateway Flow

  1. Create payment (returns payment URL)
  2. Redirect customer to All Aboard's payment page
  3. Customer pays
  4. Order is automatically finalized
  5. Tickets issued

Invoice Flow

  1. Create order (pre-books tickets)
  2. Finalize order (tracks for monthly invoicing, triggers ticket issuance)
  3. Monthly invoice for all orders

Common Patterns

Pattern 1: Simple Ticket Booking (Wallet)

Most common pattern for API integrations:

  1. getJourneysgetJourneyOffercreateBooking
  2. updateBookingcreateOrderfinalizeOrder
  3. node (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:

  1. getJourneysgetJourneyOffercreateBooking
  2. updateBookingcreatePayment → Redirect to All Aboard's payment page
  3. 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:

  1. getPassBundlescreateBooking
  2. updateBookingcreateOrderfinalizeOrder
  3. node (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