文档中心 > API类目 > 淘天仓储API

taobao.logistics.wms.inventory.imbalance.create (仓内库存差异占用)

创建库存差异占用单

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
req_dto WmsInventoryDiscrepancyAllocationReportDto 必须 reqDto
  • └ owner_code
  • String
  • 必须
  • AX5886
  • 货主编码
  • └ warehouse_code
  • String
  • 必须
  • STA
  • 仓库编码
  • └ occupy_order_id
  • String
  • 必须
  • IM1234
  • 服务商系统生成的差异占用单号
  • └ adjust_type
  • String
  • 必须
  • ADJUST
  • 单据类型(本项目会用到的枚举值只有: ADJUST=库存调整占用)
  • └ out_biz_code
  • String
  • 必须
  • 1234567890
  • 外部业务编码(消息ID;用于去重;服务商系统对于同一请求;分配一个唯一性的编码。用来保证因为网络等原因导致重复传输;请求不会被重复处理)
  • └ remark
  • String
  • 可选
  • 是 良转残
  • 备注
  • items
  • WmsInventoryDiscrepancyAllocationItemDto []
  • 必须
  • []
  • 明细信息
  • └ order_line_id
  • String
  • 必须
  • I1234
  • 明细行ID
  • └ item_code
  • String
  • 必须
  • I1234
  • 商品编码
  • └ item_id
  • String
  • 可选
  • CK1234
  • wms商品编码(服务商系统生成的商品编码)
  • └ inventory_type
  • String
  • 必须
  • ZP
  • 库存类型(ZP=正品;CC=残次;JS=机损;XS=箱损;ZT=在途库存;XQC=效期残;ZCC=收货暂存残-待退废;BLC=不良品/一级残次;ZCZP=收货暂存良-待退废;CZC=残值品/二级残次;FP=报废品/三级残次;LQC=临期品;XTZP=销退正品)
  • └ lock_quantity
  • Number
  • 必须
  • 12
  • 占用数量
  • └ batch_code
  • String
  • 可选
  • P1234
  • 批次编号
  • └ product_date
  • String
  • 可选
  • 2016-09-09
  • 生产日期(YYYY-MM-DD)
  • └ expire_date
  • String
  • 可选
  • 2016-09-09
  • 过期日期(YYYY-MM-DD)
  • └ produce_code
  • String
  • 可选
  • P1234
  • 生产批号
  • └ sn_code
  • String
  • 可选
  • S1234
  • sn编码
  • └ extend_props
  • String
  • 可选
  • {}
  • 扩展属性, Map对应的Json
  • └ extend_props
  • String
  • 可选
  • {}
  • 扩展属性, Map对应的Json
  • └ operate_time
  • String
  • 必须
  • 2016-09-09 12:00:00
  • 操作时间(YYYY-MM-DD HH:MM:SS)

响应参数

名称 类型 示例值 描述
spi_result SpiResult spiResult
  • └ success
  • Boolean
  • true
  • 是否成功: true-成功;false-失败
  • └ error_code
  • String
  • ERROR_OWNER_NOT_EXIST
  • 接口错误码
  • └ error_message
  • String
  • 货主不存在
  • 接口错误描述

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
LogisticsWmsInventoryImbalanceCreateRequest req = new LogisticsWmsInventoryImbalanceCreateRequest();
LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationReportDto obj1 = new LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationReportDto();
obj1.setOwnerCode("AX5886");
obj1.setWarehouseCode("STA");
obj1.setOccupyOrderId("IM1234");
obj1.setAdjustType("ADJUST");
obj1.setOutBizCode("1234567890");
obj1.setRemark("是	良转残");
List<LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationItemDto> list3 = new ArrayList<LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationItemDto>();
LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationItemDto obj4 = new LogisticsWmsInventoryImbalanceCreateRequest.WmsInventoryDiscrepancyAllocationItemDto();
list3.add(obj4);
obj4.setOrderLineId("I1234");
obj4.setItemCode("I1234");
obj4.setItemId("CK1234");
obj4.setInventoryType("ZP");
obj4.setLockQuantity(12L);
obj4.setBatchCode("P1234");
obj4.setProductDate("2016-09-09");
obj4.setExpireDate("2016-09-09");
obj4.setProduceCode("P1234");
obj4.setSnCode("S1234");
obj4.setExtendProps("{}");
obj1.setItems(list3);
obj1.setExtendProps("{}");
obj1.setOperateTime("2016-09-09 12:00:00");
req.setReqDto(obj1);
LogisticsWmsInventoryImbalanceCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<logistics_wms_inventory_imbalance_create_response>
    <spi_result>
        <success>true</success>
        <error_code>ERROR_OWNER_NOT_EXIST</error_code>
        <error_message>货主不存在</error_message>
    </spi_result>
</logistics_wms_inventory_imbalance_create_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部