Inventory

Add a stock item

POST
/inventory

Add a stock item. Requires the MANAGER role.

Authorization

__Host-qm_session<token>

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

In: cookie

Header Parameters

X-Requested-With*string

CSRF guard: must be quartermaster on every mutation.

Request Body

application/json

A new stock item, including its opening on-hand count.

A new stock item, including its opening on-hand count.

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[]
on_hand?integer

Units currently in stock.

Range0 <= value <= 10000000
Default0

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/inventory" \  -H "X-Requested-With: quartermaster" \  -H "Content-Type: application/json" \  -d '{    "sku": "BEV-COLA-CAN",    "name": "Cola cans",    "category": "beverages",    "unit": "each",    "on_hand": 48,    "safety_stock": 24,    "coverage_days": 4,    "search_query": "cola soda cans 24 pack",    "keywords": [      "cola",      "soda"    ]  }'
{  "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  }}