GET Get nearest stores
GET /stores
Operation ID: Get nearest stores. Tags: stores. Security: client_id; customers_auth.
This resource retrieves a list of stores, for the given site, that are within a configured distance of a location on the earth. The stores and their distance from the specified location are returned as a result set of Store objects. The distance is interpreted either in miles or kilometers depending on the distance_unit input parameter.
The location can be specified by either directly providing a latitude/longitude coordinate pair or by providing a country and a postal code:
-
If a postal code is passed, the resource looks in the system's geolocation mappings to find the coordinates for this postal code. If no matching geolocation is found, the resource will return an empty list of stores.
-
If coordinates are passed, the values for country and postal code are ignored.
This endpoint may return the following faults:
- 400 - MalformedDistanceUnitException - Invalid distance_unit given.
- 400 - MissingCoordinatesException - Thrown if only one of latitude or longitude are provided.
- 400 - MissingCountryCodeException - Thrown if no coordinates (latitude and longitude) are provided and in addition no country code is given.
- 400 - MissingPostalCodeException - Thrown if no coordinates (latitude and longitude) are provided and in addition no postal code is given..
Parameters
latitude(query, number (double)) The geo coordinate latitude to search for stores (value range -90.00 .. 90.00).
Minimum: -90. Maximum: 90.longitude(query, number (double)) The geo coordinate longitude to search for stores (value range -180.00 .. 180.00).
Minimum: -180. Maximum: 180.country_code(query, string) The two letter ISO country code e.g. "US".
Minimum length: 2. Maximum length: 2.postal_code(query, string) The postal code e.g. "01801".
Minimum length: 3. Maximum length: 10.distance_unit(query, string) The distance unit. Supported values are "mi" and "km" (for miles and kilometers respectively, default is "km").max_distance(query, number (double)) The area (radius) in distancUnit where stores will be searched for (default is half of the earth's perimeter).
Minimum: 0. Maximum: 20012.start(query, integer (int32)) The result set index to return the first instance for. Default value is 0.
Minimum: 0.count(query, integer (int32)) The maximum number of instances per request. Default value is 25.
Minimum: 1. Maximum: 200.
Responses
- 400
MalformedDistanceUnitException- Invalid distance_unit given. orMissingCoordinatesException- Thrown if only one of latitude or longitude are provided. orMissingCountryCodeException- Thrown if no coordinates (latitude and longitude) are provided and in addition no country code is given. orMissingPostalCodeException- Thrown if no coordinates (latitude and longitude) are provided and in addition no postal code is given..Media type:
application/json, text/xml. Schema:fault. - default
Media type:
application/json, text/xml. Schema:store_result.