# Get a flight booking

> Read a booking of your agency by its PNR, its supplier order id or its FX-Port id: status, prices, ticket number, the links of the PDF tickets and the ACD state.

Endpoint: `POST /flights/get_booking`

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

`POST /api/v1/flights/get_booking`

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

`booking_id` takes any of the three values (`order_id` and `pnr` are other names of the same field; when they are sent with a different value, `booking_id` wins and an `ignored_field` warning names the dropped one). Prefer the FX-Port `id` (a UUID) or the order id: **PNRs are not unique** across suppliers and airlines. A booking that is not yours, or that belongs to the other environment, is answered `404 booking_not_found`, the same as one that does not exist.

`booking.status` is `confirmed`, `awaiting_payment` (a hold), `cancelled`, `partial_refund` or `failed`. `ticket_number` is `null` until the airline returns it: ask `get_ticket_number`. `acd_required` says whether the booking needs ACD passports and `acd_submitted` whether they are all uploaded; `acd_documents[]` and `acd_links` list the files that were uploaded (public links, without FX-Port's storage keys), but `get_acd_documents` is the better source for the state of each traveler. The links `pdf_url` and `pdf_url_no_price` (`bucket_link` and `bucket_link_no_price`) are **public**: anybody who has them can open the PDF, so treat them as sensitive. The booking is a database row: only the keys listed below are part of the contract.

## 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_booking \
  -H "Authorization: Bearer fxp_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "booking_id": "Y7PAEU"
}'
```

## Response

### 200: The booking.

- `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.
- `processingTime` (number, deprecated): Legacy name: use `processing_time`. Seconds spent.
- `processing_time` (number): Seconds spent. The snake_case twin of `processingTime`, with the same value: use this name.
- `booking` (FlightBooking): A flight booking of your agency, as FX-Port stores it. The booking is a database row: more keys than the ones listed here exist (the void history, the details of a changed schedule ...); they are internal and not part of the contract. Where the ACD passports sit in FX-Port's storage is never returned: only their public links.

```json
{
  "environment": "sandbox",
  "success": true,
  "requestId": "0c2b315c",
  "processingTime": 0.272,
  "booking": {
    "id": "711371c3-00aa-4be2-b790-9f0ca2ccfdb7",
    "booking_id": "Y7PAEU",
    "amadeus_id": "eJzTd9ePNA9wdA0FAAs8AmE",
    "status": "confirmed",
    "created_at": "2026-11-01T15:26:14.871035+00:00",
    "paid_at": "2026-11-01T15:26:21.961664+00:00",
    "updated_at": "2026-11-01T15:26:21.998944+00:00",
    "total_price": 4930.37,
    "agency_commission": 4.93,
    "currency": "DZD",
    "departure_airport": "ALG",
    "arrival_airport": "ORN",
    "departure_date": "2026-12-22T19:45:00",
    "arrival_date": "2026-12-22T20:45:00",
    "return_departure_date": null,
    "return_arrival_date": null,
    "included_checked_bags": "0",
    "ticketing_agreement": "DELAY_TO_CANCEL",
    "supplier_name": "Amadeus Algeria",
    "supplier_id": "amadeus_aqc_dz_1",
    "ticket_number": "124-2446977397",
    "bucket_link": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH.pdf",
    "bucket_link_no_price": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH-no-price.pdf",
    "email_sent": false,
    "require_acd": false,
    "acd_submitted": false,
    "acd_links": null,
    "acd_amount": null,
    "acd_paid": false,
    "acd_documents_revision": 0,
    "acd_documents": null,
    "has_changed": false,
    "new_flight_details": null,
    "voided_at": null,
    "refund_amount": null,
    "refund_currency": null,
    "refund_method": null,
    "agent_id": null,
    "environment": "sandbox",
    "pricingBreakdown": {
      "supplier_currency": "DZD",
      "agency_currency": "DZD",
      "base_price": 3160,
      "taxes_and_fees": 1765.44,
      "agency_commission": 4.93,
      "final_price": 4930.37,
      "b2b_price": 4925.44,
      "created_at": "2026-11-01T15:26:22.176516+00:00",
      "environment": "sandbox"
    },
    "travelerPricing": [
      {
        "traveler_id": "1",
        "traveler_type": "ADULT",
        "fare_option": "STANDARD",
        "supplier_currency": "DZD",
        "agency_currency": "DZD",
        "base": 3160,
        "total": 4930.37,
        "b2b_price": 4925.44,
        "created_at": "2026-11-01T15:26:15.133066+00:00",
        "environment": "sandbox"
      }
    ],
    "balanceOperations": [],
    "order_id": "eJzTd9ePNA9wdA0FAAs8AmE",
    "pnr": "Y7PAEU",
    "pdf_url": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH.pdf",
    "pdf_url_no_price": "https://s3.example.com/flight-bookings/Y7PAEU-JAMES-SMITH-no-price.pdf",
    "acd_required": false,
    "requires_acd": false
  }
}
```

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

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

## Related guides

- [Get a booking](https://fx-port.com/docs/flights/get-booking.md)
- [Post-booking operations](https://fx-port.com/docs/flights/post-booking.md)
