Inventory

Record an authorized stock change

POST
/inventory/{id}/adjustments

Record an authorized stock change. Requires the MANAGER role. Idempotent: send an Idempotency-Key.

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.

Idempotency-Key*string

A unique key per user action; retries with the same key return the first result.

Length8 <= length <= 128

Request Body

application/json

An authorised stock change with a reason.

An authorised stock change with a reason.

quantity_delta*integer
Range-1000000 <= value <= 1000000
reason*string

Reason given by the person making the change.

Value in

  • "COUNT_CORRECTION"
  • "WASTE"
  • "CONSUMPTION"
  • "MANUAL_RECEIPT"
note?string

Optional note.

Lengthlength <= 500
expected_on_hand?integer
Range0 <= value <= 10000000

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/inventory/0f8fad5b-d9cb-469f-a165-70867728950e/adjustments" \  -H "X-Requested-With: quartermaster" \  -H "Idempotency-Key: 3b8c2c1e-6f6d-4a59-9a43-8f0c2a9e1d22" \  -H "Content-Type: application/json" \  -d '{    "quantity_delta": -20,    "reason": "WASTE",    "note": "Damaged sleeve"  }'
{  "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  }}