Warehouse 0.5.4: Read and change stock through API keys
Warehouse 0.5.4 lets other systems read and change stock through PhoenixKit API keys, with five tools: warehouse.list_locations, warehouse.get_stock, warehouse.receive_stock, warehouse.set_stock and warehouse.issue_stock.
The three write tools each create and post one document (a goods receipt, a stocktake or a goods issue) with up to 500 lines. A request is all or nothing: if any line is wrong, every problem is reported and nothing is posted, and an issue lists every line that is short. A dry run previews a request, and a caller’s own document number in external_ref makes a retry harmless. A large request can be held until a person confirms it. Each posted document gets an Activity entry.
The tools need a PhoenixKit core that ships the API tool registry, and the write tools also need its confirmation flow. On an older core the module offers the read tools or none, and nothing else changes.
Full release notes: Warehouse 0.5.4
0.5.4 · 17 October 2026
Added
- Warehouse admin API tools (#36) — five tools offered to API keys through
api_tools/0:warehouse.list_locationsandwarehouse.get_stock(read), andwarehouse.receive_stock,warehouse.set_stockandwarehouse.issue_stock(one document with up to 500 lines, created and posted in one transaction). Atomic: every problem of a request is reported and nothing is posted if any line is wrong;issue_stocklists every short line.dry_runpreviews, an Activity entry per posted document (via: api) andexternal_refretries answered from the posted document are included; see the README. The tools need a core that ships the tool registry; the write tools also need its confirmation flow. On an older coreapi_tools/0offers the read tools or none, and nothing else changes. :source_refsaccepted bycreate_and_post/2and aresulting_quantityrecorded on receipt lines that moved stock (#36).- Activity entries for posted goods receipts and goods issues
(
warehouse.goods_receipt.posted,warehouse.goods_issue.posted) when posted through the API (#36).
Fixed
- A retry of a posted
external_refwith a trashed product could hide a changed request — a changed quantity, unit value or duplicate on another line was answeredskipped. The retry now recovers the missing product from the posted document and compares every line; an unchanged retry is still answeredskippedwith anexternal_ref_lines_unverifiedeffect. - An unknown
external_idpassed for a stored product on such a retry. A missing ref must now match a stored UUID, a unique stored SKU or a unique stored external ID; documents posted through the API keep the external ID of each line. For older documents retry with the product UUID. mix precommitwas red against the published core (dialyzer could not findPhoenixKit.API.Tool.new!/1); a justified ignore forapi.excovers it.
Warehouse 0.5.4. Install or update: {:phoenix_kit_warehouse, "~> 0.5"}, then mix deps.get && mix phoenix_kit.update. Full history: CHANGELOG.