Skip to main content

Hotels Master

Query Overview

The hotelsMaster query returns a list of all the hotel masters created in Inventory. The returned fields include:

  • id
  • name
  • email
  • phones
  • fax
  • address
  • postalCode
  • latitude
  • longitude
  • externalCode
  • category
    • id
    • name
  • locality
    • id
    • name
    • countryCode
  • hotelCode
  • contextCode

1. Criteria

This query offers three alternative ways of retrieving hotel masters:

  • By Hotel code and context
  • By country
  • By locality

Optional Input

  • countryCodes

2. Settings

When building your hotelsMaster query, you can use one of the provided filtering methods based on your needs.

note

The localityId value from the desired locality can be retrieved using the queries Localities or Search Localities.
The possible values for contextCode can be retrieved using the query Inventory Contexts.

Response Considerations

The query returns a collection of hotels along with success status and possible advise messages.

HotelsRs (OBJECT)

  • hotels (InventoryHotelMaster) - A collection of retrieved hotels.
    • id (Int) - Unique identifier.
    • name (String) - Hotel name.
    • email (String) - Contact email.
    • phones (String) - Phone numbers.
    • fax (String) - Fax number.
    • address (String) - Physical address.
    • postalCode (String) - Postal code.
    • latitude (Decimal) - Geographic latitude.
    • longitude (Decimal) - Geographic longitude.
    • category (InventoryCategory)
      • id (Int) - Category ID.
      • name (String) - Category name.
    • locality (InventoryLocality)
      • id (Int) - Locality ID.
      • name (String) - Locality name.
      • countryCode (String) - ISO country code.
    • hotelCode (String) - Supplier's hotel code.
    • contextCode (String) - Context code associated.
  • success (Boolean) - Indicates if the operation was successful.
  • adviseMessages (AdviseMessage) - Messages related to the operation.

Query Inputs

InventoryHotelMasterFilterInput (INPUT_OBJECT)
Hotel master filter input.

hotelCodes (String)
Hotel codes of the hotels to retrieve.

countryCode (String)
Country code for the hotels to retrieve. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

localityId (Int)
Locality Id for the hotels to retrieve. Use query Location to get the available location Ids.

contextCode (String)
Context code for the hotels.

Returned Fields

HotelsRs (OBJECT)
The HotelsRs class represents the response object for hotel-related operations.

adviseMessages (AdviseMessage)
A collection of advise messages related to the operation. See AdviseMessage.

code  *  (ID)
AM code: The following codes can be returned:

description  *  (String)
Error description

level  *  (Enum of AdviseMessageLevel)
Indicates the level of importance of the message. Possible values: ERROR, WARN, INFO.
Possible values:
WARN
ERROR
INFO

external (ExternalMessage)
Specify the external message.

code (String)
External code.

message  *  (String)
External message.

correlationID  *  (ID)
Identifier to investigate the cause of the error.

hotels (InventoryHotelMaster)
A collection of hotels. See Hotel.

id  *  (Int)
The unique identifier of the hotel.

name (String)
The name of the hotel.

email (String)
The email address of the hotel.

phones (String)
The list of phone numbers of the hotel.

fax (String)
The fax number of the hotel.

address (String)
The physical address of the hotel.

postalCode (String)
The postal code of the hotel's location.

latitude (Decimal)
The latitude of the hotel's location.

longitude (Decimal)
The longitude of the hotel's location.

externalCode (String)
The external code of the hotel.

category (InventoryCategory)
The category of the hotel.

id  *  (Int)
Category Id.

name (String)
Category Name.

locality (InventoryLocality)
The locality of the hotel.

id  *  (Int)
Unique identifier for the locality.

name (String)
Name of the locality.

countryCode (String)
ISO 2-character country code associated with the locality.

unLocode (String)
UN/LOCODE associated with the locality.

hotelCode (String)
The code of the hotel.

contextCode (String)
The context code of the hotel.

success  *  (Boolean)
Indicates whether the operation was successful.

Examples

Search for Hotel masters by their code

When searching by hotel code, it is important to know that the default value of the field contextCode will be "TGX_PUSH", so if the hotels to retrieve are from a supplier that works with native codes, their respective Inventory Context must be passed in the field contextCode.

note

The possible values for contextCode can be retrieved using the query Inventory Contexts.

Search for the full list of Hotel masters linked to a specific Inventory Context

Another possibility is to retrieve directly all the hotels linked to a specific Inventory Context. For that, fill in your input just the Inventory Context in the field contextCode.

Search for Hotel masters by country

When utilizing the Hotels Query, for more personalized results, filter specific hotels based on your interests. For example, to focus solely on hotels located in Spain, add the countryCode field with "ES" in your input:

Search for Hotel masters by locality

Similarly to the previous query, to filter the results and retrieve only hotels from a specific Locality, for example, Palma de Mallorca, set your query variables as follows:

note

The localityId value from the desired Locality, can be retrieved using the queries Localities or Search Localities.