商品接口

接口名称 说明
获取联盟商品类目列表及类目ID 支持联盟开发者通过该接口获取联盟商品的一级类目列表以及类目ID
查询商品详情信息 支持联盟开发者通过该接口获取指定商品的信息(单次最多获取50个商品),支持根据商品关键词(名称、店铺、spuID)、商品价格、商品佣金以及佣金比例进行筛选
获取商品推广素材 通过该接口获取商品的推广素材,包括店铺appID、商品详情页Path、推广文案及推广短链、商品图片、商品小程序码等

1.获取联盟商品类目列表及类目ID

接口说明

通过该接口获取联盟商品的一级类目列表以及类目ID,可用于筛选联盟商品

请求地址

GET https://api.weixin.qq.com/union/promoter/product/category?access_token=ACCESS_TOKEN

请求参数

属性 类型 默认值 必填 说明
access_token string 接口调用凭证

返回值

Object

返回的 JSON 数据包

属性 类型 说明
errcode number 错误码
errmsg string 错误信息
productCats Array.<Object> 类目数据

productCats 的结构

属性 类型 说明
catId string 类目ID
name string 类目名称

返回示例

{
  "errcode": 0,
  "productCats": [
    {
      "catId": "1234",
      "name": "家纺"
    },
    {
      "catId": "1235",
      "name": "家具"
    },
    {
      "catId": "1236",
      "name": "母婴"
    },
  ]
}

2.查询商品详情信息

接口说明

支持开发者根据多种筛选条件获取可供推广的商品列表及详情,筛选条件包括商品关键词(名称、店铺、spuID)、商品价格、商品佣金以及佣金比例

请求地址

GET https://api.weixin.qq.com/union/promoter/product/list?access_token=ACCESS_TOKEN

请求参数

属性 类型 默认值 必填 说明
access_token string 接口调用凭证
from string 偏移
limit string 每页条数
query string 搜索关键词,具体含义与queryType相关
queryType number 0 搜索类型
maxPrice number 商品最高价格,单位分
minPrice number 0 商品最低价格,单位分
minCommissionValue number 0 佣金金额下限,单位分
minCommissionRatio number 0 佣金比例下限,单位万分之一
sortType number 0
categoryId number 类目ID,值来自获取类目列表接口
shopAppIds Array.<string> 小商店AppID列表

queryType 的枚举

类型 说明
0 number 搜索商品名称
1 number 搜索小商店名称
2 number 搜索商品SPU ID

sortType 的枚举

类型 说明
0 number 默认排序
1 number 商品价格升序
2 number 商品价格降序
3 number 佣金比例升序
4 number 佣金比例降序
5 number 佣金数值升序
6 number 佣金数值降序

返回值

属性 类型 说明
errcode number 错误码
errmsg string 错误信息
total number 商品总数
productList Array.<Object> 商品列表数据

productList 的结构

属性 类型 说明
productId string 商品SPU ID
product Object 商品数据
leagueExInfo Object 联盟佣金相关数据
shopInfo Object 商品所属小商店数据

product 的结构

属性 类型 说明
productId string 商品SPU ID
info Object 商品具体信息
info.title string 商品标题
info.subTitle string 商品子标题
info.headImg Array.<string> 商品主图
info.category Array.<string> 商品类目
info.category[].catId Object 类目ID
info.category[].name Object 类目名称
info.brand string 品牌名称
info.brandId string 品牌ID
info.model string 型号
info.detail Object 商品详细数据
info.detail.detailImg Array.<string> 商品详情图片
info.param Array.<Object> 商品参数
info.minPrice number 商品最低价格,单位分
info.totalStockNum number 总库存
skus Array.<Object> 商品SKU
skus[].skuId string 商品SKU ID
skus[].productSkuInfo.thumbImg string 商品SKU 小图
skus[].productSkuInfo.salePrice Object 商品SKU 销售价格,单位分
skus[].productSkuInfo.marketPrice Object 商品SKU 市场价格,单位分
skus[].productSkuInfo.stockInfo.stockNum number 商品SKU 库存

leagueExInfo 的结构

