POST /api/v1/hotels/get_rates
Get every room and rate combination for a specific hotel, with cancellation policies. Required before pre_book.
Fetch every available room/rate combination for one hotel, with commission pricing and
cancellation policies applied. Each rate's bookHash is what you pass to
pre_book.
Permission: Read
Request body
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Hotel ID — from search, name-search, or a saved value |
checkin | string | Yes | Check-in date, YYYY-MM-DD |
checkout | string | Yes | Check-out date, YYYY-MM-DD |
guests | array | Yes | Room occupancy — see Guests & rooms |
residency | string | No | Guest residency country code. Default "gb". |
language | string | No | Response language. Default "en". |
Do not send a currency field — it returns 400. The supplier is always queried in EUR;
pricing is converted to your agency's currency automatically.
Request examples
curl --request POST \
--url https://api.fx-port.com/api/v1/hotels/get_rates \
--header 'Authorization: Bearer fxp_test_YOUR_KEY' \
--header 'Content-Type: application/json' \
--data '{
"id": "test_hotel",
"checkin": "2026-11-15",
"checkout": "2026-11-18",
"residency": "dz",
"language": "en",
"guests": [{ "adults": 2, "children": [] }]
}'Response example
{
"environment": "sandbox",
"success": true,
"data": {
"hotelId": "test_hotel",
"hid": 8526976,
"rates": [
{
"bookHash": "h-048751d0-ef21-577c-9fcf-2725152d3afc",
"matchHash": "m-136810c2-614b-55a5-9c75-4cd5f4f5d153",
"room": {
"name": "Standard Room",
"beddingType": "twin-beds",
"roomClass": "room",
"bathroom": "private-bathroom",
"hasPrivateBathroom": true,
"capacity": 2,
"nonSmoking": true
},
"meal": { "type": "nomeal", "included": false },
"dailyPrices": [145.50, 145.50],
"allotment": 3,
"isPackage": false,
"anyResidency": true,
"cancellationPolicy": {
"freeCancellationBefore": "2026-11-13T21:00:00",
"policies": [
{ "from": null, "until": "2026-11-13T21:00:00", "originalAmount": 0, "originalCurrency": "EUR", "currency": "DZD" },
{ "from": "2026-11-13T21:00:00", "until": null, "originalAmount": 291.0, "originalCurrency": "EUR", "currency": "DZD" }
]
},
"pricing": {
"supplierCurrency": "EUR",
"agencyCurrency": "DZD",
"originalPrice": 291.00,
"agencyCommission": 87.30,
"totalPrice": 43812.75,
"b2bPrice": 43725.45,
"taxes": {
"vat": { "includedInPrice": true, "amount": 34.92, "currency": "EUR" }
}
},
"exchangeRate": 150.25
}
]
},
"processingTime": 1.234
}Cancellation policy
cancellationPolicy.freeCancellationBefore is the deadline for a no-penalty cancellation —
null means the rate is non-refundable. cancellationPolicy.policies[] is the full time-windowed
penalty schedule that applies afterward; each window's amount already includes your commission
chain, so it's ready to display as-is. See Hotel pricing for the underlying
commission formula.
Field reference
| Field | Description |
|---|---|
bookHash | Cached for ~30 minutes. Required as hash on pre_book. |
room | Room type, bedding, bathroom, capacity — cross-reference with get_hotel_info roomGroups[] |
meal.type | nomeal, breakfast, halfboard, fullboard, allinclusive |
allotment | Number of rooms of this type still available at this rate |
cancellationPolicy.freeCancellationBefore | ISO datetime — cancel before this and no penalty applies. null means non-refundable. |
cancellationPolicy.policies[] | Time-windowed penalty schedule. Each window's originalAmount/penaltyAmount already includes your commission chain. |
pricing | See Hotel pricing for every field |
anyResidency | false means this rate is restricted to specific guest residencies |
Only deposit-type (prepaid) rates are returned — pay-at-hotel rates are filtered out, since FX-Port bookings always draw from your agency balance rather than taking a card at check-in.
Next step
Pick a bookHash and call pre_book to lock the price.
POST /api/v1/hotels/get_hotel_info
Full hotel detail — rooms, amenities, policies, images, and facts. Tries cache first, falls back to the supplier.
POST /api/v1/hotels/pre_book
Lock in the price of a chosen rate and get a partnerOrderId + booking form ahead of book_hotel. Requires Read+Write permission.