Stock endpoints
| Method & path | Body / query | Permission | |||
|---|---|---|---|---|---|
GET /stock/movements | page, page_size, movement_type, status, item_id, warehouse_id, from, to, search | stock.read | |||
GET /stock/movements/:id | header, lines, ledger effects, attachments, links (purchase_order_id, work_order_id) | stock.read | |||
POST /stock/movements | `movement_type (receipt | issue | transfer | adjustment), movement_date, reference?, reason?, lines[{ item_id, from_warehouse_id?, to_warehouse_id?, quantity, unit_cost? }]` → draft | stock.post |
PUT /stock/movements/:id | same as create (drafts only — movement_not_draft) | stock.post | |||
POST /stock/movements/:id/post | idempotency_key | stock.post | |||
POST /stock/movements/:id/cancel | — (drafts only) | stock.post | |||
GET /stock/balances | item_id?, warehouse_id?, search?, low_stock? | stock.read | |||
GET /stock/items/:itemId/history | page, page_size | stock.read | |||
GET /dashboard/summary | { stock_value, open_jobs, jobs_due_this_week, active_items, has_data } | stock.read | |||
GET /dashboard/recent-movements?limit= · GET /dashboard/recent-jobs?limit= · GET /dashboard/movements-per-day?days= | — | stock.read / jobs.read |
Business rules enforced: no negative stock (insufficient_stock), unit cost on receipts (unit_cost_required), reason on issues and adjustments (issue_requires_reason), immutability after posting (movement_immutable), key reuse with a different payload (idempotency_key_reused).
Last updated