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: "92a19ae3-f08f-4ce1-a404-3d637163b47e") {
    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: "8933ca76-2dff-4c43-b854-ce5ed302bd66") {
    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: "c82e991d-898c-402e-81ec-8ce7be47ff1a") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}
query GetPassCodes {
  node(id: "eb549cf3-1e19-4d15-947b-2e475b0cd230") {
    ... on Order {
      items {
        ... on PassBundleOrderItem {
          passenger {
            firstName
            lastName
          }
          code
          class
          product
          travelDayCount
          validityPeriod
        }
      }
    }
  }
}