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.
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. |
totalPrice = what you pay + agencyCommission
what you pay = totalPrice - agencyCommissionA 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):
{
"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_hotelanswersbalanceDebited: falsethere. - The same hotel and the same rate in a
search_advancedanswer, in the search's own names:
{
"exchange_rate": 285,
"agency_currency": "DZD",
"agency_commission": 2.97,
"final_price": 1484.97,
"b2b_price": 1482
}Where each price is
| Where | Fields |
|---|---|
search_advanced: hotels_pricing[hotel_id] | final_price, agency_commission, b2b_price, agency_currency, exchange_rate. The price of the cheapest rate. |
get_rates and pre_book: rates[].pricing | totalPrice, agencyCommission, originalPrice, supplierCurrency, agencyCurrency, taxes. And next to it, outside pricing: rates[].exchangeRate and rates[].dailyPrices. |
book_hotel: pricing | totalPrice, agencyCommission, currency, supplierCurrency, originalPrice. |
| Booking detail and history | 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. 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. |
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: { "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 insidetotalPrice. Show it as information.includedInPrice: false: the traveler pays it at the hotel, on top oftotalPrice. Show it clearly: it is not charged to your agency.amountis never converted. It is incurrency, which is the supplier's currency (EUR) or the local currency of the hotel (HNLfor 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 gives what is refunded to your agency and to the traveler.