# Get a list of goods
# Dxplaination of Interface Call Request
http请求方式:POST
https://api.weixin.qq.com/product/spu/get_list?access_token=xxxxxxxxx
# Example of request parameters
{
"status": 5,
"page": 1,
"page_size": 10,
"need_edit_spu": 1 // 默认0:获取线上数据, 1:获取草稿数据
}
# Examples of back-up
{
"errcode": 0,
"errmsg":"ok",
"total_num": 1,
"spus":
[
{
"title": "任天堂 Nintendo Switch 国行续航增强版 NS家用体感游戏机掌机 便携掌上游戏机 红蓝主机",
"sub_title": "JD自营更放心】【国行Switch,更安心的保修服务,更快的国行服务器】一台主机三种模式,游戏掌机,随时随地,一起趣玩。",
"head_img":
[
"http://img10.360buyimg.com/n1/s450x450_jfs/t1/85865/39/13611/488083/5e590a40E4bdf69c0/55c9bf645ea2b727.jpg"
],
"desc_info":
{
"imgs":
[
"http://img10.360buyimg.com/n1/s450x450_jfs/t1/85865/39/13611/488083/5e590a40E4bdf69c0/55c9bf645ea2b727.jpg"
]
},
"out_product_id": "1234566",
"product_id": 12345,
"brand_id": 2352,
"status": 5,
"edit_status": 2,
"min_price": 100,
"path": "plugin-private://wx34345ae5855f892d/pages/productDetail/productDetail?productId=12345",
"cats":
[
{
"cat_id": 1,
"level": 1
},
{
"cat_id": 2,
"level": 2
},
{
"cat_id": 3,
"level": 3
}
],
"attrs":
[
{
"attr_key": "商品毛重",
"attr_value": "380g"
},
{
"attr_key": "商品产地",
"attr_value": "中国大陆"
}
],
"model": "国行续航增强版",
"shopcat":
[
{
"shopcat_id": 1
},
{
"shopcat_id": 2
}
],
"skus":
[
{
"sku_id": 1001
},
{
"sku_id": 1002
}
]
}
]
}
# Dxplaination of request parameters
| 参数 | type | Is it compulsory? | Introductions |
|---|---|---|---|
| status | number | yes | Condition of product |
| page | number | yes | What Page (Minimum Fill 1) |
| page_size | number | yes | Number of pages (no more than 300) |
| need_edit_spu | number | no | Default 0: Get online data, 1: Get draft data |
| source | number | no | Default 1: Mini Store Own, 2: AMS, 4: Alliance, 8: Recommendation Officer Recommendation, 16: Flash Purchase |
# Dxplaination of callback parameters
| 参数 | type | Introductions |
|---|---|---|
| errcode | number | Error code |
| errmsg | string | Error message |
| total_num | number | Total number of goods |
| spus[].product_id | number | Small shop internal product ID |
| spus[].out_product_id | string | Merchant Custom Item ID |
| spus[].title | string | title |
| spus[].sub_title | string | subheading |
| spus[].head_img | string array | Master map, multiple, list, up to 9, each not exceeding 2 MB |
| spus[].desc_info.imgs | string array | Product details, pictures (currently only support pictures, up to 20, each not more than 2MB) |
| spus[].brand_id | number | Merchants need to apply for brands |
| spus[].status | number | Item Status Online |
| spus[].edit_status | number | Draft status of commodities |
| spus[].min_price | number | Minimum SKU price (unit: cent) |
| spus[].path | string | Weixin Mini Program Page path |
| spus[].cats[].cat_id | number | Merchants need to apply for categories to use first |
| spus[].cats[].level | number | Merchants need to apply for categories to use first |
| spus[].attrs[].attr_key | string | Property key (for property customization) |
| spus[].attrs[].attr_value | string | Attribute values (for attribute customization) |
| spus[].model | string | Product Model |
| spus[].shopcat[].shopcat_id | number | Category ID, the corresponding information is obtained through the get_shop_cat interface |
| spus[].skus[].sku_id | number | skuID |
# Enumeration - edit_status
| 枚举值 | describe |
|---|---|
| 0 | Initial value |
| 1 | In edit |
| 2 | Under review |
| 3 | The audit failed |
| 4 | The audit was successful. |
# Enumeration - status
| 枚举值 | describe |
|---|---|
| 0 | Initial value |
| 5 | Get on the shelves. |
| 6 | Recycling Station |
| 9 | Logical deletion |
| 11 | Take it off the shelves on her own. |
| 12 | Sold off shelves |
| 13 | Violations removed / Risk control removed |
# Return code
| 返回码 | Error Type |
|---|---|
| -1 | System exceptions |
| -2 | Token too long |
| 9401020 | The parameter is incorrect. |
| 9401021 | Call the api without permission |
| 9401002 | SPU does not exist |
| 9401001 | SPU already exists |
| 9401023 | SPU does not allow editing |