Search Localities
Query Overviewβ
The searchLocalities query allows you to search for localities created in Inventory based on their names. The returned fields include:
idnamecountryCodeunLocode
1. Criteriaβ
When building your query, you need to provide the following input fields:
Mandatory Inputβ
localityName- The name of the locality to search for.
Optional Inputβ
countryCode- The ISO 2-character country code to filter localities by country.
2. Settingsβ
This query allows searching for localities by name and optionally filtering by country code to get more precise results.
The countryCode value follows the ISO 3166-1 alpha-2 standard.
{
"input": {
"localityName": "Washington",
"countryCode": "US"
}
}
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β
InventoryLocalitiesSearchFilterInput (INPUT_OBJECT)
Localities filter input.
Localities filter input.
countryCode(String)
Country code of the localities to retrieve. https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
localityName(String)
Locality name
Returned Fieldsβ
LocalitiesRs (OBJECT)
Represents response data for localities.
Represents response data for localities.
adviseMessages(AdviseMessage)
Collection of advise 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)
localities(InventoryLocality)
Collection of localities. idΒ *Β (Int) Unique identifier for the locality. Name of the locality. ISO 2-character country code associated with the locality. UN/LOCODE associated with the locality.name(String)
countryCode(String)
unLocode(String)
successΒ *Β (Boolean)
Indicates whether the response was successful based on the absence of advise messages.
Examplesβ
Let's try to search for localities that contain "Washington" in their name and are located in the United States.