/restaurant/timetable

If for some reason there is need to get updated version timetable of the restaurant, this action can be used to fetch it. By default timetables are available in /restaurant/list, but, for example, if a client has support for favorite restaurants, this action can be used to fetch timetable information to check if restaurant is open at the moment.

Request

POST nameValueRequired?
restaurant_idintegerYes

Response

Success:

{
  "opening_hours":[
    {
      "name":"monday",
      "open":"09.00",
      "close":"23.00"
    },
    {
      "name":"tuesday",
      "open":"09.00",
      "close":"23.00"
    },
    "comment":"more times ..."
  ],
  "lunch_times":[
    {
      "name":"monday",
      "open":"09.00",
      "close":"15.00"
    },
    ".."
  ],

  "comment":"1 if restaurant is open for orders, i.e. if it is open, 0 if closed.
    This field takes all different aspects for time of data requested from server,
    like restaurant’s opening hours and panic mode in account, so this can be used to check if
    restaurant can be used for orders not employing alternative delivery time.",
  "restaurant_open":1,

  "comment":"whether restaurant is closed during national Finnish holidays like easter and christmas",
  "is_closed_during_holidays":"1",

  "comment":"true if restaurant can make delivery orders, false if it can’t. Note that even if this is true, it doesn’t mean that restaurant can do delivery orders at any given time.",
  "has_delivery":true,

  "comment":"If this is false, restaurant can’t accept orders that will be fetched from the restaurant. If has_delivery and has_takeaway are both false, restaurant can’t accept any orders.",
  "has_takeaway":false,

  "comment":"true if restaurant is open for orders, i.e. if it is open, false if closed.",
  "restaurant_state":true,

  "comment":"true if restaurant has some kind of panic going on and is temporarily closed. false if everything is normal.",
  "restaurant_unavailable":true,

  "comment":"true if restaurant has some kind of panic going (like car exploded) on affecting only
    delivery orders and has temporarily closed delivery orders.
    false if everything is normal.",
  "delivery_unavailable":true
}

Delivery and open statuses

Whether restaurant has delivery, can be calculated from timetable of the restaurant, from delivery_times. There is also a bit that tells open statuses, for a case restaurant has burned down or something similar.

If both open and close are zero (00.00), restaurant is closed for the day.

Restaurant statuses

Restaurants has different kind of statuses that can be used to check whether restaurant is open, can do delivery orders or if it has some kind of panic going on.

If customer wants to do an order with alternative delivery time, you need to calculate if restaurant is open at the time by yourself. Implementing additional delivery time is optional, but it is often used feature. For mobile or other slow connections, it may make sense to do the calculations on the device instead of asking from backend service anyway, to speed up showing this information.

restaurant_open

The main attribute is restaurant_open which takes all timetable calculation and other flags in account, including panic states. When one wants to find whether restaurant is open at current time (when customer has requested restaurant list or timetable information from the server), just checking this attribute is enough.

For example, if customer has idled 12 hours in order creation process and client wants to make sure that restaurant really is still open, a call to /restaurant/timetable could be done and this attribute tested that it is still true.

has_delivery

The attribute has_delivery does not affect to whether restaurant is open or not, but whether restaurant can do delivery orders at all. This is likely not to change ever, and should be true for most restaurants, but make sure that this is true if for restaurants you allow delivery. This attribute is not influenced by timetable; you need to check timetable information to know whether restaurant delivers to specific restaurant.

Above also applies to has_takeaway.

restaurant_state

restaurant_state is for information purposes only. Restaurants which state is false are not browsable through API in first place.

panic states

restaurant_unavailable is automatically counted in restaurant_open. When doing order with alternative delivery time, one can’t know whether restaurant will still be in panic at that moment, so this attribute does not need be adhered, but it may be good practice to warn customers that this restaurant may be closed until end of the day in worst case.

delivery_unavailable is not used at the moment, but if possible, it would be good to implement support for this attribute in the client for future-proofness. If delivery_unavailable is 1, the restaurant has delivery temporarily closed, but takeaway orders can still be done.

Night time

Night time information night_time_enabled and night_time_start_time can be used to determine if restaurant wants specific night time fee should be applied. If current time is between night_time_start_time and restaurant’s delivery time’s end time, night_time_delivery_fee (in /restaurant/metadata) should be applied to all delivery orders.

Failure:

Error array.

Expectable errors

See error conventions section for explanation how error system works.

Label Additional data Description
NO_RESTAURANT_IDNoneThere should be a restaurant id.
NO_RESTAURANT_FOUNDNoneI need better restaurant id.