Skip to content

Inventory & stock

Org-level stock management (not shop catalog).

List inventory

GET /api/v2/public/orgs/{orgId}/inventory
Authorization: Bearer {token}

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

{ "status": "ok", "id": "log-entry-uuid" }

Stock cannot go below zero.


Stock change log

GET /api/v2/public/orgs/{orgId}/inventory/{p1Id}/log
Authorization: Bearer {token}

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

GET /api/v2/public/orgs/{orgId}/inventory/{p1Id}/history?days=30
Authorization: Bearer {token}

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:

  1. GET /inventory — snapshot current stock.
  2. On sale in POS → POST /inventory/adjust with negative delta_on_hand.
  3. On delivery → positive delta_on_hand.
  4. Subscribe to low_stock / out_of_stock webhooks for alerts.

Before assigning products to shops, add catalog items with POST /products/add-to-inventory and ensure stock > 0 — see Shops & products.