Rebook API

Rebook API monitors hotel bookings post-confirmation while they remain refundable. It automatically detects rate decreases and executes rebookings when lower prices emerge, optimizing affiliates' margins without customer intervention.

Rebook API URL

Rebook is accessible at the general Ratefox API address as a part of it https://api.ratefox.io

For Ratefox API description in Swagger - Click here.

Authorization and authentication

As a part of Ratefox API Rebook uses the same authorization. Link to the Ratefox API authorization description with code examples: https://documentation.hsp.gimmonix.com/docs/ratefox-api-v2#authorization-and-authentication.

Rebook API Endpoint

POST /hotels/rebook - to ask Rebook to start monitoring for better price and make booking if succeeded

Implementing Rebook

Just authorize in Ratefox API and make Rebook call with your booking details in request body.

Request body example:

{
  "SupplierHotel": {
    "SupplierId": 1077,
    "SupplierHotelId": "60055"
  },
  "CheckIn": "2025-05-20T09:36:37.099Z",
  "CheckOut": "2025-05-21T09:36:37.099Z",
  "CustomBookingReference": "BKN00012345",
  "Residency": "IL",
  "Price": {
    "BookingPrice": 261,
    "Currency": "USD",
    "TotalTax": {
      "Amount": 10,
      "IsIncluded": true,
      "Currency": "USD"
    },
    "TotalFee": {
      "Amount": 10,
      "IsIncluded": false,
      "Currency": "USD"
    },
    "Commission": {
      "Amount": 100,
      "Currency": "USD"
     }
    },
  "RefundableUntil": "2025-03-25T09:36:37.099Z",
  "Rooms": [
    {
                    "AdultsCount": 2,
                    "Id": "7e6f9032-fe51-4759-b88a-22c5c75a7070",
                    "RoomBasis": "room only",
                    "RoomName": "Standard",
                    "KidsAges": [1]
    }
  ],
  "WorkMode": "Evaluation",
  "LeadPassenger": {
    "Id": "7e6f9032-fe51-4759-b88a-22c5c75a825e",
    "Allocation": "7e6f9032-fe51-4759-b88a-22c5c75a7070",
    "Name": {
                    "GivenName": "Aras",
                    "NamePrefix": "Mr",
                    "Surname": "Akkar"
    },
    "Type": "Adult"
  },
"AdditionalPassengers": [
    {
      "Id": "0f741b1e-5e59-4fa9-ba61-84f5ecdd9988",
      "Allocation": "7e6f9032-fe51-4759-b88a-22c5c75a7070",
      "Name": {
        "GivenName": "Nadu",
        "NamePrefix": "Ms",
        "Surname": "Akkar"
      },
      "Type": "Adult",
      "Age": 21
    },
    {
      "Id": "1f2c479a-354c-46a8-ade2-7b34927cadc6",
      "Allocation": "7e6f9032-fe51-4759-b88a-22c5c75a7070",
      "Name": {
        "GivenName": "Kain",
        "NamePrefix": "Mr",
        "Surname": "Akkar"
      },
      "Type": "Child",
      "Age": 1
    }
  ],
  "LeadPaxRoomId": "7e6f9032-fe51-4759-b88a-22c5c75a7070",
  "Language": "en"
}

If the request is accepted by Rebook "202 Accepted" is returned in the response.

If validation step fails "400 Bad Request" is returned with details in the response body.

Example:

Invalid user input: Input general error

Response codes:

CodeValue
202Accepted
400Bad Request

Request parameters

