Lydira API
EN

API referansı

Flights

9 uç nokta

The booking API: your website's server searches, prices, holds and tickets flights on the agency's own supplier connections. Needs a flight_booking key (or full) and the booking API add-on beside the flights add-on; without them every call answers 403 addon_required and names what is missing.

Every price here is the SELL price your customer pays. Cost, commission and margin never leave the API, and passenger documents are written, never read back.

Searches spend the monthly search quota (see Usage and quotas); price, rules, holds and tickets are free. The flow: search, price, hold, take the payment on your own POS, ticket. A fare that cannot be held (holdable: false on price) is bought in one call with purchases.

Search flights

POST/api/v1/flights/search

Dar kapsamlı anahtarla da çalışır: flight_booking

Shops the agency's supplier connection and answers sell-priced offers. A search the offer cache (10 minutes) already holds is answered at once with 200 and costs nothing. Any other search answers 202 with a poll_url: read it (GET /api/v1/flights/operations/{id}) after Retry-After seconds until it answers the 200 below or one of the refusals listed here. One search that reaches the supplier costs one unit of the month's search quota; a search that fails, or has not answered in 3 minutes, costs nothing. The remaining quota rides on every booking API answer in X-Search-Quota-Remaining. On the 202 the quota headers show the balance at that moment, because the search is charged when it runs; the poll's final answer carries the balance after the charge.

Gövde

  • 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.

  • originstringzorunlu

    IATA airport or city code.

  • destinationstringzorunlu

    IATA airport or city code.

  • departure_ondatezorunlu

    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.

    şunlardan birimulti_city

  • legsobject[]

    Multi-city legs, in order.

    Alanları göster
    • 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.

    şunlardan birieconomypremium_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.

Yanıt · 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.

    Alanları göster
    • 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.

      Alanları göster
      • 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.

        Alanları göster
        • 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.

      Alanları göster
      • 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.

Yanıtlar

  • 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"
}'
Yanıt
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"
      }
    }
  ]
}

Price an offer

POST/api/v1/flights/price

Dar kapsamlı anahtarla da çalışır: flight_booking

Re-prices one offer with the supplier and answers the sell total to show your customer, its fare rules, whether it can be held, and a price_token (valid 15 minutes from the pricing) that purchases requires. Answers 202 with a poll_url; the 200 below is what the poll answers once the price is in. Costs no quota.

Gövde

  • company_iduuid

    The agency company that sells. Defaults to the account's default company.

  • search_idstringzorunlu

    From the search answer.

  • offer_keystringzorunlu

    The chosen offer's key.

  • bill_toobject

    Who pays, when you know already. Only looked up here, never created: a cari the agency has on file can carry its own service fee, and the price token is bound to it. Send the same bill-to to purchases.

    Alanları göster
    • typeenum

      individual (a person) or corporate (a company). Defaults to individual; a 10-digit tax_number reads as corporate.

      şunlardan biriindividualcorporate

    • legal_namestring

      The company's registered name. Corporate: required when tax_number is missing; finds the cari when the VKN does not.

    • tax_numberstring

      VKN (10 digits) for a company, TCKN (11 digits) for a person. The first key the cari is found by.

    • tax_officestring

      The company's tax office, for the invoice.

    • passport_numberstring

      Individual: finds the cari when there is no TCKN.

    • first_namestring

      Individual: the payer's first name, when it is not the first passenger.

    • last_namestring

      Individual: the payer's last name.

    • emailemail

      Written onto the cari for the invoice; never used to find one.

    • phonestring

      International format; never used to find a cari.

    • address_linestring

      Street and number, for the invoice.

    • districtstring

      District (ilçe).

    • citystring

      City (il).

    • zipstring

      Postal code.

    • countrystring

      ISO 3166 alpha-2.

  • customer_iduuid

    Instead of bill_to, when you hold the agency's id for the payer.

Yanıt · 200

  • offerobject
    Alanları göster
    • 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.

      Alanları göster
      • 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.

        Alanları göster
        • 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.

      Alanları göster
      • 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.

  • totalstring

    The sell total to show your customer.

  • currencystring

    ISO 4217 code of total.

  • price_changedboolean

    True when total differs from what the search showed.

  • holdableboolean

    False: buy it with POST /api/v1/flights/purchases.

  • instant_ticketableboolean

    Whether the fare can be bought outright with purchases.

  • expires_atdate-time

    When this price lapses.

  • rulesobject
    Alanları göster
    • refundableboolean

      Whether a refund is possible.

    • changeableboolean

      Whether a change is possible.

    • textstring

      The fare rules as the supplier words them.

    • penaltiesobject[]

      Fees for a refund or a change, when the supplier states them.

      Alanları göster
      • kindstring

        refund or change.

      • amountstring

        The fee.

      • currencystring

        ISO 4217 code.

      • whenstring

        When the fee applies, as the supplier states it.

  • price_tokenstring

    Signed, valid for 15 minutes. Required by purchases.

