Booking guides
Flight booking
Your website sells flights on the agency's own supplier connections: search, price, hold, take the payment on your own POS, ticket.
The steps
- 1SearchPOST
/api/v1/flights/search - 2Wait for the answerGET
/api/v1/flights/operations/{id} - 3Price the offerPOST
/api/v1/flights/price - 4Hold itPOST
/api/v1/flights/holds - 5Take the payment, then ticketPOST
/api/v1/flights/holds/{id}/ticket - 6Release an unpaid holdDELETE
/api/v1/flights/holds/{id} - 7Buy a fare that cannot be heldPOST
/api/v1/flights/purchases - 8Read it backGET
/api/v1/flights/bookings/{id}
The flow at a glance
POST /api/v1/flights/search→ choose an offer.- Every call here except the read-back answers
202(a cached search answers200): readGET /api/v1/flights/operations/{id}until it answers. POST /api/v1/flights/price→ show the total; keep the token.holdable:POST /api/v1/flights/holds→ charge your POS →POST /api/v1/flights/holds/{id}/ticket, orDELETE /api/v1/flights/holds/{id}if unpaid.- Not holdable: charge your POS →
POST /api/v1/flights/purchases. GET /api/v1/flights/bookings/{id}or the ticket webhook for the numbers.
When the price moves
A fare can move between price and purchase. The call answers
409 price_changed with no figure: price the offer again, show the new total, and send the new token with a new Idempotency-Key. At ticketing time the hold stays open, so you can release it and start over.409 approval_required means the agency approves this ticket in Lydira first. Give the key a role with no ticketing approval threshold and it never happens.