Skip to main content

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:

  1. Input
  2. Settings
  3. Filter
mutation {
hotelX {
book
input: {}
settings: {}
filter: {}
}
}
Remember
It's important to note that even if certain fields in the "criteria" or "settings" inputs are labeled as optional, we still need to use some value internally. This value will either come from your query/mutation request or your default settings. You have the ability to manage your default API settings by visiting the API Settings section on our website.

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
Key Recommendations
  • 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 the deltaPrice is 5, a change up to 105€ will still secure a confirmed booking.

note

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.)
Key Recommendations
  • 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:

StatusDescription
OKThe reservation was successfully completed without any issues.
ON_REQUESTPlease 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.
UNKNOWNThe 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_COMMITThe 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?
If you receive an error and a booking status OK in the Book response, the reservation status prevails over the error. Although you may also run a Booking Query in order to check the status of a reservation, please note that you should always contact the Seller in order to check the actual status of a booking in those cases you receive a booking status different than OK or no response at all.
What is the DeltaPrice? Why should I use it?
The Delta Price indicates the price variation permitted by the Buyer (amount or percentage), so that an error will be returned if the new price does not abide to DeltaPrice. If DeltaPrice is not sent and the integration implements it, we assume that the price range is 0 and the process will continue (price is lower or equal to the price returned in Quote). This field is implemented if it’s native to the Seller or if another Search/Quote request needs to be done in Book. Please note DeltaPrice should be implemented by a Seller in order to be available to a Buyer.

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?
In the test environment, it is common for some Sellers to consistently return an ON_REQUEST status. Furthermore, as a standard practice in the test environment, we automatically replace the holder and passenger names with "test".
Will the currency in Book be the same as the currency in Quote?
The currency used for the transaction will remain the same throughout the entire Booking Flow, including cancellation policies.
Do I have to provide real names and ages for all the passengers?
No, you are not required to provide real ages and names for all passengers. You can use default values for each age group and name. The only information that should be real is the holder's information.
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?
The payment type and details to be added in your Book request depend on the payment type returned for the option to be booked, note that payment types depend on the commercial agreement established by a Buyer with their Sellers.
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.