View a list of merchants that service a given location. This endpoint does not require authentication, but will return additional information if an access token is included in the Authorization HTTP header.

Request

HTTP Request

GET /merchant/search/{method}

Parameters

Parameter Name Value Description
Required Parameters
method delivery|pickup Whether this a is search for merchants that offer pickup or delivery orders.
address String The address where the user is. Acceptable formats include ‘Address, City, State’ and ‘Address, Zip’. We’ll validate the address for you. See more in the Response section. Note: this is only required if not sending a latitude/longitude.
latitude String The latitude of the search location. Only required if not sending an address.
longitude String The longitude of the search location. Only required if not sending an address.
Optional Parameters
access_token String Include this to see whether a user has favorited each merchant.
merchant_type R|C|F|I|W|U|P|Z Include this to filter search results to a certain merchant type. R represents Restaurant. C represents Caterer. F represents Florist. I represents Grocery Store. W represents Wine and Liquor Store. U represents Drug/Convenience Store. P represents Pet Store. Z represents Tobacco Shop
inexact true Include this to perform to search approximate addresses, such as finding all merchants who are near a particular zip code, neighborhood, or point of interest.

Request Body

Do not supply a request body with this method.

Responses

Success

HTTP 200 OK

{
  "search_address": {
    "street": "235 PARK AVE S",
    "zip_code": "10003",
    "state": "NY",
    "city": "NEW YORK",
    "latitude": 40.73771,
    "longitude": -73.987949
  },
  "message": [

  ],
  "promoted_merchants_id": [
    "57",
    ...
  ],
  "merchants": [
	{
	    "id": "57",
	    "favorite": false,
	    "summary": {
		"name": "Gramercy Bagels",
		"cuisines": [
		    "Sandwiches",
		    "Bagelry"
		],
		"phone": "555-555-5555",
		"description": "",
		"overall_rating": 75,
		"num_ratings": 138,
		"type": "R",
		"type_label": "Restaurant",
		"notes": null,
		"url": {
		    "geo_tag": "nyc",
		    "short_tag": "gramercy-bagels",
		    "complete": "https://staging.delivery.com/nyc/gramercy-bagels"
		},
		"activation_date": "2000-11-01"
	    },
	    "ordering": {
		"delivery_processes_card": true,
		"payment_types": [
		    "credit",
		    "gift card",
		    "promotions",
		    "cash"
		],
		"is_rds": false,
		"time_needed": 30,
		"specials": [
                {
                    "name": "10% Off for First Time Users",
                    "type": "F"
                }
                ],
		"last_or_next_order_time": "2014-06-03 22:15:00",
		"minimum": 8,
		"is_open": true,
		"delivery_charge": 0,
		"delivery_percent": 0
	    },
	    "location": {
		"distance": 0.18608809903916,
		"street": "246 3rd Ave",
		"city": "New York",
		"state": "NY",
		"zip": "10010",
		"longitude": -73.984444,
		"latitude": 40.737263,
		"landmark": "Between 20th & 21st."
	    }
	}
    ...
  ],
  "verticals": [
    {
      "type": "R",
      "count": 389,
      "label": "Restaurant"
    },
    {
      "type": "C",
      "count": 63,
      "label": "Caterer"
    }
    ...
  ],
  "cuisines": [
    "Afghan",
    "American",
    "Argentinian",
    "Asian",
    "Bagelry",
    "Barbeque",
    "Brazilian",
    "Breakfast",
    "Burgers",
    "Cafe",
    "Caribbean",
    "Cheesesteaks",
    "Chinese",
    "Cuban",
    "Deli",
    "Desserts",
    "Diner",
    "Empanadas",
     ...
  ],
  "popular_cuisines": [
    "Sandwiches",
    "Italian",
    "American",
    "Japanese",
    "Pizza"
    ...
  ]
}
Property Name Value Description
search_address Location This is the geocoded address that you searched for. You might want to store it for later use in the location API.  If passing inexact=true, be sure to check whether is_exact_match is true or false.  This will indicate whether the address points to a real location or is just approximate.  When dealing with approximate addresses, you’ll need to prompt users for their actual addresses later in the process to add items to their carts.
merchants Merchant[] Array of merchants that service that location
cuisines String[] Array of cuisines that are available to this location
verticals vertical[] Array of json objects containing information about verticals available to that location. See example response above.

No Results Found

HTTP 200 OK

{
    "search_address": {
        "street": "7452 STONEBROOK DR",
        "zip_code": "48187",
        "state": "MI",
        "city": "CANTON",
        "latitude": 42.338348,
        "longitude": -83.51164
    },
    "message": [
        {
            "code": "no_delivery_results",
            "user_msg": "Sorry, no results were found",
            "dev_msg": "Sorry, no results were found"
        }
    ],
    "promoted_merchants_id": [],
    "merchants": [],
    "cuisines": []
}

Ambiguous Location

HTTP 400 Bad Request

{
    "message": [
        {
            "code": "loc_multiple_possible",
            "user_msg": "Multiple addresses possible.",
            "dev_msg": "Multiple addresses possible."
        }
    ],
    "addresses": [
        {
            "street": "1 N Rosedale St",
            "city": "Baltimore",
            "state": "MD",
            "zip": "21229",
            "latitude": 39.28602,
            "longitude": -76.6689,
            "exactMatch": true
        },
        {
            "street": "1 S Rosedale St",
            "city": "Baltimore",
            "state": "MD",
            "zip": "21229",
            "latitude": 39.2858,
            "longitude": -76.66889,
            "exactMatch": true
        }
    ]
}
Property Name Value Description
addresses Location Possible addresses that the user could have meant. You should show these to the user and have him select the one that he meant.

Invalid Address

HTTP 400 Bad Request

{
    "message": [
        {
            "code": "invalid_address",
            "user_msg": "We could not find the address that you submitted. Please double check all the fields and try again.",
            "dev_msg": "This address could not be validated."
        }
    ]
}