WMS 入库 API
最后更新 2026-10-13
创建与查询入库单、收货行确认、一键收货与收货任务。
创建入库单#
POST /api/wms/inbound-receipts
{
"warehouse_id": "<uuid>", // required
"source_type": "purchase", // required: purchase|manual|portal|drayage|return
"source_id": "<purchase-order-uuid>", // required when source_type=purchase
"merchant_id": "<uuid>", // optional (auto-filled in standard edition)
"container_no": "MSKU1234567",
"seal_no": "S98765",
"vendor_id": "<uuid>",
"expected_date": "2026-10-20",
"title": "货权标识(缺省为 merchant 名)",
"lines": [
{ "item_id": "<uuid>", "expected_qty": 100, "uom": "CTN", "lot_no": "LOT-001" }
]
}- source_type 取值:purchase / manual / portal / drayage / return。
- 返回 data 中包含系统生成的单号 receipt_no(RCPT-YYYYMMDD-XXXX)。
- 权限:wms.inbound.create。
查询入库单#
GET /api/wms/inbound-receipts?q=MSKU1234567&status=receiving&warehouse_id=<uuid>&page=1&page_size=20
GET /api/wms/inbound-receipts/<id> // lines + receiving progress + item names收货行确认#
POST /api/wms/inbound-receipts/<receipt-id>/receive-line
{
"receipt_line_id": "<uuid>", // required
"received_qty": 98, // required, >= 0
"damaged_qty": 2,
"rejected_qty": 0,
"location_id": "<uuid>", // required (may be empty for cross-dock)
"lot_no": "LOT-001",
"manufacture_date": "2026-09-01",
"expiry_date": "2027-09-01",
"serial_nos": ["SN-001", "SN-002"],
"is_cross_dock": false,
"condition": "good", // good | damaged
"allow_over_receive": false,
"note": "外箱轻微破损"
}- 批次/效期/序列号强制校验(v2)。
- 桌面一键收货:POST /api/wms/inbound-receipts/[id]/receive-all,Body 为 { lines: [{ line_id, received_qty, location_id }] }。
- 完成收货:POST /api/wms/inbound-receipts/[id]/complete-receive;关闭入库单:POST /api/wms/inbound-receipts/[id]/close(received → closed,之后不可再改)。
收货任务#
POST /api/wms/receiving-tasks
{
"receipt_id": "<uuid>", // required
"assignee_id": "<uuid>", // optional
"receiving_method": "decide" // palletized | direct | decide (default decide)
}
// idempotent: an existing open task for the receipt returns meta.existing=true
GET /api/wms/tasks?task_type=receive&status=in_progress&warehouse_id=<uuid>&with_progress=1入库单状态机:imported / new → receiving → received → closed。收货行接口要求状态为 new / imported / receiving(checked_in 仅兼容存量)。建收货任务后该单的桌面直接收货会被锁定,需先完成或取消任务。