文档中心 > API类目 > 五道口API

taobao.wdk.inventory.sync (同步五道口库存信息)

提供第三方DC系统同步库存信息到五道口进行对账

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
inventory Inventory 可选 库存
  • └ dc_code
  • String
  • 可选
  • 51
  • 盒马分配给DC的组织编码
  • inventory_items
  • InventoryItem []
  • 可选
  • 库存明细
  • inventory_batches
  • InventoryBatch []
  • 可选
  • 库存批次明细
  • └ batch_count
  • String
  • 可选
  • 5.0000
  • 批次对应的数量,支持4为小数点
  • └ batch_date
  • String
  • 可选
  • 2017-03-08
  • 库存对应的生产日期
  • └ batch_no
  • String
  • 可选
  • aaaabbbb170324-001
  • 库存的批次号
  • └ item_code
  • String
  • 可选
  • 130800500100
  • 盒马系统中的商品编码
  • └ item_count
  • String
  • 可选
  • 5.0000
  • 批次数量的合计,支持4为小数点
  • └ management_code
  • String
  • 可选
  • 01
  • 管理部门编码,DC一般分:01-良品、02-退货、03-坏货部
  • └ merchant_code
  • String
  • 可选
  • HM
  • 盒马平台定义的商家编码
  • └ occur_date
  • String
  • 可选
  • 2017-03-08
  • 业务发生日期
  • └ page_size
  • Number
  • 可选
  • 100
  • 每页记录数
  • └ current_page
  • Number
  • 可选
  • 1
  • 当前第几页
  • └ total_page
  • Number
  • 可选
  • 10
  • 总页数
  • └ total_items
  • Number
  • 可选
  • 1000
  • items总记录数

响应参数

名称 类型 示例值 描述
result WdkResult wdkResult 业务处理结果
  • └ result_code
  • String
  • success
  • 结果码
  • └ result_message
  • String
  • 成功
  • 结果码中文描述
  • └ success
  • Boolean
  • true
  • 是否业务处理成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
WdkInventorySyncRequest req = new WdkInventorySyncRequest();
WdkInventorySyncRequest.Inventory obj1 = new WdkInventorySyncRequest.Inventory();
obj1.setDcCode("51");
List<WdkInventorySyncRequest.InventoryItem> list3 = new ArrayList<WdkInventorySyncRequest.InventoryItem>();
WdkInventorySyncRequest.InventoryItem obj4 = new WdkInventorySyncRequest.InventoryItem();
list3.add(obj4);
List<WdkInventorySyncRequest.InventoryBatch> list7 = new ArrayList<WdkInventorySyncRequest.InventoryBatch>();
WdkInventorySyncRequest.InventoryBatch obj8 = new WdkInventorySyncRequest.InventoryBatch();
list7.add(obj8);
obj8.setBatchCount("5.0000");
obj8.setBatchDate("2017-03-08");
obj8.setBatchNo("aaaabbbb170324-001");
list5.setInventoryBatches(list7);
obj4.setItemCode("130800500100");
obj4.setItemCount("5.0000");
obj1.setInventoryItems(list3);
obj1.setManagementCode("01");
obj1.setMerchantCode("HM");
obj1.setOccurDate("2017-03-08");
obj1.setPageSize(100L);
obj1.setCurrentPage(1L);
obj1.setTotalPage(10L);
obj1.setTotalItems(1000L);
req.setInventory(obj1);
WdkInventorySyncResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
7
<wdk_inventory_sync_response>
    <result>
        <result_code>success</result_code>
        <result_message>成功</result_message>
        <success>true</success>
    </result>
</wdk_inventory_sync_response>

异常示例

  • XML示例
  • JSON示例
1
2
3
4
5
6
<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

返回
顶部