ShippitDeveloper Centre

Recommended merchant API

The Recommended Merchant API finds the closest store to an Australian address—useful for deciding which of your stores should fulfil an order.

Important: You must use an API token associated with a company for this call.

Endpoints

store_namestringRequired
Chosen merchant's name
merchant_idintegerRequired
Chosen merchant's ID
available_service_levelsarrayRequired
List of available service levels for chosen merchant
Sample responseJSON
{
  "store_name": "Harolds Harpoons Abbotsford",
  "merchant_id": 9972,
  "available_service_levels": ["standard", "express", "on_demand"]
}

GET/company/recommend_merchant

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.

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.

Parameters

You can provide a list of merchants for the service to select from, or leave merchant_ids blank to search every merchant under your company account.

delivery_suburbstringRequired
A suburb in Australia
delivery_postcodestringRequired
A postcode in Australia
delivery_statestringRequired
A state in Australia
delivery_addressstringOptional
A street address in Australia
merchant_idsarrayOptional
List of merchants IDs under the company. If not provided, all merchants in the company are considered.

Response codes

StatusMeaningDescription
200OKReturns the closest merchant and its enabled service levels.
400Bad RequestReturned when delivery_suburb, delivery_state or delivery_postcode is missing, or when no merchant can be recommended for the address.
401UnauthorizedReturned when the API key doesn't match a valid company account. This endpoint authenticates a company, not a merchant.
200 · SuccessJSON
{
  "store_name": "Harolds Harpoons Abbotsford",
  "merchant_id": 9972,
  "available_service_levels": ["standard", "express", "on_demand"]
}