/restaurant/delivery_methods

An action to get delivery methods that will deliver to customer’s address for a specific restaurant.

In case a client does not want to do the delivery method calculation by itself (by using delivery_methods in /restaurant_metadata) and there is no other need for handling that data, this action can be used to get delivery methods and their data for given moment and restaurant, using restaurant’s location and a given address (e.g. customer’s location).

Overview of the delivery system

An array under attribute delivery_methods is returned by /restaurant/metadata. Since parsing that array by hand is time consuming, this action can be used to calculate restaurant’s available delivery methods at any given moment, so that the client does not need to parse and calculate the methods by itself.

Request

POST nameValueRequired?
restaurant_id774Yes
timestamp1299434896No
addressExample Address 1Yes
postal_code04250Yes*
cityDummycityYes*
latitude25.5203422Yes**
longitude53.3422342Yes**

(*) For postal_code and city, only one of them is required, but most accurate results can be gotten by passing the city, with or without postal code.

(**) You can insert latitude and longitude instead of an address. If both are given, latitude and longitude are preferred.

timestamp

timestamp can be optionally specified for example for getting delivery methods for alternative delivery time if customer is using one for her order. If not given, current time is used.

Response

[
  {
    "id":1,
    "name":"Delivery method name",
    "zone":{
      "See /restaurant/metadata for values"
    },
    "time":{
      "See /restaurant/metadata for values"
    }
  }
]

The details are mostly same as in delivery_methods array in /restaurant/metadata with exception that only one zone and time will be returned, which will be valid for the given arguments.

In case no delivery methods are available, empty array will be returned instead.

Expectable errors

Label Additional data Description
NO_RESTAURANT_IDNoneRestaurant id was not passed.
INVALID_RESTAURANT_IDNoneOr it was malformed.
DISTANCE_NOT_COMPUTABLENoneMost likely the address of customer’s wrong. Or our service went down or something.