Booking Rail Passes
Booking rail passes follows the same flow as booking tickets: create a booking, add passenger details, then create and finalize an order. The main difference is that passes are issued as codes (not PDF tickets) that passengers use in the pass provider's app.
Creating a Booking
Start by creating a booking from a pass bundle. This reserves the pass but doesn't confirm it yet.
Example: Create a booking with rail passes
graphql
mutation CreateBooking {
createBooking(passBundle: "c624654a-7894-482b-b038-2d91f923426a") {
id
passengers {
id
age
type
}
requirements {
countryResidence
nationality
dateOfBirth
email
tel
}
selections {
... on PassBundleSelection {
class
product
price {
amount
currency
}
travelDayCount
validityPeriod
}
}
}
}mutation CreateBooking {
createBooking(passBundle: "f0d23894-a701-4a5e-b49e-90b51f0c126e") {
id
passengers {
id
age
type
}
requirements {
countryResidence
nationality
dateOfBirth
email
tel
}
selections {
... on PassBundleSelection {
class
product
price {
amount
currency
}
travelDayCount
validityPeriod
}
}
}
}The booking includes requirements that tell you what passenger information is needed. Pass requirements often include nationality and country of residence (some passes are only available to residents of certain countries).
Adding Passenger Details
Before you can create an order, provide all required passenger information. The booking's requirements field shows exactly what's needed.
One passenger must be marked as the contact person (isContactPerson: true). This person receives booking confirmations and pass codes. The contact person must provide both email and phone number.
Updating Passengers
Before a booking can be confirmed you need to provide passenger details using updateBooking. The booking will include the PassengerRequirements for the passengers.
Contact person
At least one passenger needs to be marked as the contact person. The contact person's details will be forwarded to the train operator and is the person who will be contacted in case of any issues.
Example: Updating passengers
graphql
mutation UpdatePassengers {
updateBooking(
id: "09a29b0e-6dd3-41ec-81dc-c3b3e021f7fe"
passengers: [
{
id: "eac00416-c170-46bd-8090-65b569594777"
email: "jane.doe@example.com"
isContactPerson: true
birthDate: "1980-02-15"
nationality: "NL"
firstName: "Jane"
lastName: "Doe"
title: MS
}
]
) {
id
passengers {
... on FullPassenger {
id
isContactPerson
email
birthDate
nationality
firstName
lastName
title
}
}
}
}mutation UpdatePassengers {
updateBooking(
id: "09a29b0e-6dd3-41ec-81dc-c3b3e021f7fe"
passengers: [
{
id: "eac00416-c170-46bd-8090-65b569594777"
email: "jane.doe@example.com"
isContactPerson: true
birthDate: "1980-02-15"
nationality: "NL"
firstName: "Jane"
lastName: "Doe"
title: MS
}
]
) {
id
passengers {
... on FullPassenger {
id
isContactPerson
email
birthDate
nationality
firstName
lastName
title
}
}
}
}Creating and Finalizing Orders
Once your booking has all passenger details, create an order. How you do this depends on your payment method:
- Wallet credits or invoice: Use
createOrderthenfinalizeOrder(see Orders) - Payment gateway: Use
createPayment(see Payments)
Most API users use wallet credits. See Payments for details on all payment methods.
Retrieving Pass Codes
Once an order is finalized, passes are automatically issued. Instead of PDF tickets, you receive pass codes that passengers use in the pass provider's mobile app or website.
Pass codes are usually available within 15 minutes of finalization, but can take longer during peak times.
Pass code availability
Pass codes may not be available immediately after finalization. Poll the order every few minutes until codes appear. Most codes are available within 15 minutes.
Retrieve pass codes from the finalized order:
Example: Get pass codes from finalized order
graphql
query GetPassCodes {
node(id: "1ddffa2e-825a-4fc8-816c-18908531e349") {
... on Order {
items {
... on PassBundleOrderItem {
passenger {
firstName
lastName
}
code
class
product
travelDayCount
validityPeriod
}
}
}
}
}query GetPassCodes {
node(id: "490a51db-7c9c-479e-97e8-8fa81d2021b1") {
... on Order {
items {
... on PassBundleOrderItem {
passenger {
firstName
lastName
}
code
class
product
travelDayCount
validityPeriod
}
}
}
}
}Each passenger gets their own pass code. Share the code with the passenger; they use it to activate their pass in the provider's app (e.g., Interrail/Eurail app, BritRail app).
Pass Activation
Pass codes are used to activate passes in the provider's mobile app or website. Passengers:
- Download the provider's app (e.g., Interrail/Eurail app)
- Enter the pass code
- Activate the pass (usually on their first travel day)
- Use the pass to travel on trains
The pass code includes all the details passengers need: product type, class, travel days, and validity period.
Complete Flow Summary
The complete pass booking flow:
- Find passes using
getPassBundles(see Finding Rail Passes) - Create booking from a pass bundle
- Add passenger details (required information)
- Create order (pre-books the pass)
- Finalize order (completes purchase, triggers pass code issuance)
- Retrieve pass codes (share codes with passengers)
For detailed information on each step, see the relevant sections in this documentation.