All you need to sell rail

The All Aboard API provides tools for selling train tickets and rail passes across Europe. Whether you're building a booking platform, integrating rail travel into your travel app, or creating a custom booking experience, the API supports your needs.

What is All Aboard?

All Aboard offers three ways to sell rail travel:

  • The Dashboard: A user-friendly web interface for travel agents to book tickets and manage orders manually. Suited for smaller operations or when you need human oversight.

  • Embeds: Pre-built web components you can drop into any website. No coding required, just copy and paste. Useful for adding rail search and booking to existing sites quickly.

  • The API: A GraphQL API for building custom integrations. Search journeys, get prices, create bookings, and manage orders programmatically. Designed for automated systems and deep integrations.

Quick Start

The typical booking flows through the API isn't more than five or so operations.

1. Search for journeys

Find available train routes between two locations on a specific date.

graphql
query {
  getJourneys(
    origin: "Sb0ISveC"  # London
    destination: "p6fERure"  # Rome
    date: "2025-02-15"
  ) {
    id
    itinerary {
      # Journey details
    }
  }
}
query {
  getJourneys(
    origin: "Sb0ISveC"  # London
    destination: "p6fERure"  # Rome
    date: "2025-02-15"
  ) {
    id
    itinerary {
      # Journey details
    }
  }
}

2. Get pricing and offers

Once you have a journey, request pricing options (offers) for your passengers.

graphql
subscription {
  getJourneyOffer(
    journey: "journey-id"
    passengers: [{ type: ADULT }]
  ) {
    itinerary {
      ... on SegmentCollection {
        offers {
          price { amount currency }
          parts {
            # Offer details
          }
        }
      }
    }
  }
}
subscription {
  getJourneyOffer(
    journey: "journey-id"
    passengers: [{ type: ADULT }]
  ) {
    itinerary {
      ... on SegmentCollection {
        offers {
          price { amount currency }
          parts {
            # Offer details
          }
        }
      }
    }
  }
}

3. Create a booking

Select an offer and create a booking (createBooking). This confirms availability and price but doesn't book anything yet.

graphql
mutation {
  createBooking(journeyOffer: "offer-id") {
    id
    passengers {
      id
    }
    requirements {
      # What passenger info is needed
    }
  }
}
mutation {
  createBooking(journeyOffer: "offer-id") {
    id
    passengers {
      id
    }
    requirements {
      # What passenger info is needed
    }
  }
}

4. Add passenger details

Provide passenger information required by the train operator.

graphql
mutation {
  updateBooking(
    id: "booking-id"
    passengers: [
      {
        id: "passenger-id"
        firstName: "Jane"
        lastName: "Doe"
        email: "jane@example.com"
        # ... more details
      }
    ]
  ) {
    id
  }
}
mutation {
  updateBooking(
    id: "booking-id"
    passengers: [
      {
        id: "passenger-id"
        firstName: "Jane"
        lastName: "Doe"
        email: "jane@example.com"
        # ... more details
      }
    ]
  ) {
    id
  }
}

5. Create and finalize an order

Create an order (createOrder) to confirm the booking, not applicable if using the payment gateway. The tickets are now pre-booked and on hold, awaiting finalization.

graphql
mutation {
  createOrder(booking: "booking-id") {
    id
    status
  }
}
mutation {
  createOrder(booking: "booking-id") {
    id
    status
  }
}

Settle payment with the user before finalizing the order (finalizeOrder).

graphql
mutation {
  finalizeOrder(order: "order-id") {
    id
    status
  }
}
mutation {
  finalizeOrder(order: "order-id") {
    id
    status
  }
}

6. Retrieve tickets

Once finalized, tickets are automatically issued. Fetch them with the node query. Download as PDFs or get collection references.

graphql
query {
  node(id: "order-id") {
    ... on Order {
      items {
        resources {
          ... on PdfTicket {
            url
          }
        }
      }
    }
  }
}
query {
  node(id: "order-id") {
    ... on Order {
      items {
        resources {
          ... on PdfTicket {
            url
          }
        }
      }
    }
  }
}

That's it! You've completed a booking from search to confirmed tickets. For detailed guides on each step, see the sections below.

Typical User Flow

Understanding the booking lifecycle helps you build better integrations. The process works like this:

Journey Search: Find available routes between locations. A journey represents a complete trip, which may include multiple train segments and stopovers.

Offers: Pricing options for a journey. Different offers provide different fare types (flexible vs fixed), service classes, and comfort levels.

Booking: A temporary reservation that holds your selected offers. Bookings expire if not converted to orders within a set time.

Order: The confirmed purchase. Creating an order pre-books the tickets. Finalizing the order completes the purchase and triggers ticket issuance.

Tickets: Digital tickets issued by train operators. Most are PDFs, but some require check-in links or collect at station.

Choose Your Integration Path

Building a custom booking flow?

Start with the API documentation. You'll have full control over the user experience and can integrate rail booking into any application.

Need something quick?

Check out Embeds. Pre-built components that handle the complex parts of rail booking for you. Just add them to your website.

Booking manually?

Use the Dashboard for point-and-click booking. Suited for travel agents or when you need human oversight.

Next Steps

Suggested learning path:

  1. Getting Started with the API: Set up your API key, learn about endpoints, authentication, and technical details
  2. Finding Journeys: Learn how to search for train routes
  3. Getting Offers: Understand pricing and fare options
  4. Booking Tickets: Complete the booking process
  5. Payments: Learn about payment options (wallet, gateway, invoice)
  6. Rail Passes: Explore rail pass products

Reference Material

Need Help?