# Search for Products

# Dxplaination of Interface Call Request

Note: Currently only the status = 5 items can be found.

http请求方式:POST
https://api.weixin.qq.com/product/spu/search?access_token=xxxxxxxxx

# Example of request parameters

{
    "keyword": "测试",
    "source": 1,        //默认1, 1: 小商店自营商品, 2:带货商品
    "page": 1,
    "page_size": 10
}

# Examples of back-up

{
    "errcode": 0,
    "errmsg":"ok",
    "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 no Item Status, default 5
source number yes Default 1, 1: Owned goods from small stores, 2: Shipments
page number yes What Page (Minimum Fill 1)
page_size number yes Number of pages per page (no more than 10,000)
keyword string yes Item titles, fuzzy searches

# Dxplaination of callback parameters

参数 type Introductions
errcode number Error code
errmsg string Error message
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 Main picture, multiple sheets, list
spus[].desc_info.imgs string array Item Details, Illustration (Image Only Currently)
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