Yanıtlar

  • 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
  • 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.
  • 410The search or the offer has 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/price' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "company_id": "3f1c2b9a-6d4e-4c1a-9b2f-1a2b3c4d5e6f",
  "search_id": "eyJfcmFpbHMiOnsiZGF0YSI6eyJhY2NvdW50X2lkIjoi",
  "offer_key": "sbx_TK_1979_Y",
  "bill_to": {
    "type": "individual",
    "tax_number": "10000000146"
  }
}'
Yanıt
200
{
  "offer": {
    "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"
    }
  },
  "total": "412.50",
  "currency": "EUR",
  "price_changed": false,
  "holdable": true,
  "instant_ticketable": true,
  "expires_at": "2026-10-07T09:10:00Z",
  "rules": {
    "refundable": false,
    "changeable": true,
    "text": "Changes permitted before departure for a fee.",
    "penalties": [
      {
        "kind": "change",
        "amount": "50.00",
        "currency": "EUR",
        "when": "before_departure"
      }
    ]
  },
  "price_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJzZWxsX3RvdGFsIjoi"
}

Read an offer's fare rules

GET/api/v1/flights/rules

Dar kapsamlı anahtarla da çalışır: flight_booking

Refund and change rules for one offer. Answers 202 with a poll_url; the 200 below is what the poll answers. Costs no quota.

Parametreler

Sorgu

  • search_idstringzorunlu
  • offer_keystringzorunlu

Yanıt · 200

  • rulesobject
    Alanları göster
    • refundableboolean

      Whether a refund is possible.

    • changeableboolean

      Whether a change is possible.

    • textstring

      The fare rules as the supplier words them.

    • penaltiesobject[]

      Fees for a refund or a change, when the supplier states them.

      Alanları göster
      • kindstring

        refund or change.

      • amountstring

        The fee.

      • currencystring

        ISO 4217 code.

      • whenstring

        When the fee applies, as the supplier states it.

Yanıtlar

  • 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
  • 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.
  • 410The search or the offer has expired. Search again.
  • 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 GET 'https://YOUR-CELL.lydira.com/api/v1/flights/rules?search_id=eyJfcmFpbHMiOnsiZGF0YSI6eyJhY2NvdW50X2lkIjoi&offer_key=sbx_TK_1979_Y' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "rules": {
    "refundable": false,
    "changeable": true,
    "text": "Changes permitted before departure for a fee.",
    "penalties": [
      {
        "kind": "change",
        "amount": "50.00",
        "currency": "EUR",
        "when": "before_departure"
      }
    ]
  }
}

Hold a fare

POST/api/v1/flights/holds

Dar kapsamlı anahtarla da çalışır: flight_booking

Opens a booking on option: the seat and the fare are kept until ticketing_time_limit while your website takes the payment on its own POS. The answer's total is what to charge; when price_changed is true the fare moved while holding, so show the new total. payer says which cari the booking bills, found from bill_to (or the first passenger's TCKN or passport) by the ticket import's rules; with no identity to go on, the hold opens without one and the ticket call must bring it. Requires an Idempotency-Key. Answers 202 with a poll_url; the 201 below is what the poll answers once the hold is in. A repeat with the same key and the same body replays the first answer: 202 and the same operation_id while the hold runs, then its first final answer, byte for byte, with Idempotent-Replay: true. The same key with a different body or on another call is 422 idempotency_key_reuse. A 502 booking_unresolved means the outcome is not known, and the key keeps that answer: read the booking (GET /api/v1/flights/bookings/{booking_id}) to see whether it is held. With no booking_id, no booking was found under the key; hold again with a new Idempotency-Key. If the payment does not happen, release the hold (DELETE /api/v1/flights/holds/{id}).

Parametreler

Başlık

  • Idempotency-Keystringzorunlu

    Your own unique string for this hold, max 255 characters.

