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:
Code | Value |
---|---|
202 | Accepted |
400 | Bad Request |
Request parameters
Field | Description | Format | Mandatory |
---|---|---|---|
CustomBookingReference | Client booking reference. Is used to identify client's booking. | String | Yes |
SupplierHotel | Object | Yes | |
SupplierId | Supplier’s ID in Ratefox. Integrated suppliers list https://documentation.hsp.gimmonix.com/docs/hsp-hotels-integrated-suppliers | Integer | Yes |
SupplierHotelId | Supplier’s HotelID | String | Yes |
CheckIn | Check-in date | String Unix Epoch time | Yes |
CheckOut | Check-out date | String Unix Epoch time | Yes |
Residency | The lead passenger residency | String(2) ISO Country Code (Ex: US, CZ, IL) | Yes |
Price | object | Yes | |
BookingPrice | The 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 (*). | Double | Yes |
Currency | The currency of the BookingPrice. Rates in response will be in this currency | String(3) ISO Currency Code (Ex: USD, EUR) | Yes |
TotalTax | object | ||
Amount | Amount of taxes | Double | Yes |
IsIncluded | Are taxes included in the BookingPrice. If excluded, BookingPrice will be increased by Tax Amount before comparing with alternative packages’ prices. Otherwise does not affect. | Boolean | Yes |
Currency | If not provided (NULL), then Price Currency is used | String(3) ISO Currency Code | |
TotalFee | object | ||
Amount | Amount of fees | Double | Yes |
IsIncluded | Are fees included in the BookingPrice. If included, BookingPrice will be reduced by Fee Amount before comparing with alternative packages’ prices. Otherwise does not affect. | Boolean | Yes |
Currency | If not provided (NULL), then Price Currency is used | String(3) ISO Currency Code | |
Commission | object | ||
Amount | Amount of client’s commission. BookingPrice will be reduced by Commission Amount before comparing with alternative packages’ prices. | Double | Yes |
Currency | ISO Currency Codes. If not provided (NULL), then Price Currency is used | String(3) ISO Currency Codes | |
RefundableUntil | Refundability deadline | String Unix Epoch time | Yes |
Rooms | Array of objects. Possible room quantity is between 1 and 4 | Array | Yes |
Id | Room Id inside the request. Is generated by client GUID. Should be a unique per each room in the array | GUID | Yes |
RoomName | The name of the requested room (as it used by supplier from SupplierID) | String | Yes |
RoomBasis | The meal-plan, ”Board” (as it used by supplier from SupplierID) | String | Yes |
AdultsCount | Number of adults in the room. The value must be between 1 and 8 | Integer | Yes |
KidsAges | Array of kids ages. Each value must be between 0 and 17. If empty, there are no kids in the room | Array of integer | |
WorkMode | Defines 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". | String | Yes |
LeadPassenger | Array of objects. The main passenger from the booking | Yes | |
Id | Lead passenger’s Id inside the request. Is generated by client GUID. Should be a unique per each passenger in the request | GUID | Yes |
Allocation | Id from Rooms array. Identifies the room for the LeadPassenger | GUID | Yes |
Name | object | Yes | |
GivenName | First 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 characters | String(50) | Yes |
NamePrefix | Mr, Mrs, Ms etc. If not provided, “Mr” is used. | String | |
Surname | Last name. Use English characters only, otherwise the booking might fail on the supplier side. | String(50) | |
Type | Must be “adult” for the LeadPassenger | String | Yes |
Age | Lead passenger age | Integer | |
PhoneNumber | Passenger’s phone number to specify in the booking | String(50) | |
CustomerEmail | Passenger’s email to specify in the booking | String(254) | |
Address | object. Address details to specify in the booking | ||
CountryCode | String(2) ISO Country Code (Ex: US, CZ, IL) | ||
AddressLine | String(254) | ||
StateProv | String(20) | ||
PostalCode | String(20) | ||
AdditionalPassengers | Array of objects. All passengers (adults and kids) except LeadPassenger must be described in this array. | Array | |
Id | Passenger’s Id inside the request. Is generated by client GUID. Should be a unique per each passenger in the request | GUID | Yes |
Allocation | Id from Rooms array. Identifies the room for the Passenger | GUID | Yes |
Name | object | Yes | |
GivenName | First name. Use English characters only, otherwise the booking might fail on the supplier side. | String(50) | |
NamePrefix | Mr, Mrs, Ms etc. If not provided, “Mr” is used. | String | |
Surname | Last name. Use English characters only, otherwise the booking might fail on the supplier side. | String(50) | |
Type | “adult” or “child” | String | Yes |
Age | Mandatory 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 | |
LeadPaxRoomId | Id from Rooms array. Identifies the room of the LeadPassenger | GUID | Yes |
Language | Only “en” is currently supported | String | Yes |
RoomsRemarks | Free 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. | ||
InternalAgentRef1 | Agent reference of the booking | String | |
PointOfSale | Defines 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.1 | Ex.2 | Ex.3 | Ex.3 | |
---|---|---|---|---|
BookingPrice | 500 | 500 | 500 | 500 |
TotalTax | ||||
Amount | 100 | 100 | 100 | 100 |
IsIncluded | true | false | true | false |
TotalFee | ||||
Amount | 50 | 50 | 50 | 50 |
IsIncluded | true | false | false | true |
Commission | ||||
Amount | 25 | 25 | 25 | 25 |
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
Updated about 1 month ago