Get Nearby Merchants
This is the primary endpoint for retrieving nearby merchant store locations within a given radius of a given lat/long.
1 | |
Input Parameters
| Path Param | Type | Required | Description |
|---|---|---|---|
| token | string | Required | The security token for the customer |
| latitude | float | Required | Latitude of customer location. Valid values are from -85.05112878 to 85.05112878 degrees (Redis GeoAdd limits) |
| longitude | float | Required | Longitude of customer location. Valid values are from -180 to 180 degrees |
| radiusInMeters | int | Required | Distance in meters from center point to search. Default maximum value: 50,000. This value can be changed via the portal configuration |
| Query Param | Type | Required | Description |
|---|---|---|---|
| channelId | int | Required | Value from Channel list |
| locationId | int | Required | Value from Location list |
| maxMerchantLimit | int | Required | The maximum number of merchant store locations to return |
Output
This endpoint returns a JSON object with an array of MerchantLocations:
| JSON Prop | Type | Description |
|---|---|---|
| merchantLocations | MerchantLocation | An array of merchant locations |
Example
Request
1 | |
Response
1 2 3 4 5 | |
Info
This endpoint will only return merchant locations, not ads. The merchant locations are related to ads via the ad ID. Also note that this endpoint will only return merchant locations for ads that meet the following criteria:
- The ad must be paired with the customer specified by token.
- The ad must be new, served, active, or pending. See AdStatus for details.
- The ad must not be parked.
In order to get locations of ads of different statuses and parked states, see Get Nearby Merchants for Ad.