Gövde

  • company_iduuid

    The agency company that sells. Defaults to the account's default company.

  • search_idstringzorunlu

    From the search answer.

  • offer_keystringzorunlu

    The chosen offer's key.

  • passengersobject[]zorunlu

    One entry per passenger, as many as the search asked for.

    Alanları göster
    • first_namestringzorunlu

      As on the passport.

    • last_namestringzorunlu

      As on the passport.

    • passenger_typeenumzorunlu

      ADT adult, CHD child, INF infant. The counts must match the search.

      şunlardan biriADTCHDINF

    • date_of_birthdate

      Required for children and infants, and by some suppliers for every passenger.

    • genderenum

      F or M, as on the passport.

      şunlardan biriFM

    • passport_numberstring

      Written into the booking; never read back.

    • passport_countrystring

      Issuing country (ISO 3166 alpha-2).

    • passport_expirydate

      Must be valid beyond the travel dates; many countries ask for six months.

    • national_idstring

      National identity number, where the route asks for one (e.g. Turkish domestic flights).

    • nationalitystring

      ISO 3166 alpha-2.

    • frequent_flyerstring

      Loyalty number, credited by the airline.

  • contactobject

    Written into the booking so the airline can reach the traveller about a schedule change.

    Alanları göster
    • emailemail

      Where the airline sends schedule changes.

    • phonestring

      Where the airline calls or texts about disruptions. International format.

  • bill_toobject

    Who the booking bills, found by the ticket import's own rules. A company (corporate) is found by its VKN, then by its legal name, and opened when neither is on file. A person (individual) is found by TCKN (this one, else the first passenger's national_id), then by passport (this one, else the first passenger's), and opened from these fields or the first passenger. Never by email, phone or name. A cari that is found only has its blank fields filled; nothing on file is overwritten. Send customer_id instead when you hold it.

    Alanları göster
    • typeenum

      individual (a person) or corporate (a company). Defaults to individual; a 10-digit tax_number reads as corporate.

      şunlardan biriindividualcorporate

    • legal_namestring

      The company's registered name. Corporate: required when tax_number is missing; finds the cari when the VKN does not.

    • tax_numberstring

      VKN (10 digits) for a company, TCKN (11 digits) for a person. The first key the cari is found by.

    • tax_officestring

      The company's tax office, for the invoice.

    • passport_numberstring

      Individual: finds the cari when there is no TCKN.

    • first_namestring

      Individual: the payer's first name, when it is not the first passenger.

    • last_namestring

      Individual: the payer's last name.

    • emailemail

      Written onto the cari for the invoice; never used to find one.

    • phonestring

      International format; never used to find a cari.

    • address_linestring

      Street and number, for the invoice.

    • districtstring

      District (ilçe).

    • citystring

      City (il).

    • zipstring

      Postal code.

    • countrystring

      ISO 3166 alpha-2.

  • customer_iduuid

    Instead of bill_to, when you hold the agency's id for the payer.

  • remarksstring

    A free-text note written into the booking.

Yanıt · 201

  • booking_iduuid

    Use it to ticket, release or read the booking back.

  • sale_iduuid

    The sale in the agency's books.

  • record_locatorstring

    The airline booking reference (PNR).

  • ticketing_time_limitdate-time

    Take the payment and ticket before this.

  • totalstring

    The sell total to charge on your POS.

  • currencystring

    ISO 4217 code of total.

  • price_changedboolean

    True when the fare moved while holding; show the new total.

  • payerobject

    The cari this booking bills. customer_id: the id you sent won. matched: a cari on file carried the identity (by says which); filled lists the blank fields your bill-to completed. created: a new cari was opened from your bill-to or the first passenger. none: no cari yet; warning says why (payer_unidentified: no VKN, TCKN or passport to go on). Send bill_to with the ticket call then.

    Alanları göster
    • outcomeenum

      How the cari was resolved.

      şunlardan biricustomer_idmatchedcreatednone

    • byenum

      On matched: the identity that found it.

      şunlardan biritax_numberlegal_namepassport

    • customer_iduuid

      The cari's id; keep it and send it as customer_id next time.

    • filledstring[]

      On matched: the blank fields your bill-to completed.

    • warningenum

      Why there is no cari, or why your bill-to filled nothing.

      şunlardan biripayer_unidentifiedpayer_fill_skipped

Yanıtlar

  • 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
  • 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.
  • 404Resource not found
  • 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.
  • 410The search or the offer has expired. Search again.
  • 422The request was refused before anything was booked, or the supplier refused it (provider_rejected, with its reason in error).
  • 502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also what poll_url answers when a hold, a ticket, a release or a purchase did not finish in 3 minutes, and what a hold, a ticket or a purchase sent again with its Idempotency-Key answers once its call can no longer be read. Read the booking (GET /api/v1/flights/bookings/{booking_id}) before you retry or refund anything, and refund the card only if it was not ticketed. A hold, a ticket or a purchase keeps this answer under its Idempotency-Key, so a new attempt takes a new key; a release is sent again. With no booking_id, no booking was found under the key: hold again with a new key, and ask the agency before you refund a purchase.
  • 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/holds' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "company_id": "3f1c2b9a-6d4e-4c1a-9b2f-1a2b3c4d5e6f",
  "search_id": "eyJfcmFpbHMiOnsiZGF0YSI6eyJhY2NvdW50X2lkIjoi",
  "offer_key": "sbx_TK_1979_Y",
  "passengers": [
    {
      "first_name": "Deniz",
      "last_name": "Arslan",
      "passenger_type": "ADT",
      "date_of_birth": "1985-06-01",
      "gender": "F",
      "passport_number": "U7654321",
      "passport_country": "TR",
      "passport_expiry": "2031-01-01",
      "nationality": "TR"
    }
  ],
  "contact": {
    "email": "deniz@example.com",
    "phone": "+905551112233"
  },
  "bill_to": {
    "type": "corporate",
    "legal_name": "Arslan Turizm Ltd. Şti.",
    "tax_number": "1234567890",
    "tax_office": "Kadıköy",
    "email": "muhasebe@arslanturizm.com"
  }
}'
Yanıt
201
{
  "booking_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "sale_id": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
  "record_locator": "ABC123",
  "ticketing_time_limit": "2026-10-08T18:00:00Z",
  "total": "412.50",
  "currency": "EUR",
  "price_changed": false,
  "payer": {
    "outcome": "matched",
    "by": "tax_number",
    "customer_id": "5b4a3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "filled": [
      "tax_office",
      "address"
    ],
    "warning": "payer_unidentified"
  }
}

