Docs
Get an API key

Flight booking lifecycle

How a booking moves from prebook through book and cancel, and what an interrupted call leaves behind.

Use your booking's status to decide the next step. Read payment and refund information separately, because a ticket's state does not establish whether money moved.

Use this diagram for Duffel's booking flow. For LiteAPI, follow the checkout and recovery rules below because prebook may hold an itinerary and payment can precede book.

Duffel booking status flow

Prebook

You receive READY_FOR_COMPLETE after the fare, itinerary and passengers are stored. For Duffel, no inventory is held before book. For LiteAPI, prebook creates a checkout and may create an airline hold; pay through the SDK named in meta.payment_sdk before you book.

When prebook returns a definite refusal, read failure for the cause. An interrupted LiteAPI prebook stays PREBOOK_IN_PROGRESS, because the supplier may have acted. Replay the same key to read the stored state and contact support before creating another checkout. If local persistence failed after supplier success, you receive no checkout secret until the outcome is recovered.

Loyalty numbers

Send each passenger's airline loyalty accounts in loyalty_accounts at prebook. An account is sent when the offer can carry it: on Duffel, a programme the offer supports, for a traveller whose first and last names each have 1 to 20 Latin letters (other than Æ, æ, Œ, œ, IJ, ij, Þ and ð), spaces, hyphens or apostrophes; on LiteAPI, a Sabre or Travelport journey. The prebook response and single-booking reads list the accounts the supplier accepted, with masked numbers. Once your booking is READY_FOR_COMPLETE, an account missing from that list was not passed on, because the offer cannot carry it or the supplier refused it, and the booking goes ahead without it. The airline decides whether to credit miles, and on Duffel it can grant a member price, which lowers total_amount. You cannot add or change numbers after prebook.

If a Duffel account update gets no answer, prebook returns 500 result_unknown and the booking stays PREBOOK_IN_PROGRESS, holding its offer but no inventory or payment: search again and prebook the new offer with a new key. If Duffel rate-limits an account update or a prebook read, prebook returns 502 supplier_unreachable and the booking fails rather than going ahead without your number: wait, then prebook the same travellers again with a new key. If the airline refuses a Duffel number at book, you receive 422 loyalty_membership_rejected and the booking fails: search again and prebook without that number, with a new key. On LiteAPI, a refusal reaches you as 500 result_unknown, like any uncertain LiteAPI outcome, because LiteAPI names no refusal we can tell apart; follow Retry flight calls safely.

Book

For Duffel, you move through COMPLETE_IN_PROGRESS to CONFIRMED: OEX authorizes the instrument, the airline issues the order, then OEX captures the authorization. An unconfirmed OEX SDK intent leaves your booking ready to complete. A card decline or supplier refusal can mark it failed; OEX attempts to release an authorization after supplier refusal.

For LiteAPI, you pay in its checkout and then book with {}. You cannot send a saved instrument. LiteAPI decides whether its prebook is still valid, because a local expiry check cannot establish whether your traveller paid. A refusal can leave a paid checkout without a ticket, so contact support before starting another. While LiteAPI is still ticketing, book returns 202 with your booking COMPLETE_IN_PROGRESS: wait for flight.booking.confirmed or read the booking, and do not book again, because a repeat returns the same 202. If it stays COMPLETE_IN_PROGRESS, contact support with your booking id.

Payments

Every booking response lists your booking's payments, oldest first: its own payment, an attempt that failed before it, and each bag bought later. Each has its last recorded status, its amount, who collected it in collected_by and, when it can be read, its card in payment_method. A status is the last outcome recorded, not a live reading, so it can trail the money. A list of bookings carries no card, and a card that could not be read in time is left out; read the booking again for it.

Cancel

You receive 202 and CANCEL_IN_PROGRESS while a workflow asks the airline to cancel. On success you receive CANCELED with cancellation details. On refusal you see CONFIRMED again and failure.code, because the ticket remains valid.

Read cancellation.refunded_by for the responsible merchant and cancellation.refund_to for the payments the refund returns to. OEX requests refunds through Payment; LiteAPI handles its own refunds. You cannot infer settlement from CANCELED or refund_amount.

When the result is unknown

If book returns 500 result_unknown, re-read your booking because the airline may have issued a ticket. For Duffel, do not book again while it stays in progress; contact support. For LiteAPI, keep the original booking id and wait for support to confirm the next action before another book request. A pending supplier answer leaves your booking in progress even if payment completed.

If you see FAILED or EXPIRED on LiteAPI, contact support before opening another checkout because either state can coexist with a payment.

Keep learning

On this page