WMS 库存 API
最后更新 2026-10-13
查询库存余额、库存调整与库位间移动。
查询库存#
GET /api/wms/inventory?warehouse_id=<uuid>&item_id=<uuid>&status=available&page=1&page_size=20
// filters: warehouse_id | location_id | location (code) | item_id | sku | merchant_id | status
// status: available | allocated | hold | damaged | in_transit- 读取 wms_inventory_balance 余额投影(商品 × 库位 × 状态 × 批次)。
- 权限:任一作业域 view 点(inbound / outbound / putaway / picking / packing / cycle_count / transfer / billing)。
库存调整#
POST /api/wms/inventory/adjust
{
"warehouse_id": "<uuid>", // required
"location_id": "<uuid>", // required
"item_id": "<uuid>", // required
"qty_delta": -5, // or qty_after — exactly one is required
"reason_code": "damage", // required, e.g. damage | lost | found
"lot_no": "LOT-001",
"merchant_id": "<uuid>", // required in 3PL edition
"status": "available" // default available
}- qty_after 或 qty_delta 二选一必填。
- 权限点 wms.inventory_adjust 是特殊权限点,必须显式授予。
库存移动#
POST /api/wms/inventory/move
{
"warehouse_id": "<uuid>", // required
"to_location_id": "<uuid>", // required
"pallet_lpn": "LPN-20261013-ABC123", // pallet move…
// …or loose stock move:
// "from_location_id": "<uuid>", "item_id": "<uuid>", "qty": 10, "lot_no": "LOT-001",
"notes": "补货上架"
}调整只写 wms_inventory_ledger 台账(transaction_type=adjust),不直接碰 wms_inventory_balance;余额投影由应用层汇总维护。从被盘点任务锁定的库位移动会报 LOCATION_LOCKED。