Release a hold

DELETE/api/v1/flights/holds/{id}

Dar kapsamlı anahtarla da çalışır: flight_booking

Gives the seat back when the payment did not happen. A hold left alone lapses at its time limit. Answers 202 with a poll_url; the 200 below is what the poll answers.

Parametreler

Yol

  • iduuidzorunlu

Yanıt · 200

  • releasedboolean
  • statusstring

Yanıtlar

  • 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
  • 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.
  • 404Resource not found
  • 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.
  • 502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also what poll_url answers when a hold, a ticket, a release or a purchase did not finish in 3 minutes, and what a hold, a ticket or a purchase sent again with its Idempotency-Key answers once its call can no longer be read. Read the booking (GET /api/v1/flights/bookings/{booking_id}) before you retry or refund anything, and refund the card only if it was not ticketed. A hold, a ticket or a purchase keeps this answer under its Idempotency-Key, so a new attempt takes a new key; a release is sent again. With no booking_id, no booking was found under the key: hold again with a new key, and ask the agency before you refund a purchase.
  • 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 DELETE 'https://YOUR-CELL.lydira.com/api/v1/flights/holds/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "released": true,
  "status": "cancelled"
}

Ticket a held fare

POST/api/v1/flights/holds/{id}/ticket

Dar kapsamlı anahtarla da çalışır: flight_booking

Issues the tickets once your website has taken the payment. The payment must match the booking's total and currency; it is recorded with the ticket, once per booking, and the agency's invoice later settles from it. A 4xx answer means nothing was issued and nothing recorded: refund the card on your POS. Two exceptions say nothing about the ticket, and on them you do not refund. On 409 idempotency_conflict, send the call again with the same Idempotency-Key and the same body. On the poll's 404 operation_not_found, read the booking (GET /api/v1/flights/bookings/{id}) and refund only if it was not ticketed; the same key and body sent again replay the first answer, or answer 502 booking_unresolved once the call can no longer be read. A repeat with the same key and the same body replays the first answer: 202 and the same operation_id while the ticket runs, then its first final answer (a pending: true or amount_mismatch: true answer included) with Idempotent-Replay: true. The same key with a different body is 422 idempotency_key_reuse. A 502 booking_unresolved means the outcome is not known, and the key keeps that answer: read the booking (GET /api/v1/flights/bookings/{id}) and refund only if it was not ticketed. The payment is checked at once (a 422 here means nothing was queued); the ticket answers 202 with a poll_url, and the 200 below is what the poll answers once the ticket stands. pending: true means paid but the ticket numbers are not issued yet: the ticket webhook fires when they are. A hold opened without a cari takes its payer from the bill_to sent here; without one it answers 422 payer_required before anything is ticketed. Requires an Idempotency-Key.

Parametreler

Yol

  • iduuidzorunlu

Başlık

  • Idempotency-Keystringzorunlu

    Your own unique string for this ticketing, max 255 characters.

