5Ödemeyi alın, bileti kesin
/api/v1/flights/holds/{id}/ticketDar kapsamlı anahtarla da çalışır: flight_booking
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-KeystringzorunluYour own unique string for this ticketing, max 255 characters.
Gövde
paymentobjectzorunluThe payment your website already took on its own POS. Recorded only if the ticket is issued.
Alanları gösterAlanları gizle
amountstringzorunluMust equal the booking total.
currencystringMust equal the booking's currency.
referencestringzorunluYour POS transaction reference.
installmentsintegerNumber of installments taken on the card. Defaults to 1.
paid_atdate-timeWhen the card was charged. Defaults to now.
merchant_account_iduuidRequired when the agency has more than one POS.
bill_toobjectWho 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'snational_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. Sendcustomer_idinstead when you hold it.Alanları gösterAlanları gizle
typeenumindividual(a person) orcorporate(a company). Defaults toindividual; a 10-digittax_numberreads as corporate.şunlardan biri
individualcorporatelegal_namestringThe company's registered name. Corporate: required when
tax_numberis missing; finds the cari when the VKN does not.tax_numberstringVKN (10 digits) for a company, TCKN (11 digits) for a person. The first key the cari is found by.
tax_officestringThe company's tax office, for the invoice.
passport_numberstringIndividual: finds the cari when there is no TCKN.
first_namestringIndividual: the payer's first name, when it is not the first passenger.
last_namestringIndividual: the payer's last name.
emailemailWritten onto the cari for the invoice; never used to find one.
phonestringInternational format; never used to find a cari.
address_linestringStreet and number, for the invoice.
districtstringDistrict (ilçe).
citystringCity (il).
zipstringPostal code.
countrystringISO 3166 alpha-2.
customer_iduuidInstead of
bill_to, for the same case.
Yanıt · 200
iduuidThe booking id.
statusenumheldwaits for payment,ticketingis paid and waiting for numbers,ticketedis done;cancelled,expiredandfailedare closed.şunlardan biri
pendingheldawaiting_approvalticketingticketedpartially_ticketedcancelledexpiredfailedrecord_locatorstringThe airline booking reference (PNR).
ticketing_time_limitdate-timeWhile
held: ticket before this, or the hold lapses.sale_iduuidThe sale in the agency's books.
totalstringThe sell total of the booking.
currencystringISO 4217 code of
total.pendingbooleanPaid, ticket numbers not issued yet. The ticket webhook fires when they are.
ticketsobject[]One per passenger once issued.
Alanları gösterAlanları gizle
ticket_numberstringThe e-ticket number.
passenger_namestringAs printed on the ticket (SURNAME/GIVEN).
booking_iduuidThe booking id.
payment_recordedbooleanFalse: the ticket stands, but the payment must be recorded by hand.
amount_mismatchbooleanTrue: the supplier booked at another total than the one you charged. The agency is told; settle the difference with your customer.
payerobjectThe cari this booking bills.
customer_id: the id you sent won.matched: a cari on file carried the identity (bysays which);filledlists 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;warningsays why (payer_unidentified: no VKN, TCKN or passport to go on). Sendbill_towith the ticket call then.Alanları gösterAlanları gizle
outcomeenumHow the cari was resolved.
şunlardan biri
customer_idmatchedcreatednonebyenumOn
matched: the identity that found it.şunlardan biri
tax_numberlegal_namepassportcustomer_iduuidThe cari's id; keep it and send it as
customer_idnext time.filledstring[]On
matched: the blank fields your bill-to completed.warningenumWhy there is no cari, or why your bill-to filled nothing.
şunlardan biri
payer_unidentifiedpayer_fill_skipped
Yanıtlar
202The call is running. Readpoll_urlafterRetry-Afterseconds until it answers anything but202; after 3 minutes the call is lost and the poll says what to do.401Missing or invalid Bearer token403The key cannot reach the booking API: the account lacks an add-on (addon_required, withdetails.missing), the plan has no API access, or the key's scope is narrow.404Resource not found409The 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 inerror).502The supplier's answer is unknown: the booking may or may not exist, and money may already have moved. It is also whatpoll_urlanswers 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 itsIdempotency-Keyanswers 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 itsIdempotency-Key, so a new attempt takes a new key; a release is sent again. With nobooking_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 sameIdempotency-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"
}'{
"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"
}
}