Skip to content

Phase 1 - Set up bag selection flow

The first phase of integrating with Gordian consists of installing our Javascript SDK on your existing site, sending customer information to our SDK and interacting with the Gordian endpoints to display the bag selection and fulfill the customer’s choice of bags.

We break out each step in detail so you can measure success at each checkpoint.

Tip

For all API calls we provide examples but you can also reference them in our Postman Collection.

1. Set up script tag

In order to enable our Dynamic Upsell Widget to display our bag selection to your customers, you will first need to enable the widget on your website funnel. To do so, simply add the following tag to the header of the page you wish to display the bag selection on:

<script src="https://sdk.gordiansoftware.com/javascript/v2.2/gordian.min.js"></script>

2: Get user trip details

After a user selects an itinerary on your website, send this information to your backend via an internal endpoint. This information will be shared with Gordian in the next step and will enable us to access and return the correct bag availability data.

Tip

At this point it’s not necessary to share any traveler information (e.g., first name, last name, date of birth, etc.) just yet.

3: Create a trip with Gordian

All ancillary searches are linked to a trip, which represents a user’s trip.

To create a trip, from your backend server, use the https://api.gordiansoftware.com/v2.2/trip endpoint with your api_key. More details below:

  • POST https://api.gordiansoftware.com/v2.2/trip

  • Authorization: For server-to-server calls, send your API key as the username and a blank password. For example, curl -u $API_KEY: https://api.gordiansoftware.com/...

  • HTTP Authorization Scheme: basic

Sample request
{
  "language": "en-US",
  "currency": "USD",
  "country": "US",
  "search": {
    "bag": {
      "search": true
    }
  },
  "tickets": [
    {
      "status": "offered",
      "offered_price": {
        "currency": "USD",
        "decimal_places": 2,
        "base_price": 7000,
        "markup": 0,
        "total": 7000
      },
      "journeys": [
        {
          "segments": [
            {
              "arrival_airport": "LAS",
              "arrival_time": "2023-07-05T15:54:00-08:00",
              "departure_airport": "PDX",
              "departure_time": "2023-07-04T13:38:00-08:00",
              "fare_basis": "LKX9C3B4",
              "fare_class": "L",
              "fare_family": "ECONOMY_BASIC",
              "marketing_airline": "NK",
              "marketing_flight_number": "671"
            }
          ]
        },
        {
          "segments": [
            {
              "arrival_airport": "PDX",
              "arrival_time": "2023-07-10T12:52:00-08:00",
              "departure_airport": "LAS",
              "departure_time": "2023-07-10T10:39:00-08:00",
              "fare_basis": "LKX9C3B4",
              "fare_class": "L",
              "fare_family": "ECONOMY_BASIC",
              "marketing_airline": "NK",
              "marketing_flight_number": "765",
              "operating_airline": "NK",
              "operating_flight_number": "765"
            }
          ]
        }
      ],
      "metadata": {
        "your-id": "your-key"
      }
    }
  ],
  "passengers": [
    {
      "passenger_id": "pax-0001",
      "passenger_type": "adult"
    },
    {
      "passenger_id": "pax-0002",
      "passenger_type": "infant",
      "on_lap_of": "pax-0001"
    }
  ]
}

Tip

This is where you define the mark-ups that will be applied to the ancillary. If you do not have a fare class for the trip just input null.

In the response, you will receive two tokens that will be required in the subsequent steps of the customer journey: trip_access_token and refresh_token. You will need to return these back to the frontend via the internal endpoint from Step 2. This is where some users have trouble. If you continue to get stuck at this stage please reach out to our team to see where we can help!