Gövde

  • paymentobjectzorunlu

    The payment your website already took on its own POS. Recorded only if the ticket is issued.

    Alanları göster
    • amountstringzorunlu

      Must equal the booking total.

    • currencystring

      Must equal the booking's currency.

    • referencestringzorunlu

      Your POS transaction reference.

    • installmentsinteger

      Number of installments taken on the card. Defaults to 1.

    • paid_atdate-time

      When the card was charged. Defaults to now.

    • merchant_account_iduuid

      Required when the agency has more than one POS.

  • bill_toobject

    Who the booking bills, found by the ticket import's own rules. A company (corporate) is found by its VKN, then by its legal name, and opened when neither is on file. A person (individual) is found by TCKN (this one, else the first passenger's national_id), then by passport (this one, else the first passenger's), and opened from these fields or the first passenger. Never by email, phone or name. A cari that is found only has its blank fields filled; nothing on file is overwritten. Send customer_id instead when you hold it.

    Alanları göster
    • typeenum

      individual (a person) or corporate (a company). Defaults to individual; a 10-digit tax_number reads as corporate.

      şunlardan biriindividualcorporate

    • legal_namestring

      The company's registered name. Corporate: required when tax_number is missing; finds the cari when the VKN does not.

    • tax_numberstring

      VKN (10 digits) for a company, TCKN (11 digits) for a person. The first key the cari is found by.

    • tax_officestring

      The company's tax office, for the invoice.

    • passport_numberstring

      Individual: finds the cari when there is no TCKN.

    • first_namestring

      Individual: the payer's first name, when it is not the first passenger.

    • last_namestring

      Individual: the payer's last name.

    • emailemail

      Written onto the cari for the invoice; never used to find one.

    • phonestring

      International format; never used to find a cari.

    • address_linestring

      Street and number, for the invoice.

    • districtstring

      District (ilçe).

    • citystring

      City (il).

    • zipstring

      Postal code.

    • countrystring

      ISO 3166 alpha-2.

  • customer_iduuid

    Instead of bill_to, for the same case.

Yanıt · 200

  • iduuid

    The booking id.

  • statusenum

    held waits for payment, ticketing is paid and waiting for numbers, ticketed is done; cancelled, expired and failed are closed.

    şunlardan biripendingheldawaiting_approvalticketingticketedpartially_ticketedcancelledexpiredfailed

  • record_locatorstring

    The airline booking reference (PNR).

  • ticketing_time_limitdate-time

    While held: ticket before this, or the hold lapses.

  • sale_iduuid

    The sale in the agency's books.

  • totalstring

    The sell total of the booking.

  • currencystring

    ISO 4217 code of total.

  • pendingboolean

    Paid, ticket numbers not issued yet. The ticket webhook fires when they are.

  • ticketsobject[]

    One per passenger once issued.

    Alanları göster
    • ticket_numberstring

      The e-ticket number.

    • passenger_namestring

      As printed on the ticket (SURNAME/GIVEN).

  • booking_iduuid

    The booking id.

  • payment_recordedboolean

    False: the ticket stands, but the payment must be recorded by hand.

  • amount_mismatchboolean

    True: the supplier booked at another total than the one you charged. The agency is told; settle the difference with your customer.

  • payerobject

    The cari this booking bills. customer_id: the id you sent won. matched: a cari on file carried the identity (by says which); filled lists the blank fields your bill-to completed. created: a new cari was opened from your bill-to or the first passenger. none: no cari yet; warning says why (payer_unidentified: no VKN, TCKN or passport to go on). Send bill_to with the ticket call then.

    Alanları göster
    • outcomeenum

      How the cari was resolved.

      şunlardan biricustomer_idmatchedcreatednone

    • byenum

      On matched: the identity that found it.

      şunlardan biritax_numberlegal_namepassport

    • customer_iduuid

      The cari's id; keep it and send it as customer_id next time.

    • filledstring[]

      On matched: the blank fields your bill-to completed.

    • warningenum

      Why there is no cari, or why your bill-to filled nothing.

      şunlardan biripayer_unidentifiedpayer_fill_skipped

Yanıtlar

  • 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
  • 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.
  • 404Resource not found
  • 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).
  • 502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also what poll_url answers when a hold, a ticket, a release or a purchase did not finish in 3 minutes, and what a hold, a ticket or a purchase sent again with its Idempotency-Key answers once its call can no longer be read. Read the booking (GET /api/v1/flights/bookings/{booking_id}) before you retry or refund anything, and refund the card only if it was not ticketed. A hold, a ticket or a purchase keeps this answer under its Idempotency-Key, so a new attempt takes a new key; a release is sent again. With no booking_id, no booking was found under the key: hold again with a new key, and ask the agency before you refund a purchase.
  • 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/holds/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f/ticket' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "payment": {
    "amount": "412.50",
    "currency": "EUR",
    "reference": "POS-884213",
    "installments": 1,
    "paid_at": "2026-10-07T09:05:00Z",
    "merchant_account_id": "9d8c7b6a-5f4e-4d3c-2b1a-0f9e8d7c6b5a"
  },
  "bill_to": {
    "type": "corporate",
    "legal_name": "Arslan Turizm Ltd. Şti.",
    "tax_number": "1234567890",
    "tax_office": "Kadıköy",
    "passport_number": "U7654321",
    "first_name": "Deniz",
    "last_name": "Arslan",
    "email": "muhasebe@arslanturizm.com",
    "phone": "+902161112233",
    "address_line": "Caferağa Mah. Moda Cad. No:12",
    "district": "Kadıköy",
    "city": "İstanbul",
    "zip": "34710",
    "country": "TR"
  },
  "customer_id": "5b4a3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d"
}'
Yanıt
200
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "status": "ticketed",
  "record_locator": "ABC123",
  "ticketing_time_limit": "2026-10-08T18:00:00Z",
  "sale_id": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
  "total": "412.50",
  "currency": "EUR",
  "pending": false,
  "tickets": [
    {
      "ticket_number": "235-1234567890",
      "passenger_name": "ARSLAN/DENIZ"
    }
  ],
  "booking_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "payment_recorded": true,
  "amount_mismatch": false,
  "payer": {
    "outcome": "matched",
    "by": "tax_number",
    "customer_id": "5b4a3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "filled": [
      "tax_office",
      "address"
    ],
    "warning": "payer_unidentified"
  }
}

Buy a fare in one call

POST/api/v1/flights/purchases

Dar kapsamlı anahtarla da çalışır: flight_booking

