Lydira API
EN

Aktarım yolları

Biletler

Bilet satışlarını kendi sisteminizden gönderin ya da GDS yazıcı dosyasını aktarın.

Bilet satışı, paylaşılan bir güzergâh ve yolcu başına bir biletten oluşan tek bir rezervasyondur; her yolcu kendi maliyet ve satış satırlarını taşır.

Bu sayfada

Şu kapsamlardan birini taşıyan anahtar erişir:importimport_issue

Biletlertickets

POST/api/v1/imports/tickets

Bir kez oluşturulur: aynı external_id ile tekrar gönderim kopya açmaz, atlanır.

Uç noktalar

  • validatePOST /api/v1/imports/tickets/validate
  • importPOST /api/v1/imports/tickets
  • feedGET /api/v1/imports/tickets/records
  • read_backGET /api/v1/imports/tickets/records/{external_id}

Yeni bir satırda bulunmalı

passengerspnr (option_date boşsa)

Fatura bilgisiyle örnek istek (cari anahtarı olmadan)

curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/imports/tickets/validate' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "source_system": "crm",
  "rows": [
    {
      "external_id": "TICKET-1001-B",
      "pnr": "ABC123",
      "gds_pnr": "ABC123",
      "currency": "EUR",
      "settlement_channel": "bsp",
      "fare_type": "normal",
      "miles_used": 2,
      "reservation_giver_name": "Ada Lovelace",
      "issuing_system": "amadeus",
      "corporate_code": "TKCORP2026",
      "booked_at": "2026-03-14T09:30:00+03:00",
      "tags": [
        "corporate"
      ],
      "transaction_date": "2026-03-14",
      "invoice_date": "2026-03-18",
      "notes": "Imported from the source system.",
      "legs": [
        {
          "airline_code": "TK",
          "flight_number": "1985",
          "departure_airport": "IST",
          "arrival_airport": "FCO",
          "departure_at": "2026-03-14T09:30:00+03:00",
          "arrival_at": "2026-03-14T12:45:00+03:00",
          "cabin_class": "economy",
          "booking_class": "L",
          "fare_basis": "LLXOW",
          "baggage_allowance": "1PC",
          "operating_carrier": "TK",
          "fare_family": "EcoFly",
          "refundable": true,
          "changeable": true,
          "change_fee": "1250.00",
          "refund_fee": "1250.00",
          "status": "confirmed"
        }
      ],
      "passengers": [
        {
          "first_name": "Ada",
          "last_name": "Lovelace",
          "nationality": "TR",
          "national_id": "10000000146",
          "passport_number": "U01234567",
          "passport_country": "TR",
          "passport_expiry": "2031-06-30",
          "date_of_birth": "1988-04-21",
          "gender": "MRS",
          "frequent_flyer_number": "TK123456789",
          "name": "Ada Lovelace",
          "type": "adult",
          "ticket_number": "235-1234567890",
          "cost_lines": [
            {
              "kind": "base_fare",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true
            }
          ],
          "sell_lines": [
            {
              "kind": "package_price",
              "amount": "1250.00",
              "label": "Imported line",
              "currency": "EUR",
              "vat_rate": "20",
              "tax_inclusive": true,
              "customer_visible": true
            }
          ]
        }
      ],
      "supplier_external_id": "SUPPLIER-1001",
      "bill_to_legal_name": "Lovelace Seyahat A.Ş.",
      "bill_to_tax_number": "1234567890",
      "bill_to_tax_office": "Beşiktaş",
      "bill_to_address_line": "Nispetiye Cad. No:12",
      "bill_to_city": "İstanbul",
      "bill_to_country": "TR"
    }
  ]
}'
Alanlar(47)
  • external_idstring

    source primary key → ExternalReference

  • pnrstring

    required unless the sale is still on option (option_date set)

  • gds_pnrstring
  • currencycurrency
  • settlement_channelenum

    who we pay — drives the airline payable + BSP recon

    Şunlardan biri:bspdirectwebcardconsolidatorprepaid

  • fare_typetaxonomy

    taxonomy fare_type (normal, award, …)

    Hesabınızın fare_type listesi; başlangıç değerleri:normalawardstafftour_conductor

  • miles_usedinteger
  • reservation_giver_namestring
  • issuing_systemstring
  • corporate_codestring

    the airline corporate code the booking was made under (as entered in the GDS); never filled from the customer by the API

  • option_datestring

    ticketing deadline: the agency's wall clock (YYYY-MM-DDTHH:MM), an ISO-8601 instant (read on that clock), or a date alone for the end of that day; set ⇒ the sale opens as option rather than draft, unless every passenger carries a ticket number: then it is dropped (option_dropped warning)

  • booked_atdatetime

    when the reservation was made (an instant, ISO-8601 with offset)

  • cost_center_codestring

    a department of the sale's (corporate) customer, by its code

  • line_template_idstring

    an invoice line template; see reference_options.line_templates

  • reservation_agent_emailemail

    the agency user who took the booking; defaults to the key's user

  • issuing_agent_emailemail

    the agency user who issued it; defaults to the reservation agent

  • card_account_idstring

    the company card that paid; required when settlement_channel is card. See reference_options.card_accounts

  • cost_fx_ratedecimal

    this sale's own purchase rate

  • sell_fx_ratedecimal

    this sale's own selling rate

  • tagsstring[]

    tag names, applied to every ticket

  • commission_partner_idstring

    the introducer who brought the sale; see reference_options.commission_partners

  • introducer_commission_typeenum

    Şunlardan biri:flatpercentage

  • introducer_commission_valuedecimal
  • issueboolean

    issue the invoice after saving (the key needs the import_issue scope)

  • issue_optionsobject

    the invoice's issue options, as the Issue invoice dialog takes them; every key is optional and a blank one keeps the account's default

    Anahtarlar

    • serial_prefixstring

      the invoice series to number it in

    • einvoice_scenarioenum

      Türkiye e-Fatura profile

      Şunlardan biri:temelticariihracatkamu

    • line_template_idstring

      see reference_options.line_templates

    • e_invoice_design_idstring

      the e-invoice design (XSLT) to print with

    • footer_notestring
    • notesstring
    • order_referencestring

      the buyer's PO number

    • issued_ondate
    • due_ondate

      not before issued_on

    • internet_saleboolean
    • transmit_nowboolean

      send the e-invoice at once; default false

    • currencycurrency

      the currency the document is cut in; blank keeps the sale's

    • settlement_modeenum

      what the invoice is settled from; blank lets the customer's rule decide

      Şunlardan biri:on_accountwalletcreditwallet_credit

    • settlement_partialboolean

      settle partly when the balance falls short; blank follows the customer's rule

    • print_traveler_namesboolean

      default true

    • merge_identical_linesboolean

      default false

    • consolidate_linesboolean

      one line per VAT rate; default false

    • consolidated_default_descriptionstring
    • consolidated_descriptionsobject

      the text of each consolidated line, by VAT rate ({"20": "Air travel"})

    • bill_to_namestring

      overrides the buyer's name on this invoice

    • bill_to_tax_numberstring
    • bill_to_addressstring
    • bill_to_emailemail
    • gib_aliasstring

      the buyer's e-Fatura mailbox alias

    • withholding_codesobject

      VAT withholding code by product type (transfer, tour, meal, event, hotel, cruise, rental, charter, visa, package); "" for none

    • internet_sale_detailsobject

      internet_web_address, internet_payment_method, internet_payment_date, internet_carrier_name, internet_carrier_tax_id, internet_dispatch_date

  • transaction_datedate

    işlem tarihi — the FX anchor for every cost line

  • invoice_datedate
  • notesstring
  • custom_fieldsobject

    the account's own fields on the sale, by key; see custom_fields in GET /api/v1/imports/entities/tickets

  • legsobject[]

    shared itinerary; int/dom + one-way/round-trip are derived from the airports

    Her öğe

    • airline_codestring
    • flight_numberstring
    • departure_airportstring
    • arrival_airportstring
    • departure_atdatetime
    • arrival_atdatetime
    • cabin_classstring

      Uygulamanın kullandığı değerler:economypremium_economybusinessfirst

    • booking_classstring
    • fare_basisstring
    • baggage_allowancestring
    • operating_carrierstring

      the airline that flies it, when not the marketing carrier

    • fare_familystring

      branded fare / fare package name

    • refundableboolean

      omit when unknown

    • changeableboolean

      omit when unknown

    • change_feemoney

      the airline's change penalty, in the sale's currency

    • refund_feemoney

      the airline's refund penalty, in the sale's currency

    • statusenum

      Şunlardan biri:confirmedcancelledwaitlistpending

  • passengersobject[]zorunluPII

    one Ticket each; identities are auto-saved to the customer's traveller directory

    Her öğe

    • first_namestringPII
    • last_namestringPII
    • nationalitystring
    • national_idstringPII
    • passport_numberstringPII
    • passport_countrystring
    • passport_expirydate
    • date_of_birthdatePII
    • genderstring

      Uygulamanın kullandığı değerler:MRMRSMISSMSTR

    • frequent_flyer_numberstring
    • namestringPII

      full name; or send first_name + last_name

    • typestring

      taxonomy passenger_type (adult, child, infant)

      Hesabınızın passenger_type listesi; başlangıç değerleri:adultchildinfantstudentseniormilitaryseamandiplomat

    • ticket_numberstring
    • custom_fieldsobject

      the account's own fields on the passenger, by key

    • idstring

      amendments only: the passenger's id from the read-back. Keys the item leaves out keep their stored value; an item without an id is a new passenger

    • cost_center_codestring

      overrides the sale's department

    • complimentaryboolean

      bedelsiz hizmet; the key's role needs complimentary__grant

    • complimentary_reasonstring

      Hesabınızın complimentary_reason listesi; başlangıç değerleri:marketing_promoloyaltyservice_recoveryfam_trippartner_courtesystaff_travelother

    • complimentary_coverageenum

      Şunlardan biri:fullfare_only

    • service_fee_waivedboolean

      true: the account's service-fee rules write no fee on this passenger

    • cost_linesobject[]

      cost-side pricing lines for the "flight" pricing context

      Her öğe

      • kindstringzorunlu

        Uygulamanın kullandığı değerler:base_fareairline_taxesyq_fuel_surchargegds_feeseat_selectionbaggage_feemeal_upgradeancillary_bundlelounge_accesschange_feecommissionservice_feesupplier_refundinsurance_premium

      • amountmoneyzorunlu
      • labelstring
      • currencycurrency
      • vat_ratedecimal

        percent (20 ⇒ 20% KDV); omit to take the kind's default

      • tax_inclusiveboolean

        true ⇒ the amount includes VAT. A hotel stay or a charter takes one VAT mode: the lines' flags decide it, lines stating both are refused, and every line follows the booking's mode afterwards

      • tax_codestring

        IATA tax code (TR, YQ, XT…) for an airline_taxes line

      • document_numberstring

        an ancillary EMD's document number

    • sell_linesobject[]

      sell-side pricing lines for the "flight" pricing context

      Her öğe

      • kindstringzorunlu

        Uygulamanın kullandığı değerler:package_pricemarkupservice_feesupplier_commissioncancellation_feeinsurance_premiumdiscountrefund_allowancebase_fareairline_taxesyq_fuel_surchargegds_feeseat_selectionbaggage_feemeal_upgradeancillary_bundlelounge_accesschange_feecommissionsupplier_refund

      • amountmoneyzorunlu
      • labelstring
      • currencycurrency
      • vat_ratedecimal

        percent (20 ⇒ 20% KDV); omit to take the kind's default

      • tax_inclusiveboolean

        true ⇒ the amount includes VAT. A hotel stay or a charter takes one VAT mode: the lines' flags decide it, lines stating both are refused, and every line follows the booking's mode afterwards

      • tax_codestring

        IATA tax code (TR, YQ, XT…) for an airline_taxes line

      • document_numberstring

        an ancillary EMD's document number

      • customer_visibleboolean

        false folds the line into the fare on the invoice; a markup line defaults to false

      • exemption_codestring

        GİB VAT exemption code override

      • markup_percentdecimal

        the percentage this markup was entered as

      • discount_percentdecimal

        the percentage this discount was entered as

      • markup_amountmoney

        an ancillary EMD's markup share of amount

      • discount_amountmoney

        an ancillary EMD's discount share of amount

  • customer_external_idreference
  • supplier_external_idreference

    the settlement supplier (airline / consolidator) we pay

  • bill_to_typeenum

    omit to infer: a legal name or a 10-digit tax number ⇒ corporate

    Şunlardan biri:corporateindividual

  • bill_to_legal_namestring
  • bill_to_tax_numbertax_numberPII

    VKN for a corporate payer, TCKN for an individual; matched digits-only

  • bill_to_tax_officestring
  • bill_to_passport_numberstringPII

    individual only; used when there is no TCKN

  • bill_to_first_namestringPII
  • bill_to_last_namestringPII
  • bill_to_emailemailPII

    stored on a NEW cari; never used to match

  • bill_to_phonephonePII

    stored on a NEW cari; never used to match

  • bill_to_address_linestringPII
  • bill_to_districtstringPII
  • bill_to_citystringPII
  • bill_to_zipstringPII
  • bill_to_countrystring

    ISO-2 code, e.g. TR

