跳转到内容
返回官网

代发-获取商品列表

微信供货商

获取微信供应商的商品列表

一、接口名称

  • 接口地址:https://kf.fw199.com/gateway/wxstore/df/supply/product/list

  • 请求方式:POST

  • Content-Type:application/x-www-form-urlencoded

二、请求参数

公共参数

参数名类型是否必需说明
appidstring必需开发者 appid
timestampstring必需时间戳(秒)
signstring必需参数签名,算法见蜂巢接入指南

业务参数

参数名类型是否必需说明
seller_nickstring必需供货商 ownerId / username(订单宝授权店铺标识)
sysidstring固定传 `551`(微信小店供货商代发)
page_sizestring每页数量,默认 `10`,最大 `30`
next_keystring翻页游标;首页传空,后续传上次响应中的 `next_key`
statusstring商品状态筛选;不传则拉全部。`0` 初始值,`5` 上架,`6` 回收站,`11` 下架
is_demostring传 `1` 时返回固定演示数据. 仅用于测试.

三、请求示例代码

Java

三(一)、正常查询

@Test
public void wxstoreDfSupplyProductList() throws Exception {
String apiUrl = "https://kf.fw199.com/gateway/wxstore/df/supply/product/list";
Map<String, String> data = new HashMap<>();
data.put("appid", Config.AppId);
Long timestamp = System.currentTimeMillis() / 1000;
data.put("timestamp", timestamp.toString());
data.put("seller_nick", "your_owner_id");
data.put("sysid", "551");
data.put("page_size", "10");
data.put("next_key", "");
data.put("status", "5");
data.put("sign", Utils.Sign(data, Config.AppSecret));
String result = doHttpRequest(apiUrl, data);
System.out.println("result:" + result);
}

四、返回结果

说明:最外层 code0 表示蜂巢接口调用成功,非 0 为失败,message 包含失败原因。data 为商品列表分页结果。

四(一)、成功示例

{
"code": 0,
"message": "ok",
"data": {
"product_ids": [
10001260878553,
10000741839533
],
"next_key": "CKa1zdMGEK3lqNWHowI=",
"total_num": 2
},
"trace_id": "4cbf9022-adf7-4c9b-ad93-c92211030ec5"
}

四(二)、data 字段说明

参数名类型说明
product_idsarray[number]当前页商品 ID 列表
next_keystring下一页翻页游标;为空表示无更多数据
total_numnumber符合条件的商品总数

四(三)、蜂巢层失败示例

{
"code": 20,
"message": "获取供货商商品列表失败,..."
}