Inventory

Update a stock item's details (not its quantity)

PUT
/inventory/{id}

Update a stock item's details (not its quantity). Requires the MANAGER role.

Authorization

__Host-qm_session<token>

Session cookie set by sign-in on HTTPS deployments (the hosted demo).

In: cookie

Path Parameters

id*string

Resource id (UUID).

Formatuuid

Header Parameters

X-Requested-With*string

CSRF guard: must be quartermaster on every mutation.

Request Body

application/json

Editable details of a stock item (quantities change through adjustments).

Editable details of a stock item (quantities change through adjustments).

sku*string

Stock-keeping unit code.

Match^[A-Za-z0-9][\w.\-/]*$
Length1 <= length <= 64
name*string

Display name.

Length1 <= length <= 120
category*string

Product category.

Value in

  • "food_packaging"
  • "cleaning_supplies"
  • "cooking_ingredients"
  • "beverages"
  • "kitchen_equipment"
  • "alcohol"
  • "gift_cards"
  • "services"
unit*string

Unit of measure (each, liter, case...).

Length1 <= length <= 24
safety_stock*integer

Units to keep on hand as a buffer.

Range0 <= value <= 10000000
coverage_days*integer

Days of usage an order should cover.

Range1 <= value <= 60
lead_time_days_override?|

Lead time for this item, overriding the supplier's (null = use supplier's).

Defaultnull
preferred_supplier_id?|

Id of the related preferred supplier.

Defaultnull
search_query*string

Phrase used to look up market prices (Channel3).

Length2 <= length <= 200
keywords?array<>

Words that identify this item in natural-language requests.

Itemsitems <= 20
Default[]

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/inventory/0f8fad5b-d9cb-469f-a165-70867728950e" \  -H "X-Requested-With: quartermaster" \  -H "Content-Type: application/json" \  -d '{    "sku": "string",    "name": "string",    "category": "food_packaging",    "unit": "string",    "safety_stock": 0,    "coverage_days": 1,    "search_query": "string"  }'
{  "item": {    "id": "string",    "sku": "string",    "name": "string",    "category": "food_packaging",    "unit": "string",    "on_hand": 0,    "inbound_confirmed": 0,    "committed": 0,    "available": 0,    "avg_daily_usage": 0,    "lead_time_days": 0,    "safety_stock": 0,    "coverage_days": 0,    "reorder_point": 0,    "days_of_cover": 0,    "status": "OK",    "preferred_supplier_id": "string",    "data_source": "CHANNEL3_MARKET",    "search_query": "string",    "keywords": [      "string"    ],    "lead_time_days_override": 0  }}