Skip to navigation

Change an opening hours override

Partner key + restaurant key. Changes the fields you send. End a period early with { "endDate": "<today>" } (it still applies for the rest of today); an override that has not started is removed with DELETE. With expectedUpdatedAt, a concurrent change gives 409 CHANGED; without it, the first write wins and the second gets 409. No difference gives 200 without a change. Not allowed for an archived restaurant or the demo restaurant.

Authentication

AuthorizationBearer

The partner key (lbp_test_… or lbp_live_…), sent as Authorization: Bearer lbp_… and created in LettBestilt Partner under Partner key. It belongs to the whole partner, not to a restaurant, and only works against /api/v1/partner. Server to server only: a request with an Origin header is rejected with 403 FORBIDDEN, and the key must never be in a browser. A TEST key sees and creates only sandboxes; LIVE keys work once LettBestilt Partner is open. A suspended or archived partner, a revoked key and a restaurant key (lbs_…) here give 401 UNAUTHORIZED; an expired key gives 401 KEY_EXPIRED.

X-LettBestilt-Restaurant-Keystring

The restaurant’s own key (lbs_test_… or lbs_live_…) for calls about one restaurant in the partner API, sent together with the partner key. The key must have full access (scope *, otherwise 403 INSUFFICIENT_SCOPE), belong to a restaurant the partner owns and be in the same environment as the partner key. A restaurant that does not exist, belongs to another partner or does not match the key always gives the same 404 RESTAURANT_NOT_FOUND. Older keys without an environment in the prefix (lbs_<random>) are not accepted here; rotate them in LettBestilt Partner.

Path parameters

slugstringRequired

The restaurant’s slug. It must match the restaurant key in X-LettBestilt-Restaurant-Key.

overrideIdstringRequired

The override’s id from GET …/hours.

Request

This endpoint expects an object.
labelstringOptional1-200 characters
startDatedateOptional

Calendar day in Oslo time, YYYY-MM-DD.

endDatedateOptional
Set it to today to end a period early.
opensAtstring or nullOptionalformat: "^(?:[01]\d|2[0-3]):[0-5]\d$"
closesAtstring or nullOptionalformat: "^(?:[01]\d|2[0-3]):[0-5]\d$"
isClosedbooleanOptional
expectedUpdatedAtdatetimeOptional

updatedAt as you read it. If the override has changed since, the API responds 409 CHANGED.

Response

The override as it is now.
dataobject

An override of the weekly hours for a date period (a public holiday, a holiday, summer hours). Dates are YYYY-MM-DD in Oslo time; endDate is inclusive and cannot be before startDate. isClosed: true closes the whole period; an open override needs both opensAt and closesAt. closesAt before opensAt means open 00:00–closesAt and opensAt–24:00 on each day of the period (e.g. 18:00/02:00 = 00:00–02:00 and 18:00–24:00 on the same day), not a window into the next day. When several overrides cover the same day, the one with the shortest period wins.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
422
Unprocessable Entity Error
429
Too Many Requests Error