属性 类型 说明
hasCommission number 是否有佣金,1/0
commissionRatio number 佣金比例,万分之一
commissionValue number 佣金金额,单位分

shopInfo 的结构

属性 类型 说明
name number 小商店名称
appId string 小商店AppID
headImgUrl string 小商店店铺头像

返回示例

{
    "errcode": 0,
    "errmsg": "",
    "productList": [
        {
            "productId": "7554942",
            "product": {
                "productId": "7554942",
                "status": 5,
                "info": {
                    "title": "新增商品并保存case_UpProduct",
                    "subTitle": "这是商品子标题",
                    "headImg": [
                        "https://wxamusic.wx.qq.com/wxasr/getminipic/zncFu89-HApz37MU8ZbwXB-7W09r7a2spQoE8wPrMFG4kgySC04JEIgbjTy8izde?media-id=zncFu89-HApz37MU8ZbwXB-7W09r7a2spQoE8wPrMFG4kgySC04JEIgbjTy8izde&amp;appid=wx678687fa5226e237"
                    ],
                    "category": [
                        {
                            "catId": "1247",
                            "name": "家具",
                            "fCatId": "0",
                            "updateTime": "0",
                            "catType": 1,
                            "bizuin": "3845180796",
                            "brandCat": "9223372036854775807",
                            "catInfo": {
                                "isRequired": 0,
                                "isCustomize": 0,
                                "catLevel": 1
                            },
                            "auditId": "0",
                            "desc": "",
                            "priority": 0
                        },
                        {
                            "catId": "1267",
                            "name": "儿童家具",
                            "fCatId": "1247",
                            "catType": 1,
                            "version": 0,
                            "bizuin": "0",
                            "catInfo": {
                                "isRequired": 0,
                                "isCustomize": 0,
                                "catLevel": 2
                            },
                            "auditId": "0",
                            "desc": "",
                            "priority": 0
                        },
                        {
                            "catId": "1270",
                            "name": "儿童床",
                            "fCatId": "1267",
                            "createTime": "0",
                            "updateTime": "0",
                            "catType": 1,
                            "version": 0,
                            "bizuin": "0",
                            "brandCat": "9223372036854775807",
                            "catInfo": {
                                "isRequired": 0,
                                "isCustomize": 0,
                                "specType": 0,
                                "specTypeDesc": "",
                                "attrTemplateId": "0",
                                "attrTemplateName": "",
                                "maxAttrNum": 18,
                                "editByUser": 0,
                                "catLevel": 3,
                                "highestPriceFixing": 0,
                                "wording": "",
                                "description": "",
                                "maxProductNum": 0,
                                "qualification": "",
                                "productQualification": "",
                                "quaNeedAudit": "",
                                "maxQualificationImg": 0,
                                "catGroup": 0,
                                "individualAuditInfo": {
                                    "qualification": "",
                                    "productQualification": "",
                                    "quaNeedAudit": "",
                                    "maxQualificationImg": 0
                                },
                                "enterpriseAuditInfo": {
                                    "qualification": "",
                                    "productQualification": "",
                                    "quaNeedAudit": "",
                                    "maxQualificationImg": 0
                                }
                            },
                            "auditId": "0",
                            "desc": "",
                            "priority": 0
                        }
                    ],
                    "brand": "",
                    "brandId": "2100000000",
                    "model": "",
                    "detail": {
                        "detailImg": [
                            "https://wxamusic.wx.qq.com/wxasr/getminipic/zncFu89-HApz37MU8ZbwXB-7W09r7a2spQoE8wPrMFG4kgySC04JEIgbjTy8izde?media-id=zncFu89-HApz37MU8ZbwXB-7W09r7a2spQoE8wPrMFG4kgySC04JEIgbjTy8izde&amp;appid=wx678687fa5226e237"
                        ],
                        "detailVideos": [],
                        "detailVideoInfo": []
                    },
                    "param": [],
                    "minPrice": 2000,
                    "expressInfo": {
                        "templateId": "37927"
                    },
                    "totalStockNum": 0
                },
                "skus": []
            },
            "leagueExInfo": {
                "hasCommission": 1,
                "commissionRatio": 8000,
                "commissionValue": 1600
            },
            "shopInfo": {
                "name": "猪腩肉小商店",
                "guaranteeFlag": 0,
                "headImgUrl": "http://wx.qlogo.cn/mmhead/Q3auHgzwzM77ia7ibuPAQBJgME8gFF9APicaSpd7evrLCVb5hn2zsUBOw"
            }
        },
        {
            "productId": "6565746",
            "product": {
                "productId": "6565746",
                "status": 5,
                "info": {
                    "title": "测试假发",
                    "subTitle": "测试假发",
                    "headImg": [
                        "https://snsdy.tc.qq.com/161/20304/snscosdownload/SZ/reserved/5fd316dc0000ef4b0000000043785609000000a000004f50"
                    ],
                    "category": [
                        {
                            "catId": "1001",
                            "name": ""
                        },
                        {
                            "catId": "1030",
                            "name": ""
                        },
                        {
                            "catId": "1031",
                            "name": ""
                        }
                    ],
                    "brandId": "2100000000",
                    "detail": {
                        "detailImg": [],
                        "detailVideos": [],
                        "detailVideoInfo": [],
                        "desc": "测试商品"
                    },
                    "param": [],
                    "minPrice": 100,
                    "expressInfo": {
                        "templateId": "1024691"
                    },
                    "totalStockNum": 39995
                },
                "skus": [
                    {
                        "skuId": "11913889",
                        "status": 5,
                        "productSkuInfo": {
                            "saleParam": [
                                {
                                    "categorys": [
                                        {
                                            "catId": "35245",
                                            "name": "选择产品",
                                            "fCatId": "1031",
                                            "catType": 3,
                                            "bizuin": "3853210889",
                                            "brandCat": "0",
                                            "catInfo": {
                                                "isCustomize": 1,
                                                "editByUser": 0
                                            },
                                            "desc": "",
                                            "priority": 0
                                        },
                                        {
                                            "catId": "1000000000000",
                                            "name": "111",
                                            "fCatId": "35245",
                                            "bizuin": "3853210889",
                                            "catInfo": {
                                                "editByUser": 1
                                            },
                                            "desc": "",
                                            "priority": 1
                                        }
                                    ]
                                },
                                {
                                    "categorys": [
                                        {
                                            "catId": "35246",
                                            "name": "选择颜色",
                                            "fCatId": "1031",
                                            "catType": 3,
                                            "bizuin": "3853210889",
                                            "brandCat": "0",
                                            "catInfo": {
                                                "isCustomize": 1,
                                                "editByUser": 0
                                            },
                                            "desc": "",
                                            "priority": 0
                                        },
                                        {
                                            "catId": "1000000000001",
                                            "name": "3333",
                                            "fCatId": "35246",
                                            "bizuin": "3853210889",
                                            "catInfo": {
                                                "editByUser": 1
                                            },
                                            "desc": "",
                                            "priority": 1
                                        }
                                    ]
                                }
                            ],
                            "thumbImg": "",
                            "skuCode": "",
                            "salePrice": 100,
                            "marketPrice": 100,
                            "stockInfo": {
                                "stockNum": 20000
                            },
                            "appidForMedia": ""
                        }
                    },
                    {
                        "skuId": "11915862",
                        "status": 5,
                        "productSkuInfo": {
                            "saleParam": [
                                {
                                    "categorys": [
                                        {
                                            "catId": "35245",
                                            "name": "选择产品",
                                            "fCatId": "1031",
                                            "catType": 3,
                                            "bizuin": "3853210889",
                                            "brandCat": "0",
                                            "catInfo": {
                                                "isCustomize": 1,
                                                "editByUser": 0
                                            },
                                            "desc": "",
                                            "priority": 0
                                        },
                                        {
                                            "catId": "1000000000002",
                                            "name": "1112",
                                            "fCatId": "35245",
                                            "bizuin": "3853210889",
                                            "catInfo": {
                                                "editByUser": 1
                                            },
                                            "desc": "",
                                            "priority": 2
                                        }
                                    ]
                                },
                                {
                                    "categorys": [
                                        {
                                            "catId": "35246",
                                            "name": "选择颜色",
                                            "fCatId": "1031",
                                            "catType": 3,
                                            "bizuin": "3853210889",
                                            "brandCat": "0",
                                            "catInfo": {
                                                "isCustomize": 1,
                                                "editByUser": 0
                                            },
                                            "desc": "",
                                            "priority": 0
                                        },
                                        {
                                            "catId": "1000000000001",
                                            "name": "3333",
                                            "fCatId": "35246",
                                            "bizuin": "3853210889",
                                            "catInfo": {
                                                "editByUser": 1
                                            },
                                            "desc": "",
                                            "priority": 1
                                        }
                                    ]
                                }
                            ],
                            "thumbImg": "",
                            "skuCode": "",
                            "salePrice": 100,
                            "marketPrice": 100,
                            "stockInfo": {
                                "stockNum": 20000
                            },
                            "appidForMedia": ""
                        }
                    }
                ]
            },
            "leagueExInfo": {
                "hasCommission": 1,
                "commissionRatio": 3300,
                "commissionValue": 33
            },
            "shopInfo": {
                "name": "沅沅小可爱",
                "guaranteeFlag": 0,
                "headImgUrl": "http://wx.qlogo.cn/mmhead/574VdhMFwaETvsGUwOpJsHAWaM3UDznibq3MMMiaOPSt7Ir1ecTLOfJQ/0"
            }
        }
    ],
    "total": 100
}

