Lydira API
EN

Uçuş rezervasyonuAdım 5 / 8

5Ödemeyi alın, bileti kesin

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

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

Kartı kendi POS'unuzda çekin, sonra payment gönderin: tutar, para birimi ve POS referansınız. Tutar opsiyonun toplamına eşit olmalı; değilse hiçbir şey kesilmeden 422 payment_mismatch döner. Ödeme biletle birlikte, rezervasyon başına bir kez kaydedilir ve acentenin faturası sonradan ondan kapanır.

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"
  }
}