# The Flight booking object

> A flight booking of your agency as FX-Port stores it: its status, price, ticket number, the links of the PDF tickets and the ACD state.

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

`get_booking` returns it under `booking`. `id` is the FX-Port UUID, the stable key to store; `booking_id` (also `pnr`) is the airline record locator, which is not unique across suppliers and airlines; `amadeus_id` (also `order_id`) is the supplier's order id, the value `pay_order`, `cancel_order` and `cancel_quote` take. 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. The links `bucket_link` (`pdf_url`) and `bucket_link_no_price` are public addresses of PDFs that hold the traveler's name and the fare, and the `link` of every entry of `acd_documents` (also `acd_links`) is a public address of a passport: treat them all as sensitive. FX-Port's own storage keys of the passports are never returned. See Get a booking.

## Attributes

- `id` (string): The FX-Port UUID of the booking. **Use it as the key** when you store or re-read a booking.
- `booking_id` (string, deprecated): Legacy name: use `pnr`. The PNR. Not unique; prefer `id`.
- `pnr` (string): The PNR. Not unique; prefer `id`. The snake_case twin of `booking_id`, with the same value: use this name.
- `amadeus_id` (string, deprecated): Legacy name: use `order_id`. The supplier's order id (the name is historical: it also holds the `ord_...` of a Duffel order). This is the `order_id` of `pay_order`, `cancel_order` and `cancel_quote`.
- `order_id` (string): The supplier's order id (the name is historical: it also holds the `ord_...` of a Duffel order). This is the `order_id` of `pay_order`, `cancel_order` and `cancel_quote`. The snake_case twin of `amadeus_id`, with the same value: use this name.
- `status` (string): `confirmed`, `awaiting_payment` (a hold), `cancelled`, `partial_refund`, `failed`; `voided`, `refunded` and `expired` can appear for changed orders.
- `created_at` (string): When the booking was created.
- `paid_at` (string, nullable): When it was paid.
- `updated_at` (string): When it last changed.
- `total_price` (number): The final price in the currency of the agency.
- `agency_commission` (number): Your commission.
- `currency` (string): Currency of the agency.
- `departure_airport` (string): IATA code of the first departure.
- `arrival_airport` (string): IATA code of the last arrival.
- `departure_date` (string): Local departure time, without a zone.
- `arrival_date` (string): Local arrival time, without a zone.
- `return_departure_date` (string, nullable): Local departure time of the return.
- `return_arrival_date` (string, nullable): Local arrival time of the return.
- `included_checked_bags` (string): The checked bags included, as a text.
- `ticketing_agreement` (string, nullable): The ticketing-time-limit agreement of an Amadeus booking, for example `DELAY_TO_CANCEL`.
- `supplier_name` (string): Name of the supplier.
- `supplier_id` (string): Id of the supplier.
- `ticket_number` (string, nullable): The e-ticket number(s), as one text; several numbers are joined by commas. `null` until the airline returns one.
- `bucket_link` (string, nullable, deprecated): Legacy name: use `pdf_url`. Address of the PDF of the ticket (a hold: the hold voucher). `null` until generated. A public link.
- `pdf_url` (string, nullable): Address of the PDF of the ticket (a hold: the hold voucher). `null` until generated. A public link. The snake_case twin of `bucket_link`, with the same value: use this name.
- `bucket_link_no_price` (string, nullable, deprecated): Legacy name: use `pdf_url_no_price`. Address of the same PDF without prices. A public link.
- `pdf_url_no_price` (string, nullable): Address of the same PDF without prices. A public link. The snake_case twin of `bucket_link_no_price`, with the same value: use this name.
- `email_sent` (boolean): Whether the confirmation e-mail went out.
- `require_acd` (boolean): `true` for an ACD booking (the stored flag).
- `acd_required` (boolean): `true` for an ACD booking whose passports FX-Port did not waive: the same value as `acd.acd_required` of `get_acd_documents`.
- `requires_acd` (boolean): The same value as `acd_required`.
- `acd_submitted` (boolean): `true` once every traveler has a passport. Never `null`.
- `acd_documents` (array of object, nullable): The passports uploaded through the API, one entry for each traveler who has one. `null` for a booking that never had one. `get_acd_documents` gives the same information for each traveler, with the files FX-Port staff added from the dashboard.
  - `traveler_id` (string): The traveler the passport belongs to: the `traveler_id` of `get_acd_documents`.
  - `traveler_name` (string): The name on the booking.
  - `traveler_type` (string): The passenger type, for example `ADULT`.
  - `link` (string): The **public** address of the file: anybody who has it can open the passport. Treat it as sensitive.
  - `filename` (string): The file name that was sent.
  - `content_type` (string): The type FX-Port detected from the content, for example `application/pdf` or `image/png`.
  - `size` (integer): The size of the stored file in bytes (`size_bytes` in `get_acd_documents`).
  - `format` (string): The detected format: `pdf`, `jpeg`, `png`, `webp`, `heif`, `avif`, `tiff`, `bmp`, `gif`, `jp2` or `jxl`.
  - `uploaded_at` (string): When the file was stored: ISO 8601, UTC.
  - `replaced_count` (integer): How many times the passport was replaced.
  - `previous_links` (array of object): The files this passport replaced, oldest first. Empty for a passport that was never replaced.
    - `link` (string): The public address of a file that was replaced.
    - `uploaded_at` (string): When that file was stored.
    - `replaced_at` (string): When it was replaced.
  - `source` (string): How the file arrived: `api` for an upload through the API.
