# 获取达人橱窗商品列表
接口应在服务器端调用,不可在前端(小程序、网页、APP等)直接调用,具体可参考接口调用指南
接口英文名:get_product_list
通过该接口可获取达人橱窗的商品列表
# 1. 调用方式
# HTTPS 调用
POST https://api.weixin.qq.com/channels/ec/talent/window/product/list/get?access_token=ACCESS_TOKEN
# 云调用
- 本接口不支持云调用
# 第三方调用
本接口支持第三方平台代商家调用。
该接口所属的权限集 id 为:189
服务商获得其中之一权限集授权后,可通过使用 authorizer_access_token 代商家进行调用,具体可查看 第三方调用 说明文档。
# 2. 请求参数
# 查询参数 Query String parameters
参数名 | 类型 | 必填 | 示例 | 说明 |
---|---|---|---|---|
access_token | string | 是 | ACCESS_TOKEN | 接口调用凭证,可使用 access_token、authorizer_access_token |
# 请求体 Request Payload
参数名 | 类型 | 必填 | 说明 |
---|---|---|---|
page_size | number | 是 | 单页商品数(不超过500) |
page_index | number | 否 | 页面下标,下标从1开始 (不可以与last_buffer一起填写) |
last_buffer | string | 否 | 由上次请求返回,顺序翻页时需要传入, 会从上次返回的结果往后翻一页(不可以与page_index一起填写) |
# 3. 返回参数
# 返回体 Response Payload
参数名 | 类型 | 说明 |
---|---|---|
errcode | number | 错误码 |
errmsg | string | 错误信息 |
products | objarray | products |
last_buffer | string | 本次翻页的上下文,用于顺序翻页请求 |
# Res.products(Array) Object Payload
products
参数名 | 类型 | 说明 |
---|---|---|
product_id | number | 橱窗商品id |
appid | string | 对于自营商品会返回,代表商品来源店铺的appid |
product_source | number | 对于带货商品会返回, 代表商品在货源小店中的商品id |
out_product_id | string | 商品来源,枚举值详情请参考下文 |
# 4. 注意事项
接口限制了 page_size × page_index ≤ 10000。命中限制时建议改用传last_buffer顺序翻页的请求方式。
商品来源
枚举值 | 解释 |
---|---|
1 | 来源店铺的自营商品 |
2 | 来源选品中心的带货商品 |
# 5. 代码示例
请求示例
// page_index 方式请求
{
"page_size": 1,
"page_index": 1
}
// last_buffer 方式请求
{
"page_size": 1,
"last_buffer": "abcdefg"
}
返回示例
{
"errcode": 0,
"errmsg": "ok",
"products": [
{ // 来自自营店铺的商品
"product_id": "1000000000000",
"appid": "wxee9f94a33abcdefg",
"product_source": 1
},
{ // 带货商品
"product_id": "14000000000000",
"out_product_id": "100000012356",
"product_source": 2
}
],
"last_buffer": "EB4YAg="
}
# 6. 错误码
以下是本接口的错误码列表,其他错误码可参考 通用错误码
错误码 | 错误描述 | 解决方案 |
---|---|---|
10200003 | 请求参数 page_size 超过限制 | |
10200004 | 请求参数 page_index 与 last_buffer 同时存在 | |
10200005 | 请求参数 page_size × page_index 超过限制 |
# 7. 适用范围
本接口支持「带货助手(需申请)」账号类型调用。其他账号类型如无特殊说明,均不可调用。