Referanslar

  • customer_external_id → customers · eşleşme external_id, email · bulunamazsa skip
  • supplier_external_id → suppliers · eşleşme external_id, code · bulunamazsa skip

Hesabınızın ek alanları (custom_fields)

Her acente Ayarlar → Ek alanlar'dan kendi alanlarını ekler: proje kodu, seyahat nedeni, sicil numarası gibi. Alanlar hesaptan hesaba değiştiği için bu sayfa onları listeleyemez. Entegrasyonunuz bunları API'den öğrenir.

GET /api/v1/imports/entities/{key} yanıtındaki custom_fields, anahtarınızın bağlı olduğu hesabın bu kayıt türündeki alanlarını verir: kaydın kendisi için record, her yolcu ya da misafir için traveler. Her alan satırda gönderilecek key'i, type'ını, zorunlu olup olmadığını (required), hangi carilere uygulandığını (applies_to) ve seçmeli bir alansa options listesini taşır. Eşlemeyi kurarken okuyun; acente bir alanı değiştirdiğini söylediğinde yeniden okuyun. Bu, hesabın canlı listesidir.

İstek · hesabın alanları

curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/imports/entities/tickets' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt · custom_fields (kesit)
200
{
  "key": "tickets",
  "custom_fields": {
    "record": [
      {
        "key": "project_code",
        "label": "Project code",
        "type": "text",
        "required": "always",
        "applies_to": "all"
      },
      {
        "key": "trip_reason",
        "label": "Trip reason",
        "type": "select",
        "required": "listed_customers",
        "applies_to": "listed_customers",
        "options": [
          {
            "value": "meeting",
            "label": "Meeting"
          },
          {
            "value": "fair",
            "label": "Trade fair"
          }
        ],
        "customers": [
          {
            "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
            "external_id": "CUST-17",
            "required": true
          }
        ]
      }
    ],
    "traveler": [
      {
        "key": "employee_no",
        "label": "Employee no",
        "type": "text",
        "required": "never",
        "applies_to": "all",
        "pii": true
      }
    ]
  }
}

