All you need to sell rail ​

The All Aboard API provides tools for selling train tickets and rail passes across Europe. Use it to build a booking platform, add rail travel to your travel app, or create a custom booking experience.

What is All Aboard? ​

All Aboard offers three ways to sell rail travel:

  • The Dashboard: A 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.

Psst. Working with AI agents? Try our MCP server.

Quick Start ​

A ticket booking through the API takes seven operations. Try them in the test GraphQL console with a test API key (see Getting Started), copying the ids each step returns into the next one. Booking Flows summarizes the same steps for every payment method, and for rail passes.

1. Search for journeys ​

Find train journeys between two locations on a date. Pick a journey and copy its id.

graphql
query Journeys {
  journeys(
    origin: { uid: "Sb0ISveC" } # London
    destination: { uid: "p6fERure" } # Rome
    date: "2026-11-09"
  ) {
    id
    status
    itinerary {
      ... on SegmentCollection {
        segments {
          departureAt
          identifier
        }
      }
    }
  }
}
query Journeys {
  journeys(
    origin: { uid: "Sb0ISveC" } # London
    destination: { uid: "p6fERure" } # Rome
    date: "2026-11-09"
  ) {
    id
    status
    itinerary {
      ... on SegmentCollection {
        segments {
          departureAt
          identifier
        }
      }
    }
  }
}

2. Get offers ​

Request prices for the journey and your passengers (journeyOffer). Each leg of the journey (SegmentCollection) has its own offers. Copy the id of the offer you want for each leg.

graphql
query JourneyOffer {
  journeyOffer(
    journeyId: "JOURNEY_ID"
    passengers: [{ type: ADULT }]
  ) {
    status
    itinerary {
      ... on SegmentCollection {
        status
        offers {
          id
          price {
            amount
            currency
          }
        }
      }
    }
  }
}
query JourneyOffer {
  journeyOffer(
    journeyId: "JOURNEY_ID"
    passengers: [{ type: ADULT }]
  ) {
    status
    itinerary {
      ... on SegmentCollection {
        status
        offers {
          id
          price {
            amount
            currency
          }
        }
      }
    }
  }
}

3. Create a booking ​

Create a booking from the offer ids (createBooking), with the same passengers you priced. This doesn't book anything with the operator yet. Copy the booking id and the passenger ids.

graphql
mutation CreateBooking {
  createBooking(
    offerIds: ["OFFER_ID"]
    passengers: [{ type: ADULT }]
  ) {
    id
    expiresAt
    passengers {
      id
    }
    requirements {
      passportNumber
      dateOfBirth
      nationality
      email
      tel
    }
  }
}
mutation CreateBooking {
  createBooking(
    offerIds: ["OFFER_ID"]
    passengers: [{ type: ADULT }]
  ) {
    id
    expiresAt
    passengers {
      id
    }
    requirements {
      passportNumber
      dateOfBirth
      nationality
      email
      tel
    }
  }
}

4. Add passenger details ​

Add names and contact details with updateBooking, plus anything listed in requirements. Exactly one passenger must be the contact person, with email and tel.

graphql
mutation UpdatePassengers {
  updateBooking(
    id: "BOOKING_ID"
    passengers: [
      {
        id: "PASSENGER_ID"
        firstName: "Jane"
        lastName: "Doe"
        email: "jane.doe@example.com"
        tel: "+46701234567"
        isContactPerson: true
      }
    ]
  ) {
    id
  }
}
mutation UpdatePassengers {
  updateBooking(
    id: "BOOKING_ID"
    passengers: [
      {
        id: "PASSENGER_ID"
        firstName: "Jane"
        lastName: "Doe"
        email: "jane.doe@example.com"
        tel: "+46701234567"
        isContactPerson: true
      }
    ]
  ) {
    id
  }
}

5. Create an order ​

Create an order (createOrder). This pre-books the tickets with the operator and is the same step for every payment method. It can take up to 30 seconds. Copy the order id.

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

6. Finalize the order ​

Finalize the order (finalizeOrder) to complete the purchase with your wallet or invoice. If your customer pays through the payment gateway instead, pass the order's id to createPayment; the order is finalized automatically after payment.

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

7. Retrieve tickets ​

Tickets are issued after finalization. Most are available within 15 minutes, but some take longer. Poll the order with node until resources appear. The order status turns CONFIRMED when the purchase completes, before the tickets are ready, so don't wait on the status.

graphql
query GetTickets {
  node(id: "ORDER_ID") {
    ... on Order {
      status
      items {
        ... on JourneyOrderItem {
          resources {
            ... on PdfTicket {
              url
            }
            ... on CheckInResource {
              url
            }
            ... on TicketOnDeparture {
              reference
              description
            }
          }
        }
      }
    }
  }
}
query GetTickets {
  node(id: "ORDER_ID") {
    ... on Order {
      status
      items {
        ... on JourneyOrderItem {
          resources {
            ... on PdfTicket {
              url
            }
            ... on CheckInResource {
              url
            }
            ... on TicketOnDeparture {
              reference
              description
            }
          }
        }
      }
    }
  }
}

For the terms used above, see Key Concepts. For details on each step, see the guides in the sidebar.

Choose Your Integration Path ​

Building a custom booking flow? ​

Start with Getting Started and the Quick Start above. 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. Booking Flows: See every step from search to tickets
  3. Finding Journeys: Learn how to search for train routes
  4. Getting Offers: Understand pricing and fare options
  5. Booking Tickets: Complete the booking process
  6. Orders and Payments: Complete the purchase with your payment method (wallet, gateway, invoice)
  7. Rail Passes: Explore rail pass products

Reference Material ​

Need Help? ​