FieldDescriptionFormatMandatory
CustomBookingReferenceClient booking reference. Is used to identify client's booking.StringYes
SupplierHotelObjectYes
SupplierIdSupplier’s ID in Ratefox. Integrated suppliers list https://documentation.hsp.gimmonix.com/docs/hsp-hotels-integrated-suppliersIntegerYes
SupplierHotelIdSupplier’s HotelIDStringYes
CheckInCheck-in dateString Unix Epoch timeYes
CheckOutCheck-out dateString Unix Epoch timeYes
ResidencyThe lead passenger residencyString(2) ISO Country Code (Ex: US, CZ, IL)Yes
PriceobjectYes
BookingPriceThe price from client’s booking flow. Taxes, fees and commission from the request will be applied to the BookingPrice to obtain “clear” price for comparison with alternative packages’ prices. See examples below the table (*).DoubleYes
CurrencyThe currency of the BookingPrice. Rates in response will be in this currencyString(3) ISO Currency Code (Ex: USD, EUR)Yes
TotalTaxobject
AmountAmount of taxesDoubleYes
IsIncludedAre taxes included in the BookingPrice. If excluded, BookingPrice will be increased by Tax Amount before comparing with alternative packages’ prices. Otherwise does not affect.BooleanYes
CurrencyIf not provided (NULL), then Price Currency is usedString(3) ISO Currency Code
TotalFeeobject
AmountAmount of feesDoubleYes
IsIncludedAre fees included in the BookingPrice. If included, BookingPrice will be reduced by Fee Amount before comparing with alternative packages’ prices. Otherwise does not affect.BooleanYes
CurrencyIf not provided (NULL), then Price Currency is usedString(3) ISO Currency Code
Commissionobject
AmountAmount of client’s commission. BookingPrice will be reduced by Commission Amount before comparing with alternative packages’ prices.DoubleYes
CurrencyISO Currency Codes. If not provided (NULL), then Price Currency is usedString(3) ISO Currency Codes
RefundableUntilRefundability deadlineString Unix Epoch timeYes
RoomsArray of objects. Possible room quantity is between 1 and 4ArrayYes
IdRoom Id inside the request. Is generated by client GUID. Should be a unique per each room in the array GUIDYes
RoomNameThe name of the requested room (as it used by supplier from SupplierID)StringYes
RoomBasisThe meal-plan, ”Board” (as it used by supplier from SupplierID)StringYes
AdultsCountNumber of adults in the room. The value must be between 1 and 8IntegerYes
KidsAgesArray of kids ages. Each value must be between 0 and 17. If empty, there are no kids in the roomArray of integer
WorkModeDefines the WorkMode for the request.
Possible values: “live”. Can be used only by the client which is set “live” in Gimmonix. The request in this mode produces the real booking;
“evaluation”. The mode for testing and evaluation. The request in this mode doesn’t produce the real booking but full description of Ratefox found alternative is steal returned. This mode can be used by both clients connected to Ratefox as "evaluation" (new clients before the certification stage is completed) and those who are set "live".
StringYes
LeadPassengerArray of objects. The main passenger from the bookingYes
IdLead passenger’s Id inside the request. Is generated by client GUID. Should be a unique per each passenger in the request GUID Yes
AllocationId from Rooms array. Identifies the room for the LeadPassenger GUID Yes
NameobjectYes
GivenNameFirst name. Use English characters only, otherwise the booking might fail on the supplier side. For internal use only: there is some “cleaning” process in the flow of non English charactersString(50)Yes
NamePrefixMr, Mrs, Ms etc. If not provided, “Mr” is used.String
SurnameLast name. Use English characters only, otherwise the booking might fail on the supplier side.String(50)
TypeMust be “adult” for the LeadPassengerStringYes
AgeLead passenger ageInteger
PhoneNumberPassenger’s phone number to specify in the bookingString(50)
CustomerEmailPassenger’s email to specify in the bookingString(254)
Addressobject. Address details to specify in the booking
CountryCodeString(2) ISO Country Code (Ex: US, CZ, IL)
AddressLineString(254)
StateProvString(20)
PostalCodeString(20)
AdditionalPassengersArray of objects. All passengers (adults and kids) except LeadPassenger must be described in this array.Array
IdPassenger’s Id inside the request. Is generated by client GUID. Should be a unique per each passenger in the request GUID Yes
AllocationId from Rooms array. Identifies the room for the Passenger GUID Yes
NameobjectYes
GivenNameFirst name. Use English characters only, otherwise the booking might fail on the supplier side.String(50)
NamePrefixMr, Mrs, Ms etc. If not provided, “Mr” is used.String
SurnameLast name. Use English characters only, otherwise the booking might fail on the supplier side.String(50)
Type“adult” or “child”StringYes
AgeMandatory in case the passenger’s type is ”child”. The value must be between 0 and 17 and match one of the KigsAges array’s values.Integer
LeadPaxRoomIdId from Rooms array. Identifies the room of the LeadPassenger GUID Yes
LanguageOnly “en” is currently supportedStringYes
RoomsRemarksFree text remarks to be sent to the supplier within booking. Collection of "Key" : "Value” pairs, where Key is room Id from the Rooms array. Only suppliers that support this feature will receive the remarks.
InternalAgentRef1Agent reference of the bookingString
PointOfSaleDefines the sales environment. Possible values:

- “web” - rates that are available to be sold through desktop websites,
- ”mobileapp” - rates that are available to be sold through mobile apps/websites,
- ”cug” - Closed User Group. Discounted rates which are sold to ‘members-only’ groups,
- ”b2b” - rates which are intended to be sold by travel agents, operating under a B2B booking engine. Suppliers forbid selling B2B rates in B2C channels.
String

(*) Examples of price (P) calculations for comparison with alternative packages’ prices.

Ex.1Ex.2Ex.3Ex.3
BookingPrice500500500500
TotalTax
Amount100100100100
IsIncludedtruefalsetruefalse
TotalFee
Amount50505050
IsIncludedtruefalsefalsetrue
Commission
Amount25252525

General formula:

P = BookingPrice - Commission.Amount + If(TotalTax.Included == True; 0; TotalTax.Amount) - If(TotalFee.Included == True; TotalFee.Amount; 0)

Ex.1: P = 500 - 50 - 25 = 425

Ex.2: P = 500 + 100 - 25 = 575

Ex.3: P = 500 - 25 = 475

Ex.4: P = 500 + 100 - 50 - 25 = 525