Her tip ne alır

tipsatırdaki değer
text"PRJ-2026-001"
long_text"Fair delegation, second group"
number12.5
date"2026-03-14"
booleantrue
select"meeting"
multi_select["meeting", "fair"]

number takes a number or a numeric string; date an ISO date; select one option value (or its label); multi_select a list of them.

required ve applies_to

  • requiredneveralwayslisted_customers

    listed_customers: required only for the customers marked required in customers.

  • applies_toalllisted_customers

    listed_customers: the field is accepted only on those customers' records.

Değerleri key'e göre tek bir JSON nesnesi olarak gönderin. Bilinmeyen bir anahtar, yanlış tipte bir değer ya da eksik bir zorunlu alan satırı düşürür ve hatada anahtarın adı geçer. Güncellemede (on_conflict: update) nesne anahtar anahtar birleşir: göndermediğiniz anahtar korunur, null gönderdiğiniz silinir. Acentenin müşteri belgelerine bastığı bir alan, kayıt faturalandıktan sonra değişmez.

Yolcu alanları her yolcunun kendi custom_fields nesnesine yazılır.

Aynı biçimde geri gelirler: geri okumada ve webhook gövdesinde detail.custom_fields altında (biletin her yolcusunda da). Kişisel veri olarak işaretli alan yalnızca rolü kişisel veriyi okuyabilen bir anahtara döner; webhook'ta hiç yer almaz.

