Skip to main content

Search Localities

Query Overview

The searchLocalities query allows you to search for localities created in Inventory based on their names. The returned fields include:

  • id
  • name
  • countryCode
  • unLocode

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.

note

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.

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.

adviseMessages (AdviseMessage)
Collection of advise messages.

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.

localities (InventoryLocality)
Collection of localities.

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.

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.