Lydira API
TR

Flight bookingStep 6 of 8

6Release an unpaid hold

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

Reachable with a narrow key: flight_booking

When the customer does not pay, give the seat back. A hold left alone lapses at its time limit, but releasing it frees the seat now and keeps the agency's supplier record clean.

Parameters

Path

  • iduuidrequired

Response · 200

  • releasedboolean
  • statusstring

Responses

  • 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'
Response
200
{
  "released": true,
  "status": "cancelled"
}