3.获取商品推广素材

接口说明

通过该接口获取商品的推广素材,包括店铺appID、商品详情页Path、推广文案及推广短链、商品图片、商品小程序码等

请求地址

POST https://api.weixin.qq.com/union/promoter/product/generate?access_token=ACCESS_TOKEN

请求参数

属性 类型 默认值 必填 说明
access_token string 接口调用凭证
pid string 推广位PID
productList Array.<Object> 商品列表
productList[].productId string 商品SPU ID
productList[].appId string 商品所在小商店的AppID

POST示例

{
  "pid": "oUnIc49zinb1mtlfB5K-NfGJxxNE_341161518",
  "productList": [
    {
      "productId": "14495788",
      "appId": "wxb82530c28"
    }
  ]
}

返回值

Object

返回的 JSON 数据包

属性 类型 说明
errcode number 错误码
errmsg string 错误信息
list Array.<Object>
list[].productId string 商品SPU ID
list[].pid string 推广位PID
list[].productInfo Object 商品相关信息
list[].shareInfo Object 推广相关信息

productInfo 的结构

属性 类型 说明
productId string 商品SPU ID
title string 商品标题
subTitle string 商品子标题
headImg Array.<string> 商品主图
minPrice number 商品最低价格,单位分
shopName string 商店名称

shareInfo 的结构

属性 类型 说明
appId string 推广商品的小程序AppID
path string 推广商品的小程序Path
wxaCode string 推广商品详情页的葵花码图片,Data URL格式,比如'data:image/jpeg;base64,iVBORw0'
promotionUrl string 推广商品短链
promotionWording string 推广商品文案

返回示例

{
  "errcode": 0,
  "errmsg": "ok",
  "list": [
    {
      "pid": "oUkIc71zinc2mtlfC7K-NfGJxxNE_328751529",
      "productInfo": {
        "productId": "14495674",
        "title": "洗衣液",
        "subTitle": "",
        "headImg": [
          "https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SZ/reserved/601151160005275c000000003e9f9d09000000a000004f50"
        ],
        "minPrice": 12300,
        "shopName": "猪腩肉小商店"
      },
      "shareInfo": {
        "appId": "wxb825f130c284597f",
        "path": "plugin-private://wx34345ae5855f892d/pages/productDetail/productDetail?productId=14495788&ticket=dasdfa2V0NzIx123MTI4MDAxODadfdI4NDE3NabcMA",
        "wxaCode": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAa4A",
        "promotionWording": "好评💦好价速撸🔰价格实惠🐸\n————\n黄酒\n\n开抢啦:123元,比市场价优惠2311元",
        "promotionUrl": "https://mmbizurl.cn/s/017btcGpB"
      }
    }
  ]
}