OneTablet API Documentation

Set item availability

POST/management/item-availability/setItemAvailability

Mark ONE item available or unavailable at ONE kitchen.

itemId/sku must resolve to an item whose brand this organization owns, and locationId must be one this organization owns or operates a brand out of; anything that does not resolve is a real HTTP error — 404 for an unowned/unknown item or location (indistinguishable by design, same as fetchLocationItems), 400 for a malformed request, 409 for an ambiguous sku. There is no per-pair status: 'failed' result: a failure is never reported inside a 200.

To change an item across many kitchens, discover the scope with fetchLocationItems / fetchStores and call this once per (item, location).

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

Request

application/json
required
  • locationIdstring

    The location (kitchen) to change availability at. Required; absent is 400. Not yours, or not existing, is 404.

  • itemIdstring

    The item to change, by ItemAvailability.itemId. Set exactly one of itemId / sku — both or neither is 400. An item whose brand your organization does not own is 404.

  • skustring

    The item to change, by SKU — the alternate key to itemId; set exactly one of the two. SKUs are not unique: a SKU matching more than one of your items is 409, and nothing is written.

  • availableboolean

    The availability to set: true puts the item back in stock, false marks it unavailable ("86'd") at the location. Required; absent is 400.

Responses

200 — The item's resulting availability at the location.

Headers

  • x-mealco-tx-idstringoptional

    The correlation id for this call, echoed on every response — a 200 exactly as much as a 400, 401 or 500. Quote it when reporting a problem and we can find every log line for the request, in every service it touched. You may also send your own x-mealco-tx-id on the request and we adopt it, so your correlation id becomes ours. Not marked required for one reason: a request whose JSON body is malformed is rejected before it reaches an operation, so no id exists yet and that single response carries neither this header nor the txId field of the error body. Everything that reaches an operation carries it.

  • itemIdstring

    OneTablet's identifier for the item — brand-scoped, stable for that brand's catalogue across every location. What setItemAvailability addresses items by.

    The same id space whether or not isModifier is set — a modifier option is addressed exactly like any other item.

  • skustring

    Stock-keeping unit. NOT unique — an alternate lookup key on setItemAvailability.

  • namestring

    The item's display name.

  • isModifierboolean

    true when this item is configured as a modifier option (e.g. a side or topping added to another item) rather than a standalone menu item. Availability works identically for both.

  • availableboolean

    Current availability at the requested location.

About Item availability

Item availability ("86-ing") — mark one item available or unavailable at one kitchen.

fetchLocationItems and setItemAvailability work as a pair: the write needs the discovery read, because OneTablet's item ids cannot be known in advance.

There is no Idempotency-Key replay on this API: a retried setItemAvailability call re-applies the same value rather than de-duplicating.