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. Each profile's reference names it: the profile directory it is in and the id that directory gives the traveler.

Name the chosen profile with its reference, as passengerProfile: { directory, id }, 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 {
        reference {
          directory
          id
        }
        firstName
        lastName
        email
      }
    }
  }
}
subscription GetJourneyOffer {
  journeyOffer(
    journeyId: "5d42e65e-652a-4470-a91d-67a6f5669fb8"
    passengers: [
      {
        passengerProfile: {
          directory: "umbrella_faces"
          id: "3f2a8c1e-5b7d-4e9a-a6c2-8d1f0b4e7a95"
        }
      }
      { type: ADULT }
    ]
  ) {
    status
    itinerary {
      ... on SegmentCollection {
        offers {
          id
          price {
            amount
            currency
          }
        }
      }
    }
  }
}
mutation CreateBooking {
  createBooking(
    offerIds: ["offer_09zw7sgj84nztdnprdy0949my7"]
    passengers: [
      {
        passengerProfile: {
          directory: "umbrella_faces"
          id: "3f2a8c1e-5b7d-4e9a-a6c2-8d1f0b4e7a95"
        }
      }
      { type: ADULT }
    ]
  ) {
    id
    passengers {
      id
      passengerProfile {
        directory
        id
      }
      ... on FullPassenger {
        firstName
        lastName
        email
      }
    }
  }
}

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.

A field's type says what it holds, and so which input to show. A SELECT field lists its choices in options, which is empty for every other type. Send the value of the chosen option, read it back in the field's value, and show that option's label. Text is trimmed, any other value is refused, and null or blank text clears the field. The options are the field's own copy from when the booking was created. An order's field holds only the chosen option, so its options is that one entry, or empty when the field has no value, not the list of choices.

Example: Read a booking's custom fields

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

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
      label
      value
    }
  }
}

Next steps

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