4Opsiyon alın
/api/v1/flights/holdsDar kapsamlı anahtarla da çalışır: flight_booking
ticketing_time_limit anına kadar tutar. Yanıttaki total çekeceğiniz tutardır. price_changed doğruysa fiyat opsiyon sırasında değişmiştir; parayı almadan önce yeni tutarı gösterin.Parametreler
Başlık
Idempotency-KeystringzorunluYour own unique string for this hold, max 255 characters.
Gövde
company_iduuidThe agency company that sells. Defaults to the account's default company.
search_idstringzorunluFrom the search answer.
offer_keystringzorunluThe chosen offer's
key.passengersobject[]zorunluOne entry per passenger, as many as the search asked for.
Alanları gösterAlanları gizle
first_namestringzorunluAs on the passport.
last_namestringzorunluAs on the passport.
passenger_typeenumzorunluADTadult,CHDchild,INFinfant. The counts must match the search.şunlardan biri
ADTCHDINFdate_of_birthdateRequired for children and infants, and by some suppliers for every passenger.
genderenumForM, as on the passport.şunlardan biri
FMpassport_numberstringWritten into the booking; never read back.
passport_countrystringIssuing country (ISO 3166 alpha-2).
passport_expirydateMust be valid beyond the travel dates; many countries ask for six months.
national_idstringNational identity number, where the route asks for one (e.g. Turkish domestic flights).
nationalitystringISO 3166 alpha-2.
frequent_flyerstringLoyalty number, credited by the airline.
contactobjectWritten into the booking so the airline can reach the traveller about a schedule change.
Alanları gösterAlanları gizle
emailemailWhere the airline sends schedule changes.
phonestringWhere the airline calls or texts about disruptions. International format.
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, when you hold the agency's id for the payer.remarksstringA free-text note written into the booking.
Yanıt · 201
booking_iduuidUse it to ticket, release or read the booking back.
sale_iduuidThe sale in the agency's books.
record_locatorstringThe airline booking reference (PNR).
ticketing_time_limitdate-timeTake the payment and ticket before this.
totalstringThe sell total to charge on your POS.
currencystringISO 4217 code of
total.price_changedbooleanTrue when the fare moved while holding; show the new total.
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.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 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' \
-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"
}
}'{
"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"
}
}