Booking Rail Passes

Just as with booking tickets, when buying rail passes you create a booking and update the passenger details before collecting payment and finalizing the order.

After getting a PassBundle you create a Booking by calling createBooking.

Filtering pass bundles

When searching for pass bundles, you can use PassBundleFilterInput to narrow results:

  • product — Specific pass product type (e.g. "interrail-global-pass")
  • class — Travel class (e.g. "1stclass"/"2ndclass")
  • campaignCode — Promotional campaign code
Example: Create a booking with rail passes
graphql
mutation CreateBooking {
  createBooking(passBundle: "6f1e9235-c218-4c39-a78b-d47d3623889b") {
    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: "b2f64e84-fd93-4cc7-849e-9b78fe10f5bf") {
    id
    passengers {
      id
      age
      type
    }
    requirements {
      countryResidence
      nationality
      dateOfBirth
      email
      tel
    }
    selections {
      ... on PassBundleSelection {
        class
        product
        price {
          amount
          currency
        }
        travelDayCount
        validityPeriod
      }
    }
  }
}

Updating Passengers

Before a booking can be confirmed you need to provide passenger details. 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 carrier and is the person who will be contacted in case of any issues.

Example: Updating passengers
graphql
mutation UpdatePassengers {
  updateBooking(
    id: "c3b419e9-c974-4b5e-b066-2bcddb334327"
    passengers: [
      {
        id: "2bc4a988-3542-46de-abbc-5735059906ad"
        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: "c3b419e9-c974-4b5e-b066-2bcddb334327"
    passengers: [
      {
        id: "2bc4a988-3542-46de-abbc-5735059906ad"
        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
      }
    }
  }
}

Create Order

Once you have a booking with all the offers selected and passengers updated, you can create an order. There are two ways of creating an order; either by creating a payment or by manually creating an order. The latter is a privileged operation and requires a special commercial configuration.

Get Pass Codes

Once an order has been finalized, passes are automatically issued. The issued pass code can be retrieved from the completed order. The pass code is then used in the respective pass provider services.

Pass issuing time

It may take 15 minutes or more for the passes to be issued and the codes to be made available in the API.

Just like with all types that implement the Node interface, you can use the node query to fetch an Order. See the details on how to query anything for more information.

Example: Get pass codes
graphql
query GetPassCodes {
  node(id: "9260536f-6dd1-4fa6-bfb6-e1ecfa1be681") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}
query GetPassCodes {
  node(id: "988717e5-d723-484a-b6db-9aa620cdb5f7") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}