第13章:库存
13.1 拉取SKU库存
13.1.1 接口说明
支持分页拉取SKU库存信息。可以根据SKU、仓库编码、库存类型等条件查询库存信息。
13.1.2 请求信息
- 接口地址:
POST /onixport/api/wms/inventory/sku/list - 请求方式:POST
- Content-Type:application/json
13.1.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| skuList | Array | 否 | SKU列表,可以根据SKU查询对应的库存信息,单次请求最多允许100个SKU查询,超过100个则丢弃 |
| warehouseCode | String | 否 | 仓库编码,可以根据仓库编码查询库存信息 |
| inventoryType | Integer | 否 | SKU库存类型:1:New;2:Refurbished;3:Recycle |
| current | Integer | 否 | 当前页号,默认值为1 |
13.1.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | Array | 否 | SKU库存信息列表 |
| result[].warehouseCode | String | 是 | 仓库编码 |
| result[].warehouseName | String | 是 | 仓库名称 |
| result[].sku | String | 是 | SKU |
| result[].commodityName | String | 是 | 品名 |
| result[].inventoryType | Integer | 是 | 库存类型:1:New;2:Refurbished;3:Recycle |
| result[].inventoryTypeDesc | String | 是 | 库存类型描述 |
| result[].availableQty | Integer | 是 | 可用库存 |
| result[].frozenQty | Integer | 是 | 占用库存 |
| result[].totalQty | Integer | 是 | 总库存 |
| pagination | Object | 否 | 分页信息 |
| pagination.current | Integer | 是 | 当前页码 |
| pagination.pageSize | Integer | 是 | 每页条数,默认100 |
| pagination.total | Long | 是 | 数据总条数 |
13.1.5 请求示例
{
"skuList": ["SKU123456", "SKU123457"],
"warehouseCode": "W1",
"inventoryType": 1,
"current": 1
}
13.1.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": [
{
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"availableQty": 1200,
"frozenQty": 200,
"totalQty": 1400
},
{
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"sku": "SKU123457",
"commodityName": "iPhone 15 Pro Case",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"availableQty": 800,
"frozenQty": 100,
"totalQty": 900
}
],
"pagination": {
"current": 1,
"pageSize": 100,
"total": 2
}
}
失败响应
{
"success": false,
"errorCode": 1000,
"errorMsg": "无效的参数",
"result": null
}
13.1.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
13.1.8 注意事项
1. 单次请求最多支持100个SKU查询,超过限制的SKU将被丢弃
2. 支持分页查询,默认每页100条,当前页号默认为1
3. 可以根据SKU、仓库编码、库存类型等条件组合查询
4. 总库存 = 可用库存 + 占用库存
13.2 拉取序列号库存
13.2.1 接口说明
支持分页拉取序列号库存信息。可以根据序列号、SKU、仓库编码、库存类型等条件查询序列号库存信息。
13.2.2 请求信息
- 接口地址:
POST /onixport/api/wms/inventory/sn/list - 请求方式:POST
- Content-Type:application/json
13.2.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| serialNoList | Array | 否 | 序列号列表,可以根据序列号查询对应的库存信息,单次请求最多允许100个序列号查询,超过100个则丢弃 |
| skuList | Array | 否 | SKU列表,可以根据SKU查询对应的库存信息,单次请求最多允许100个SKU查询,超过100个则丢弃 |
| warehouseCode | String | 否 | 仓库编码,可以根据仓库编码查询库存信息 |
| inventoryType | Integer | 否 | SKU库存类型:1:New;2:Refurbished;3:Recycle |
| current | Integer | 否 | 当前页号,默认值为1 |
13.2.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | Array | 否 | 序列号库存信息列表 |
| result[].warehouseCode | String | 是 | 仓库编码 |
| result[].warehouseName | String | 是 | 仓库名称 |
| result[].sku | String | 是 | SKU |
| result[].commodityName | String | 是 | 品名 |
| result[].serialNo | String | 是 | 序列号 |
| result[].inventoryType | Integer | 是 | 库存类型:1:New;2:Refurbished;3:Recycle |
| result[].inventoryTypeDesc | String | 是 | 库存类型描述 |
| result[].inboundDate | String | 是 | 入库日期,格式:MM/dd/yyyy |
| result[].storageDays | Integer | 是 | 在仓天数 |
| result[].availableQty | Integer | 是 | 可用库存 |
| pagination | Object | 否 | 分页信息 |
| pagination.current | Integer | 是 | 当前页码 |
| pagination.pageSize | Integer | 是 | 每页条数,默认100 |
| pagination.total | Long | 是 | 数据总条数 |
13.2.5 请求示例
{
"serialNoList": ["SN001234567890", "SN001234567891"],
"skuList": ["SKU123456"],
"warehouseCode": "W1",
"inventoryType": 1,
"current": 1
}
13.2.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": [
{
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"serialNo": "SN001234567890",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"inboundDate": "10/10/2025",
"storageDays": 100,
"availableQty": 1
},
{
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"serialNo": "SN001234567891",
"inventoryType": 1,
"inventoryTypeDesc": "New",
"inboundDate": "10/11/2025",
"storageDays": 99,
"availableQty": 1
}
],
"pagination": {
"current": 1,
"pageSize": 100,
"total": 2
}
}
失败响应
{
"success": false,
"errorCode": 1000,
"errorMsg": "无效的参数",
"result": null
}
13.2.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
13.2.8 注意事项
1. 单次请求最多支持100个序列号或100个SKU查询,超过限制的将被丢弃
2. 支持分页查询,默认每页100条,当前页号默认为1
3. 可以根据序列号、SKU、仓库编码、库存类型等条件组合查询
4. 序列号库存的可用库存通常为1(每个序列号对应一个货物)
13.3 拉取退货库存
13.3.1 接口说明
支持分页拉取退货库存信息。可以根据序列号、SKU、仓库编码、库存类型等条件查询退货库存信息。
13.3.2 请求信息
- 接口地址:
POST /onixport/api/wms/inventory/returned/list - 请求方式:POST
- Content-Type:application/json
13.3.3 请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| serialNoList | Array | 否 | 序列号列表,可以根据序列号查询对应的退货库存信息,单次请求最多允许100个序列号查询,超过100个则丢弃 |
| skuList | Array | 否 | SKU列表,可以根据SKU查询对应的退货库存信息,单次请求最多允许100个SKU查询,超过100个则丢弃 |
| warehouseCode | String | 否 | 仓库编码,可以根据仓库编码查询退货库存信息 |
| inventoryType | Integer | 否 | SKU库存类型:1:Returned; 2:New; 3:Refurbished; 4:Recycle; 5:Repairing |
| current | Integer | 否 | 当前页号,默认值为1 |
13.3.4 响应参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| success | Boolean | 是 | 请求是否成功 |
| errorCode | Integer | 否 | 错误码。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| errorMsg | String | 否 | 错误信息。当 success=true 时,该字段为 null;当 success=false 时,该字段有值 |
| result | Array | 否 | 退货库存信息列表 |
| result[].warehouseCode | String | 是 | 仓库编码 |
| result[].warehouseName | String | 是 | 仓库名称 |
| result[].sku | String | 是 | SKU |
| result[].commodityName | String | 是 | 品名 |
| result[].serialNo | String | 是 | 序列号 |
| result[].inventoryType | Integer | 是 | 库存类型:1:Returned; 2:New; 3:Refurbished; 4:Recycle; 5:Repairing |
| result[].inventoryTypeDesc | String | 是 | 库存类型描述 |
| pagination | Object | 否 | 分页信息 |
| pagination.current | Integer | 是 | 当前页码 |
| pagination.pageSize | Integer | 是 | 每页条数,默认100 |
| pagination.total | Long | 是 | 数据总条数 |
13.3.5 请求示例
{
"serialNoList": ["SN001234567890"],
"skuList": ["SKU123456"],
"warehouseCode": "W1",
"inventoryType": 1,
"current": 1
}
13.3.6 响应示例
成功响应
{
"success": true,
"errorCode": null,
"errorMsg": null,
"result": [
{
"warehouseCode": "W1",
"warehouseName": "LA Warehouse",
"sku": "SKU123456",
"commodityName": "iPhone 15 Case",
"serialNo": "SN001234567890",
"inventoryType": 1,
"inventoryTypeDesc": "Returned"
}
],
"pagination": {
"current": 1,
"pageSize": 100,
"total": 1
}
}
失败响应
{
"success": false,
"errorCode": 1000,
"errorMsg": "无效的参数",
"result": null
}
13.3.7 错误码说明
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| 1000 | 无效的参数 | 检查请求参数是否完整、格式正确 |
13.3.8 注意事项
1. 单次请求最多支持100个序列号或100个SKU查询,超过限制的将被丢弃
2. 支持分页查询,默认每页100条,当前页号默认为1
3. 可以根据序列号、SKU、仓库编码、库存类型等条件组合查询
4. 退货库存信息包含序列号,用于追踪具体的退货货物
13.4 库存类型说明
13.4.1 SKU库存类型
| 类型码 | 类型描述 | 说明 |
|---|---|---|
| 1 | New | 新品 |
| 2 | Refurbished | 翻新 |
| 3 | Recycle | 回收 |
13.4.2 退货库存类型
| 类型码 | 类型描述 | 说明 |
|---|---|---|
| 1 | Returned | 退货 |
| 2 | New | 新品 |
| 3 | Refurbished | 翻新 |
| 4 | Recycle | 回收 |
| 5 | Repairing | 维修中 |
13.5 库存字段说明
13.5.1 SKU库存字段
| 字段名 | 说明 |
|---|---|
| availableQty | 可用库存,可以用于出库的库存数量 |
| frozenQty | 占用库存,已被订单占用但尚未出库的库存数量 |
| totalQty | 总库存,总库存 = 可用库存 + 占用库存 |
13.5.2 序列号库存字段
| 字段名 | 说明 |
|---|---|
| serialNo | 序列号,唯一标识每个货物 |
| inboundDate | 入库日期,格式:MM/dd/yyyy |
| storageDays | 在仓天数,从入库日期到当前日期的天数 |
| availableQty | 可用库存,序列号库存通常为1 |
13.5.3 退货库存字段
| 字段名 | 说明 |
|---|---|
| serialNo | 序列号,用于追踪具体的退货货物 |
| inventoryType | 库存类型,表示退货货物的处理状态 |
13.6 分页说明
所有库存查询接口均支持分页,分页参数说明:
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| current | Integer | 否 | 当前页号,默认值为1,从1开始 |
| pageSize | Integer | 否 | 每页条数,默认值为100(系统默认,请求参数中不传递) |
注意:请求参数中只需要传递 current(当前页号),pageSize 由系统默认设置为100。如需调整每页条数,请联系技术支持。