Geri okuma

Acente kaydı işledikten sonra (onaylar, biletleri numaralar, faturalar) GET /api/v1/imports/{entity}/records/{external_id} bunu döner; her webhook da aynı gövdeyi taşır. detail, gönderiminizden sonra yalnız acentenin ekleyebildiği bilgileri taşır.

GET /api/v1/imports/tickets/records/TICKET-1001
200
{
  "entity": "tickets",
  "external_id": "TICKET-1001",
  "source_system": "crm",
  "type": "TicketSale",
  "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
  "created_at": "2026-03-14T09:30:00Z",
  "updated_at": "2026-03-15T11:05:00Z",
  "status": "issued",
  "locked": true,
  "lock_reason": "invoiced",
  "currency": "EUR",
  "invoices": [
    {
      "id": "4b8e1f60-7c2d-4e9a-b3f5-0a6d2c9e8b71",
      "number": "LYD2026000000117",
      "status": "issued",
      "currency": "EUR",
      "total": "1250.0",
      "balance": "1250.0"
    }
  ],
  "detail": {
    "pnr": "ABC123",
    "gds_pnr": "ABC123",
    "settlement_channel": "bsp",
    "corporate_code": "TKCORP2026",
    "custom_fields": {
      "project_code": "PRJ-2026-001",
      "trip_reason": "meeting"
    },
    "passengers": [
      {
        "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "name": "Ada Lovelace",
        "type": "adult",
        "ticket_number": "235-1234567890",
        "status": "issued",
        "custom_fields": {
          "employee_no": "E-10442"
        }
      },
      {
        "id": "4b8e1f60-7c2d-4e9a-b3f5-0a6d2c9e8b71",
        "name": "Byron Lovelace",
        "type": "child",
        "ticket_number": "235-1234567891",
        "status": "issued",
        "custom_fields": {
          "employee_no": "E-10442"
        }
      }
    ],
    "legs": [
      {
        "flight": "TK1985",
        "from": "IST",
        "to": "FCO",
        "departure_at": "2026-03-14T06:30:00Z",
        "arrival_at": "2026-03-14T09:45:00Z",
        "cabin_class": "economy",
        "booking_class": "L",
        "fare_basis": "LLXOW",
        "baggage_allowance": "1PC",
        "fare_family": "EcoFly",
        "refundable": true,
        "changeable": true,
        "change_fee": "1250.0",
        "refund_fee": "1250.0",
        "status": "confirmed"
      }
    ]
  }
}

