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: "9eb755e2-1cea-4010-90bc-6c5b4de1f314") {
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: "ac4f51e9-d9ff-4f35-9f43-886262eacb27") {
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: "1d345a86-f196-4c04-81ff-f65aa863ffd3") {
... on Order {
items {
... on PassBundleOrderItem {
passenger {
firstName
lastName
}
code
class
product
travelDayCount
validityPeriod
}
}
}
}
}
query GetPassCodes {
node(id: "6f2cc7f5-11f7-4cee-920f-6ee5eead1591") {
... on Order {
items {
... on PassBundleOrderItem {
passenger {
firstName
lastName
}
code
class
product
travelDayCount
validityPeriod
}
}
}
}
}