Bestand & Lager¶
Bestandsverwaltung auf Organisationsebene (nicht Shop-Katalog).
Bestand auflisten¶
Bereich: inventory.read
Antwort¶
{
"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"
}
]
}
Bestand anpassen¶
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" }
}
Bereich: inventory.write
| Feld | Pflicht | Beschreibung |
|---|---|---|
p1_id |
Ja | Produkt-ID |
reason |
Ja | Grund für Audit-Log |
delta_on_hand |
Nein | Änderung verfügbarer Menge (negativ = Abgang) |
delta_incoming |
Nein | Änderung erwarteter Menge |
shop_id |
Nein | Optionaler Kontext für Log-Eintrag |
metadata |
Nein | Beliebiges JSON im Log |
Antwort¶
Bestand kann nicht unter null fallen.
Bestandsänderungs-Log¶
Bereich: inventory.read
Bis zu 200 letzte Einträge:
{
"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"
}
]
}
Produkt muss zum Org-Bestand gehören (sonst 404).
Bestandshistorie¶
Bereich: inventory.read
| Query | Standard | Max | Beschreibung |
|---|---|---|---|
days |
30 |
365 |
Rückblickzeitraum |
Tägliche Bestandsänderungen aggregiert aus inventory_log.
Workflow: POS-Sync¶
Typischer Integrationsablauf:
GET /inventory— aktuellen Bestand abrufen.- Bei Verkauf im POS →
POST /inventory/adjustmit negativemdelta_on_hand. - Bei Lieferung → positives
delta_on_hand. - Webhooks
low_stock/out_of_stockfür Alarme abonnieren.
Vor Shop-Zuordnung: Katalogartikel mit POST /products/add-to-inventory hinzufügen und Bestand > 0 sicherstellen — siehe Shops & Produkte.