Adding Opening Times Rules to a Location

The openingTimesRules endpoint allows for the configuration of opening times, per weekday for a given store.

These rules are optional. If none is specified, the assumption is that the location or store is never available.

Properties

  • openingTimesRules[i].rule - string - the currently supported rule format is "every <weekday>" (weekday in monday, tuesday ... sunday)
  • openingTimesRules[i].openingClosingTimes - array of time periods for the given weekday for which the location is open
    • openingTimesRules[i].openingClosingTimes[j].openingAt: string - opening time in the following format: "<2 digit hours>:<2 digit minutes>"
    • openingTimesRules[i].openingClosingTimes[j].closingAt: string - closing time in the following format: "<2 digit hours>:<2 digit minutes>"

Notes

  1. Opening / closing times values containing spaces or nulls or not conforming to the <2 digit>:<2 digit> format are not supported.

Required Permission

can-create-locations

See Auth* (scopes).

Request

POST /locations/<id>/openingTimesRules
Content-Type: application/json
{
   "openingTimesRules":[
      {
         "rule":"every Monday",
         "openingClosingTimes":[
            {
               "openingAt":"08:00",
               "closingAt":"18:00"
            }
         ]
      },
      {
         "rule":"every Tuesday",
         "openingClosingTimes":[
            {
               "openingAt":"08:00",
               "closingAt":"18:00"
            }
         ]
      }
   ]
}

Response

HTTP/1.1 201 CREATED
{
   "rel":"self",
   "href":"/locations/6b2e279d-8afd-4785-8ea4-b06739fb0f14/openingTimesRules"
}

Failure

Request error; e.g. invalid JSON object:

HTTP/1.1 400 BAD REQUEST

User doesn't have the required permission:

HTTP/1.1 403 FORBIDDEN

Location id doesn't match an existing location:

HTTP/1.1 404 NOT FOUND

Other errors:

HTTP/1.1 500 INTERNAL SERVER ERROR

results matching ""

    No results matching ""