Booking flows
Step-by-step flight booking flows: instant issue, hold then pay, and how cancelling a held PNR works.
Every flight booking follows one of two flows. Both start with a search and a mandatory pricing step, and a booking can be cancelled in different ways depending on its state and its supplier.
Instant issue (most common)
The tickets are issued when you book.
- 1Your server to FX-Port API
POST /get_flights - 2FX-Port API to Supplier
Search every enabled supplier - 3Supplier to FX-Port API
Fares - 4FX-Port API to Your server
Offers, one search_id per supplier - 5Your server to FX-Port API
POST /flights/price_flight - 6FX-Port API to Your server
Confirmed fare, offer cached - 7Your server to FX-Port API
POST /flights/book_flight (issue) - 8FX-Port API to Supplier
Book and issue the tickets - 9FX-Port API to Your server
Booking, PNR and ticket numbers - 10Your server to FX-Port API
POST /flights/get_booking - 11FX-Port API to Your server
Booking with the PDF link
Search for flights
POST /returns offers from one or every supplier. Each supplier entry has aapi/ v1/ get_flights searchId: keep it for the next steps. See Search flights.Price the offer (required)
POST /confirms the current fare and saves the priced offer. This step is mandatory: booking an offer that was not priced is refused withapi/ v1/ flights/ price_flight 404 offer_not_priced. See Price a flight offer.Book and issue the tickets
POST /withapi/ v1/ flights/ book_flight "booking_type": "issue". The tickets are issued at once. The response hasbooking.reference(the supplier's order id),booking.pnrand the ticket documents. See Book a flight.Read the booking and the PDF
POST /returns the whole booking. The PDF link (api/ v1/ flights/ get_booking booking.bucket_link) appears a few seconds after the booking. See Get a flight booking and Get the ticket PDF.
GET_FLIGHTS -> PRICE_FLIGHT -> BOOK_FLIGHT (issue) -> GET_BOOKINGTwo rules that surprise people:
- A booking is idempotent per offer. Booking an offer twice answers
409 duplicate_bookingwith the PNR of the first booking, and a second request while the first is running answers409 booking_in_progress. A booking that failed releases the offer, so you can try again. - Duffel books one offer per search. After a Duffel booking, booking another offer of the same search fails with
409 offer_request_already_booked: search again first.
Hold, then pay (suppliers that support holds)
Reserve the seats, pay later. Use it only when the priced offer says supportHold: true (today Amadeus Algeria). Never infer hold support from a supplier name: it depends on the supplier, the airline, the fare and the offer.
- 1Your server to FX-Port API
POST /get_flights, then /flights/price_flight - 2Your server to FX-Port API
POST /flights/book_flight (hold) - 3FX-Port API to Supplier
Create the reservation, no ticket - 4FX-Port API to Your server
Held booking, awaiting_payment - 5Your server to FX-Port API
POST /flights/get_order_quote (optional) - 6FX-Port API to Your server
Current price and deadline - 7Your server to FX-Port API
POST /flights/pay_order - 8FX-Port API to Supplier
Issue the tickets, debit the balance - 9FX-Port API to Your server
Ticketed booking
Search and price: as for an instant issue.
Create the hold
POST /withapi/ v1/ flights/ book_flight "booking_type": "hold". The reservation is created without tickets and without a charge. The booking answer saysbooking.status: "pending"; every later answer (quote,get_booking) saysawaiting_payment. Aholdon an offer that cannot be held is refused with400 hold_not_supported.Preview the price (optional)
POST /returns the current price and whether the hold can still be paid. See Quote a held booking.api/ v1/ flights/ get_order_quote Pay and issue
POST /debits the agency balance and issues the tickets. Send theapi/ v1/ flights/ pay_order order_id. Do not sendcurrency: it is refused. See Pay a held booking.
GET_FLIGHTS -> PRICE_FLIGHT -> BOOK_FLIGHT (hold) -> [GET_ORDER_QUOTE] -> PAY_ORDER -> GET_BOOKINGCancelling
What you can cancel by yourself depends on the state and on the supplier:
| Booking | How | Money |
|---|---|---|
| A held (unpaid) reservation, Amadeus Algeria | cancel_order: deletes the reservation and releases the PNR | Nothing was paid: nothing is refunded |
| An issued Duffel order | cancel_quote asks what the airline would refund, then confirm_cancel cancels for good | The refund is credited to your FX-Port balance. Only for orders the airline lets you cancel (order_not_cancellable otherwise) |
| An issued Amadeus Algeria ticket: void, exchange, re-issue, refund | Manual: see Post-booking operations | By the FX-Port team |
Why cancel a hold you abandon
If you create a hold and then abandon it, the airline can refuse a new booking for the same passenger on the same route while the old reservation is pending. Cancel the old hold with cancel_order to release the PNR before you book that passenger again.
BOOK_FLIGHT (hold) -> (you change your mind) -> CANCEL_ORDER -> PNR released -> safe to book againAfter the booking
get_bookingis the source of truth for the status, the prices and the PDF links.get_ticketreturns the PDF links, andget_ticket_numberthe ticket number when the airline has issued it: see Get the ticket number.- A booking that needs passports (
requiresACD) is completed with ACD passport uploads. - There are no webhooks: poll
get_booking, not more often than every few seconds.