Sample Response
Reference the `trip_id` and `trip_access_token` fields
    {
      "trip_state_hash": "69abcc117863186292bdf5f1c0d94db1e5227210935e6abe039cfb017cbefbee",
      "country": "AD",
      "currency": "USD",
      "language": "zh-HK",
      "journeys": [
        {
          "segments": [
            {
              "segment_id": "string",
              "departure_airport": "string",
              "departure_airport_name": "string",
              "departure_city": "string",
              "departure_city_name": "string",
              "arrival_airport": "string",
              "arrival_airport_name": "string",
              "arrival_city": "string",
              "arrival_city_name": "string",
              "arrival_time": "2020-12-24T08:49:00-07:00",
              "departure_time": "2020-12-24T08:49:00-07:00",
              "marketing_airline": "string",
              "operating_airline": "string",
              "operating_flight_number": "string",
              "marketing_flight_number": "string",
              "number_of_stops": 0,
              "metadata": {},
              "fare_basis": "string",
              "fare_class": "string",
              "fare_family": "string"
            }
          ]
        }
      ],
      "orders": { },
      "to_cancel": { },
      "passengers": [
        {
          "passenger_id": "a3f62964-0709-433f-b313-f29a08471a31",
          "on_lap_of": "string",
          "first_names": "Vincent Willem",
          "surname": "Van Gogh",
          "loyalty_programs": [
            {
              "airline_id": "string",
              "program_name": "rapid_rewards",
              "number": "string",
              "tier_name": "string"
            }
          ],
          "date_of_birth": "2000-01-01",
          "gender": "male",
          "title": "string",
          "type": "adult",
          "metadata": {},
          "identity_documents": [
            {
              "document_type": "known_traveller",
              "document_number": "string"
            }
          ]
        }
      ],
      "contact_details": {
        "contact_details_type": "passenger",
        "passenger_id": "a3f62964-0709-433f-b313-f29a08471a31",
        "email": "joe.bloggs@example.com",
        "phone_number": "+44 7777 111 22222",
        "address": {
          "city": "Beverly Hills",
          "country": "AD",
          "postal_code": "90210",
          "street_address_1": "123 Main Street",
          "street_address_2": "Unit 1A",
          "state": "CA"
        }
      },
      "tickets": [
        {
          "basket_item_ids": [
            "dffdfd40-d29b-4777-b57e-21de2b4a8e3d"
          ],
          "journey_ids": [
            "ec94d475-73af-4739-b2a1-607cda351b26"
          ],
          "status": "in_basket",
          "ticket_id": "aa509d3a-7066-4c9e-bd13-dbfa87181ff5",
          "access_details": {
            "record_locator": "AB12CD3",
            "ticket_number": "123-1234567890",
            "reference_name": "BLOGGS",
            "reference_email": "joe@bloggs.com",
            "ticketing_channel": {
              "record_locator": "ABC123",
              "name": "sabre"
            }
          },
          "basket_item_id": "dffdfd40-d29b-4777-b57e-21de2b4a8e3d"
        }
      ],
      "trip_id": "03f2d22a-9d4b-4978-be84-074690e97ea8",
      "corporate_identifiers": {
        "property1": {
          "corporate_id": "string",
          "name": "string"
        },
        "property2": {
          "corporate_id": "string",
          "name": "string"
        }
      },
      "basket": { },
      "trip_access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0cmlwX2lkIjoiMDNmMmQyMmEtOWQ0Yi00OTc4LWJlODQtMDc0NjkwZTk3ZWE4IiwiaW50ZWdyYXRpb25faWQiOiJkZW1vIn0.VnUKekFOWXBWXyl4A_iuAN2c2o-rRjZH_tDUAYnTgPg",
      "refresh_token": "string",
      "search_id": "70d87fd6-2819-4c00-9ea5-376077656b8b"
    }

Tip

For more details please access our full API guide here.

4: Initialize Gordian SDK

To initialize the Gordian SDK, call the Gordian.init function that will be attached to the browser Window object on the frontend. This function requires:

  • The trip_id and trip_access_token you received from creating a trip.
  • A callback function into onBasketChange. This function helps you keep track of the products the customer has selected and the state of those products.
Sample request
    Gordian.init({
      tripId: "c1859ade-6ceb-4a7f-9a08-bf5ff33f1129",
      tripAccessToken: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0cl9pZCI6ImMxODU5YWRlLTZjZWItNGE3Zi05YTA4LWJmNWZmMzNmMTEyOSIsImluX2lkIjoiZjM5ZTRkZGQtNGM0Zi00ZTczLWJkOGUtNzBlNjRlZjBhNDdjIiwic2FuZGJveCI6ZmFsc2V9.F3hAHVoHut1Qkpm-wUUkK6b-_DHGMLpJ6CWf9A5ifuLBilwfK52aDVeW8axzwCA2dddKV8oq_Vdo90Z6sv-l_XfVoHsRkSBkSuZsLhj9TZ6WcYElstKr5NJxxUWG6muax_i4ceMTLbWIItr1QUtsSqVGHqrGj46Xvw5hebip-wCnhAjE3-N3rqzM_skDHnJEQwX9OiexrXFXtvwPyhp5UMaDCeuH2j9pw1VnURQVYsv8hBxdyCOWfdiHcwgFzKkSuja2PyYXTk9R1LgJm0KFICEbRer0L31lDYfuxo5_3OK8mnUD0P40xr4g9xoeiQkWumlDJ4fz6crIqlvv1hfj0g",
      onBasketChange: onBasketChange
    });

