Lydira API
TR

Flight bookingStep 1 of 8

1Search

POST/api/v1/flights/search

Reachable with a narrow key: flight_booking

Answers offers with the price your customer pays, through GET /api/v1/flights/operations/{id} unless the offer cache already holds the search. Keep search_id and the chosen offer's key: every later call needs both. A search that reaches the supplier costs one unit of the month's quota; the same search again within 10 minutes comes from the cache and costs nothing, a search that fails is refunded, and one that is lost is never charged (Usage and quotas).

Body

  • company_iduuid

    The agency company that sells. Defaults to the account's default company (see GET /api/v1/workspace).

  • connection_iduuid

    A supplier connection to shop on. Defaults to the agency's default flight connection.

  • originstringrequired

    IATA airport or city code.

  • destinationstringrequired

    IATA airport or city code.

  • departure_ondaterequired

    Outbound date, in the departure airport's local calendar.

  • return_ondate

    Omit for a one-way search.

  • trip_typeenum

    Send multi_city with legs for a multi-city search.

    one ofmulti_city

  • legsobject[]

    Multi-city legs, in order.

    Show fields
    • originstring

      IATA code.

    • destinationstring

      IATA code.

    • departure_ondate

      Local departure date.

  • adultsinteger

    Passengers aged 12 and over. Defaults to 1.

  • childreninteger

    Passengers aged 2 to 11.

  • infantsinteger

    Passengers under 2, travelling on an adult's lap. At most one per adult.

  • cabin_classenum

    Defaults to economy.

    one ofeconomypremium_economybusinessfirst

  • non_stopboolean

    Only direct flights.

  • airlinesstring

    Comma-separated carrier codes to keep.

  • excluded_airlinesstring

    Comma-separated carrier codes to drop.

  • currencystring

    The currency to quote in, when the supplier offers it. Defaults to the supplier's own.

Response · 200

  • search_idstring

    Pass back with every later call on this search.

  • cachedboolean

    True when the offer cache answered; such a search costs no quota.

  • currencystring

    Currency of the prices in offers.

  • expires_atdate-time

    When the offers lapse; price or hold before this.

  • offersobject[]

    The offers, cheapest first.

    Show fields
    • keystring

      Pass back as offer_key.

    • fare_familystring

      The airline's brand for this fare, when it has one.

    • validating_carrierstring

      The airline that issues the ticket.

    • carriersstring[]

      Every marketing carrier on the offer.

    • stopsinteger

      Connections on the longest direction.

    • duration_minutesinteger

      Total journey time over every direction.

    • refundableboolean

      Whether the fare can be refunded at all (penalties may still apply; see rules).

    • changeableboolean

      Whether the fare can be changed at all (fees may apply; see rules).

    • baggage_allowancestring

      Checked baggage on the first segment, as the supplier states it.

    • seats_leftinteger

      As the supplier reports it; a hint, not a guarantee.

    • last_ticketing_datedate

      The airline's last day to ticket this fare.

    • itinerariesobject[]

      One entry per direction: outbound, then return, or each multi-city leg.

      Show fields
      • duration_minutesinteger

        Door to door for this direction, connections included.

      • originstring

        Where this direction starts (IATA).

      • destinationstring

        Where this direction ends (IATA).

      • segmentsobject[]

        The flights of this direction, in order.

        Show fields
        • airline_codestring

          Marketing carrier (IATA).

        • flight_numberstring

          Flight number, without the carrier code.

        • departure_airportstring

          IATA airport code.

        • arrival_airportstring

          IATA airport code.

        • departure_timedate-time

          Local departure time with its UTC offset.

        • arrival_timedate-time

          Local arrival time with its UTC offset.

        • duration_minutesinteger

          Time in the air for this segment.

        • cabin_classstring

          Cabin the fare books on this segment.

        • booking_classstring

          Fare class letter (RBD).

        • baggage_allowancestring

          Checked baggage as the supplier states it, e.g. 1PC or 20K.

        • operating_carrierstring

          The airline that flies the segment, when it differs from the marketing one.

    • priceobject

      What the traveller pays. Sell only.

      Show fields
      • totalstring

        What the traveller pays for every passenger on the offer, all taxes and the agency's fees included.

      • service_feestring

        The agency's service fee inside total.

      • taxesstring

        Taxes and carrier surcharges inside total.

      • currencystring

        ISO 4217 code.

Responses

  • 202The call is running. Read poll_url after Retry-After seconds until it answers anything but 202; after 3 minutes the call is lost and the poll says what to do.
  • 401Missing or invalid Bearer token
  • 402The month's searches and the search wallet are both used up.
  • 403The key cannot reach the booking API: the account lacks an add-on (addon_required, with details.missing), the plan has no API access, or the key's scope is narrow.
  • 409The booking cannot go ahead as asked. price_changed: price again and confirm the new total with your customer. approval_required: the agency approves the ticket first, then call ticket again. hold_expired: search again.
  • 422The request was refused before anything was booked, or the supplier refused it (provider_rejected, with its reason in error).
  • 429Rate limit exceeded
  • 503The supplier could not be reached, the call could not be queued, or a search, a price or the rules did not finish in 3 minutes (provider_unavailable). Nothing was booked: a search costs nothing, and a hold or a purchase is retried with the same Idempotency-Key.
curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/flights/search' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "company_id": "3f1c2b9a-6d4e-4c1a-9b2f-1a2b3c4d5e6f",
  "origin": "IST",
  "destination": "LHR",
  "departure_on": "2026-11-20",
  "return_on": "2026-11-27",
  "adults": 1,
  "cabin_class": "economy"
}'
Response
200
{
  "search_id": "eyJfcmFpbHMiOnsiZGF0YSI6eyJhY2NvdW50X2lkIjoi",
  "cached": false,
  "currency": "EUR",
  "expires_at": "2026-10-07T09:10:00Z",
  "offers": [
    {
      "key": "sbx_TK_1979_Y",
      "fare_family": "EcoFly",
      "validating_carrier": "TK",
      "carriers": [
        "TK"
      ],
      "stops": 0,
      "duration_minutes": 250,
      "refundable": false,
      "changeable": true,
      "baggage_allowance": "1PC",
      "seats_left": 7,
      "last_ticketing_date": "2026-10-09",
      "itineraries": [
        {
          "duration_minutes": 250,
          "origin": "IST",
          "destination": "LHR",
          "segments": [
            {
              "airline_code": "TK",
              "flight_number": "1979",
              "departure_airport": "IST",
              "arrival_airport": "LHR",
              "departure_time": "2026-11-20T07:45:00+03:00",
              "arrival_time": "2026-11-20T09:55:00+00:00",
              "duration_minutes": 250,
              "cabin_class": "economy",
              "booking_class": "Y",
              "baggage_allowance": "1PC",
              "operating_carrier": "TK"
            }
          ]
        }
      ],
      "price": {
        "total": "412.50",
        "service_fee": "15.00",
        "taxes": "96.40",
        "currency": "EUR"
      }
    }
  ]
}