Skip to navigation

Delete an empty category

Partner key + restaurant key. A category with active products or subcategories gives 409 CATEGORY_NOT_EMPTY; turn it off with isActive: false instead. If an inactive product in it has order history, the category is turned off instead of deleted (soft: true). Otherwise it is deleted with its inactive products, and addon groups with scope CATEGORY for it are removed with it (removedAddonGroupIds). GET /api/v1/menu is CDN-cached (s-maxage=30, stale-while-revalidate=300, at most 330 seconds), so the website can show the old menu for up to six minutes; the response has notice about it.

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.

categoryIdstringRequired

The category’s id from GET …/menus/{menuId}.

Response

The category is deleted or turned off.
dataobject

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
429
Too Many Requests Error