# Hotel pricing

> What each hotel price field means, what your agency is debited (totalPrice minus agencyCommission), and how taxes and the exchange rate are shown.

Source: https://fx-port.com/docs/hotels/pricing

Every hotel price is a **whole-stay price for all the rooms**, in the **currency of your agency** (the sandbox agency settles in DZD). There is no per-night amount except the supplier's `dailyPrices`. Three numbers matter:

| Amount | What it is |
|---|---|
| **`totalPrice`** (`final_price` in a search) | What the traveler pays. Show this price. |
| **`agencyCommission`** | Your commission: the part of `totalPrice` that stays with your agency. |
| **What you pay** (`b2b_price` in a search, `netPrice` in a booking) | What is debited from your agency balance when you book: `totalPrice - agencyCommission`. |

~~~text
totalPrice = what you pay + agencyCommission
what you pay = totalPrice - agencyCommission
~~~


> [!WARNING]
> **b2bPrice is not in the rate, pre-book and booking answers**
>
> Only the search (`hotels_pricing[].b2b_price`) and the booking detail (`netPrice`, `pricing[].b2b_price`) carry the amount you pay. The `pricing` blocks of [`get_rates`](https://fx-port.com/docs/hotels/rates.md), [`pre_book`](https://fx-port.com/docs/hotels/pre-book.md) and [`book_hotel`](https://fx-port.com/docs/hotels/book.md) do not: compute it as `totalPrice - agencyCommission`.


## A real example

The cheapest rate of the sandbox test hotel for three nights, from `get_rates` (the supplier prices in EUR, the agency settles in DZD):

~~~json
{
  "exchangeRate": 285,
  "pricing": {
    "supplierCurrency": "EUR",
    "agencyCurrency": "DZD",
    "originalPrice": 3,
    "agencyCommission": 2.97,
    "totalPrice": 1484.97,
    "taxes": {
      "cityTax": {
        "includedInPrice": false,
        "amount": 23.1,
        "currency": "HNL"
      },
      "electricityFee": {
        "includedInPrice": true,
        "amount": 0.6,
        "currency": "EUR"
      },
      "resortFee": {
        "includedInPrice": true,
        "amount": 0.68,
        "currency": "EUR"
      }
    }
  }
}
~~~

- The traveler pays **1,484.97 DZD** (`totalPrice`).
- Your commission is **2.97 DZD** (`agencyCommission`).
- You are debited **1,482.00 DZD** (`1484.97 - 2.97`). The sandbox does not debit anything: `book_hotel` answers `balanceDebited: false` there.
- The same hotel and the same rate in a `search_advanced` answer, in the search's own names:

~~~json
{
  "exchange_rate": 285,
  "agency_currency": "DZD",
  "agency_commission": 2.97,
  "final_price": 1484.97,
  "b2b_price": 1482
}
~~~


> [!NOTE]
> `originalPrice` is the supplier's own price in EUR (3.00 here), for information. **Do not compute your prices from it**: what you pay is not `originalPrice × exchangeRate`, because it also holds FX-Port's own fees, which are not itemised. Use `totalPrice` and `agencyCommission`.


## Where each price is

| Where | Fields |
|---|---|
| [`search_advanced`](https://fx-port.com/docs/hotels/search.md): `hotels_pricing[hotel_id]` | `final_price`, `agency_commission`, `b2b_price`, `agency_currency`, `exchange_rate`. The price of the **cheapest rate**. |
| [`get_rates`](https://fx-port.com/docs/hotels/rates.md) and [`pre_book`](https://fx-port.com/docs/hotels/pre-book.md): `rates[].pricing` | `totalPrice`, `agencyCommission`, `originalPrice`, `supplierCurrency`, `agencyCurrency`, `taxes`. And next to it, **outside** `pricing`: `rates[].exchangeRate` and `rates[].dailyPrices`. |
| [`book_hotel`](https://fx-port.com/docs/hotels/book.md): `pricing` | `totalPrice`, `agencyCommission`, `currency`, `supplierCurrency`, `originalPrice`. |
| [Booking detail](https://fx-port.com/docs/account/booking-detail.md) and [history](https://fx-port.com/docs/account/history.md) | `totalPrice`, `netPrice` (what was debited), `agencyCommission`, `currency`, and `pricing[].b2b_price`. |

The names differ between the search (snake_case) and the rest (camelCase): `final_price` is `totalPrice`, `b2b_price` is `netPrice`, `agency_currency` is `agencyCurrency`. The camelCase blocks also carry snake_case twins (`total_price`, `agency_commission`, `agency_currency`, `supplier_currency`, `exchange_rate`): see [Legacy names](https://fx-port.com/docs/legacy-names.md). Amounts are rounded to two decimals.

## The fields of a `pricing` block

| Field | Meaning |
|---|---|
| `supplierCurrency` | The currency the supplier prices in: `EUR`. |
| `agencyCurrency` | The currency of your agency. Every amount of the block, except `originalPrice` and `taxes`, is in it. |
| `originalPrice` | The supplier's price for the stay, in `supplierCurrency`. For information only. |
| `agencyCommission` | Your commission, in `agencyCurrency`. |
| `totalPrice` | What the traveler pays, in `agencyCurrency`. |
| `taxes` | The taxes and fees of the rate, by name. See [Taxes](#taxes). |

Internal fields of the cost build-up (FX-Port's own commission and the supplier's cost lines) are never returned: do not build on a field that is not listed here.

## Your commission

`agencyCommission` comes from the commission rule of your agency. To set it for one booking, send `commission_override` to [`book_hotel`](https://fx-port.com/docs/hotels/book.md#commission-override): `{ "type": "fixed", "value": 50 }` is 50 in your currency **per room**, `{ "type": "percentage", "value": 5 }` is 5% of what you pay. What you are debited does not change: the traveler price becomes what you pay plus the new commission.

## The exchange rate

`exchangeRate` says how many units of your agency currency one unit of the supplier's currency is worth (`285.0`: 1 EUR is 285 DZD). It is on each rate of `get_rates` and `pre_book` (outside `pricing`), and on each hotel of `hotels_pricing`. Use it only to **convert supplier-currency amounts for display**, such as taxes and penalties; never to recompute a price.

## Taxes

`taxes` lists the taxes and fees of the rate by name (`cityTax`, `resortFee`, `electricityFee`, `vat` ...). Each one has `includedInPrice`, `amount` and `currency`:

- **`includedInPrice: true`**: already inside `totalPrice`. Show it as information.
- **`includedInPrice: false`**: **the traveler pays it at the hotel**, on top of `totalPrice`. Show it clearly: it is not charged to your agency.
- **`amount` is never converted.** It is in `currency`, which is the supplier's currency (`EUR`) or the **local currency of the hotel** (`HNL` for a hotel in Honduras). Convert it with care, or show it as it is.

## Cancellation penalties

The `cancellationPolicy.policies[]` windows carry the **supplier's** penalty: `originalAmount` in `originalCurrency` (EUR). The `currency` field of a window is only the **label** of your agency currency: `originalAmount` is **not** in it. There is no penalty in your currency in the rate. Show the penalty as the supplier states it, or as a share of the stay (`originalAmount ÷ originalPrice`) and say that the exact amount is known when the booking is cancelled: the answer of [`cancel_hotel`](https://fx-port.com/docs/hotels/cancel.md) gives what is refunded to your agency and to the traveler.

## Related


- [Get hotel rates](https://fx-port.com/docs/hotels/rates.md): Where the prices of the rooms come from.
- [Pre-book a rate](https://fx-port.com/docs/hotels/pre-book.md): Lock a price, and what a price change looks like.
- [Book a hotel](https://fx-port.com/docs/hotels/book.md): The price as it is debited, and `commission_override`.
- [Cancel a booking](https://fx-port.com/docs/hotels/cancel.md): What is refunded, and when.
