# Get a booking

> Get one booking of your agency, whatever its product: the summary of the history, the stored record and, for flights and hotels, the price breakdown and the balance operations.

Endpoint: `GET /bookings/{booking_id}`

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

`GET /api/v1/bookings/{booking_id}`

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

The reference is looked up in these fields, in this order, and the first booking found is returned. Flights: `booking_id` (the record locator), the supplier order id, `id`. Hotels: `booking_id`, `id`. eSIMs: `booking_id` (`FX-...`), the supplier order code, the ICCID, `id`. Transfers: `booking_id`, `id`. Without `product` the products are tried in the order flights, hotels, eSIMs, transfers.

Prefer the internal `id` (a UUID): record locators are not unique across suppliers. An ICCID matches the original order of the eSIM, not its topups: look a topup up by its `booking_id` or its `id`. A reference that does not match the `product` you ask for is `booking_not_found`.

## Request

### Path parameters

- `booking_id` (string, required): The booking reference: the internal `id` or the public reference of the product (see above). At most 100 characters.

### Query parameters

- `product` (string, optional): Look in one product only, which is faster and avoids a match in another product. Case does not matter. The singular names (`flight`, `hotel`, `esim`, `transfer`) are read as the plural. One of `all`, `esims`, `flights`, `hotels`, `transfers`. Default `all`.

### Example request

```bash
curl 'https://api.fx-port.com/api/v1/bookings/FX-1793546602916?product=esims' \
  -H "Authorization: Bearer fxp_test_YOUR_KEY"
```

## Response

### 200: The booking. The keys after `updatedAt` and in `record` depend on the product.

- `success` (boolean): `true` when the booking was found.
- `data` (AccountBookingDetail): One booking with its stored record. The summary keys are the ones of the history; `record` repeats the booking in snake_case.
- `meta` (object): Facts about the answer.
  - `agencyId` (string (uuid), deprecated): Legacy name: use `agency_id`. The id of your agency, resolved from the key. The older name of `agency_id`: same value, use `agency_id`.
  - `agency_id` (string (uuid)): The id of your agency, resolved from the key. The snake_case twin of `agencyId`, with the same value: use this name.
  - `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`.

```json
{
  "environment": "sandbox",
  "success": true,
  "data": {
    "product": "esims",
    "id": "639417b4-b103-4ece-bd5d-850315322278",
    "bookingId": "FX-1793546602916",
    "booking_id": "FX-1793546602916",
    "status": "confirmed",
    "environment": "sandbox",
    "agencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
    "agency_id": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
    "agentId": null,
    "agent_id": null,
    "currency": "DZD",
    "totalPrice": 468.84,
    "total_price": 468.84,
    "netPrice": 418.6,
    "b2b_price": 418.6,
    "agencyCommission": 50.24,
    "agency_commission": 50.24,
    "providerName": "Airalo",
    "provider_name": "Airalo",
    "supplierId": "airalo",
    "supplier_id": "airalo",
    "createdAt": "2026-11-01T15:23:22.961228+00:00",
    "created_at": "2026-11-01T15:23:22.961228+00:00",
    "updatedAt": "2026-11-01T15:23:22.961228+00:00",
    "updated_at": "2026-11-01T15:23:22.961228+00:00",
    "orderId": "20261101-106852",
    "order_id": "20261101-106852",
    "type": "esim",
    "packageName": "1 GB - 7 days • France",
    "package_name": "1 GB - 7 days • France",
    "iccid": "8900000540463077957",
    "customerEmail": "traveler@example.com",
    "customer_email": "traveler@example.com",
    "customer_first_name": "John",
    "customer_last_name": "Smith",
    "customer_phone": "+15555550123",
    "record": {
      "id": "639417b4-b103-4ece-bd5d-850315322278",
      "booking_id": "FX-1793546602916",
      "order_id": "20261101-106852",
      "status": "confirmed",
      "currency": "DZD",
      "total_price": 468.84,
      "agency_commission": 50.24,
      "type": "esim",
      "package_name": "1 GB - 7 days • France",
      "iccid": "8900000540463077957",
      "customer_email": "traveler@example.com",
      "customer_first_name": "John",
      "customer_last_name": "Smith",
      "customer_phone": "+15555550123",
      "provider_name": "Airalo",
      "supplier_id": "airalo",
      "created_at": "2026-11-01T15:23:22.961228+00:00",
      "updated_at": "2026-11-01T15:23:22.961228+00:00",
      "environment": "sandbox"
    }
  },
  "meta": {
    "agencyId": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
    "agency_id": "0b1c2d3e-4f50-4a6b-8c7d-9e0f1a2b3c4d",
    "environment": "sandbox"
  }
}
```

## Errors

| Status | Code | Example message |
| --- | --- | --- |
| 400 | `invalid_product` | product must be one of all, esims, flights, hotels, transfers. |
| 400 | `invalid_booking_id` | booking_id is not a valid booking reference (received '!'). |
| 400 | `agency_id_not_allowed` | External API keys resolve agency_id automatically; do not send agency_id as a query parameter. |
| 404 | `booking_not_found` | No sandbox booking found for 'FX-0000000000000'. |
| 503 | `service_overloaded` | The service is temporarily overloaded; retry after the time given in the Retry-After header. |

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

## Related guides

- [Booking detail](https://fx-port.com/docs/account/booking-detail.md)
