One Step Book
The One Step Book operation requests a booking confirmation for the specified option criteria. Our system will internally perform the search and quote steps. Confirmation will only be applied if the price of the option is the same or lower than the one specified in the input request.
It provides a concise summary of the option, along with the reservation status. Please note that the returned information may vary depending on the Seller. The returned fields include:
holder
hotel
price
cancelPolicy
bookingID
status
(Make sure you add this field to your query in order to receive the reservation status in the one step book response.)clientReference
(The booking locator in your system - alphanumerical value.)supplierReference
(Make sure you add this field to your query in order to receive the supplier locator in the one step book response.)
Book Inputs
This mutation offers versatility in book options, with certain fields marked as mandatory (clientReference
, holder
etc.) and others as optional (language
, deltaPrice
, paymentCard
etc.).
When creating your book mutation, you have three different inputs to fill based on your specific needs:
- Input
- Settings
- Filter
mutation {
hotelX {
book
input: {}
settings: {}
filter: {}
}
}
1. Input
To specify your one step book input you need to use the input HotelOneStepBookInput
in your mutation variables:
{
"input": {
"clientReference": "test_0123456789",
"language": "es",
"market": "ES",
"nationality": "ES",
"checkIn": "2024-10-28",
"checkOut": "2024-10-29",
"hotel": "1",
"board": "1",
"price": {
"currency": "EUR",
"binding": false,
"net": 146,
"gross": 146
},
"ratePlan": "BAR",
"rateRulesExtended": [
{
"type": "PACKAGE"
},
{
"type": "NON_REFUNDABLE"
}
],
"payment": {
"type": "MERCHANT"
},
"holder": {
"title": "MISS",
"name": "Jane",
"surname": "Doe"
},
"rooms": {
"occupancyRefId": 1,
"code": "2269",
"paxes": [
{
"title": "MISS",
"name": "Jane",
"surname": "Doe",
"age": 30
},
{
"title": "MISS",
"name": "Jane",
"surname": "Doe",
"age": 30
}
]
},
"cancelPolicy": {
"refundable": false
}
}
}
Mandatory input:
clientReference
(Booking ID in client's system.)holder
rooms
checkIn
checkOut
hotel
board
price
cancelPolicy
payment
(If the payment is done by credit card, it's mandatory to specify the payment type and the credit card information.)
Optional input:
language
deltaPrice
(Indicates price variation permitted by the Buyer.)remarks
(Any customer comments for the supplier to consider.)nationality
market
ratePlan
rateRulesExtended
surcharges
supplements
-
Customize the
timeout
according to your needs, taking into consideration the maximum values in Book is 180,000ms. -
Consider that the
deltaPrice
sets the price tolerance between Quote and Book. For instance, if the Quote stage displays a price of 100€ and thedeltaPrice
is 5, a change up to 105€ will still secure a confirmed booking.
If the option or rate you want to book has a payment type such as DIRECT, CARD_BOOKING, or CARD_CHECK_IN, it is mandatory to provide payment card information when making the booking. This should be done using the PaymentCardInput
in the book mutation.
2. Settings
Settings are the common configurations used to construct requests to the supplier/s. By default, we apply the same configuration to all Hotel-X clients.
To specify your quote settings you need to use the input HotelSettingsInput
in your query variables:
{
"settings": {
"client": "client_demo",
"context": "HOTELTEST",
"testMode": true,
"timeout": 180000
}
}
Mandatory Settings:
client
context
(You have the flexibility to choose between using the supplier's context or your own, depending on which codes you want to see in the response. If you prefer to receive responses with your custom codes, please ensure that your context code is linked to the mapping files that you've previously uploaded to your FTP account.)timeout
(Timeout in milliseconds for supplier connections. Applied to all suppliers; won't close client connection if exceeded.)
-
Customize the
timeout
according to your needs, taking into consideration the maximum values in Book is 180,000ms. -
Set the
auditTransaction
to "true" in Book when investigating errors.
3. Filter
Filter allow you to precisely tailor the response according to your preferences.
To specify your filters you need to use the input HotelFilterInput
in your query variables. The available filters inside this input are:
access
(mandatory): Specify the supplier access you want to use to book the option.excludeComparisonFields
(optional): If there are specific rate characteristics you prefer not to use internally for finding the option, indicate them here. For example, you may not want us to specifically check for a non-refundable option. You may want us to quote an option with the same other characteristics (hotel, rate, board), and whether the option is refundable or not doesn't matter to you.
{
"filter" : {
"access" : "2",
"excludeComparisonFields" : [
"CANCEL_POLICY"
]
}
}
Requests Examples
Book option without checking the surcharges
Book Response
Book Status
Once a Book (Reservation) method is run, our API response will provide its book status. This status represents the current status of the reservation and can be categorized into four possible values:
Status | Description |
---|---|
OK | The reservation was successfully completed without any issues. |
ON_REQUEST | Please note that a Book status may change over time: you may receive an ON_REQUEST status in Book response, and after running a Booking Query some seconds later the status may have already changed to OK. |
UNKNOWN | The reservation process through Travelgate was completed but due to a supplier error or a timeout, the reservation status is unknown (our system was unable to confirm if the booking has been confirmed or not the on Seller's system). It is the Buyer’s responsibility to check if the booking is OK. |
PENDING_COMMIT | The payment has been confirmed on the provider’s side, but is necessary to make a commit in order to confirm the reservation. |
Frequently Asked Questions
What should I do if I receive both an OK status and an error in the same Book response?
What is the DeltaPrice? Why should I use it?
What does DeltaPrice "applyBoth" mean?
- If the value is 'false' it indicates that one of the conditions (amount or percentage) has to meet the DeltaPrice criteria before reservation.
- If the value is 'true' it indicates that the new price cannot exceed the amount and percentage indicated by the Buyer.
Why do I receive a status "ON_REQUEST" and a holder name "test" in my reservations the test environment?
Will the currency in Book be the same as the currency in Quote?
Do I have to provide real names and ages for all the passengers?
How do I define the total number of rooms in my Book request?
To define the number of rooms in your reservation, you need to utilize the occupancyRefId previously returned i n Search response.For instance, for a room of two adults:
"rooms": [
{
"occupancyRefId": 1,
"paxes": [
{
"name": "TestName",
"surname": "Surname",
"age": 30
},
{
"name": "TestName",
"surname": "Surname",
"age": 30
}
]
}
]
What payment details should I add to my Book request?
Where can I get the Hotel Confirmation Number (HCN)?
Once a booking has been successfully confirmed in Travelgate you may retrieve 2 different locators from its logs:
- The Buyer's locator (client reference).
- The Seller's locator (provider reference).
The Seller may also provide a third type of locator, issued by the hotel when it confirms the booking. This is known as the Hotel Confirmation Number (HCN) or Hotel Reference Booking (HRB). Please note we are only able to provide this code if the Seller returns it in their response.