Skip to content

Get Nearby Merchants for Ad

This endpoint for retrieving nearby merchant locations within a given radius of a given latitude and longitude for a specific ad.

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

Input Parameters

Path Param Type Required Description
token string Required The security token for the customer
adId long Required The ID of the ad for which we are retrieving locations
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/ads/10132748/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 for ads which are paired with the given customer.