Get the ticket PDF
Returns the ticket PDF download URL. Poll until ticket_ready is true.
POST/api/v1/flights/get_ticket
Returns the download links of the ticket PDF of a booking. The PDF is generated after the booking: call again until ticket_ready is true.
Permission: Read. Rate group: default (6,000 requests per minute per key).
Request body
| Field | Type | Required | Description |
|---|---|---|---|
booking_id | string | Yes | The PNR, the supplier order id or the FX-Port UUID of the booking. order_id and pnr are accepted as other names. |
Legacy names: bookingId and orderId. If booking_id is sent together with order_id or pnr and the values differ, booking_id wins and an ignored_field warning names the dropped one. A booking of another agency, or of the other environment, is answered 404 booking_not_found.
Request example
curl https://api.fx-port.com/api/v1/flights/get_ticket \
-H "Authorization: Bearer fxp_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"booking_id": "Y7PAEU"
}'Response: not ready
Real response of 2026-11-01, a second after a hold was created:
{
"environment": "sandbox",
"success": true,
"requestId": "76be69dc",
"ticket_ready": false,
"booking_id": "Y7PAEU",
"message": "Ticket is not ready yet. Please retry in a moment."
}Response: ready
{
"environment": "sandbox",
"success": true,
"requestId": "71fdaeb7",
"ticket_ready": true,
"booking_id": "Y7PAEU",
"download_url": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH.pdf",
"download_url_with_price": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH.pdf",
"download_url_no_price": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH-no-price.pdf"
}| Field | Meaning |
|---|---|
ticket_ready | true when a link exists. It does not mean that an e-ticket exists (see below). |
booking_id | Echoes the value you sent (the PNR if you sent the PNR, the order id if you sent the order id). It is not normalised. |
download_url, download_url_with_price | The same address: the PDF with the fare receipt (twin: pdf_url). |
download_url_no_price | A second PDF of the same ticket without prices (twin: pdf_url_no_price). Can be null. |
message | Only when ticket_ready is false. |
What ticket_ready means
ticket_ready is true as soon as the booking has a PDF link, whatever the status of the booking:
- a held booking has a hold voucher, and the flag can be
truebefore the payment; - a cancelled hold keeps its voucher link and stays
true; - an instant ACD booking can be
truebefore the airline has returned an e-ticket number: useget_ticket_numberto know whether tickets were issued; - a booking with the status
failedstaysfalsefor ever.
Polling
- Book, then keep the order id (or the PNR).
- Wait about 10 seconds and call
get_ticket. - While
ticket_readyisfalse, call again every 10 seconds, for about two minutes. Stop then: a failed booking never gets a PDF. Check the status withget_booking. - When it is
true, download the PDF fromdownload_url.
Errors
| Status | Code | When | What to do |
|---|---|---|---|
400 | bad_request | No booking_id (booking_id is required). | Send it. |
400 | invalid_booking_id | booking_id is not a valid token. | Send the id as you received it. |
400 | invalid_json, invalid_body | The body is not valid JSON, or not a JSON object. | Send a JSON object. |
404 | booking_not_found | No such booking in your agency and environment. | Check the id and the key. |
Related
- Get a flight booking and Get the ticket number.
- Security: links to tickets, vouchers and documents.