Skip to content

Get Nearby Merchants

This is the primary endpoint for retrieving nearby merchant store locations within a given radius of a given lat/long.

1
GET /customers/<token>/merchants/latitude/<latitude>/longitude/<longitude>/radius/<radiusInMeters>

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
GET /api/v1/customers/C1FA3C38-1B28-4B54-A2F8-E577FFEEF9F5/merchants/latitude/33.7490/longitude/84.3880/radius /1000?channelId=1&locationId=1&maxMerchantLimit=20

Response

1
2
3
4
5
{
   "merchantLocations":[
      // See the MerchantLocation object for a JSON example
   ]
}

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.