flights

Poll a booking

Poll every few seconds until terminal is true. The poll is also how LetsFG knows you are still there, which keeps a booking paused on a question alive.

States: authorised, card_issued, booking_in_progress, awaiting_settlement, then completed (with pnr and charged_amount), failed (hold released, nothing charged) or needs_attention (a human at LetsFG is on it — do not book again).

A declined payment is failed with decline_reason, decline_message and decline_advice - and, when the same payment went on as 3-D Secure, retry {booking_id, pay_url}. That retry booking reads awaiting_payment with pay_url and awaiting_link_payment until the traveller's bank approves the payment on pay_url, then starts by itself and walks the states above.

While booking_in_progress, question may carry a seat map, a paid extra or a fare increase; answer it through POST /flights/bookings/{booking_id}/answer within its window or the run continues without it.

get/flights/bookings/{booking_id}

Request

  • Base URL: https://letsfg.co/developers/api/v1
  • URL: https://letsfg.co/developers/api/v1/flights/bookings/{booking_id}
  • Auth: API key in header X-API-Key

Path parameters

booking_idstring required

booking_id returned by POST /flights/book.

Response

Booking state.

booking_idstring
state'awaiting_payment' | 'authorised' | 'card_issued' | 'booking_in_progress' | 'awaiting_settlement' | 'completed' | 'failed' | 'needs_attention'

awaiting_payment only on a 3-D Secure retry booking that the traveller has not paid yet (see pay_url).

terminalboolean

True for completed, failed and needs_attention.

pnrstring
currencystring
held_amountnumber
charged_amountnumber

Set once the hold is captured against a real PNR.

card_last4string
failure_reasonstring
decline_reasonstring

The payment provider's code when the traveller's own payment method was declined; '' otherwise.

decline_messagestring

What the decline means, in words to show the traveller (second person).

decline_advicestring

What the traveller can do next, in words to show them.

pay_urlstring uri

On a 3-D Secure retry booking while it is unpaid: the secure page where the traveller's bank approves the payment.

awaiting_link_paymentboolean

True while a 3-D Secure retry booking waits for the traveller to pay pay_url.

updated_at_msinteger
offerobject
questionobject nullable

kind is 'seat', 'extra' or 'price_change'; echo its round to the answer route.

messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.