Inventory & stock¶
Org-level stock management (not shop catalog).
List inventory¶
Scope: inventory.read
Response¶
{
"data": [
{
"p1_id": 12345,
"name": "Example Strain",
"stockquantity": 50,
"price": 8.99,
"category": "Blüten",
"log_entries": 12,
"last_activity": "2026-06-05T14:00:00Z"
}
]
}
Adjust stock¶
POST /api/v2/public/orgs/{orgId}/inventory/adjust
Authorization: Bearer {token}
Content-Type: application/json
{
"p1_id": "12345",
"delta_on_hand": -2,
"delta_incoming": 0,
"reason": "POS sale",
"shop_id": "shop1",
"metadata": { "pos_ref": "TX-999" }
}
Scope: inventory.write
| Field | Required | Description |
|---|---|---|
p1_id |
Yes | Product id |
reason |
Yes | Audit reason (shown in log) |
delta_on_hand |
No | Change to on-hand qty (negative reduces) |
delta_incoming |
No | Change to incoming qty |
shop_id |
No | Optional context for log entry |
metadata |
No | Arbitrary JSON stored in log |
Response¶
Stock cannot go below zero.
Stock change log¶
Scope: inventory.read
Returns up to 200 recent entries:
{
"data": [
{
"id": "uuid",
"p1_id": 12345,
"shop_id": "shop1",
"delta_on_hand": -2,
"delta_incoming": 0,
"reason": "POS sale",
"created_at": "2026-06-05T14:00:00Z"
}
]
}
Product must belong to org inventory (404 otherwise).
Stock history¶
Scope: inventory.read
| Query | Default | Max | Description |
|---|---|---|---|
days |
30 |
365 |
Lookback period |
Returns daily stock changes aggregated from inventory_log.
Workflow: POS sync¶
Typical integration flow:
GET /inventory— snapshot current stock.- On sale in POS →
POST /inventory/adjustwith negativedelta_on_hand. - On delivery → positive
delta_on_hand. - Subscribe to
low_stock/out_of_stockwebhooks for alerts.
Before assigning products to shops, add catalog items with POST /products/add-to-inventory and ensure stock > 0 — see Shops & products.