Types

Below are all the available GraphQL types and fields. Please refer to the getting started guide for detailed information and examples on how to use the API.

Try it out

Explore the GraphQL Schema and start making requests with the interactive API console. Visit the console

Query

getLocations

Get location matching given query string


getAllLocations

Get all available locations


getJourneys

Get journeys between origin and destination on given date

  • Returns: [Journey!]!
  • Arguments:
    • origin: ID!

      Origin location uid

    • destination: ID!

      Destination location uid

    • date: Date!

      Date of departure


getJourneyOffer

Get fares for given journey, prefer socket


getJourneyForBlueprint

Get journey for given blueprint

  • Returns: Journey
  • Arguments:
    • blueprint: ID!

      Blueprint id to get journey for

    • date: Date!

      Date of departure


getPassBundles

Get applicable pass bundles for given passengers


getPassBundlesForJourneyOffer

Get applicable pass bundles for given journey offer


getJourneyRatings

Get comparative rating for journeys

  • Returns: [Float!]!
  • Arguments:
    • journeys: [ID!]!

      List of journey ids


getTicketingFee

Get fee for issuing tickets

  • Returns: Money
  • Arguments:
    • fares: [ID!]

      List of fares to get ticketing fee for

    • passBundle: ID

      Id of pass bundle to get ticketing fee for

    • currency: String (default: "EUR")

      Currency to display prices in


node

Get anything with an ID

  • Returns: Node
  • Arguments:
    • id: ID!

      Id of node

Mutation

createBooking

Create a booking

  • Returns: Booking!
  • Arguments:
    • journeyOffer: ID

      Id of journey to add to booking

    • passBundle: ID

      Id of pass bundle to att to booking

    • currency: String (default: "EUR")

      Currency to display prices in


updateBooking

Update an existing booking


createPayment

Create a payment which, once fulfilled, will create and finalize the order

  • Returns: Payment!
  • Arguments:
    • booking: ID!

      Id of booking to pay for

    • cancelUrl: String!

      URL to redirect to in the case of payment cancellation

    • successUrl: String!

      URI Template (RFC 6570) compliant string with {order} placeholder

    • metadata: String

      JSON encoded string of metadata to attach to order


createOrder

Confirm booking selections and prebook fares

  • Returns: Order!
  • Arguments:
    • booking: ID!

      Id of booking to confirm

    • metadata: String

      JSON encoded string of metadata to attach to order


finalizeOrder

Finalize order and fetch tickets

  • Returns: Order!
  • Arguments:
    • order: ID!

      Id of order to finalize

Subscription

getJourneys

Get journeys between origin and destination on given date

  • Returns: [Journey!]!
  • Arguments:
    • origin: ID!

      Origin location uid

    • destination: ID!

      Destination location uid

    • date: Date!

      Date of departure


getJourneyOffer

Get fares for given journey


getJourneyForBlueprint

Get journey for given blueprint

  • Returns: Journey
  • Arguments:
    • blueprint: ID!

      Blueprint id to get journey for

    • date: Date!

      Date of departure

Objects

AnonymousLocation

A station where stops may be made but journeys cannot be planned from/to

Fields


BlueprintJourney

The journey is planned according to a Itinerary Blueprint

Fields


BookingFare

A bookable fare offer for a journey

Fields


Booking

Non-finalized offer for collection order details

Fields


CompartmentType

A compartment type for a fare, e.g. Sleeper or Couchette

Fields


ExpertJourney

The journey is planned according to a predefined route

Fields


FullPassenger

All passenger details

Fields


GeoJsonPoint

Coordinates of a given location

Fields


GenericOrderItem

An inspecified item in an order

Fields


JourneyOffer

Fare result produced by a given journey

Fields


JourneySelection

The journey selected for an offer

Fields


JourneyFare

A fare offer for a journey

Fields


JourneyOfferSelection

Selected fare offers

Fields


JourneyOrderItem

Journey fare of placed order

Fields


Location

Known location from and to which journeys can be planned

Fields


Money

Monetary sum (in cent) of specified currency

