Skip to content
FX-Port/Docs
GuidesAPI referenceChangelog
Get API keys
  • Overview
  • Error object

Search and price

  • Search flightsPOST
  • Flexible datesPOST
  • Price an offerPOST
  • Airport autocompleteGET
  • Most searched airportsGET

Book, pay and cancel

  • Book an offerPOST
  • Quote a held orderPOST
  • Pay a held orderPOST
  • Cancel a held orderPOST

After booking

  • Get a bookingPOST
  • Ticket PDFPOST
  • Ticket numberPOST
  • Quote a refundPOST
  • Confirm a cancellationPOST

ACD documents

  • Get the document statePOST
  • Upload passportsPOST

Objects

  • Flight offer
  • Flight booking

Flights ยท After booking

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.

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.

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"
}'
Response200
{
  "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": "[email protected]",
        "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
    }
  }
}
Response200
{
  "environment": "sandbox",
  "success": true,
  "requestId": "921cee35",
  "ticket_available": false,
  "ticket_number": null,
  "booking_id": "Y7PAEU",
  "supplier_order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
  "booking_response": {
    "booking": {
      "pnr": "Y7PAEU",
      "type": "hold",
      "status": "pending",
      "content": "managed",
      "syncedAt": "2026-11-01T15:26:00.000",
      "createdAt": "2026-11-01T15:26:00.000",
      "reference": "eJzTd9ePNA9wdA0FAAs8AmE",
      "cancelledAt": null,
      "cancellation": null,
      "voidableUntil": null,
      "availableActions": [
        "confirm",
        "cancel"
      ]
    },
    "supplier": {
      "id": "amadeus_aqc_dz_1",
      "name": "Amadeus AQC",
      "offerId": "3",
      "technology": "amadeus_aqc"
    },
    "pricing": {
      "acd": {
        "applied": false
      },
      "b2bPrice": 4736,
      "basePrice": 3160,
      "finalPrice": 4930.37,
      "taxesAndFees": 1770.37,
      "agencyCurrency": "DZD",
      "agencyCommission": 4.93,
      "supplierCurrency": "DZD",
      "additionalServices": []
    },
    "payment": {
      "paidAt": null,
      "status": "awaiting_payment",
      "awaitingPayment": true,
      "paymentRequiredBy": null,
      "priceGuaranteeExpiresAt": null
    },
    "documents": [],
    "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": "[email protected]",
        "title": "mr",
        "bornOn": "1988-06-15",
        "gender": "male",
        "givenName": "JAMES",
        "familyName": "SMITH",
        "phoneNumber": "15555550123",
        "ticketNumber": null,
        "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
    }
  },
  "message": "The airline has not returned a ticket number yet. Please retry shortly."
}

Request

Body

Required, JSON.

booking_idstring

The PNR, the supplier order id or the FX-Port booking UUID. Prefer the UUID or the order id: PNRs are not unique.

order_idstring

Another name of booking_id.

pnrstring

Another name of booking_id.

include_api_responseboolean

get_booking only: true adds booking.apiResponse. Default false.

agency_idstring

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.

bookingIdstringdeprecated

Legacy 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.

orderIdstringdeprecated

Legacy 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.

includeApiResponsebooleandeprecated

Legacy name, still accepted. Use include_api_response instead.

The previous spelling of include_api_response: get_booking only: true adds booking.apiResponse.

agencyIdstringdeprecated

Legacy 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 ticket number, or ticket_available: false with a message.

environmentstring

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_idstring

The id of the request, also in the X-Request-Id header.

warningsarray of object

Present only when the request used a previous spelling of a field or something the endpoint ignored.

ShowHide 5 attributes
codestring

What the warning is about.

One of deprecated_field, ignored_field, coerced_value, deprecated_value, deprecated_endpoint.

fieldstring

The request field the warning is about.

replacementstring

The name to use instead, for deprecated_* warnings.

messagestring

A sentence that says what happened and what to do.

documentation_urlstring

Where the naming rules are explained.

successboolean

true when the booking was found.

requestIdstringdeprecated

Legacy name, still accepted. Use request_id instead.

The id of this request, 8 characters, for support.

ticket_availableboolean

true when the airline has returned a ticket number.

ticket_numberstringnullable

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_idstringdeprecated

Legacy name, still accepted. Use pnr instead.

The PNR.

pnrstring

The PNR. The snake_case twin of booking_id, with the same value: use this name.

supplier_order_idstringdeprecated

Legacy name, still accepted. Use order_id instead.

The supplier's order id.

order_idstring

The supplier's order id. The snake_case twin of supplier_order_id, with the same value: use this name.

messagestring

Only when ticket_available is false.

booking_responseobject

The stored answer of the booking, in the shape of the book_flight response, without the supplier's costs and commissions.

Errors

StatusCodeExample message
400bad_requestbooking_id is required
400unsupported_supplierTicket-number retrieval is only supported for Amadeus, Travelport and Duffel bookings.
404booking_not_foundNo booking found for 'ZZZZZZ'

The shape of the error body depends on the endpoint. See Errors for every shape and code.

Related guides

  • Get the e-ticket number
  • Get a booking
PreviousGet the ticket PDF of a bookingNext Quote the refund of an issued order

ยฉ 2026 FX-Port

TermsPrivacy[email protected]