Get recommended merchant
GET /company/recommend_merchant
You can use the recommended merchant endpoint to find the closest store to an Australian address you provide. For example, you can use this endpoint to determine which of your stores should fulfil an order for a particular address.
Important: You must use an API token associated with a company for this call.
Addresses that you submit in the GET request are parsed first by street address, if provided, then by suburb and postcode.
If the provided address doesn’t match a legitimate Australian address, the endpoint ignores the street address, and uses the provided suburb and postcode instead. If the provided street address is a legitimate Australian address, but it doesn’t match the provided suburb and postcode, the endpoint ignores the provided suburb and postcode and uses the suburb that matches the street address instead. If the request can’t parse the address you provide as a legitimate Australian address, the endpoint returns a 400 error.
When you send a GET request to the recommended merchant API endpoint, the service uses the parameters you provide in the request to search through the available merchants. You can provide a list of merchants for the service to select from, or leave the parameter blank to search all merchant IDs that exist under your company account.
The service iterates through the merchants under consideration and calculates the distance between the destination provided in the API parameters and each merchant’s listed primary location to return the closest merchant. For the closest merchant, the service returns all enabled service levels. If the endpoint returns merchants that are further than 25km away, any on demand service levels are removed from the results.