Tip

For more details on additional parameters to initialize the SDK, click here

Some of these additional parameters may include: onSeatLoad - onSeatModalClosed - onBagLoad - onBagModalClosed - onSeatFail - onBagFail.

5: Display Gordian bag selection to user

Once the SDK is initialized, use the Gordian.showUpsell function to display the seat map to the customer.

The following is a sample code snippet:

Gordian.showUpsell({
  container: document.getElementById("upsell-container"),
  display: "card", // card | embedded | modal
  allowProducts: ["bags"], //"seats", "fare_family_upsell", "priority_boading"...
  excludeProducts: [""],
  theme: {
    textPrimary: '#002244',
  },
})

The showUpsell function has the following inputs:

  • container: The element ID of the container you want to display the widget within.
  • display: This controls how the product is presented to the customer.
  • allowProducts: The product type you want to display. For example, use allowProducts:["bags"] to display only bags.
  • excludeProducts: The product type you do not want to display. For example, use excludeProducts:["seats"] to display all products but seats.
  • theme: Parts of the bag visualization can be configured through the theme parameter. More information on theming can be found here.

Tip

Using multiple display types: Each instance of the Dynamic Upsell widget can only have a single display type. To display two product types in two different displays, add two instances of the Dynamic Upsell widget on your page with different allowed and excluded products.
For more details on seat map display options, click here.

6: Integrate the Gordian basket

Now that the SDK is able to display the Gordian bag selection, you need to keep track of the products the customer selected for purchase using the basket functionality.

Warning

Any product that the customer selects must be added to your checkout basket. It is critical that you actively track which products are added or removed from the widget.

Whenever the basket has anything added or removed, or if an item in the basket expires, the widget calls the onBasketChange function.

