Hotels
The Hotels Query returns a comprehensive hotel list from a supplier's access, granting you access to all the properties configured by the Seller for a given set of credentials. The returned fields include:
hotelCodehotelNamegiataDatalocationallAmenitiesmediasdescriptions
Query Overview
When creating your hotels query, you have three different inputs to fill based on your specific needs:
- Criteria
- Token
1. Criteria
This query offers versatility, with certain fields marked as mandatory (access) and others as optional (hotelCodes, countries, destinationCodes, etc.). This flexibility empowers you to create a personalized Hotels Query, tailoring the requested fields to your specific needs. Consequently, the response will only include information that is highly relevant to you, streamlining the retrieval process and ensuring the data you receive meets your exact requirements.
{
"criteriaHotels": {
"access": "2",
"hotelCodes": [
"91415"
],
"maxSize": 5
}
}
Mandatory criteria
access
Optional criteria
hotelCodes(Search by hotel)countries(Search by country)destinationCodes(Search by destination)ranksmaxSize(Paginate response)language(It requests the language in format "ISO 639-1 lowercase", in case of having information stored in that language, it will return the answer in the requested language.)
2. Token
The Hotel-X API provides paginated responses to handle cases where the number of hotels from the selected supplier exceeds 10000. The default response page contains a maximum of 500 hotels, but you can specify the number of objects returned per page using the maxSize field in the criteria variable explained before to retrieve between 1 and 10000 hotels.
To include the token in your request, all you need to do is:
-
Add the
tokenobject to the fields and variables. -
After receiving a response, you will only receive a portion of the full list. To access the next page, simply copy the
tokentag from the response and include it in your next request. This will allow you to obtain a new set of objects in the following response. -
Repeat these steps until the
tokenis no longer included in the response, the query will return “Hotels not found”.
Query variables
First, in your hotels query you won't indicate any token input:
{
"criteriaHotels" : {
"access" : "2",
"maxSize" : 5
},
"token" : ""
}
You will obtain a response with 5 hotels per page:
Response
{
"data": {
"hotelX": {
"hotels": {
"token": "FGluY2x1ZGVfY29udGV4dF91dWlkDnF1ZXJ5VGhlbkZldGNoAhZMN2w2SlZYaVNaaXhYeXQwdm1GWjlBAAAAAAV14HUWeXZ3cU02MkpSbTY3WkF6QzJraWJWZxY2NDJ0Uk1EUFFkZXZZTS1ENDVTd2tBAAAAAAZuWSgWdFZSMzRYUVBUWC1nZ1ltWVRCTjVMZw==",
"edges": [
{
"..."
}
]
}
}
}
}
This token should be used as input in your next hotels query, inside the token input:
{
"criteriaHotels" : {
"access" : "2",
"maxSize" : 5
},
"token" : "FGluY2x1ZGVfY29udGV4dF91dWlkDnF1ZXJ5VGhlbkZldGNoAhZMN2w2SlZYaVNaaXhYeXQwdm1GWjlBAAAAAAV14HUWeXZ3cU02MkpSbTY3WkF6QzJraWJWZxY2NDJ0Uk1EUFFkZXZZTS1ENDVTd2tBAAAAAAZuWSgWdFZSMzRYUVBUWC1nZ1ltWVRCTjVMZw=="
}
Response Considerations
The amount of information and content returned might vary between Sellers.
Hotel-X supports all languages, but receiving hotel descriptions in one or another depends entirely on the languages supported by the Seller.
Know the Total Amount of Properties
To obtain the total number of properties in the list, you can easily add the count field to your Hotels Query.
Request
query {
hotelX {
hotels(criteria: {access: "2"}) {
count
edges {
Response
{
"data": {
"hotelX": {
"hotels": {
"count": 16,
"edges": [
Receive GIATA Codes
Hotel-X API fully supports GIATA codes in Hotel-X Hotels Query response. Note that GIATA codes are only available at a hotel level.
GIATA information is retrieved in the node giataData. This information is not returned by default, to activate this feature, open a ticket to our Customer Care team with your GIATA credentials and specified Sellers for activation. Once GIATA is implemented for your account, add giataData node to your Hotels Query to receive GIATA details in the response.
Request
query {
hotelX {
hotels(criteria: {access: "2"}) {
edges {
cursor
node {
code
hotelData {
hotelCode
hotelName
giataData {
updatedAt
source
href
}
Response
{
"data": {
"hotelX": {
"hotels": {
"edges": [
{
"cursor": "",
"node": {
"code": "",
"hotelData": {
"hotelCode": "66337",
"hotelName": "Hotel Test",
"giataData": "11267",
Mapping
When utilizing the Hotel List Query, you will receive the Seller's native hotel codes. Connecting with a new Seller doesn't always mean that you are interested in the whole hotels portfolio, maybe you are just interested in some specific hotels. Since mapping depends entirely on your side, you can map only those hotels you are interested in.
Additionally, you can upload your own mapping files to our FTP (credentials should be provided by our Customer Care team), and we will use your own hotel codes in the booking flow.
You can find all the necessary information in the mapping section.
Query Inputs
HotelXHotelListInput (INPUT_OBJECT)
access(ID)
Indicates the access
hotelCodes(String)
Search by hotel codes. These hotel codes are used to perform search.
supplierHotelCodes(String)
Search by hotel codes in supplier s context.
hotelName(String)
Search by hotel name
destinationCodes(String)
Search by destination codes, only search by minimal destinations
countries(Country)
Filter by country
ranks(Int)
Filter by supplier rank
maxSize(Int)
Maxium number of items per page
group(ID)
The supplier s group. Only available if all permissions allowed
supplierCode(ID)
The supplier s unique code
token (String)
A unique authentication token required for API requests.
A unique authentication token required for API requests.
Returned Fields
HotelConnection (OBJECT)
HotelList definition
HotelList definition
edges(HotelEdge)
node(Hotel)
code * (ID)
Hotel ID
hotelData(HotelData)
Hotel data code * (ID) Internal code. hotelCode * (String) Code to perform availability. Native supplier hotel code. Giata data stored in giata. id * (ID) Giata System ID. Giata URL for the hotels of the supplier. Giata url for the hotel info. updatedAt * (DateTime) Date of last Giata update for this code. Name of the hotel in the Supplier selected. Hotel category (for example number of stars). Hotel chain code exclusiveDeal * (Boolean) Indicates that the Hotel has an Exclusive Deal. location * (Location) Indicates the location of the hotel Contains Hotel Address Contains the city Contains the zipCode. Country where is the Hotel. Geographical coordinates corresponding to a location. latitude * (Float) Latitude longitude * (Float) Longitude Closest destination code * (ID) Destination Code available * (Boolean) Indicates if you can search by destination Returns destination leafs of the destination. texts * (Text) Contains the destination name text * (String) language * (Language) Closest destinations, indicates destinations in proximity Parent destination code Indicates destination type, zone or city
Possible values: Airports code * (ID) Airport ID Airport data code * (ID) Airport Code (IATA) The airport s name The airport s location List of messages code * (ID) AM code: The following codes can be returned: description * (String) Error description level * (AdviseMessageLevel) Indicates the level of importance of the message.
Possible values: ERROR, WARN, INFO.
Possible values: Specify the external message. External code. message * (String) External message. correlationID * (ID) Identifier to investigate the cause of the error. createdAt * (DateTime) Date created updatedAt * (DateTime) Date updated the state/province of the property Contact contains information about hotel contact. Email Telephone Fax Web rank * (Int) Rank indicates the supplier categorization. List of credit cards
Possible values: Medias Code. Indicates the order priority. type * (ApplicationAreaType) Indicates the type of the media.
Possible values: updatedAt * (DateTime) Date updated. url * (URI) Url. Contains the descriptive. text * (String) language * (Language) Descriptions type * (DescriptionType) Indicates type of description
Possible values: Label text * (String) language * (Language) Rooms code * (ID) Room ID Room data code * (ID) Internal code for checking availability roomCode * (String) Code of the hotel in the Supplier selected Label text * (String) language * (Language) Room source Room occupancies Occupancy Total Pax Range Occupancy Infants Pax Range Occupancy Children Pax Range Occupancy Adults Pax Range Room views Contains the descriptive of view. text * (String) language * (Language) viewCode * (String) Containg the view code Room medias Code. Indicates the order priority. type * (ApplicationAreaType) Indicates the type of the media.
Possible values: updatedAt * (DateTime) Date updated. url * (URI) Url. Contains the descriptive. text * (String) language * (Language) Room beds Specifies the bed type Indicates number of beds in a room Specifies if the bed is shared or not Room area in square meters. Amenities with mapping Amenity edges of amenity connection node * (HotelXAmenity) Amenity node code * (ID) Node Id Indicates data values of amenity List of messages createdAt * (DateTime) Indicates the creation date of the node updatedAt * (DateTime) Indicates the date of last update of the node cursor * (String) Edge s cursor List of messages code * (ID) AM code: The following codes can be returned: description * (String) Error description level * (AdviseMessageLevel) Indicates the level of importance of the message.
Possible values: ERROR, WARN, INFO.
Possible values: Specify the external message. External code. message * (String) External message. correlationID * (ID) Identifier to investigate the cause of the error. createdAt * (DateTime) Date created updatedAt * (DateTime) Date updated cursor * (String) Indicates property type. Native supplier property code. PropertyType name Mandatory fees of property Fee duration mandatoryFeeCode * (String) Native supplier Mandatry Fee price * (PriceStatic) Fee price amount * (Float) Net amount currency * (Currency) Price curency The scope of the fee the name of the fee Fee description included * (Boolean) Indicates if the fee is included in the price CheckIn information CheckIn instructions text * (String) language * (Language) CheckIn special instructions text * (String) language * (Language) Minimal age allowed for doing the checkin The schedule of checkIn the start time of range the end time of range CheckOut information CheckIn instructions text * (String) language * (Language) CheckIn special instructions text * (String) language * (Language) Minimal age allowed for doing the checkin The schedule of checkIn the start time of range the end time of range Accesses that has this hotel Amenities with mapping Amenity edges of amenity connection node * (HotelXAmenity) Amenity node code * (ID) Node Id Indicates data values of amenity code * (ID) Amenity code amenityCode * (String) External amenity code type * (ApplicationAreaType) Indicates the type of Amenity.
Possible values: texts * (Text) Contains the descriptive text * (String) language * (Language) value * (Text) Indicates the amenity s value in different languages text * (String) language * (Language) Mappings of amenity codes in different contexts context * (String) Context of the mapped code code * (String) Code in context List of messages code * (ID) AM code: The following codes can be returned: description * (String) Error description level * (AdviseMessageLevel) Indicates the level of importance of the message.
Possible values: ERROR, WARN, INFO.
Possible values: Specify the external message. External code. message * (String) External message. correlationID * (ID) Identifier to investigate the cause of the error. createdAt * (DateTime) Indicates the creation date of the node updatedAt * (DateTime) Indicates the date of last update of the node cursor * (String) Edge s cursor Mapping codes for this property in various contexts, e.g.: TGX, GIATA,... context * (String) Context of the mapped code code * (String) Code in contexthotelCodeSupplier(String)
giataData(GiataData)
source(URI)
href(URI)
hotelName(String)
categoryCode(String)
chainCode(String)
address(String)
city(String)
zipCode(String)
country(Country)
coordinates(Coordinates)
closestDestination(DestinationData)
destinationLeaf(String)
closestDestinations(String)
parent(String)
type(DestinationType)
ZONE: ZoneCITY: Cityairports(Airport)
airportData(AirportData)
name(String)
location(Location)
adviseMessage(AdviseMessage)
WARN: Warning message.ERROR: Error message.INFO: Info message.external(ExternalMessage)
code(String)
state(State)
contact(Contact)
email(String)
telephone(String)
fax(String)
web(URI)
cardTypes(PaymentCardType)
VI: VisaAX: American ExpressBC: BC CardCA: MasterCardCB: Carte BlancheCU: China Union PayDS: DiscoverDC: Diners ClubT: Carta SiR: Carte BleueN: DankortL: DeltaE: ElectronJC: Japan Credit BureauTO: MaestroS: SwitchEC: Electronic CashEU: EuroCardTP: universal air travel cardOP: optimaER: Air Canada/RnRouteXS: accessO: othersmedias(Media)
code(String)
order(String)
HOTEL: Apply at the hotel.ROOM: Apply in the hotel.SERVICE: Applies to a service.GENERAL: Applies in general.texts(Text)
descriptions(Description)
ADDITIONAL: Additional InformationAMENITY: AmenitiesACTIVITY: ActivitiesRESTAURANT: RestaurantsROOM: RoomsGENERAL: GeneralPOOL: PoolsLOCATION: LocationsHOW_TO_GET: How to gettexts(Text)
rooms(RoomConnection)
edges(RoomEdge)
node(RoomStatic)
roomData(RoomData)
texts(Text)
source(String)
occupancies(OccupancyStatic)
total(OccupancyRange)
min(Int)
max(Int)
infants(OccupancyRange)
min(Int)
max(Int)
children(OccupancyRange)
min(Int)
max(Int)
adults(OccupancyRange)
min(Int)
max(Int)
views(View)
texts(Text)
medias(Media)
code(String)
order(String)
HOTEL: Apply at the hotel.ROOM: Apply in the hotel.SERVICE: Applies to a service.GENERAL: Applies in general.texts(Text)
beds(BedStatic)
type(String)
count(Int)
shared(Boolean)
area(Area)
allAmenities(HotelXAmenityConnection)
edges(HotelXAmenityEdge)
amenityData(HotelXAmenityData)
adviseMessage(AdviseMessage)
adviseMessage(AdviseMessage)
WARN: Warning message.ERROR: Error message.INFO: Info message.external(ExternalMessage)
code(String)
token(String)
propertyType(PropertyType)
propertyCode(String)
name(String)
mandatoryFees(MandatoryFee)
duration(String)
scope(String)
name(String)
text(String)
checkIn(CheckInformation)
instructions(Text)
specialInstructions(Text)
minAge(Int)
schedule(TimeRange)
startTime(Time)
endTime(Time)
checkOut(CheckInformation)
instructions(Text)
specialInstructions(Text)
minAge(Int)
schedule(TimeRange)
startTime(Time)
endTime(Time)
accesses(String)
allAmenities(HotelXAmenityConnection)
edges(HotelXAmenityEdge)
amenityData(HotelXAmenityData)
HOTEL: Apply at the hotel.ROOM: Apply in the hotel.SERVICE: Applies to a service.GENERAL: Applies in general.mappings(HotelXMappedCode)
adviseMessage(AdviseMessage)
WARN: Warning message.ERROR: Error message.INFO: Info message.external(ExternalMessage)
code(String)
mappings(HotelXMappedCode)
adviseMessage(AdviseMessage)
List of messages code * (ID) AM code: The following codes can be returned: description * (String) Error description level * (AdviseMessageLevel) Indicates the level of importance of the message.
Possible values: ERROR, WARN, INFO.
Possible values: Specify the external message. External code. message * (String) External message. correlationID * (ID) Identifier to investigate the cause of the error.WARN: Warning message.ERROR: Error message.INFO: Info message.external(ExternalMessage)
code(String)
createdAt * (DateTime)
Date created
updatedAt * (DateTime)
Date updated
cursor * (String)
count * (Int)
token(String)
Examples
Search for the complete hotel list from a supplier
Search for a specific country from a supplier
When utilizing the Hotels List Query, for more personalized results, filter specific hotels, countries or destinations based on your interests. For example, to focus solely on the inventory of a Seller in Greece, add the countries field with "GR" in your criteria. This will ensure you receive hotels directly related to that country, providing you with highly targeted and relevant information.
You would need to apply the same approach for search for specific hotels (hotelCodes) and destinations (destinationCodes).
Search for a specific destination from a supplier
For example, if you want to obtain only hotels from "Santorini", you can use the destination code for that zone. In the bellow case, test supplier have determined code "101402" as Santorini, so you need to specify this code in the destinationCodes field:
Search for a specific hotel code from a supplier
If you want to retrieve the information of specific hotel codes from a supplier, you will need to specify the codes in the hotelCodes field: