WMS - InventoryPhiếu nhập/xuất kho
Tạo phiếu nhập/xuất mới
Tạo một phiếu nhập hoặc xuất kho mới
Endpoint
POST /v1/productreceipts
Quyền:
inventory.add(scoped theowarehouse_id). Nếustatus = 9(Hoàn thành), cần thêm quyềninventory.statuscomplete.
Request Payload
JSON Object Payload:
{
"company_id": 1,
"creator_id": 101,
"warehouse_id": 10,
"direction": 3,
"type": 1,
"status": 1,
"identifier": "PNK-2023-001",
"shift_id": 0,
"source": 1,
"source_id": 0,
"picking_list_id": 0,
"external_id": "",
"note": "Nhập hàng",
"tag": "import",
"file_id_list": [],
"quantity": 10,
"count_detail": 1,
"details": [
{
"product_variant_id": 201,
"uom_id": 1,
"uom_name": "Cái",
"uom_factor": 1,
"uom_quantity": 10,
"item_quantity": 10,
"item_serial_number": "",
"is_catch_weight": 0,
"weight_sale_mode": 0,
"catch_counting": 0,
"order_detail_id": 0
}
]
}Response Schema
HTTP 201 - JSON Object
Xem ProductReceipt Object Schema
Error Codes
| HTTP | Code | Mô tả |
|---|---|---|
| 422 | error_company_id_required | ID công ty không được để trống |
| 422 | error_creator_id_required | ID người tạo không được để trống |
| 422 | error_not_permission | Không có quyền thêm phiếu tại kho này |
| 422 | error_type_required | Loại phiếu là bắt buộc |
| 422 | error_direction_required | Hướng nhập/xuất là bắt buộc |
| 422 | error_direction_invalid | Hướng nhập/xuất không hợp lệ |
| 422 | error_type_invalid | Loại phiếu không hợp lệ với hướng nhập/xuất |
| 422 | error_warehouse_id_required | ID kho là bắt buộc |
| 422 | error_warehouse_id_invalid | ID kho không hợp lệ |
| 422 | error_detail_required | Chi tiết phiếu là bắt buộc |
| 422 | error_status_invalid | Trạng thái không hợp lệ |
| 422 | error_status_complete_not_allow | Không có quyền hoàn thành phiếu |
| 422 | error_this_api_not_allow_cancel | API này không cho phép hủy phiếu (Dùng API Cancel) |
| 422 | error_item_quantity_required | Số lượng sản phẩm không hợp lệ |
| 422 | error_product_variant_id_is_required | ID biến thể sản phẩm là bắt buộc |
| 422 | error_product_variant_id_invalid | ID biến thể sản phẩm không hợp lệ |
| 422 | error_product_not_found | Sản phẩm không tồn tại |
| 422 | error_add | Lỗi khi thêm phiếu |