# Adding goods

Detailed Product Rules

# Dxplaination of Interface Call Request

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

# Example of request parameters

{
    "out_product_id": "1234566",
    "title": "任天堂 Nintendo Switch 国行续航增强版 NS家用体感游戏机掌机 便携掌上游戏机 红蓝主机",
    "path": "pages/productDetail/productDetail?productId=2176180",
    "direct_path": "pages/productDetail/productDetail?productId=2176180&direct=true",
    "head_img": 
    [
        "https://mmecimage.cn/p/wx77e672d6d34a4bed/HNTiaPWTllJ5R2pq9Jv9jRD5bZOWmq2svUUzJcZbcg"
    ],
    "qualification_pics": [
        "https://mmecimage.cn/p/wx77e672d6d34a4bed/HNTiaPWTllJ5R2pq9Jv9jRD5bZOWmq2svUUzJcZbcg"
    ],
    "desc_info": 
    {
        "desc": "xxxxx",
        "imgs": 
        [
            "https://mmecimage.cn/p/wx77e672d6d34a4bed/HNTiaPWTllJ5R2pq9Jv9jRD5bZOWmq2svUUzJcZbcg"
        ]
    },
    "third_cat_id": 6666,
    "brand_id": 2100000000,
    "info_version": "xxx",
    "skus":
    [
        {
            "out_product_id": "1234566",
            "out_sku_id": "1024",
            "thumb_img": "https://mmecimage.cn/p/wx77e672d6d34a4bed/HNTiaPWTllJ5R2pq9Jv9jRD5bZOWmq2svUUzJcZbcg",
            "sale_price": 1300,
            "market_price": 1500,
            "stock_num": 100,
            "sku_code": "A24525252",
            "barcode": "13251454",
            "sku_attrs": 
            [
                {
                    "attr_key": "选择颜色",
                    "attr_value": "红蓝主机"
                },
                {
                    "attr_key": "选择套装",
                    "attr_value": "主机+保护套"
                }
            ]
        }
    ],
    "scene_group_list": [1]
}

# Examples of back-up

{
    "errcode": 0,
    "errmsg":"ok",
    "data": 
    {
        "product_id": 23423523452345235,
        "out_product_id": "1234566",
        "create_time": "2020-03-25 12:05:25",
        "skus":
        [
            {
                "sku_id": 123,
                "out_sku_id": "1024"
            },
            ...
        ]
    }
}

# Dxplaination of request parameters

parameter type Is it compulsory? Introductions
out_product_id string yes Merchant Custom Item ID
title string yes Title, character type, no lower than 3 and no longer than 60. Note: 1. The product title only allows Chinese characters, numbers, English letters, special character set; 2. The title of the product shall not be limited to numbers, letters, special character sets, or a combination of these.
path string yes Bound Weixin Mini Program product path
direct_path string no Item Buy Now link
head_img string array yes Main picture, multiple images, list, picture type, no more than 9 images
qualification_pics string array no Product qualification picture, picture type, no more than 5 pictures
desc_info.desc string no Item Details Graphic, Character Type, No Longer than 2000
desc_info.imgs string array no Item Details Image, type of image, no more than 50 images
third_cat_id number yes Third-level category ID
brand_id number yes Brand id
info_version string no Reserve fields for version control
skus[] object array yes sku array
skus[].out_product_id string yes Merchant Custom Item ID
skus[].out_sku_id string yes Merchant custom skuID
skus[].thumb_img string yes SCU diagram
skus[].sale_price number yes Selling price, divided into units, numerical types, up to a maximum of 10000000 (10 million yuan)
skus[].market_price number yes Market prices, to be divided into units, numerical types, up to a maximum of 10000000 (10 million yuan)
skus[].stock_num number yes Inventory, numerical type, maximum not exceeding 10000000 (10 million)
skus[].barcode string no barcode
skus[].sku_code string no Product Code, Character Type, No Longer than 20
skus[].sku_attrs[].attr_key string yes Sales attribute key (custom), character type, maximum 40
skus[].sku_attrs[].attr_value string yes Sales attribute value (custom), character type, the longest not more than 40, the same key can not more than 100 different values
scene_group_list enum array yes Product use scenario, 1:WeChat Channels~~,3:The Order Center (not the Order Center in WeChat Channels; merchants who have not explicitly enabled this scenario should not pass values).~~Leave it empty during component turn on and when scene is not connected"scene_group_list": []

# Dxplaination of callback parameters

parameter type Introductions
errcode number Error code
errmsg string Error message
data.product_id number(uint64) Trading Component Platform Internal Product ID
data.out_product_id string Merchant Custom Item ID
data.skus object array sku array
data.skus[].sku_id string Trading component platform custom skuID
data.skus[].out_sku_id string Merchant custom skuID