# Update 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",
       "sku_id": 1343,
       "out_sku_id": "1024",
       "thumb_img": "https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SZ/reserved/6059ade300096eb200000000f19f9d09000000a000004f50",
       "sale_price": 1300,
       "market_price": 1500,
       "stock_in a": 100,
       "sku_code": "A24525252",
       "barcode": "13251454",
               "attr_key": "Choose a color,"
               "attr_value": "Red and blue host."
               "attr_key": "Choose a suit,"
               "attr_value": "Host + Protective Case"

# Return Package Example

    "errcode": 0,
            "update_time": "2020-03-25 12:05:25"

# Request Parameter Dxplaination

parameter type Is it necessary to fill out Introductions
product_id number no Mini Store internal product ID, with out_product_Id choose two
out_product_id string no Merchant custom product ID, with product_Id choose two
sku_id number no out_sku_id、sku_id Either way,
out_sku_id string no out_sku_id、sku_Id choose two
thumb_img string no sku small diagram
sale_price number yes Sale price, to be divided into units, not more than 10 million (10 million yuan)
market_price number yes Market price, to be divided into units, not exceeding 1 0000000 (10 million yuan)
stock_A number yes stock
barcode string no barcode
sku_code string no Product code, up to 20 characters
sku_attrs string yes Sales properties, each spu below the first sku sku_ATTR order determines the order of the SPU on the PC side of the listing page
attr_key string yes Attribute key (for attribute customization), up to 40 characters
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_imgBe sure to use 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/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_id number skuID
data.update_time string Update time

# 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/(Refer to [Notes] in the documentation)