FX-Port API
Flights

POST /api/v1/flights/get_ticket

Returns the ticket PDF download URL. Polls ticket_ready until the PDF is ready.

Returns the PDF download URL for a confirmed booking. The PDF is generated asynchronously after booking — poll until ticket_ready is true.

Permission: Read

Simpler alternative: Call get_booking and read booking.bucket_link directly. It is populated as soon as the PDF is ready (same data, one fewer endpoint).

  1. Book flight → store the returned order_id (or PNR).
  2. After ~10 seconds, call get_ticket.
  3. If ticket_ready: false, retry every 10 seconds (up to ~2 minutes).
  4. Once ticket_ready: true, present or download the PDF from download_url.

Request body

FieldTypeRequiredDescription
booking_idstringYesPNR or supplier order ID

Request example

curl --request POST \
  --url https://api.fx-port.com/api/v1/flights/get_ticket \
  --header 'Authorization: Bearer fxp_live_YOUR_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "booking_id": "XE4YCB"
  }'

Response — ticket not ready yet

{
    "success": true,
    "requestId": "a1b2c3d4",
    "ticket_ready": false,
    "booking_id": "XE4YCB",
    "message": "Ticket is not ready yet. Please retry in a moment."
}

Response — ticket ready

{
    "success": true,
    "requestId": "a1b2c3d4",
    "ticket_ready": true,
    "booking_id": "XE4YCB",
    "download_url": "https://s3.eu-central-003.backblazeb2.com/213carousat/flight-bookings/XE4YCB-JAMES-SMITH.pdf"
}

On this page