Booking Rail Pass

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.

Example: Create a booking with rail passes
graphql
query CreateBooking {
  createBooking(passBundle: "99eff513-571a-4e44-a59f-ab78725da486") {
    id
    passengers {
      id
      age
      type
    }
    requirements {
      countryOfResidence
      nationality
      dateOfBirth
      email
      tel
    }
    selection {
      ... on PassBundleSelection {
        class
        product
        price {
          amount
          currency
        }
        travelDayCount
        validityPeriod
      }
    }
  }
}
query CreateBooking {
  createBooking(passBundle: "531f3b2e-204c-4676-9dc0-7da9d3a60bb1") {
    id
    passengers {
      id
      age
      type
    }
    requirements {
      countryOfResidence
      nationality
      dateOfBirth
      email
      tel
    }
    selection {
      ... on PassBundleSelection {
        class
        product
        price {
          amount
          currency
        }
        travelDayCount
        validityPeriod
      }
    }
  }
}

Create Order

Once you have a booking with all the fares 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 issed pass code can be retrieved from the completed order. The pass code is then to be 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 are made available in the API.

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

Example: Get pass codes
graphql
query GetPassCodes {
  node(id: "ff8fadd6-18f3-4589-842a-5d3784074108") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}
query GetPassCodes {
  node(id: "c0190690-aea8-448c-beb4-05ea8313d4d6") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}