For a fare that cannot be held (holdable: false on price): books and tickets in one call against the price_token you priced with, for the same bill_to and company_id you priced for. A purchase takes money at once, so it needs a payer: a bill_to (or a first passenger) with no VKN, TCKN or passport answers 422 payer_required. A fare that moved since answers 409 price_changed; price again and send the new token with a new Idempotency-Key. The token, the payer and the payment are checked at once (a 4xx here means nothing was queued: refund the card); the purchase answers 202 with a poll_url, and the 201 below is what the poll answers once the ticket stands. Three answers say nothing about the purchase, and on them you do not refund yet. On 409 idempotency_conflict, send the call again with the same Idempotency-Key. A 502 booking_unresolved means the outcome is not known, and the key keeps that answer: read the booking (GET /api/v1/flights/bookings/{booking_id}) and refund only if it was not ticketed. On the poll's 404 operation_not_found, send the call again with the same key and body: it replays the first answer, or answers that 502 with the booking_id its key claimed. A 502 with no booking_id means no booking was found under the key; ask the agency before you refund. A repeat with the same key and the same body replays the first answer and never buys twice: 202 and the same operation_id while the purchase runs, then its first final answer, byte for byte, with Idempotent-Replay: true, also after the price token has lapsed. The same key with a different body (another offer, a new token) or on another call (a hold's key) is 422 idempotency_key_reuse. A refusal (409 price_changed, any 4xx) frees the key: a repeat then runs every check again.

Parametreler

Başlık

  • Idempotency-Keystringzorunlu

    Your own unique string for this purchase, max 255 characters.