İstek · deneme, tüm alanlar

curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/imports/tickets/validate' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "source_system": "crm",
  "rows": [
    {
      "external_id": "TICKET-1001",
      "pnr": "ABC123",
      "gds_pnr": "ABC123",
      "currency": "EUR",
      "settlement_channel": "bsp",
      "fare_type": "normal",
      "miles_used": 2,
      "reservation_giver_name": "Ada Lovelace",
      "issuing_system": "amadeus",
      "corporate_code": "TKCORP2026",
      "booked_at": "2026-03-14T09:30:00+03:00",
      "cost_center_code": "SALES-IST",
      "line_template_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "reservation_agent_email": "booking@agency.example",
      "issuing_agent_email": "ticketing@agency.example",
      "card_account_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "cost_fx_rate": "36.2150",
      "sell_fx_rate": "36.5000",
      "tags": [
        "corporate"
      ],
      "commission_partner_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "introducer_commission_type": "percentage",
      "introducer_commission_value": "2.5",
      "issue": true,
      "issue_options": {
        "serial_prefix": "LYD",
        "einvoice_scenario": "temel",
        "line_template_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "e_invoice_design_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
        "footer_note": "Thank you for flying with us.",
        "notes": "Group booking, March fair.",
        "order_reference": "PO-2026-0117",
        "issued_on": "2026-03-14",
        "due_on": "2026-03-18",
        "internet_sale": false,
        "transmit_now": false,
        "currency": "EUR",
        "settlement_mode": "on_account",
        "settlement_partial": false,
        "print_traveler_names": true,
        "merge_identical_lines": true,
        "consolidate_lines": false,
        "consolidated_default_description": "Air travel",
        "consolidated_descriptions": {
          "20": "Air travel"
        },
        "bill_to_name": "Lovelace Seyahat A.Ş.",
        "bill_to_address": "Nispetiye Cad. No:12, Beşiktaş, İstanbul",
        "gib_alias": "urn:mail:defaultpk@lovelace.example",
        "withholding_codes": {
          "transfer": ""
        },
        "internet_sale_details": {
          "internet_web_address": "https://agency.example",
          "internet_payment_method": "KREDIKARTI/BANKAKARTI",
          "internet_payment_date": "2026-03-14"
        }
      },
      "transaction_date": "2026-03-14",
      "invoice_date": "2026-03-18",
      "notes": "Imported from the source system.",
      "custom_fields": {
        "project_code": "PRJ-2026-001",
        "trip_reason": "meeting"
      },
      "legs": [
        {
          "airline_code": "TK",
          "flight_number": "1985",
          "departure_airport": "IST",
          "arrival_airport": "FCO",
          "departure_at": "2026-03-14T09:30:00+03:00",
          "arrival_at": "2026-03-14T12:45:00+03:00",
          "cabin_class": "economy",
          "booking_class": "L",
          "fare_basis": "LLXOW",
          "baggage_allowance": "1PC",
          "operating_carrier": "TK",
          "fare_family": "EcoFly",
          "refundable": true,
          "changeable": true,
          "change_fee": "1250.00",
          "refund_fee": "1250.00",
          "status": "confirmed"
        }
      ],
      "passengers": [
        {
          "first_name": "Ada",
          "last_name": "Lovelace",
          "nationality": "TR",
          "national_id": "10000000146",
          "passport_number": "U01234567",
          "passport_country": "TR",
          "passport_expiry": "2031-06-30",
          "date_of_birth": "1988-04-21",
          "gender": "MRS",
          "frequent_flyer_number": "TK123456789",
          "name": "Ada Lovelace",
          "type": "adult",
          "ticket_number": "235-1234567890",
          "custom_fields": {
            "employee_no": "E-10442"
          },
          "cost_center_code": "SALES-IST",
          "service_fee_waived": true,
          "cost_lines": [
            {
              "kind": "base_fare",
              "amount": "1000.00",
              "label": "Base fare",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true
            },
            {
              "kind": "airline_taxes",
              "amount": "150.00",
              "label": "Airline taxes",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "tax_code": "TR"
            },
            {
              "kind": "seat_selection",
              "amount": "25.00",
              "label": "Seat selection",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "document_number": "235-9876543210"
            }
          ],
          "sell_lines": [
            {
              "kind": "base_fare",
              "amount": "1000.00",
              "label": "Base fare",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "exemption_code": "351"
            },
            {
              "kind": "airline_taxes",
              "amount": "150.00",
              "label": "Airline taxes",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "tax_code": "TR"
            },
            {
              "kind": "markup",
              "amount": "115.00",
              "label": "Markup",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": false,
              "markup_percent": "10"
            },
            {
              "kind": "discount",
              "amount": "-57.50",
              "label": "Discount",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "discount_percent": "5"
            },
            {
              "kind": "seat_selection",
              "amount": "35.00",
              "label": "Seat selection",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "document_number": "235-9876543210",
              "markup_amount": "10.00",
              "discount_amount": "0.00"
            }
          ]
        },
        {
          "first_name": "Byron",
          "last_name": "Lovelace",
          "nationality": "TR",
          "passport_country": "TR",
          "passport_expiry": "2031-06-30",
          "date_of_birth": "2018-09-02",
          "gender": "MSTR",
          "name": "Byron Lovelace",
          "type": "child",
          "ticket_number": "235-1234567891",
          "custom_fields": {
            "employee_no": "E-10442"
          },
          "cost_center_code": "SALES-IST",
          "service_fee_waived": true,
          "cost_lines": [
            {
              "kind": "base_fare",
              "amount": "1000.00",
              "label": "Base fare",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true
            },
            {
              "kind": "airline_taxes",
              "amount": "150.00",
              "label": "Airline taxes",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "tax_code": "TR"
            }
          ],
          "sell_lines": [
            {
              "kind": "base_fare",
              "amount": "1000.00",
              "label": "Base fare",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "exemption_code": "351"
            },
            {
              "kind": "airline_taxes",
              "amount": "150.00",
              "label": "Airline taxes",
              "currency": "EUR",
              "vat_rate": "0",
              "tax_inclusive": true,
              "customer_visible": true,
              "tax_code": "TR"
            }
          ],
          "complimentary": true,
          "complimentary_reason": "loyalty",
          "complimentary_coverage": "fare_only"
        }
      ],
      "customer_external_id": "CUSTOMER-1001",
      "supplier_external_id": "SUPPLIER-1001"
    }
  ]
}'

