Finding Rail Passes

Passes are fetched in bundles, called PassBundle, which are optimised based on the provided passengers. Given a set of passengers, the API will calculate the optimal combination of passes for the passengers based on commercial policies.

Use the getPassBundles query to get all available PassBundle for the given passengers.

Pass combination optimisation

The API will find the cheapest combination of passes that covers the passengers. E.g. a senior and a child travelling with together could use one senior Interrail pass and one youth pass. In this case the API will instead produce a bundle containing one adult Interrail pass and one child pass (which are free) resulting in a lower total price.

Including passenger nationality and countryOfResidence will further inform the API about which passes are applicable for the given passengers.

Example: Get all passes
graphql
query GetInterrailBundles {
  getPassBundles(passengers: [{ type: ADULT }, { type: YOUTH, age: 9 }]) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}
query GetInterrailBundles {
  getPassBundles(passengers: [{ type: ADULT }, { type: YOUTH, age: 9 }]) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}

Lookup Specific Passes

If you are looking a certain type of pass there are ways to narrow down the search results.

Filter by Product

All PassBundles have a product field which can be used to filter the results.

Example: Get all Interrail passes
graphql
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { product: "interrail-global-pass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { product: "interrail-global-pass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}

Filter by Class

The class filter can be used to get only passes of a certain class. The classes available depends on the product.

Example: Get all Interrail passes in first class
graphql
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { class: "1stclass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { class: "1stclass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}

Campaigns

Periodically the pass issuing authorities run campaigns on certain passes. By default only passes that are not part of a campaign will be returned. To get passes part of a specific campaign, use the campaign filter.

Conditions may apply

Pass campaigns often have specific conditions that apply, e.g. refundability or validity period. Make sure to check the conditions of the campaign before selling the pass.

Example: Get all Interrail passes part of the Black Friday campaign
graphql
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { campaign: "black-friday", product: "interrail-global-pass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}
query GetInterrailBundles {
  getPassBundles(
    passengers: [{ type: ADULT }]
    filter: { campaign: "black-friday", product: "interrail-global-pass" }
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}

Compare to Tickets

It is a common use case to compare the price of a pass to the price of a set of tickets. To make this easier, the API provides a way to get the applicable passes that are valid for a given JourneyOffer.

The getPassBundlesForJourneyOffer query will, just like getPassBundles, find passes that apply for the given passengers, and also make sure that the returned passes are valid in the countries travelled through and is valid for the correct amount of travel days needed for the journey.

Example: Get passes applicable for a journey offer
graphql
query GetApplicablePassBundles {
  getPassBundlesForJourneyOffer(
    journeyOffer: "96ada3d7-cb48-4dca-99f9-572cdec2adec"
    passengers: [{ type: ADULT }]
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}
query GetApplicablePassBundles {
  getPassBundlesForJourneyOffer(
    journeyOffer: "309b61e9-be45-48a5-a83b-91feb3b12d7f"
    passengers: [{ type: ADULT }]
  ) {
    id
    class
    product
    price {
      amount
      currency
    }
    travelDayCount
    validityPeriod
  }
}