Gövde

  • company_iduuid

    The agency company that sells. Defaults to the account's default company.

  • search_idstringzorunlu

    From the search answer.

  • offer_keystringzorunlu

    The chosen offer's key.

  • passengersobject[]zorunlu

    One entry per passenger, as many as the search asked for.

    Alanları göster
    • first_namestringzorunlu

      As on the passport.

    • last_namestringzorunlu

      As on the passport.

    • passenger_typeenumzorunlu

      ADT adult, CHD child, INF infant. The counts must match the search.

      şunlardan biriADTCHDINF

    • date_of_birthdate

      Required for children and infants, and by some suppliers for every passenger.

    • genderenum

      F or M, as on the passport.

      şunlardan biriFM

    • passport_numberstring

      Written into the booking; never read back.

    • passport_countrystring

      Issuing country (ISO 3166 alpha-2).

    • passport_expirydate

      Must be valid beyond the travel dates; many countries ask for six months.

    • national_idstring

      National identity number, where the route asks for one (e.g. Turkish domestic flights).

    • nationalitystring

      ISO 3166 alpha-2.

    • frequent_flyerstring

      Loyalty number, credited by the airline.

  • contactobject

    Written into the booking so the airline can reach the traveller about a schedule change.

    Alanları göster
    • emailemail

      Where the airline sends schedule changes.

    • phonestring

      Where the airline calls or texts about disruptions. International format.

  • bill_toobject

    Who the booking bills, found by the ticket import's own rules. A company (corporate) is found by its VKN, then by its legal name, and opened when neither is on file. A person (individual) is found by TCKN (this one, else the first passenger's national_id), then by passport (this one, else the first passenger's), and opened from these fields or the first passenger. Never by email, phone or name. A cari that is found only has its blank fields filled; nothing on file is overwritten. Send customer_id instead when you hold it.

    Alanları göster
    • typeenum

      individual (a person) or corporate (a company). Defaults to individual; a 10-digit tax_number reads as corporate.

      şunlardan biriindividualcorporate

    • legal_namestring

      The company's registered name. Corporate: required when tax_number is missing; finds the cari when the VKN does not.

    • tax_numberstring

      VKN (10 digits) for a company, TCKN (11 digits) for a person. The first key the cari is found by.

    • tax_officestring

      The company's tax office, for the invoice.

    • passport_numberstring

      Individual: finds the cari when there is no TCKN.

    • first_namestring

      Individual: the payer's first name, when it is not the first passenger.

    • last_namestring

      Individual: the payer's last name.

    • emailemail

      Written onto the cari for the invoice; never used to find one.

    • phonestring

      International format; never used to find a cari.

    • address_linestring

      Street and number, for the invoice.

    • districtstring

      District (ilçe).

    • citystring

      City (il).

    • zipstring

      Postal code.

    • countrystring

      ISO 3166 alpha-2.

  • customer_iduuid

    Instead of bill_to, when you hold the agency's id for the payer.

  • remarksstring

    A free-text note written into the booking.

  • price_tokenstringzorunlu

    From price, for the same offer, bill-to and company. Valid 15 minutes.

  • paymentobjectzorunlu

    The payment your website already took on its own POS. Recorded only if the ticket is issued.

    Alanları göster
    • amountstringzorunlu

      Must equal the booking total.

    • currencystring

      Must equal the booking's currency.

    • referencestringzorunlu

      Your POS transaction reference.

    • installmentsinteger

      Number of installments taken on the card. Defaults to 1.

    • paid_atdate-time

      When the card was charged. Defaults to now.

    • merchant_account_iduuid

      Required when the agency has more than one POS.

Yanıt · 201

  • iduuid

    The booking id.

  • statusenum

    held waits for payment, ticketing is paid and waiting for numbers, ticketed is done; cancelled, expired and failed are closed.

    şunlardan biripendingheldawaiting_approvalticketingticketedpartially_ticketedcancelledexpiredfailed

  • record_locatorstring

    The airline booking reference (PNR).

  • ticketing_time_limitdate-time

    While held: ticket before this, or the hold lapses.

  • sale_iduuid

    The sale in the agency's books.

  • totalstring

    The sell total of the booking.

  • currencystring

    ISO 4217 code of total.

  • pendingboolean

    Paid, ticket numbers not issued yet. The ticket webhook fires when they are.

  • ticketsobject[]

    One per passenger once issued.

    Alanları göster
    • ticket_numberstring

      The e-ticket number.

    • passenger_namestring

      As printed on the ticket (SURNAME/GIVEN).

  • booking_iduuid

    The booking id.

  • payment_recordedboolean

    False: the ticket stands, but the payment must be recorded by hand.

  • amount_mismatchboolean

    True: the supplier booked at another total than the one you charged. The agency is told; settle the difference with your customer.

  • payerobject

    The cari this booking bills. customer_id: the id you sent won. matched: a cari on file carried the identity (by says which); filled lists the blank fields your bill-to completed. created: a new cari was opened from your bill-to or the first passenger. none: no cari yet; warning says why (payer_unidentified: no VKN, TCKN or passport to go on). Send bill_to with the ticket call then.

    Alanları göster
    • outcomeenum

      How the cari was resolved.

      şunlardan biricustomer_idmatchedcreatednone

    • byenum

      On matched: the identity that found it.

      şunlardan biritax_numberlegal_namepassport

    • customer_iduuid

      The cari's id; keep it and send it as customer_id next time.

    • filledstring[]

      On matched: the blank fields your bill-to completed.

    • warningenum

      Why there is no cari, or why your bill-to filled nothing.

      şunlardan biripayer_unidentifiedpayer_fill_skipped

Yanıtlar

  • 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
  • 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.
  • 410The search or the offer has expired. Search again.
  • 422The request was refused before anything was booked, or the supplier refused it (provider_rejected, with its reason in error).
  • 502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also what poll_url answers when a hold, a ticket, a release or a purchase did not finish in 3 minutes, and what a hold, a ticket or a purchase sent again with its Idempotency-Key answers once its call can no longer be read. Read the booking (GET /api/v1/flights/bookings/{booking_id}) before you retry or refund anything, and refund the card only if it was not ticketed. A hold, a ticket or a purchase keeps this answer under its Idempotency-Key, so a new attempt takes a new key; a release is sent again. With no booking_id, no booking was found under the key: hold again with a new key, and ask the agency before you refund a purchase.
  • 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/purchases' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "company_id": "3f1c2b9a-6d4e-4c1a-9b2f-1a2b3c4d5e6f",
  "search_id": "eyJfcmFpbHMiOnsiZGF0YSI6eyJhY2NvdW50X2lkIjoi",
  "offer_key": "sbx_TK_1979_Y",
  "passengers": [
    {
      "first_name": "Deniz",
      "last_name": "Arslan",
      "passenger_type": "ADT",
      "date_of_birth": "1985-06-01",
      "gender": "F",
      "passport_number": "U7654321",
      "passport_country": "TR",
      "passport_expiry": "2031-01-01",
      "nationality": "TR"
    }
  ],
  "contact": {
    "email": "deniz@example.com",
    "phone": "+905551112233"
  },
  "bill_to": {
    "type": "individual",
    "tax_number": "10000000146",
    "email": "deniz@example.com"
  },
  "price_token": "eyJfcmFpbHMiOnsiZGF0YSI6eyJzZWxsX3RvdGFsIjoi",
  "payment": {
    "amount": "412.50",
    "currency": "EUR",
    "reference": "POS-884213",
    "installments": 1
  }
}'
Yanıt
201
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "status": "ticketed",
  "record_locator": "ABC123",
  "ticketing_time_limit": "2026-10-08T18:00:00Z",
  "sale_id": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
  "total": "412.50",
  "currency": "EUR",
  "pending": false,
  "tickets": [
    {
      "ticket_number": "235-1234567890",
      "passenger_name": "ARSLAN/DENIZ"
    }
  ],
  "booking_id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "payment_recorded": true,
  "amount_mismatch": false,
  "payer": {
    "outcome": "matched",
    "by": "tax_number",
    "customer_id": "5b4a3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c1d",
    "filled": [
      "tax_office",
      "address"
    ],
    "warning": "payer_unidentified"
  }
}

Read a booking

GET/api/v1/flights/bookings/{id}

Dar kapsamlı anahtarla da çalışır: flight_booking

Status, record locator, ticket numbers and the hold's time limit. Only bookings made through the booking API; no passenger documents.

Parametreler

Yol

  • iduuidzorunlu