Kayıt türünün aldığı tüm alanlar. Kimlikler hesabınızdaki kayıtları (kart, aracı, şablon) gösterir; bunları custom_fields anahtarları gibi GET /api/v1/imports/entities/{key} yanıtındaki reference_options'tan okursunuz.

Yanıt
200
{
  "import": {
    "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "entity": "tickets",
    "source_system": "crm",
    "status": "ready",
    "company_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
    "stats": {
      "total": 1,
      "will_create": 1,
      "will_update": 0,
      "created": 0,
      "updated": 0,
      "skipped": 0,
      "invalid": 0,
      "failed": 0,
      "not_selected": 0
    },
    "error": null,
    "created_at": "2026-03-14T09:30:00Z",
    "links": {
      "self": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "rows": "/api/v1/imports/9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18/rows"
    },
    "mode": "validate",
    "async": false,
    "on_conflict": "skip",
    "pricing": "apply_rules"
  },
  "ignored_fields": [],
  "results": [
    {
      "row": 1,
      "external_id": "TICKET-1001",
      "status": "will_create",
      "payer": {
        "outcome": "external_id",
        "customer_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18"
      }
    }
  ]
}

Akış

  1. Deneyin. POST …/validate aynı yolu koşar ve hiçbir şey yazmaz.
  2. Gönderin. Aynı gövde, /validate olmadan. Bozuk satır tek başına düşer ve alanını söyler.
  3. Geri okuyun. GET /api/v1/imports/{entity}/records/{external_id} kendi kimliğinizle cevap verir.
  4. Dinleyin. Acente kaydı değiştirdiğinde webhook haber verir.

