Special closures and holiday hours
In the preceding sections the Order API component and the Menu API component are described – and within the Menu API description you will find a description of the hours object:
An object with a key for every day of the week, each key having a value which is an array of objects - each object in that array representing 1 block of time) hours are applicable to item availability across entire Menu object - items with distinct menu availability should be in a Menu object with hours matching that availability - if no hours are provided, this menu is assumed to be available during all open hours of the location - if hours are provided for some days but not others, those omitted days are assumed to have no availability for the items in that menu (i.e. probably closed)
An example can be viewed here.
But – of course – businesses don’t always adhere to their regular hours, since holidays require a special set of hours and closures. And, we are planning on including special_hours in a planned Open API version 2, that will be the new standard.
In the mean-time, while Open API v2 is still pending, ordering platforms that want to make use of special_hours functionality may do so on a per location basis; if you choose to do so, we just need to be told which locations to toggle the behavior “on” for.
When special_hours have been enabled for a location...
At the same level of depth in the Menu object as “hours” you will find the special_hours key pointing to an array of objects like so:
Here you can see an example special_hours array of Objects in the context of an example Menu response object.
date – the day that the special hours apply in year-month-day format
closed – a Boolean value that lets you know that:
- the start_time and end_time apply to a situation where the store is open between start_time and end_time if closed is false
- the start_time and end_time apply to a situation where the store is closed between start_time and end_time if closed is true
start_time – the beginning of time span block
end_time – the end of time span block
Each object in the special_hours array is for 1 time span in a single day. And a single day might have multiple objects, each denoting a distinct time span. For example, a store that is open on Easter from 8am to 10am, and then again on the same day from 8pm to 10pm.