Switch to dark mode

Passenger Profiles

A profile directory stores the details of people who travel often: names, contact details, date of birth, nationality and travel cards. Each person's entry is a passenger profile. Pick a profile when booking and the API fills in that passenger's details, so you don't have to ask for them again.

Profiles require the passenger_profiles:read scope (see API Scopes). Contact team@allaboard.eu to connect a profile directory.

Using a profile

Search the profile directory with passengerProfiles, by name or by email address. It returns the profiles you may book for, with their names, contact details and travel cards.

Pass the chosen profile's id as passengerProfileId on a passenger when you get offers and when you create the booking. The API prices the journey from the profile's birth date and travel cards, and fills in the passenger details the booking requires. Other passengers are added as usual.

Example: Price and book with a profile

query PassengerProfiles {
  passengerProfiles(filter: { query: "jane doe" }) {
    edges {
      node {
        id
        firstName
        lastName
        email
      }
    }
  }
}
subscription GetJourneyOffer {
  journeyOffer(
    journeyId: "5d42e65e-652a-4470-a91d-67a6f5669fb8"
    passengers: [
      { passengerProfileId: "umbrella_faces_profile_4ew0zx0rje7kts5gjv99dfwnmt" }
      { type: ADULT }
    ]
  ) {
    status
    itinerary {
      ... on SegmentCollection {
        offers {
          id
          price {
            amount
            currency
          }
        }
      }
    }
  }
}
mutation CreateBooking {
  createBooking(
    offerIds: ["offer_09zw7sgj84nztdnprdy0949my7"]
    passengers: [
      { passengerProfileId: "umbrella_faces_profile_4ew0zx0rje7kts5gjv99dfwnmt" }
      { type: ADULT }
    ]
  ) {
    id
    passengers {
      id
      firstName
      lastName
      email
      passengerProfileId
    }
  }
}

Custom fields

A profile directory can also define custom fields, such as an employee number or a project code, for each passenger and for the booking as a whole. Bookings carry them in customFields, filled from the profile where it holds a value. Set a passenger's fields with updateBooking, and the booking's with setCustomFields. The order can't be created while a required field is empty, and the fields can be changed until the order is paid.

Example: Read a booking's custom fields

query GetBooking {
  booking: node(id: "booking_0ek1b0y7w7x4ph1weq7a7yzdvh") {
    ... on Booking {
      customFields {
        key
        name
        type
        value
        required
        readonly
      }
      passengers {
        id
        customFields {
          key
          name
          type
          value
          required
          readonly
        }
      }
    }
  }
}
{
  "data": {
    "booking": {
      "customFields": [
        {
          "key": "008679ee-7956-44b6-92fa-3241e357ddeb",
          "name": "Purchase order",
          "type": "INPUT",
          "value": null,
          "required": true,
          "readonly": false
        }
      ],
      "passengers": [
        {
          "id": "06e4bfba-1f9b-48f0-b227-0eb125d68a54",
          "customFields": [
            {
              "key": "4d8a4bcd-b5f4-4122-95d7-71251bde9710",
              "name": "Employee number",
              "type": "INPUT",
              "value": "E-1042",
              "required": false,
              "readonly": true
            },
            {
              "key": "328d776f-b50e-4cc4-b696-e9fc18d5a601",
              "name": "Approved by manager",
              "type": "BOOLEAN",
              "value": true,
              "required": false,
              "readonly": false
            }
          ]
        }
      ]
    }
  }
}

Example: Set a booking's custom field

graphql
mutation SetCustomFields {
  setCustomFields(
    bookingId: "booking_0ek1b0y7w7x4ph1weq7a7yzdvh"
    fields: [
      { key: "008679ee-7956-44b6-92fa-3241e357ddeb", value: "PO-4711" }
    ]
  ) {
    customFields {
      key
      name
      value
    }
  }
}

Next steps

Booking Tickets
The rest of the booking flow.
Passenger Profile Errors
What searches, bookings and custom field changes can return.