Sample of this function
const onBasketChange = ({ basket }) => {
  var basketBody = document.getElementById("basket-body");
  basketBody.innerHTML = "";
  for (var key in basket) {
    const product = basket[key];
    var row = document.createElement("tr");
    row.classList.remove("invalid");
    var productCell = document.createElement("td");
    var priceCell = document.createElement("td");
    productCell.innerText = product.display_name;
    priceCell.innerText = window.Gordian.formatPrice(
      product.price.total.amount,
      product.price.total.decimal_places,
      product.price.total.currency
    );
    var message = document.createElement("message");

    product.validity = product.validity;
    if (product.validity.state === "valid") {
    } else if (product.validity.state === "checking") {
      row.classList.add("checking");
      message.innerText = "Checking if this product is still available...";
    } else if (product.validity.state === "price_changed") {
      row.classList.add("price_changed");
      message.innerText = "The price for this product has changed!";
    } else if (product.validity.state === "unavailable") {
      row.classList.add("unavailable");
      message.innerText = "Sorry, this product is no longer available";
    }
    priceCell.appendChild(message);
    row.appendChild(productCell);
    row.appendChild(priceCell);
    basketBody.appendChild(row);
  }

The single parameter to onBasketChange is a JSON representation of the whole customer trip. When you receive the JSON object, update your local basket with this new set by replacing all the products previously selected.

The basket includes a lot of granularity on each product. At a minimum, include the display_name and the price of each product in your basket for the customer's reference.

The function Gordian.formatPrice helps you render the price for your user.

Invalid products
Products can become invalid because of changed availability or because of new passenger information, such as the age of the passenger or loyalty program information. When the validity changes, the onBasketChanged function retrieves different values for the validity field. You must check the new value to decide if there are actions needed. The possible values are the following:

Validity value Description Action
valid This product is still valid. N/A
checking Checking is in progress. Show a spinner to the user.
price_changed The price changed. Show the price change to the user and allow them to accept or reject it.
unavailable The product is not available. Inform the user, remove the product from the basket and call the showUpsell function to select an alternative.

7: Validate basket and charge user

Review the contents of the basket by polling the basket contents.

  • GET https://api.gordiansoftware.com/v2.2/trip/{trip_id}/basket
Sample response
{
  "trip_state_hash": "69abcc117863186292bdf5f1c0d94db1e5227210935e6abe039cfb017cbefbee",
  "basket": {
    "1c3df555-a2dc-4813-a055-2a8bf56fd8f1": {
      "basket_item_id": "1c3df555-a2dc-4813-a055-2a8bf56fd8f1",
      "benefits": [],
      "display_name": "10kg Bag",
      "price": {
        "base": {
          "amount": 2000,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 1820,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 600,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 546,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 200,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 182,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 2400,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 2184,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "checked": false,
        "journey_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba",
        "passenger_id": "p1",
        "size": 150,
        "size_unit": "cm",
        "weight": 10,
        "weight_unit": "kg"
      },
      "product_id": "741bcc97-c2fe-4820-b14d-f11f32e6fadb",
      "product_type": "bag",
      "quantity": 1,
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "2654f3f9-8990-4d2e-bdea-3b341ad5d1de": {
      "basket_item_id": "2654f3f9-8990-4d2e-bdea-3b341ad5d1de",
      "benefits": [],
      "display_name": "Seat 15C",
      "price": {
        "base": {
          "amount": 2000,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 1820,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 400,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 364,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 200,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 182,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 2600,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 2366,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "column": "C",
        "passenger_id": "p1",
        "row": 15,
        "segment_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba"
      },
      "product_id": "a17e10ca-0c9a-4691-9922-d664a3b52382",
      "product_type": "seat",
      "quantity": 1,
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "5d5e1bce-4577-4118-abcb-155823d8b4a3": {
      "basket_item_id": "5d5e1bce-4577-4118-abcb-155823d8b4a3",
      "benefits": [],
      "display_name": "10kg Bag",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "checked": false,
        "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
        "size": 150,
        "size_unit": "cm",
        "weight": 10,
        "weight_unit": "kg"
      },
      "product_id": "c074cd12-6b7f-4773-85d5-ddf1d1fd4a46",
      "product_type": "bag",
      "quantity": 2,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "6acd57ba-ccb7-4e86-85e7-b3e586caeae2": {
      "basket_item_id": "6acd57ba-ccb7-4e86-85e7-b3e586caeae2",
      "benefits": [],
      "display_name": "Seat 16A",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "column": "A",
        "passenger_id": "p1",
        "row": 16,
        "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
      },
      "product_id": "8b894895-da86-48d8-a787-0b834aa54e08",
      "product_type": "seat",
      "quantity": 1,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "dffac4ba-73b9-4b1b-9334-001817fff0cf": {
      "basket_item_id": "dffac4ba-73b9-4b1b-9334-001817fff0cf",
      "benefits": [],
      "display_name": "Economy Ticket",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "journeys": [
          {
            "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
            "segments": [
              {
                "arrival_airport": "LHR",
                "arrival_time": "2020-07-07T22:30:00Z",
                "departure_airport": "EDI",
                "departure_time": "2020-07-07T21:10:00Z",
                "fare_basis": "OTZ0RO/Y",
                "fare_class": "O",
                "fare_family": "Basic Economy",
                "marketing_airline": "BA",
                "marketing_flight_number": "1465",
                "number_of_stops": 0,
                "operating_airline": "BA",
                "operating_flight_number": "1465",
                "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
              }
            ]
          }
        ]
      },
      "product_id": "2846068e-6fd0-4329-ac70-da79a57b21f7",
      "product_type": "ticket",
      "quantity": 1,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    }
  },
  "journeys": [
    {
      "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
      "segments": [
        {
          "arrival_airport": "LHR",
          "arrival_time": "2020-07-07T22:30:00Z",
          "departure_airport": "EDI",
          "departure_time": "2020-07-07T21:10:00Z",
          "fare_basis": "OTZ0RO/Y",
          "fare_class": "O",
          "fare_family": "Basic Economy",
          "marketing_airline": "BA",
          "marketing_flight_number": "1465",
          "number_of_stops": 0,
          "operating_airline": "BA",
          "operating_flight_number": "1465",
          "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
        }
      ]
    },
    {
      "journey_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba",
      "segments": [
        {
          "arrival_airport": "EDI",
          "arrival_time": "2020-07-14T08:35:00Z",
          "departure_airport": "LGW",
          "departure_time": "2020-07-14T07:05:00Z",
          "fare_basis": "NALZ0KO/Y",
          "fare_class": "N",
          "fare_family": "Basic Economy",
          "marketing_airline": "BA",
          "marketing_flight_number": "2500",
          "number_of_stops": 0,
          "operating_airline": "BA",
          "operating_flight_number": "2500",
          "segment_id": "7d693cb0-d6d8-49f0-9489-866b3d789215"
        }
      ]
    }
  ]
}

Tip

For more detail on polling the basket, click here.

  • Confirm that all the products in the basket have the status of valid.

    • If the products have other status values, proceed as follows:

      Status value Action item
      checking Poll the basket information endpoint until the check is complete.
      invalid Start a check of the basket to refresh validity.
      unavailable Inform the customer and possibly give them the option to select alternatives.
      price_changed Inform the customer and possibly give them the option to select alternatives.
  • Confirm that the customer sees the final price before proceeding.

  • Now we need to validate the basket and charge user.
    • If the valid_until date has passed, then the check basket endpoint needs to be called to revalidate the basket.
    • Then start Step 7: Validate basket and charge user over once more.

8: Update trip and request Gordian fulfillment

Update the trip information with all pending details such as record locator (aka PNR).

  • PATCH https://api.gordiansoftware.com/v2.2/trip/{trip_id}

  • Authorization: For server-to-server calls, send your API key as the username and a blank password. For example, curl -u $API_KEY: https://api.gordiansoftware.com/...

  • HTTP Authorization Scheme: basic

Sample request
{
  "passengers": [
    {
      "passenger_id": "21200cbc-f9a9-42ba-a059-bd11ef9e6739",
      "date_of_birth": "2000-01-01",
      "first_names": "Vincent Willem",
      "surname": "Van Gogh",
      "loyalty_programs": [
        {
          "airline_id": "IB",
          "program_name": "iberia_plus",
          "number": "1234567890"
        }
      ]
    },
    {
      "passenger_id": "0a6e6404-063f-4e37-98b8-77451356696f",
      "date_of_birth": "2020-01-01",
      "on_lap_of": "21200cbc-f9a9-42ba-a059-bd11ef9e6739",
      "first_names": "John",
      "surname": "Doe"
    }
  ]
}
 ```
 </details>

 <details closed>
 <summary>Sample response</summary>

```json
{
  "trip_state_hash": "69abcc117863186292bdf5f1c0d94db1e5227210935e6abe039cfb017cbefbee",
  "basket": {
    "1c3df555-a2dc-4813-a055-2a8bf56fd8f1": {
      "basket_item_id": "1c3df555-a2dc-4813-a055-2a8bf56fd8f1",
      "benefits": [],
      "display_name": "10kg Bag",
      "price": {
        "base": {
          "amount": 2000,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 1820,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 600,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 546,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 200,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 182,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 2400,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 2184,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "checked": false,
        "journey_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba",
        "passenger_id": "p1",
        "size": 150,
        "size_unit": "cm",
        "weight": 10,
        "weight_unit": "kg"
      },
      "product_id": "741bcc97-c2fe-4820-b14d-f11f32e6fadb",
      "product_type": "bag",
      "quantity": 1,
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "2654f3f9-8990-4d2e-bdea-3b341ad5d1de": {
      "basket_item_id": "2654f3f9-8990-4d2e-bdea-3b341ad5d1de",
      "benefits": [],
      "display_name": "Seat 15C",
      "price": {
        "base": {
          "amount": 2000,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 1820,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 400,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 364,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 200,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 182,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 2600,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 2366,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "column": "C",
        "passenger_id": "p1",
        "row": 15,
        "segment_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba"
      },
      "product_id": "a17e10ca-0c9a-4691-9922-d664a3b52382",
      "product_type": "seat",
      "quantity": 1,
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "5d5e1bce-4577-4118-abcb-155823d8b4a3": {
      "basket_item_id": "5d5e1bce-4577-4118-abcb-155823d8b4a3",
      "benefits": [],
      "display_name": "10kg Bag",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "checked": false,
        "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
        "size": 150,
        "size_unit": "cm",
        "weight": 10,
        "weight_unit": "kg"
      },
      "product_id": "c074cd12-6b7f-4773-85d5-ddf1d1fd4a46",
      "product_type": "bag",
      "quantity": 2,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "6acd57ba-ccb7-4e86-85e7-b3e586caeae2": {
      "basket_item_id": "6acd57ba-ccb7-4e86-85e7-b3e586caeae2",
      "benefits": [],
      "display_name": "Seat 16A",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "column": "A",
        "passenger_id": "p1",
        "row": 16,
        "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
      },
      "product_id": "8b894895-da86-48d8-a787-0b834aa54e08",
      "product_type": "seat",
      "quantity": 1,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "7c0eb8d2-9abb-4ac9-aab7-32193a654bef": {
      "basket_item_id": "7c0eb8d2-9abb-4ac9-aab7-32193a654bef",
      "benefits": [],
      "display_name": "Automatic Check-in",
      "price": {
        "base": {
          "amount": 2000,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 1820,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 600,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 546,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 200,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 182,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 2400,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 2184,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "journey_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba"
      },
      "product_id": "fc0916b4-4883-4223-be42-0bcb3e0ab2ed",
      "product_type": "automatic_check_in",
      "quantity": 1,
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    },
    "dffac4ba-73b9-4b1b-9334-001817fff0cf": {
      "basket_item_id": "dffac4ba-73b9-4b1b-9334-001817fff0cf",
      "benefits": [],
      "display_name": "Economy Ticket",
      "price": {
        "base": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        },
        "fees": [],
        "markups": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "markup_type": "markup"
          }
        ],
        "taxes": [
          {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2,
            "in_original_currency": {
              "amount": 0,
              "currency": "USD",
              "decimal_places": 2
            },
            "tax_type": "tax"
          }
        ],
        "total": {
          "amount": 0,
          "currency": "USD",
          "decimal_places": 2,
          "in_original_currency": {
            "amount": 0,
            "currency": "USD",
            "decimal_places": 2
          }
        }
      },
      "product_details": {
        "journeys": [
          {
            "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
            "segments": [
              {
                "arrival_airport": "LHR",
                "arrival_time": "2020-07-07T22:30:00Z",
                "departure_airport": "EDI",
                "departure_time": "2020-07-07T21:10:00Z",
                "fare_basis": "OTZ0RO/Y",
                "fare_class": "O",
                "fare_family": "Basic Economy",
                "marketing_airline": "BA",
                "marketing_flight_number": "1465",
                "number_of_stops": 0,
                "operating_airline": "BA",
                "operating_flight_number": "1465",
                "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
              }
            ]
          }
        ]
      },
      "product_id": "2846068e-6fd0-4329-ac70-da79a57b21f7",
      "product_type": "ticket",
      "quantity": 1,
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f",
      "validity": {
        "status": "valid",
        "valid_from": "2020-05-22T16:34:08Z",
        "valid_to": "2020-05-22T16:49:08Z"
      }
    }
  },
  "country": "US",
  "currency": "USD",
  "journeys": [
    {
      "journey_id": "aab8980e-b263-4624-ad40-d6e5e364b4e9",
      "segments": [
        {
          "arrival_airport": "LHR",
          "arrival_time": "2020-07-07T22:30:00Z",
          "departure_airport": "EDI",
          "departure_time": "2020-07-07T21:10:00Z",
          "fare_basis": "OTZ0RO/Y",
          "fare_class": "O",
          "fare_family": "Basic Economy",
          "marketing_airline": "BA",
          "marketing_flight_number": "1465",
          "number_of_stops": 0,
          "operating_airline": "BA",
          "operating_flight_number": "1465",
          "segment_id": "938d8e82-dd7c-4d85-8ab4-38fea8753f6f"
        }
      ]
    },
    {
      "journey_id": "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba",
      "segments": [
        {
          "arrival_airport": "EDI",
          "arrival_time": "2020-07-14T08:35:00Z",
          "departure_airport": "LGW",
          "departure_time": "2020-07-14T07:05:00Z",
          "fare_basis": "NALZ0KO/Y",
          "fare_class": "N",
          "fare_family": "Basic Economy",
          "marketing_airline": "BA",
          "marketing_flight_number": "2500",
          "number_of_stops": 0,
          "operating_airline": "BA",
          "operating_flight_number": "2500",
          "segment_id": "7d693cb0-d6d8-49f0-9489-866b3d789215"
        }
      ]
    }
  ],
  "language": "en-US",
  "orders": {},
  "contact_details": {
    "address": {
      "city": "EDI",
      "country": "GB",
      "postal_code": "EH1 1AB",
      "street_address_1": "Flat 12/3",
      "street_address_2": "1234 James Road"
    },
    "contact_details_type": "passenger",
    "email": "vincent_williams@gmail.com",
    "passenger_id": "ee850c82-e150-4f35-b0c7-228064c2964b",
    "phone_number": "6501234567"
  },
  "passengers": [
    {
      "first_names": "Vincent Willem",
      "passenger_id": "ee850c82-e150-4f35-b0c7-228064c2964b",
      "surname": "Van Gogh"
    }
  ],
  "tickets": [
    {
      "ticket_basket_item_id": "dffac4ba-73b9-4b1b-9334-001817fff0cf",
      "basket_item_ids": [
        "dffac4ba-73b9-4b1b-9334-001817fff0cf",
        "e960eff9-7628-4645-99d8-20a6e22f6419",
        "6acd57ba-ccb7-4e86-85e7-b3e586caeae2",
        "5d5e1bce-4577-4118-abcb-155823d8b4a3"
      ],
      "journey_ids": [
        "aab8980e-b263-4624-ad40-d6e5e364b4e9"
      ],
      "status": "in_basket",
      "ticket_id": "8c1c9fc8-d968-4733-93a8-6067bac2543f"
    },
    {
      "basket_item_ids": [
        "2654f3f9-8990-4d2e-bdea-3b341ad5d1de",
        "1c3df555-a2dc-4813-a055-2a8bf56fd8f1"
      ],
      "journey_ids": [
        "1770bf8f-0c1c-4ba5-99f5-56e446fe79ba"
      ],
      "offered_price": {
        "currency": "USD",
        "decimal_places": 2,
        "total": 20000
      },
      "status": "offered",
      "ticket_id": "e8558737-2ec0-436f-89ec-00e7a20b3252"
    }
  ],
  "trip_access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  "trip_id": "23259b86-3208-44c9-85cc-4b116a822bff"
}

Tip

For more information on Updating Trip, refer to our complete API documentation.

Upon successfully charging the user and receiving the PNR, send Gordian a fulfillment request.

  • POST https://api.gordiansoftware.com/v2.2/trip/{trip_id}/fulfill

  • Authorization: For server-to-server calls, send your API key as the username and a blank password. For example, curl -u $API_KEY: https://api.gordiansoftware.com/...

  • HTTP Authorization Scheme: basic

Sample request
{
  "trip_state_hash": "69abcc117863186292bdf5f1c0d94db1e5227210935e6abe039cfb017cbefbee",
  "contact_details": {
    "contact_details_type": "passenger",
    "passenger_id": "a0dc4b56-0469-4a3d-8bf6-5fc1645ca840",
    "email": "joe@bloggs.com",
    "phone_number": "441234567890",
    "address": {
      "city": "EDI",
      "country": "GB",
      "postal_code": "EH1 1AB",
      "street_address_1": "Flat 12/3",
      "street_address_2": "1234 James Road"
    }
  },
  "passengers": [
    {
      "passenger_id": "a0dc4b56-0469-4a3d-8bf6-5fc1645ca840",
      "first_names": "Joe",
      "surname": "Bloggs",
      "date_of_birth": "1998-05-01",
      "passenger_type": "adult"
    },
    {
      "passenger_id": "e8ab9813-e5d3-4f91-878f-db211469365f",
      "first_names": "Daniel",
      "surname": "Smith",
      "date_of_birth": "1998-05-01",
      "passenger_type": "adult"
    }
  ],
  "tickets": [
    {
      "ticket_id": "d06a2d54-0416-4940-87b1-f60f6118c078",
      "access_details": {
        "record_locator": "ABCDEF",
        "ticket_number": "123-1234567890"
      },
      "status": "booked"
    }
  ],
  "payment_details": {
    "payment_type": "gordian_settlement"
  }
}
Sample response
{
  "status": "queued"
}

Tip

For more detail on the Fulfillment Request, click here.

Remaining Phases