获取商品列表
微信小店获取商品列表
一、接口名称
接口地址:
https://kf.fw199.com/gateway/wxstore/product/list请求方式:
POSTContent-Type:
application/x-www-form-urlencoded
分页获取微信小店商品 ID 列表。蜂巢完成签名校验、权限校验与扣费后,代理调用订单宝上游接口。
二、请求参数
公共参数
| 参数名 | 类型 | 是否必需 | 说明 |
|---|---|---|---|
| appid | string | 必需 | 开发者 appid |
| timestamp | string | 必需 | 时间戳(秒) |
| sign | string | 必需 | 参数签名,算法见蜂巢接入指南 |
业务参数
| 参数名 | 类型 | 是否必需 | 说明 |
|---|---|---|---|
| seller_nick | string | 必需 | 微信小店店铺 ownerId / username(订单宝授权店铺标识) |
| sysid | string | 否 | 固定传 550(微信小店订单宝) |
| page_size | string | 否 | 每页数量,默认 10,最大 30 |
| next_key | string | 否 | 翻页游标;首页传空,后续传上次响应中的 next_key |
| status | string | 否 | 商品状态筛选;不传则拉全部。0 初始值,5 上架,6 回收站,11 下架 |
说明:
- 调用前需开通权限
wxstore_product_list,且店铺已完成订单宝授权 seller_nick对应上游请求体中的ownerId
三、请求示例代码(Java)
@Test
public void wxstoreProductList() throws Exception {
String apiUrl = "https://kf.fw199.com/gateway/wxstore/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", "550");
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);
}
四、返回结果
说明:最外层 code 为 0 表示蜂巢接口调用成功,非 0 为失败,message 包含失败原因。data 为商品列表分页结果。
4.1 成功示例
{
"code": 0,
"message": "ok",
"data": {
"product_ids": [
10001260878553,
10000741839533
],
"next_key": "CKa1zdMGEK3lqNWHowI=",
"total_num": 2
},
"trace_id": "4cbf9022-adf7-4c9b-ad93-c92211030ec5"
}
4.2 data 字段说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| product_ids | array[number] | 当前页商品 ID 列表 |
| next_key | string | 下一页翻页游标;为空表示无更多数据 |
| total_num | number | 符合条件的商品总数 |
4.3 蜂巢层失败示例
{
"code": 103,
"message": "没有此项权限,请联系客服开通"
}
{
"code": 20,
"message": "获取商品列表失败,..."
}文档更新时间: 2026-08-06 00:53 作者:admin