Search for Location
The Search Location API allows the user to find a particular location based on a number of variables.
The .json address above can be used to access the schema within Postman. An example use of the Location API follows below, or view the schema or the sample Postman collection.
The request itself is built within the URL by adding a “/?” to the call followed by specific parameters joined by the “&” symbol. For instance, searching for locations from a particular retailer and manufacturer combination would use the following format:
- https://integration.shopatron.com/api/v2/location/?retailerID=[Retailer ID]&manufacturerID=[Manufacturer ID]
In the case of performing a search with multiple terms of the same parameter, such as retrieving multiple retailer IDs at once, use a comma-separated list as shown below.
- https://integration.shopatron.com/api/v2/location/?retailerID=[Retailer ID One],[Retailer ID Two],[Retailer ID Three]
GET calls that support pagination for numerous results, such as when searching, also accept a perPage parameter that defines how many results can be returned on each page. The default is 1. Switch between pages of results by appending the page parameter to the call. For example:
- https://integration.shopatron.com/api/v2/location/?retailerID=[Retailer ID]&perPage=2&page=2
In this example, the location being searched for includes these particular properties:
- Manufacturer ID 55555
- Exclude inactive locations (only search for active locations)
A variety of possible properties can be used to locate an existing location. The API call always requires at least one of these data points to reference as a search term:
|manufacturerID||integer||A unique identifier for the location’s manufacturer. The minimum value is “1”.|
|retailerID||integer||A unique identifier for the location’s retailer. The minimum value is “1”.|
|locationID||string||One or multiple (comma-separated) unique location identifiers to retrieve.|
|page||integer||The page number to begin listing the results from. The default and minimum value is “1”. While this parameter is technically required, this default means that it does not have to be provided in the request unless a different page is specifically desired. Also, note that the page cannot be the sole parameter in the search query – if provided, there must be at least one of the other parameters in this table. |
The API can also search for any of these additional elements:
|catalogID||integer||A unique identifier for a catalog.|
|catalogIDs||string|| A single or list of catalogIDs. They must be positive integers. The minimum value is “1”. |
|externalStoreID||string||A unique external identifier for the store, also known as Dealer ID. Requires a single manufacturerID and an optional single catalogID.|
|lastUpdatedStart||string||The start of the date range the location was last updated (date-time).|
|lastUpdatedEnd||string||The end of the date range the location was last updated (date-time).|
|searchTerm||string||A string to search locations by: name, address, externalStoreID, or locationID. The minimum length is 3 and the maximum length is 300.|
|includeExternalFulfillers||boolean||Whether to include locations for fulfillers with external associations in the network. The default is “false”.|
|excludeInactiveLocations||boolean||If true, locations that are currently inactive will be filtered out. The default is “false”.|
|includeHours||boolean||Whether to include store hours or not.|
|perPage||integer|| The (max) number of items to return per results page. The minimum value is “1” and the maximum value is “100”. The default is “10”. |
The Full Request
Using the URL format as outlined above, the entire call is fairly simple to put together. This sample will search for customers matching the example’s parameters. Any amount of additional parameters could be appended if desired.
The Full Response
This is the full response returned by the API.
"name": "Example Location Three",
"addressLine1": "9999 Example Rd",
"contact": "John Smith",