# Get the e-ticket number of a booking

> Get the e-ticket number of a booking, asking the airline for it when it is not stored yet.

Endpoint: `POST /flights/get_ticket_number`

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

`POST /api/v1/flights/get_ticket_number`

Requires an API key with **Read** permission; a **Read+Write** key works too.

Use it after an instant booking whose number has not arrived, or to find out whether the tickets of a booking were issued.

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 number on the booking and can send the confirmation e-mail that was held back until the ticket exists. Calling it twice is harmless. Wait 5 to 10 seconds between calls instead of looping. `ticket_available: false` with a message means the airline has not returned a number yet. A hold has no ticket number until it is paid.

`booking_response` is the stored answer of the booking, without the supplier's costs and commissions. Only bookings of your agency in the environment of your key are answered.

## Request

### Body

Required, JSON.

- `booking_id` (string, optional): The PNR, the supplier order id or the FX-Port booking UUID. Prefer the UUID or the order id: PNRs are not unique.
- `order_id` (string, optional): Another name of `booking_id`.
- `pnr` (string, optional): Another name of `booking_id`.
- `include_api_response` (boolean, optional): `get_booking` only: `true` adds `booking.apiResponse`. Default `false`.
- `agency_id` (string, optional): Not 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.
- `bookingId` (string, deprecated, optional): Legacy name: use `booking_id`. The previous spelling of `booking_id`: The PNR, the supplier order id or the FX-Port booking UUID.
- `orderId` (string, deprecated, optional): Legacy name: use `booking_id`. The previous spelling of `booking_id`: The PNR, the supplier order id or the FX-Port booking UUID.
- `includeApiResponse` (boolean, deprecated, optional): Legacy name: use `include_api_response`. The previous spelling of `include_api_response`: `get_booking` only: `true` adds `booking.apiResponse`.
- `agencyId` (string, deprecated, optional): Legacy name: use `agency_id`. The previous spelling of `agency_id`: Not needed: the agency of a call is always the one of your API key.

### 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

### 200: The ticket number, or `ticket_available: false` with a message.

- `environment` (string): The 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_id` (string): The id of the request, also in the `X-Request-Id` header.
- `warnings` (array of object): Present only when the request used a previous spelling of a field or something the endpoint ignored.
  - `code` (string): What the warning is about. One of `deprecated_field`, `ignored_field`, `coerced_value`, `deprecated_value`, `deprecated_endpoint`.
  - `field` (string): The request field the warning is about.
  - `replacement` (string): The name to use instead, for `deprecated_*` warnings.
  - `message` (string): A sentence that says what happened and what to do.
  - `documentation_url` (string): Where the naming rules are explained.
- `success` (boolean): `true` when the booking was found.
- `requestId` (string, deprecated): Legacy name: use `request_id`. The id of this request, 8 characters, for support.
- `ticket_available` (boolean): `true` when the airline has returned a ticket number.
- `ticket_number` (string, nullable): The e-ticket number, for example `124-2446977397` (Amadeus); in the Duffel sandbox the text `1`. Several tickets are joined in one text. `null` until available.
- `booking_id` (string, deprecated): Legacy name: use `pnr`. The PNR.
- `pnr` (string): The PNR. The snake_case twin of `booking_id`, with the same value: use this name.
- `supplier_order_id` (string, deprecated): Legacy name: use `order_id`. The supplier's order id.
- `order_id` (string): The supplier's order id. The snake_case twin of `supplier_order_id`, with the same value: use this name.
- `message` (string): Only when `ticket_available` is `false`.
- `booking_response` (object): The stored answer of the booking, in the shape of the `book_flight` response, without the supplier's costs and commissions.

```json
{
  "environment": "sandbox",
  "success": true,
  "requestId": "a8e2164f",
  "ticket_available": true,
  "ticket_number": "124-2446977397",
  "booking_id": "Y7PAEU",
  "supplier_order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
  "booking_response": {
    "booking": {
      "pnr": "Y7PAEU",
      "type": "instant",
      "status": "confirmed",
      "content": "managed",
      "syncedAt": "2026-11-01T15:26:21.896668",
      "createdAt": "2026-11-01T15:26:21.896668",
      "reference": "eJzTd9ePNA9wdA0FAAs8AmE",
      "cancelledAt": null,
      "cancellation": null,
      "voidableUntil": "2026-11-01T23:00:00Z",
      "availableActions": []
    },
    "supplier": {
      "id": "amadeus_aqc_dz_1",
      "name": "Amadeus AQC",
      "offerId": "1",
      "technology": "amadeus_aqc"
    },
    "pricing": {
      "b2bPrice": 4736,
      "basePrice": 3160,
      "finalPrice": 4930.37,
      "taxesAndFees": 1770.37,
      "agencyCurrency": "DZD",
      "agencyCommission": 4.93,
      "supplierCurrency": "DZD",
      "additionalServices": []
    },
    "payment": {
      "paidAt": "2026-11-01T15:26:21.896710",
      "status": "paid",
      "awaitingPayment": false,
      "paymentRequiredBy": null,
      "priceGuaranteeExpiresAt": null
    },
    "documents": [
      {
        "type": "electronic_ticket",
        "status": "ISSUED",
        "segmentIds": [
          "1"
        ],
        "documentType": "ETICKET",
        "passengerIds": [
          "1"
        ],
        "uniqueIdentifier": "124-2446977397"
      }
    ],
    "bookingReferences": [
      {
        "pnr": "Y7PAEU",
        "carrier": {
          "name": "Air Algerie",
          "logoUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AH.svg",
          "iataCode": "AH",
          "logoLockupUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/AH.svg"
        }
      }
    ],
    "passengers": [
      {
        "id": "1",
        "type": "ADULT",
        "email": "traveler@example.com",
        "title": "mr",
        "bornOn": "1988-06-15",
        "gender": "male",
        "givenName": "JAMES",
        "familyName": "SMITH",
        "phoneNumber": "15555550123",
        "ticketNumber": "124-2446977397",
        "infantPassengerId": null,
        "loyaltyProgrammeAccounts": []
      }
    ],
    "owner": {
      "id": null,
      "name": "Air Algerie",
      "logoUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/AH.svg",
      "iataCode": "AH",
      "logoLockupUrl": "https://assets.duffel.com/img/airlines/for-light-background/full-color-lockup/AH.svg",
      "conditionsOfCarriageUrl": null
    }
  }
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 400 | `bad_request` | booking_id is required |
| 400 | `unsupported_supplier` | Ticket-number retrieval is only supported for Amadeus, Travelport and Duffel bookings. |
| 404 | `booking_not_found` | No booking found for 'ZZZZZZ' |

See [Errors](https://fx-port.com/docs/errors.md) for every code and how to react.

## Related guides

- [Get the e-ticket number](https://fx-port.com/docs/flights/get-ticket-number.md)
- [Get a booking](https://fx-port.com/docs/flights/get-booking.md)
