# Update goods
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
https://api.weixin.qq.com/product/spu/update?access_token=xxxxxxxxx
# Request Parameter Sample
{
"product_id":1234234,
"out_product_id": "1234566",
"title": " Nintendo Nintendo Switch China Line Endurance Enhanced Edition NS Home Gaming Console Portable handheld game consoles Red and blue host " ,
"sub_title": " JD self more assured] [National Bank Switch, more secure warranty services, faster national bank server] a host three modes, game palm, anytime, anywhere, fun to play together. " ,
"head_img":
[
"https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SZ/reserved/6059ade300096eb200000000f19f9d09000000a000004f50"
],
"desc_info":
{
"imgs":
[
"https://store.mp.video.tencent-cloud.com/161/20304/snscosdownload/SZ/reserved/6059ade300096eb200000000f19f9d09000000a000004f50"
]
},
"brand_id": 2100000000,
"cats":
[
{
"cat_id": 6033,
"level": 1
},
{
"cat_id": 6057,
"level": 2
},
{
"cat_id": 6091,
"level": 3
}
],
"attrs":
[
{
"attr_key": "Gross weight of merchandise,"
"attr_value": "380g"
},
{
"attr_key": "origin of commodities";
"attr_value": "Mainland China"
}
],
"model": "china bank extended endurance edition";
"express_info":
{
"template_id": 5189
}
}
# Return Package Example
{
"errcode": 0,
"errmsg":"ok",
"data":
{
"product_id": 23423523452345235,
"out_product_id": "1234566",
"update_time": "2020-06-20 10:00:00"
}
}
# Request Parameter Dxplaination
parameter | type | Required Required | 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 |
title | string | yes | Title, up to 60 characters |
sub_title | string | no | Subtitles, up to 18 characters |
head_img | string array | yes | Master, Multiple, List, Up to 9 |
desc_info.imgs | string array | no | Product details, graphic(Currently only supports pictures, up to 20) |
brand_id | number | yes | Brand ID, merchants need to apply for the brand and get the brand interface brand/Get get, if no brand please fill 2100000000 |
cats[].cat_id | number | yes | Category ID, if brand_Id = 2100000000, you first need to get the category interface category/Get available cat_idIf brand_id! = 2100000000, then the cat here_ID needs to interface with get brand brand/Get 1, 2, 3 level categories one-to-one correspondence |
cats[].level | number | yes | Category level |
attrs[].attr_key | string | yes | Attribute key (for attribute customization) |
attrs[].attr_value | string | yes | Property values (for property customization) |
model | string | no | Commodity model |
express_info.template_id | number | yes | Shipping template ID first by getting the shipping template interface delivery/get_freight_Template (get) |
product_type | number | no | 1 - Physical goods 2 - Coupon code goods. Do not fill default to physical goods. The types passed in by the item must be added consistently, otherwise the parameter error will be returned. |
couponcode_info.verify_type | number | Written-off goods required | 0 - Daily write-off 1 - Not available for holidays. This field is only used for display on the verification page and will not limit the verification process. It is up to the merchant to decide whether to write off. |
couponcode_info.valid_info.valid_type | number | Written-off goods required | 1 - Specified time interval takes effect 2 - Specified days effective (N days after purchase) |
couponcode_info.valid_info.valid_day_A | number | Number of days valid Required | valid_When type is 2, it must be filled in. The valid days of the goods will be calculated from the completion of the order payment, and will automatically be rounded to the end day 23: 59: 59. The minimum is 1 and the maximum is 365. |
couponcode_info.valid_info.start_time | number | Specified interval valid Required | valid_Required when type is 1. Date on which the goods will become effective. The actual effective time of the item is automatically rounded to 00: 00: 00hrs on the day according to the time stamp passed in by this parameter. |
couponcode_info.valid_info.end_time | number | Specified interval valid Required | valid_When type is 1, it must be filled in, the date of expiration of the goods after verification. The actual expiration time of the product is automatically rounded to 23: 59: 59 on the day according to the time stamp passed in this parameter. The maximum acceptable value is the timestamp of the calling interface + 365 days. |
# Be careful
- Image - related parameters such as
head_img
、desc_info.imgs
Be sure to use https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/ministore/minishopopencomponent/API/register/uploadimg.html Interface to upload pictures (parametersor_type=1
And returns thetemp_img_url
Fill in here, here.Do not accept any external link image urlIfurl
Has done a conversion (domain name isstore.mp.video.tencent-cloud.com
Or 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
- product
product_type
No modification allowed
# Return parameter specification
parameter | type | Introductions |
---|---|---|
Errcode | number | Error code |
errmsg | string | Error message |
data.product_id | number | Mini Store Internal Product ID |
data.out_product_id | string | Custom Product ID |
data.update_time | string | Update time |
# Return code
Return code | Type of error |
---|---|
-1 | System exception |
-2 | Token is too long |
9401001 | SPU already exists |
9401002 | SPU does not exist |
9401020 | Wrong parameter |
9401021 | Call the api without permission |
9401023 | SPU does not allow editing |
9401026 | The item category length is not correct (expected to have three categories) |
9401032 | Category illegal |
9401033 | The merchant does not have the current category qualification |
9401034 | Shipping Template IDexpress_info.template_id illegal |
9401035 | Product Titletitle Empty |
9401036 | Product Titletitle Characters too long |
9401037 | Product master charthead_img Empty |
9401038 | Product master charthead_img too much |
9401039 | subheadingsub_title Characters too long |
9401040 | Picture of the daydesc_info.imgs too much |
9401041 | Product details description characters too long |
9401042 | Too many pictures |
9401049 | After-sales explaination characters too long |
9401050 | Image url illegal: empty string, or domain name is notstore.mp.video.tencent-cloud.com Or the url prefix is notmmbizurl.cn/p/ Or the url prefix is notmmecimage.cn/p/ (Refer to [Notes] in the documentation) |
110111 | Write-off informationcouponcode_info Incomplete or wrong |
110112 | The validity period of the goods written off exceeds the limit |