Kurallar →Webhook'lar →

GDS yazıcı dosyasından (Air Printer)

Recent captures

GET/api/v1/ticket_imports

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

Newest first. Doubles as the agent's "test connection" probe and its "last N imported" panel; walk page.next_cursor to read back past the first page, which is what a reconnecting agent needs after an outage.

Parametreler

Sorgu

  • limitintegervarsayılan 25

    Rows per page.

  • cursorstring

    Opaque; take it from the previous response's page.next_cursor.

Yanıt · 200

  • dataobject[]zorunlu
    Alanları göster
    • iduuid
    • statusenum

      şunlardan biriparsedduplicatefailed

    • providerstring
    • formatstring
    • filenamestringnull olabilir
    • ticket_sale_iduuidnull olabilir
    • errorstringnull olabilir
    • captured_atdate-timenull olabilir
    • created_atdate-time
    • duplicate_ticket_numbersstring[]null olabilir

      On a ticket-grain duplicate, the document numbers this capture repeats.

  • pageobjectzorunlu

    The cursor for the list beside it. Re-send the same request with ?cursor=<next_cursor> while has_more is true. next_cursor is null on the last page.

    Alanları göster
    • next_cursorstringzorunlunull olabilir
    • has_morebooleanzorunlu
    • limitintegerzorunlu

