Get the ticket PDF of a booking
Get the download links of the ticket PDF of a booking (the hold voucher for a hold).
/api/v1/flights/get_ticketThe PDF is generated after the booking: call again until ticket_ready is true.
ticket_ready is true as soon as the booking has a PDF link, whatever its status: it does not mean that an e-ticket exists, ask get_ticket_number for that. get_booking returns the same links as booking.pdf_url and booking.pdf_url_no_price together with the rest of the booking.
The links are public. Anybody who has a pdf_url can open the PDF with no key and no login; it holds the traveler's name, the itinerary and the fare. Do not log them, do not send them to third parties, and prefer to download the PDF on your server and serve it yourself.
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"
}'{
"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"
}{
"environment": "sandbox",
"success": true,
"requestId": "76be69dc",
"ticket_ready": false,
"booking_id": "Y7PAEU",
"message": "Ticket is not ready yet. Please retry in a moment."
}Request
Body
Required, JSON.
booking_idstringThe PNR, the supplier order id or the FX-Port booking UUID. Prefer the UUID or the order id: PNRs are not unique.
order_idstringAnother name of booking_id.
pnrstringAnother name of booking_id.
include_api_responsebooleanget_booking only: true adds booking.apiResponse. Default false.
agency_idstringNot needed: the agency of a call is always the one of your API key. The field is accepted so that older clients keep working, and it is ignored.
bookingIdstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The previous spelling of booking_id: The PNR, the supplier order id or the FX-Port booking UUID.
orderIdstringdeprecatedLegacy name, still accepted. Use booking_id instead.
The previous spelling of booking_id: The PNR, the supplier order id or the FX-Port booking UUID.
includeApiResponsebooleandeprecatedLegacy name, still accepted. Use include_api_response instead.
The previous spelling of include_api_response: get_booking only: true adds booking.apiResponse.
agencyIdstringdeprecatedLegacy name, still accepted. Use agency_id instead.
The previous spelling of agency_id: Not needed: the agency of a call is always the one of your API key.
Response
200The links, or ticket_ready: false with a message while the PDF is being generated.
environmentstringThe environment of the key that made the call: sandbox for fxp_test_ keys, live for fxp_live_ keys. Present in every JSON body.
One of sandbox, live.
request_idstringThe id of the request, also in the X-Request-Id header.
warningsarray of objectPresent only when the request used a previous spelling of a field or something the endpoint ignored.
ShowHide 5 attributes
codestringWhat the warning is about.
One of deprecated_field, ignored_field, coerced_value, deprecated_value, deprecated_endpoint.
fieldstringThe request field the warning is about.
replacementstringThe name to use instead, for deprecated_* warnings.
messagestringA sentence that says what happened and what to do.
documentation_urlstringWhere the naming rules are explained.
successbooleantrue when the booking was found.
requestIdstringdeprecatedLegacy name, still accepted. Use request_id instead.
The id of this request, 8 characters, for support.
ticket_readybooleantrue as soon as the booking has a PDF link, whatever its status. It does not mean that an e-ticket exists: ask get_ticket_number.
booking_idstringEchoes the value you sent: the PNR, the order id or the UUID.
messagestringOnly when ticket_ready is false.
download_urlstringdeprecatedLegacy name, still accepted. Use pdf_url instead.
The PDF with the fare receipt. A public link.
pdf_urlstringThe PDF with the fare receipt. A public link. The snake_case twin of download_url, with the same value: use this name.
download_url_with_pricestringThe same address as download_url.
download_url_no_pricestringnullabledeprecatedLegacy name, still accepted. Use pdf_url_no_price instead.
A second PDF of the same ticket without prices. A public link.
pdf_url_no_pricestringnullableA second PDF of the same ticket without prices. A public link. The snake_case twin of download_url_no_price, with the same value: use this name.
Errors
| Status | Code | Example message |
|---|---|---|
| 400 | bad_request | booking_id is required |
| 400 | invalid_booking_id | `booking_id` is not a valid identifier (letters, digits and - _ . : = ~ only, up to 128 characters). |
| 404 | booking_not_found | No booking found for 'ZZZZZZ' |
The shape of the error body depends on the endpoint. See Errors for every shape and code.