- `acd_links` (array of string, nullable): The public addresses of every passport file of the booking, including the ones FX-Port staff added. `null` when there is none.
- `acd_amount` (number, nullable): The ACD amount of the booking in euros, saved when the set of passports became complete. Informational. `null` before.
- `acd_paid` (boolean): `true` once FX-Port's team has marked the ACD amount as paid. You cannot set it.
- `acd_documents_revision` (integer): Increases by one with each upload that stored a file. `0` for a booking without any.
- `has_changed` (boolean): `true` when the airline changed the schedule after ticketing.
- `new_flight_details` (object, nullable): The new schedule, when `has_changed`.
- `voided_at` (string, nullable): When the ticket was voided.
- `refund_amount` (number, nullable): The refund of a cancelled Duffel order.
- `refund_currency` (string, nullable): Currency of the refund.
- `refund_method` (string, nullable): How the refund was paid: `balance`.
- `agent_id` (string, nullable): Your own agent id, when you sent one.
- `environment` (string): `sandbox` or `live`.
- `pricingBreakdown` (object, nullable): The price of the booking in snake_case. The rate and the ACD details are not here.
  - `supplier_currency` (string): Currency of the supplier.
  - `agency_currency` (string): Currency of the agency.
  - `base_price` (number): Base fare.
  - `taxes_and_fees` (number): Taxes and fees.
  - `agency_commission` (number): Your commission.
  - `final_price` (number): What the traveler pays.
  - `b2b_price` (number): What was debited from your balance.
- `travelerPricing` (array of object): The price of each traveler.
- `balanceOperations` (array of object): The ledger entries of this booking (debits, refunds). Empty in the sandbox.
  - `id` (string): Id of the entry.
  - `flight_booking_id` (string): The `id` of the booking.
  - `operation` (string): `debit`, `refund` ...
  - `amount` (number): The amount.
  - `currency` (string): Currency of the amount.
  - `description` (string): What the entry is for.
  - `created_at` (string): When it was written.
  - `b2b_price` (number): The booking's `b2b_price` at that time.
  - `final_price` (number): The booking's `final_price` at that time.
- `apiResponse` (object): Only with `include_api_response: true`: the stored answer of the booking call, with the full passenger list.

## Example

```json
{
  "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
}
```
