Localities
Query Overview
The localities
query returns a list of all the possible localities that a hotel can have assigned in Inventory. The returned fields include:
id
name
countryCode
unLocode
1. Criteria
When building your query, you can provide the following input fields:
Optional Input
countryCodes
- A list of ISO 2-character country codes associated with the localities to retrieve.
2. Settings
This query offers versatility, allowing you to filter localities based on country codes. This customization ensures that you retrieve only relevant information, streamlining the data retrieval process.
The countryCodes
value follows the ISO 3166-1 alpha-2 standard.
{
"input": {
"countryCodes": ["ES", "FR"]
}
}
Response Considerations
The query returns a collection of localities along with success status and possible advise messages.
LocalitiesRs
(OBJECT)
localities
(InventoryLocality) - A collection of retrieved localities.id
(Int) - Unique identifier for the locality.name
(String) - Name of the locality.countryCode
(String) - ISO 2-character country code.unLocode
(String) - UN/LOCODE associated with the locality.
success
(Boolean) - Indicates whether the operation was successful.adviseMessages
(AdviseMessage) - Messages related to the operation.code
(ID) - AM code.type
(String) - Error type.description
(String) - Error description.level
(Enum of AdviseMessageLevel) - Importance level (ERROR, WARN, INFO).external
(ExternalMessage) - External message details.correlationID
(ID) - Identifier for debugging.
Query Inputs
InventoryLocalitiesFilterInput (INPUT_OBJECT)
Localities filter input.
Localities filter input.
countryCodes (String)
Country codes of the localities to retrieve. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Country codes of the localities to retrieve. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Returned Fields
LocalitiesRs (OBJECT)
Represents response data for localities.
Represents response data for localities.
adviseMessages (AdviseMessage)
Collection of advise messages.
Collection of advise messages.
code * (ID)
AM code: The following codes can be returned:
AM code: The following codes can be returned:
description * (String)
Error description
Error description
level * (Enum of AdviseMessageLevel)
Indicates the level of importance of the message.
Possible values: ERROR, WARN, INFO.
Possible values:
WARN
ERROR
INFO
Indicates the level of importance of the message. Possible values: ERROR, WARN, INFO.
Possible values:
WARN
ERROR
INFO
external (ExternalMessage)
Specify the external message.
Specify the external message.
code (String)
External code.
External code.
message * (String)
External message.
External message.
correlationID * (ID)
Identifier to investigate the cause of the error.
Identifier to investigate the cause of the error.
localities (InventoryLocality)
Collection of localities.
Collection of localities.
id * (Int)
Unique identifier for the locality.
Unique identifier for the locality.
name (String)
Name of the locality.
Name of the locality.
countryCode (String)
ISO 2-character country code associated with the locality.
ISO 2-character country code associated with the locality.
unLocode (String)
UN/LOCODE associated with the locality.
UN/LOCODE associated with the locality.
success * (Boolean)
Indicates whether the response was successful based on the absence of advise messages.
Indicates whether the response was successful based on the absence of advise messages.
Examples
Retrieve the full list of localities available
Retrieve localities from specific countries
When utilizing the localities Query, for more personalized results, filter specific localities based on your interests. For example, to focus solely on Spanish localities, add the countryCodes
field with "ES" in your input: