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 journeys to find available routes between locations
  2. Select a journey: Choose from the available options (filter by type if needed)
  3. Get offers: Use journeyOffer to get pricing options for the journey
  4. Create booking: Call createBooking with one or more offer IDs (and optionally passengers)
  5. Save passengers: Call updateBooking with each passenger's details, marking exactly one passenger as the contact person (with email and phone number). createBooking only takes placeholders (type, age, travel cards), so this step is always required
  6. Create order: Call createOrder to pre-book tickets (the same first step for every payment method)
  7. Finalize order: Call finalizeOrder to complete the purchase (wallet/invoice), or pass the order's id to createPayment to collect payment. Payment orders are finalized automatically
  8. Wait for tickets: Tickets are issued automatically. Most are available within 15 minutes, but some take longer
  9. Retrieve tickets: Fetch tickets from the finalized order

Round Trips ​

Both directions are priced in one call, so operators that sell a genuine return fare can quote one. Steps 1 to 4 above become:

  1. Search each direction: Two journeys searches, the second with origin and destination swapped
  2. Select a journey in each direction
  3. Price them together: Use combinedJourneyOffer with the two journey IDs
  4. Create one booking: Call createBooking with the offer IDs from both directions in a single offerIds list

From there the flow continues unchanged. It is one booking, not one per direction: a return fare is a single ticket priced across both directions, so its offers can only be booked together. See Round Trips.

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. Save passengers: Call updateBooking with each passenger's details, marking exactly one passenger as the contact person (with email and phone number). This step is always required
  5. Create order: Call createOrder to pre-book the pass (the same first step for every payment method)
  6. Finalize order: Call finalizeOrder to complete the purchase (wallet/invoice), or pass the order's id to createPayment to collect payment. Payment orders are finalized automatically
  7. Wait for codes: Pass codes are issued automatically. Most are available within 15 minutes, but some take longer
  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 order (pre-books tickets)
  2. Create payment for that order (returns payment URL)
  3. Redirect customer to All Aboard's payment page
  4. Customer pays
  5. Order is finalized automatically
  6. 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. journeys → journeyOffer → createBooking
  2. updateBooking → createOrder → finalizeOrder
  3. node (poll the order until its tickets appear)

Best for: Automated systems, high-volume operations

Pattern 2: Customer-Facing Booking (Payment Gateway) ​

For collecting payment from end customers:

  1. journeys → journeyOffer → createBooking
  2. updateBooking → createOrder → createPayment → Redirect to All Aboard's payment page
  3. Customer pays → Order auto-finalized → node (poll the order until its tickets appear)

Best for: Customer-facing booking platforms

Pattern 3: Rail Pass Purchase ​

Simpler flow since passes don't have seat selection:

  1. getPassBundles → createBooking
  2. updateBooking → createOrder → finalizeOrder
  3. node (poll the order until its pass codes appear)

Best for: Flexible travel products, multi-city trips

Pattern 4: Passholder Reservations ​

For travelers who already hold an Interrail Pass:

  1. journeys → journeyOffer with the pass attached to each passenger → createBooking with the same passengers and the identifier
  2. updateBooking → createOrder → finalizeOrder
  3. node (poll the order until its tickets appear)

Best for: Passholders who need seat reservations. See Travel Cards for how cards change pricing.

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 ​