接口 cabinet.product.replenish
接口说明
自取柜商品补货接口,用于补货员对自取柜进行商品补货操作
业务参数
| 参数名称 |
类型 |
是否必须 |
说明 |
| cid |
string |
Y |
自取柜 ID |
| productList |
array |
Y |
补货商品列表 |
| isUpdateCapacity |
number |
N |
是否更新货道容量,1:更新,0:不更新,默认 1 |
| location |
array |
N |
补货位置坐标 [经度, 纬度],默认 [0, 0] |
| accountId |
string |
Y |
补货员 ID |
productList 数组元素说明
| 参数名称 |
类型 |
是否必须 |
说明 |
| BarCode |
string |
Y |
商品条码(支持 BarCode) |
| ProviderProductID |
string |
N |
第三方供应商商品 ID |
| Stock |
number |
Y |
补货数量,范围 0-1000 补货后柜子内商品数量 |
请求示例
{
"cid": "6512e7feaf643c001041ed06",
"productList": [
{
"BarCode": "4891599338393",
"ProviderProductID": "4891599338393",
"Stock": 7
},
{
"BarCode": "6926265305381",
"ProviderProductID": "6926265305381",
"Stock": 0
}
],
"accountId": "5d5619bbf756f30011367eeb"
}
返回示例
成功返回
{
"error_code": 0,
"error_msg": "SUCCESS",
"sub_error_code": null,
"sub_error_msg": null,
"data": {
"UpdatedAt": 1760090616,
"CreateAt": 1760090616,
"Location": [0, 0],
"Videos": [],
"VideosReportMsg": "",
"Remark": "",
"CargoImageList": [],
"ImageList": [],
"BizType": 0,
"TotalSupplementQuantity": 1,
"TotalStock": 8,
"ProductList": [
{
"BarCode": "4891599338393",
"ProviderProductID": "4891599338393",
"BeforeStock": 7,
"Stock": 8
}
],
"ReceiptNo": "CSBH2025101078059",
"AccountID": "5d5619bbf756f30011367eeb",
"CID": "6512e7feaf643c001041ed06",
"OID": "660641dae4f5df001010f240",
"id": "68e8d9f83f8f08001531133d"
}
}
失败返回
{
"error_code": -1,
"error_msg": "ERR_BARCODE_OUTSTOCK",
"data": "6926265305381"
}
返回字段说明
| 字段名称 |
类型 |
说明 |
| id |
string |
补货记录 ID |
| ReceiptNo |
string |
补货单号 |
| OID |
string |
运营商 ID |
| CID |
string |
自取柜 ID |
| AccountID |
string |
补货员账户 ID |
| TotalSupplementQuantity |
number |
本次补货总数量 |
| TotalStock |
number |
补货后总库存 |
| ProductList |
array |
补货商品明细列表 |
| BizType |
number |
业务类型 |
| Location |
array |
补货位置坐标 [经度, 纬度] |
| CreateAt |
number |
创建时间戳(秒) |
| UpdatedAt |
number |
更新时间戳(秒) |
| ImageList |
array |
图片列表 |
| CargoImageList |
array |
货物图片列表 |
| Videos |
array |
视频列表 |
| Remark |
string |
备注 |
ProductList 数组元素说明
| 字段名称 |
类型 |
说明 |
| BarCode |
string |
商品条码 |
| ProviderProductID |
string |
第三方供应商商品 ID |
| BeforeStock |
number |
补货前库存 |
| Stock |
number |
补货后库存 |
错误代码
| error_msg |
描述 |
data 字段 |
| 缺少参数cid |
未提供自取柜 ID |
- |
| 缺少参数accountId |
未提供补货员账户 ID |
- |
| 缺少参数productList |
未提供补货商品列表 |
- |
| 商品 {barCode} 的库存数量必须在0-1000之间 |
商品库存数量超出允许范围 |
- |
| ERR_BARCODE_OUTSTOCK |
补货员商品库存不足 |
错误的商品条码 |