API docs
Sous Chef Management API
Request access

Set location weekly hours

POST/management/stores/setLocationHours

Replace a location's weekly operating hours: the regular template, as opposed to the date-specific overrides setLocationSpecialHours writes. Send the complete week; windows replaces whatever the location had. A window whose closesAt is earlier than its opensAt crosses midnight, and several windows may name the same day for a split service.

What it propagates to. Every storefront at the location whose menus follow location hours. A menu configured with its own weekly hours is unaffected: read MenuAssignment.hours.followsLocationHours from fetchStoreMenus to see which is which. So is a storefront of another organization's brand once that organization has set its own weekly hours at your kitchen: its menus that follow location hours take that organization's hours, not yours, and fetchStoreHours keeps reporting them for it.

An hours write republishes menus. Propagation is an asynchronous save-then-publish over every affected menu, so a menu holding unpublished saved changes goes live with them. Verify the outcome with fetchStoreHours, which reads the effective, post-propagation state. This operation's own reply echoes what was saved, not what each platform has accepted.

windows is required and must be non-empty. See SetLocationHoursRequest for why this operation has no equivalent of wipeAll.

Scope: owner-only, which is narrower than the reads. Only a locationId your organization owns: one whose Location.organizationId from fetchLocations equals your own organization id. If you operate a brand out of somebody else's host kitchen, fetchLocations shows you that kitchen and fetchStoreHours reports the hours its storefronts trade on, but you may not write the kitchen's weekly hours: this write moves the weekly template for every brand there that follows the location's hours, including the host's, so it is the host's to make. Ask them, or give your brands their own week instead (below).

A locationId that is not yours, whether it belongs to another organization or is a host kitchen you operate in, is treated the same as one that does not exist. Each returns the same 404 and nothing is written. The response body does not say which case applied, so check organizationId on the location from fetchLocations against your own organization id before you write.

Your own week at a host kitchen. If your brands cook in somebody else's kitchen, your organization can set its own weekly hours for all of its brands there, in the Sous Chef Portal. They apply to your brands there and to nobody else's, fetchStoreHours reports them as regular on your storefronts there whose menus follow location hours, and the host's setLocationHours no longer changes those storefronts' weekly hours. No operation on this API reads or writes that schedule as such.

Safe to retry: this operation changes state but is idempotent.

Request

application/json
required
  • locationIdstring

    The Location whose weekly hours are being replaced. Required.

  • windowsRegularHoursWindow[]

    The complete weekly template. Required, non-empty. Several windows may name the same day (a split service, such as lunch and dinner), and a window whose closesAt is earlier than its opensAt crosses midnight, exactly as fetchStoreHours reports them.

    No two windows may cover the same minute. Overlapping entries are rejected with a 400, and the comparison spans midnight, so a Sunday 22:00-02:00 window collides with a Monday 01:00-05:00 one.

    Times are wall clock in the location's own timezone (the IANA zone fetchStoreHours reports beside the windows), never UTC and never an offset (HH:MM accepts no offset). Do not convert before sending: "11:00" means eleven in the morning where the kitchen is, in summer and in winter, and no value written here shifts at a DST boundary.

Responses

200: The location's weekly template as saved by this call.

Headers

  • x-mealco-tx-idstringoptional

    The correlation id for this call, returned on every response that an operation produces, successful or not. Quote it when you report a problem so that we can trace the request. You may send your own x-mealco-tx-id on the request and it is used as the id. It is optional in the schema because a request with a malformed JSON body is rejected before an id is assigned, so that one response carries neither this header nor the txId field of the error body.

About Stores

The places you operate and the brands you operate there.

Sous Chef models a restaurant business in three layers, and every other section of this API assumes them. A brand is a menu concept: what a customer sees on a delivery app. A location is a physical address with a kitchen in it. A store is one storefront: a single brand, at a single location, on a single platform. A location running two brands on three platforms has six stores, each with its own menu, hours and pause state.

The directory reads join on ids, never on display names: every store carries its location.id and brand.id, and a location carries the id of each brand it runs.

Start here. A location carries the timezone that every schedule, report window and business day elsewhere on this API is interpreted in.

Every operation is scoped to the organization your API key resolves to, and nothing here calls out to a delivery platform live. The directory reads (fetchLocations, fetchBrands, fetchStores, fetchStore, fetchStoreHours, fetchStoreMenus) never mutate; setLocationHours and setLocationSpecialHours write a location you own.

Whether a storefront is currently taking orders is not in this section. fetchStoreStatuses, pauseStores, unpauseStores and the store.status.changed webhook are in the Store status section. This section describes what you operate. That one describes whether it is open right now, and whether the platform agrees.