Yanıt · 200

  • iduuid

    The booking id.

  • statusenum

    held waits for payment, ticketing is paid and waiting for numbers, ticketed is done; cancelled, expired and failed are closed.

    şunlardan biripendingheldawaiting_approvalticketingticketedpartially_ticketedcancelledexpiredfailed

  • record_locatorstring

    The airline booking reference (PNR).

  • ticketing_time_limitdate-time

    While held: ticket before this, or the hold lapses.

  • sale_iduuid

    The sale in the agency's books.

  • totalstring

    The sell total of the booking.

  • currencystring

    ISO 4217 code of total.

  • pendingboolean

    Paid, ticket numbers not issued yet. The ticket webhook fires when they are.

  • ticketsobject[]

    One per passenger once issued.

    Alanları göster
    • ticket_numberstring

      The e-ticket number.

    • passenger_namestring

      As printed on the ticket (SURNAME/GIVEN).

Yanıtlar

  • 401Missing or invalid Bearer token
  • 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.
  • 404Resource not found
curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/flights/bookings/2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "status": "ticketed",
  "record_locator": "ABC123",
  "ticketing_time_limit": "2026-10-08T18:00:00Z",
  "sale_id": "7e6d5c4b-3a2f-4e1d-8c0b-9a8f7e6d5c4b",
  "total": "412.50",
  "currency": "EUR",
  "pending": false,
  "tickets": [
    {
      "ticket_number": "235-1234567890",
      "passenger_name": "ARSLAN/DENIZ"
    }
  ]
}

Read a call's answer

GET/api/v1/flights/operations/{id}

Dar kapsamlı anahtarla da çalışır: flight_booking

A flight call that waits on the supplier answers 202 at once, with an operation_id and a poll_url; this is the poll_url. While the call runs it answers 202 again, with a Retry-After of 1 second for the first 2 seconds and 2 seconds after that. Once the call has finished it answers what the call itself answers: the same status and the same body, as listed on that call's own entry. Only the key that started the call can read it: a hold, a ticket, a release or a purchase sent with an Idempotency-Key for 7 days, any other call for 15 minutes; any other id is 404 operation_not_found. A call that has not finished in 3 minutes is lost: a search, a price or the rules answer 503 provider_unavailable (send the call again), and a hold, a ticket, a release or a purchase answers 502 booking_unresolved. Do not refund the card on it: read the booking (GET /api/v1/flights/bookings/{booking_id}) and refund only if it was not ticketed. A hold, a ticket or a purchase keeps that answer under its Idempotency-Key; a release is sent again as it was. Once a keyed call's answer is final (a 2xx, or that 502), a repeat of that call with the same key and the same body replays it, even after the operation is gone. Polls count into their own per-key budget, ten times the tier's rate limit.

Parametreler

Yol

  • iduuidzorunlu

    The operation_id the call answered with.

Yanıt · 202

  • statusenum

    queued until a worker takes the call, then running.

    şunlardan biriqueuedrunning

  • operation_iduuid

    The call's operation, kept for 7 days for a hold, ticket, release or purchase sent with an Idempotency-Key, else 15 minutes.

  • poll_urlstring

    Where the answer is read (GET).

Yanıtlar

  • 200The finished call's own answer: a search's FlightSearchResponse, a price's FlightPriceResponse, the rules, a ticket's FlightTicketedBooking, a release's { released, status }. See the call's own entry for its body.
  • 201A finished hold's FlightHoldResponse or a finished purchase's FlightTicketedBooking. See the call's own entry for its body.
  • 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.
  • 404No operation by that id for this key: it has expired (a hold, a ticket, a release or a purchase sent with an Idempotency-Key is kept for 7 days, any other call for 15 minutes), it can no longer be read, or another key started it. On a hold, a ticket or a purchase, send the call again with the same Idempotency-Key and the same body: it replays the first answer, or answers 502 booking_unresolved with the booking its key claimed. Read that booking (GET /api/v1/flights/bookings/{booking_id}) and refund the card only if it was not ticketed. Send a release (DELETE) again as it was. Do not refund the card on this answer alone.
  • 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.
  • 410The search or the offer has 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
  • 502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also what poll_url answers when a hold, a ticket, a release or a purchase did not finish in 3 minutes, and what a hold, a ticket or a purchase sent again with its Idempotency-Key answers once its call can no longer be read. Read the booking (GET /api/v1/flights/bookings/{booking_id}) before you retry or refund anything, and refund the card only if it was not ticketed. A hold, a ticket or a purchase keeps this answer under its Idempotency-Key, so a new attempt takes a new key; a release is sent again. With no booking_id, no booking was found under the key: hold again with a new key, and ask the agency before you refund a purchase.
  • 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 GET 'https://YOUR-CELL.lydira.com/api/v1/flights/operations/5d1f0b7e-8a2c-4e3f-9b6d-1c2a3b4c5d6e' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
202
{
  "status": "queued",
  "operation_id": "5d1f0b7e-8a2c-4e3f-9b6d-1c2a3b4c5d6e",
  "poll_url": "/api/v1/flights/operations/5d1f0b7e-8a2c-4e3f-9b6d-1c2a3b4c5d6e"
}