# Get the ticket number

> Ask for the e-ticket number of a booking: FX-Port asks the airline when the number is not stored yet.

Endpoint: `POST /api/v1/flights/get_ticket_number`

Source: https://fx-port.com/docs/flights/get-ticket-number

Returns the **e-ticket number** of a booking, asking the airline for it when it is not stored yet. Use it after an instant booking whose ticket number has not arrived, or to find out whether the tickets of a booking were issued.

**Permission:** Read. **Rate group:** default (6,000 requests per minute per key).


> [!NOTE]
> This is a Read endpoint that can **do work**: when the number is not stored, FX-Port asks the supplier (Amadeus, Travelport or Duffel) for the order, stores the ticket number on the booking and can send the confirmation e-mail that was held back until the ticket exists. Calling it twice is harmless. Do not call it in a tight loop: wait 5 to 10 seconds between calls.


## Request body

| Field | Type | Required | Description |
|---|---|---|---|
| `booking_id` | string | Yes | The PNR, the supplier order id or the FX-Port UUID. `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. Only bookings of your agency in the environment of your key are answered (a sandbox key never reads a live booking); anything else, including the booking of another agency, is `404 booking_not_found`.

## Request example


**Request**

```bash
curl https://api.fx-port.com/api/v1/flights/get_ticket_number \
  -H "Authorization: Bearer fxp_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "booking_id": "Y7PAEU"
}'
```


## Response: not yet

A hold has no ticket; an instant booking can have none for a few seconds. Real response of 2026-11-01 for a hold:

~~~json
{
  "environment": "sandbox",
  "success": true,
  "requestId": "921cee35",
  "ticket_available": false,
  "ticket_number": null,
  "booking_id": "Y7PAEU",
  "supplier_order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
  "message": "The airline has not returned a ticket number yet. Please retry shortly.",
  "booking_response": { "...": "the stored booking, see below" }
}
~~~

## Response: issued

The same booking after `pay_order`:

~~~json
{
  "environment": "sandbox",
  "success": true,
  "requestId": "a8e2164f",
  "ticket_available": true,
  "ticket_number": "124-2446977397",
  "booking_id": "Y7PAEU",
  "supplier_order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
  "booking_response": { "...": "the stored booking, see below" }
}
~~~

| Field | Meaning |
|---|---|
| `ticket_available` | `true` when the airline has returned a ticket number. |
| `ticket_number` | The e-ticket number, for example `124-2446977397` (Amadeus); in the Duffel sandbox the text `1`. When there are several tickets they are joined in one text. `null` until available. |
| `booking_id` | The PNR (twin: `pnr`). |
| `supplier_order_id` | The supplier's order id (twin: `order_id`). |
| `message` | Only when `ticket_available` is `false`. |
| `booking_response` | The stored answer of the booking, in the shape of the [book](https://fx-port.com/docs/flights/book.md#response-example-instant-issue) response (booking, supplier, pricing, passengers, itinerary, documents ...), without the supplier's costs and commissions. Use [`get_booking`](https://fx-port.com/docs/flights/get-booking.md) for a stable description of the booking. |

## Errors

| Status | Code | When | What to do |
|---|---|---|---|
| `400` | `bad_request` | No `booking_id` (`booking_id is required`). | Send it. |
| `400` | `invalid_booking_id`, `invalid_json`, `invalid_body` | The id is not a valid token, or the body is not a JSON object. | Fix the request. |
| `400` | `unsupported_supplier` | The booking is not an Amadeus, Travelport or Duffel booking. | Use `get_booking`. |
| `404` | `booking_not_found` | No such booking for your agency. | Check the id. |

## Related

- [Get a flight booking](https://fx-port.com/docs/flights/get-booking.md) and [Get the ticket PDF](https://fx-port.com/docs/flights/get-ticket.md).
- [ACD passport uploads](https://fx-port.com/docs/flights/acd-documents.md): the `ticket_number` of an ACD traveler is `null` until the airline returns it.