Yanıtlar

  • 401Missing or invalid Bearer token
  • 403The key lacks the required scope, or the plan doesn't include API access
  • 429Rate limit exceeded
curl -X GET 'https://YOUR-CELL.lydira.com/api/v1/ticket_imports' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY'
Yanıt
200
{
  "data": [
    {
      "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "status": "parsed",
      "provider": "amadeus",
      "format": "amadeus_air",
      "filename": "AIR07.05.24.1342.0000.txt",
      "ticket_sale_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
      "error": null,
      "captured_at": "2026-03-14T09:30:00Z",
      "created_at": "2026-03-14T09:30:00Z",
      "duplicate_ticket_numbers": null
    }
  ],
  "page": {
    "next_cursor": "MjAyNi0wMy0xNFQwOTozMDowMC4wMDAwMDBafDk0MQ",
    "has_more": true,
    "limit": 25
  }
}

Submit a printer file

POST/api/v1/ticket_imports

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

201 when the file parsed into a new draft sale, 200 when it was already captured (same bytes, or a ticket number the account holds) and 422 when it could not be parsed — the capture is still recorded, so a failure is visible rather than lost.

The GDS and the format are sniffed from the CONTENT and are authoritative over any provider / format the agent sends.

Parametreler

Başlık

  • Idempotency-Keystring

    Your own unique string for this write (a UUID is the obvious choice), max 255 characters. Optional: omit it and nothing changes. Send it and a repeat of the same request returns this call's response verbatim, with Idempotent-Replay: true, instead of writing again.

Gövde

  • contentstringzorunlu

    The printer file, base64-encoded.

  • filenamestring
  • encodingstring

    Source encoding, when it is not UTF-8.

  • providerstring

    A hint only; the content decides.

  • formatstring

    A hint only; the content decides.

  • agentobject

    The desktop agent's own build, for support.

    Alanları göster
    • versionstring
    • hoststring
    • osstring

Yanıt · 200

  • iduuid
  • statusenum

    şunlardan biriduplicate

  • providerstring
  • formatstring
  • filenamestringnull olabilir
  • ticket_sale_iduuidnull olabilir
  • errorstringnull olabilir
  • captured_atdate-timenull olabilir
  • created_atdate-time
  • duplicate_ticket_numbersstring[]null olabilir

Yanıtlar

  • 201Parsed into a new draft ticket sale
  • 401Missing or invalid Bearer token
  • 403The key lacks the required scope, or the plan doesn't include API access
  • 422The file could not be parsed; the capture is recorded anyway
  • 429Rate limit exceeded
curl -X POST 'https://YOUR-CELL.lydira.com/api/v1/ticket_imports' \
  -H 'Authorization: Bearer sek_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: 8f14e45f-ea2c-4f33-9a3b-6d0c1b7e5a90' \
  -d '{
  "content": "QUlSLUJMSzIwNzs3QTs7MjQ3OzAwMDAwMDAwMDA7MUExNDUwMTk3OzAwMTAwMQ0KQU1EIDA3MDAwMTI3NTM7MS8xOw0K",
  "filename": "AIR07.05.24.1342.0000.txt",
  "encoding": "Windows-1254",
  "provider": "amadeus",
  "format": "amadeus_air"
}'
Yanıt
200
{
  "id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
  "status": "duplicate",
  "provider": "amadeus",
  "format": "amadeus_air",
  "filename": "AIR07.05.24.1342.0000.txt",
  "ticket_sale_id": "9d2f7c3a-1b4e-4a7d-8e51-2c0f6b9a4d18",
  "error": null,
  "captured_at": "2026-03-14T09:30:00Z",
  "created_at": "2026-03-14T09:30:00Z",
  "duplicate_ticket_numbers": [
    "235-1234567890"
  ]
}