Booking Read and List
The Booking query allows you to retrieve a specific booking with all its details using the booking ID or reference locator. You can also obtain a list of bookings that were made within a specific arrival date range or a specific booking date range. The returned fields for each booking in the list include:
holder
hotel
price
remarks
status
Booking Read and List Inputs
When creating your booking query, you have two different inputs to fill based on your specific needs:
- Criteria
- Settings
query {
hotelX {
booking
criteria: {}
settings: {}
}
}
Remember that you can choose the information you want displayed:
reference
: To display client or supplier booking referencestatus
: To display the booking status
1. Criteria
This query offers versatility in booking search, with all fields marked as optional (accessCode
, typeSearch
, language
etc.). This flexibility empowers you to create a personalized Booking List Query, tailoring the requested fields to your specific needs.
To specify your booking criteria you need to use the input HotelCriteriaBookingInput
in your query variables.
Booking read using the bookingID
input:
{
"criteriaBookingRead" : {
"bookingID" : "1@1[241028[241029[230918[1[es[EUR[2[test_0123456789[2596391"
}
}
Booking read using the accessCode
, hotelCode
and references
inputs:
{
"criteriaBookingRead" : {
"accessCode" : "2",
"typeSearch" : "REFERENCES",
"references" : {
"hotelCode" : "1",
"currency" : "EUR",
"references" : [
{
"client" : "test_0123456789",
"supplier": "2636944"
}
]
}
}
}
Booking list by dates:
{
"criteriaBookingRead" : {
"accessCode" : "2",
"typeSearch" : "DATES",
"dates" : {
"dateType" : "ARRIVAL",
"start" : "2024-10-28",
"end" : "2024-10-28"
}
}
}
Optional criteria
accessCode
(Necessary if you search by references or by dates)typeSearch
(Necessary if you search by references or by dates)language
dates
(To receive a list of all the reservations made in a specific type frame)bookingID
(To receive the details of a specific reservation)references
(To receive the details of a specific reservation)
Even if not all criteria are marked as mandatory, you must either use the bookingID
from the book response or provide the set of all other criteria, including the accessCode
, hotel
, and reference
, to read the reservation.
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 booking settings you need to use the HotelSettingsInput
input in your query variables:
{
"settings": {
"client": "client_demo",
"context": "HOTELTEST",
"testMode": true,
"auditTransactions": false,
"timeout": 60000
}
}
Mandatory Settings:
client
context
timeout
(Timeout in milliseconds for the supplier connection. Won't close client connection if exceeded.)businessRules
Optional Settings:
group
auditTransactions
suppliers
(Each one contains its own code, settings and accesses)plugins
testMode
(This flag allows only the accesses checked as test)clientTokens
(Used to identify the origin of the request, this is only used in plugins)operationTimeout
(Timeout in milliseconds for Hotel-X connection. Will close Buyer connection if exceeded. Must be higher thantimeout
.)
Requests Examples
Booking read with the bookingID
from the book response
Booking read using the accessCode
, hotelCode
, currency
and reference
from the book response
Booking list by arrival date range
Booking list by booking date range
You can generate a booking list based on booking or arrival dates by simply specifying your client. This will provide a consolidated booking list from all suppliers associated with that client.
Booking Read and List Response
Keep in mind that the content of the Booking response can differ depending on the Sellers. For instance, some Sellers might provide details about the hotel or cancel policies, while others may only offer information about the status and locators/references.
Explore all the booking read output fields and their descriptions in our detailed Graphql API Reference section here.