Connect API

Search for flights

Find itineraries and fares, then turn a search result into an offer.

Search is where a booking starts. It returns priced itineraries, and each result carries what you need to create an offer for it.

Search has its own base URL

Search is served from a different host and path than the rest of the Connect API. Your API key and the apikey header are the same for both.

  • Search: https://api.dev.dohop.com/ndc/api/0.11
  • Offers and orders: https://api.staging.dohop.io/connect_api/v1

Send the trip to POST /air_shopping/:

  • metadata holds the traveller's country of residence and the currency and language to answer in.
  • origin_destinations holds one entry for a one-way trip and two for a return trip. An airport_code can list several airports, separated by commas.
  • passengers holds one entry per traveller. Set age for children and infants. A passenger without an age is treated as an adult.
  • preferences is optional. limit caps the number of results and cabin_class asks for a cabin.
curl -X POST 'https://api.dev.dohop.com/ndc/api/0.11/air_shopping/' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "metadata": { "country": "GB", "currency": "GBP", "language": "en" },
    "origin_destinations": [
      {
        "departure": { "airport_code": "OLI", "date": "2026-12-12" },
        "arrival": { "airport_code": "DJU" }
      },
      {
        "departure": { "airport_code": "DJU", "date": "2026-12-19" },
        "arrival": { "airport_code": "OLI" }
      }
    ],
    "passengers": [
      { "pax_id": "PAX1", "age": 30 },
      { "pax_id": "PAX2", "age": 7 }
    ]
  }'

2. Read the results

The response has two parts:

  • offers lists the results. Each one is an itinerary with a price.
  • data_lists holds the flights the offers refer to, so a flight that appears in many offers is only sent once.
{
  "offers": [
    {
      "offer_id": "2400.00-EUR-5003|0-0|...",
      "fare_type": "standard",
      "total_price": { "currency": "GBP", "amount": 2003.7 },
      "offer_items": [
        {
          "offer_item_id": "OFFER_ITEM_OUT",
          "price": { "currency": "GBP", "amount": 1001.85 },
          "services": [
            {
              "service_id": "SERVICE_JOURNEY_0_...",
              "pax_ref_ids": ["PAX1", "PAX2"],
              "journey_ids": ["JOURNEY_0_..."]
            }
          ]
        },
        { "offer_item_id": "OFFER_ITEM_HOME", "...": "..." }
      ],
      "web_address_url": "https://.../fares?combo=0-0&currency=GBP&fares=a-2400.00-EUR-5003&fee=0.00-EUR&home=DJUOLI20261219150001530XX203&issued_at=...&mbs_partner=...&out=OLIDJU20261212040000430XX201&passenger_ages=30-7&residency=GB&sig=..."
    }
  ],
  "data_lists": {
    "journeys": [
      { "journey_id": "JOURNEY_0_...", "segment_ids": ["FLIGHT_0_..."] }
    ],
    "segments": [
      {
        "segment_id": "FLIGHT_0_...",
        "departure": {
          "airport_code": "OLI",
          "datetime": "2026-12-12T04:00:00"
        },
        "arrival": { "airport_code": "DJU", "datetime": "2026-12-12T04:30:00" },
        "marketing_carrier": { "carrier_code": "XX", "flight_number": 201 }
      }
    ]
  }
}

To show the flights of an offer:

  1. Take the journey_ids from the services of its offer_items. OFFER_ITEM_OUT is the outbound journey and OFFER_ITEM_HOME the homebound one.
  2. Look each journey up in data_lists.journeys to get its segment_ids.
  3. Look each segment up in data_lists.segments for the airports, times and carrier.

fare_type says how the flights are connected and who protects the connection. The values are described in the API reference.

When nothing is found

A search without results still answers 200. offers is empty and errors gives the reason, for example no_itineraries, no_fares, unknown_stations or invalid_date.

{
  "data_lists": {
    "segments": [],
    "journeys": [],
    "products": [],
    "passengers": []
  },
  "offers": [],
  "errors": [{ "reason": "no_itineraries" }]
}

To avoid empty searches, the availability endpoints list what can be searched:

  • GET /availability/departure_stations/: every airport you can depart from.
  • GET /availability/station_pairs/{departure_stations}/: the destinations of up to 20 departure airports.
  • GET /availability/station_pair_dates/{departure_station}/{arrival_stations}/: the dates with flights to each destination.

A listed date can still return no offers, so always handle an empty result.

3. Create an offer from a result

Every search offer has a web_address_url. Its query string holds the itinerary, the fares and the passengers of that result, in the form POST /new expects.

Take everything after the ? and send it as the query string of POST /new on the Connect API. Send it as it is: do not decode, rebuild or reorder the parameters.

curl -X POST 'https://api.staging.dohop.io/connect_api/v1/new?combo=0-0&currency=GBP&fares=a-2400.00-EUR-5003&fee=0.00-EUR&home=DJUOLI20261219150001530XX203&issued_at=...&mbs_partner=...&out=OLIDJU20261212040000430XX201&passenger_ages=30-7&residency=GB&sig=...' \
  -H 'apikey: YOUR_API_KEY'
const { search } = new URL(searchOffer.web_address_url);

const response = await fetch(
  `https://api.staging.dohop.io/connect_api/v1/new${search}`,
  { headers: { apikey: YOUR_API_KEY }, method: 'POST' },
);

const offer = await response.json();

The response is the Connect offer, with its own short offer_id. The offer_id of the search result is not used again.

Two things to know when you move from the search result to the offer:

  • Passengers. The offer lists one passenger per traveller in the search, in the same order, each with a new passenger_id. The pax_id values from the search are not carried over.
  • Price. Creating the offer prices the itinerary again and adds the bundles and fees. Show the traveller the summary of the offer, which can differ from the total_price of the search result.

From here, continue with selecting bundles and luggage.