Fields


NonStopJourney

The journey is the optimal route without any stopovers

Fields


NoChargeRedirect

No charge required

Fields


Operator

Operator details

Fields


Order

Finalized order

Fields


PiggybackJourney

The journey is partially based on a predefined route

Fields


PlacePreference

Possible place preferences

Fields


PassengerBundle

Passengers grouped by type

Fields


PassBundle

Bundle of Interrail passes

Fields


PassengerPlaceholder

The minium passenger details

Fields


PassengerRequirements

Details required for all passengers

Fields


PassBundleSelection

Selected Interrail bundle

Fields


PassBundleOrderItem

Interrail pass of placed order

Fields


Resource

File resource

Fields

  • name: String
  • type: String!

    MIME type, e.g. application/pdf, image/png, text/plain

  • url: String!

Segment

Individual train segment (physical train)

Fields


Stopover

Location for an overnight stopover

Fields


SegmentCollection

Set of segments that make up a journey leg

Fields


SmartJourney

The journey has been segmented into several travel days for comfort

Fields


SelectedFare

The selected fare of a journey offer

Fields


StripePayment

Payment using Stripe

Fields

Interfaces

Node

Any unique resource with an ID

Fields


Stop

Generic train stop

Fields


Journey

Journey result produced by any given search algorithm

Fields


Fare

Fare offer for given itinerary item

Fields


Passenger

A passenger with minimal details

Fields


Payment

Payment to be settled for an order

Fields

Enums

Transport

The mode of transport

Values

  • NIGHT_TRAIN
  • TRAIN
  • BUS
  • FERRY
  • NIGHT_BUS

JourneyStatus

The current status for a fare search result

Values

  • LOADING
  • SUCCESS
  • ERROR

SegmentCollectionStatus

The current status of a leg of a fare search result

Values

  • LOADING
  • SUCCESS
  • INDETERMINATE
  • UNKNOWN
  • ONE_DAY
  • NO_FARES
  • NO_TIMETABLE
  • UNABLE_TO_SELL

PassengerType

The type of passenger

Values

  • ADULT

    Ages 28-59

  • YOUTH

    Ages 0-27

  • SENIOR

    Ages 60+


PassengerBundleType

The resulting product type definition for a passenger

Values

  • ADULT
  • SENIOR
  • YOUTH
  • CHILD

PassengerTitle

The perferred title of a passenger (required by carriers)

Values

  • MR
  • MS
  • MX

OrderStatus

Current status of an order

Values

  • CONFIRMED

    Order is confirmed

  • PENDING_CONFIRMATION

    Order is partially confirmed

  • PENDING_PRE_BOOK

    Order has not yet been pre booked or confirmed

  • PRE_BOOKED

    Order has been pre booked, but not yet confirmed

  • REFUNDED

    The order has been refunded

  • UNKNOWN

    Unknown state


JourneyType

Type of journey

Values

  • BLUEPRINT
  • NON_STOP
  • EXPERT
  • PIGGYBACK
  • SMART

Unions

ItineraryItem

Items that can make up the itinerary of a Journey

Possible types


BookingSelection

Selections that can be part of a booking

Possible types


OrderItem

Items that can be part of an order

Possible types

Scalars

Date

UTC date string in the format yyyy-MM-dd


DateTime

UTC date string in the format yyyy-MM-ddTHH:mm


Duration

ISO 8601 formatted string, e.g. PT2H15M, P2D, P1M


ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.


String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.


Float

The Float scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).


Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.


Boolean

The Boolean scalar type represents true or false.

Inputs

ViaInput

Via stopover for a journey

Fields


PassPassengerInput

Passenger details for passholder

Fields


PassengerPlaceholderInput

Placeholder for passenger details

Fields


FullPassengerInput

Full passenger details

Fields


FareSelectionInput

Selection of fare for a journey offer

Fields


BookingSelectionInput

Selection for a booking

Fields


JourneyFilterInput

Filter for journey search

Fields


PassBundleFilterInput

Filter for pass bundles

Fields