# Bulk Add SKU

Note: Product has 2 copies of data, draft and online data Call the interface to add and modify the product data, the impact is only draft data, to tune the interface and audit, draft data will cover online data officially effective

# Interface call request specification

Http request method: POST

# Request Parameter Sample

            "product_id": 23423523452345235,
            "out_product_id": "1234566",
            "out_sku_id": "1024",
            "thumb_img": " http://img10.360buyimg.com/n1/s450x450_jfs/t1/100778/17/13648/424215/5e590a40E2d68e774/e171d222a0c9b763.jpg",
            "sale_price": 1300,
            "market_price": 1500,
            "stock_in a": 100,
            "sku_code": "A24525252",
            "barcode": "13251454",
                    "attr_key": "Choose color,"
                    "attr_value": "Red and blue mainframe."
                    "attr_key": "Choose a set";
                    "attr_value": "Host + Cover"

# Return Package Example

    "errcode": 0,
                "sku_id": 12343455,
                "out_sku_id": "1024"
                "create_time": "2020-03-25 12:05:25"

# Request Parameter Dxplaination

parameter type Required Required Introductions
skus[].product_id number no Mini Store internal product ID, with out_product_Id choose two
skus[].out_product_id string no Merchant custom product ID, with product_Id choose two
skus[].out_sku_id string yes Merchant custom skuID, up to 32 characters
skus[].thumb_img string no sku small diagram
skus[].sale_price number yes Sale price, divided into units, not exceeding 1000000000 (10 million yuan)
skus[].market_price number yes Market price, divided into units, not exceeding 10 million (10 million yuan)
skus[].stock_A number yes stock
skus[].barcode string no barcode
skus[].sku_code string no Product code, up to 20 characters
skus[].sku_attrs[].attr_key string yes Attribute key (for attribute customization), up to 40 characters
skus[].sku_attrs[].attr_value string yes Attribute values (for custom attributes), up to 40 characters, no more than 100 different values under the same key.

# Be careful

  • Image - related parameters such asthumb_img), pleasemustUse https://developers.weixin.qq.com/miniprogram/dev/framework/ministore/minishopopencomponent/API/register/uploadimg.html Interface to upload pictures (parametersor_type=1And returns thetemp_img_urlFill in here, here.Do not accept any external link image urlIfurlHas done a conversion (domain name isstore.mp.video.tencent-cloud.comOr the url prefix ismmbizurl.cn/p/Or the url prefix ismmecimage.cn/p/You can submit directly.
  • Character: 1 Chinese character/1 letter, each count as 1 character

# Return parameter specification

parameter type Introductions
Errcode number Error code
errmsg string Error message
data.sku_key.sku_id number Mini Store Internal Product ID
data.sku_key.out_sku_id string Custom Product ID
data.create_time string Time of creation

# Return code

Return code Type of error
-1 System exception
-2 Token is too long
9401020 Wrong parameter
9401006 SKU does not exist
9401005 SKU already exists
9401025 SKU does not allow editing
9401043 SKU overpriced
9401044 SKU Product Codesku_codeToo long
9401046 Too many SKUs with key attributes
9401047 Key Property Keyskus[].sku_attrs[].attr_keyCharacters too long
9401048 Sku attribute valueskus[].sku_attrs[].attr_valueCharacters too long
9401050 Image url illegal: empty string, or domain name is notstore.mp.video.tencent-cloud.comOr the url prefix is notmmbizurl.cn/p/Or the url prefix is notmmecimage.cn/p/(Refer to [Notes] in the documentation)
9401052 out_sku_idToo long