FX-Port API
Hotels

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

FieldTypeRequiredDescription
idstringYesHotel ID — from search, name-search, or a saved value
checkinstringYesCheck-in date, YYYY-MM-DD
checkoutstringYesCheck-out date, YYYY-MM-DD
guestsarrayYesRoom occupancy — see Guests & rooms
residencystringNoGuest residency country code. Default "gb".
languagestringNoResponse 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

FieldDescription
bookHashCached for ~30 minutes. Required as hash on pre_book.
roomRoom type, bedding, bathroom, capacity — cross-reference with get_hotel_info roomGroups[]
meal.typenomeal, breakfast, halfboard, fullboard, allinclusive
allotmentNumber of rooms of this type still available at this rate
cancellationPolicy.freeCancellationBeforeISO 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.
pricingSee Hotel pricing for every field
anyResidencyfalse 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.

On this page