Last Updated on : 2024-01-12 02:43:01download
Edit a commodity in the commodity database of the specified store.
POST: /v1.0/cloud/ecm/store/admin/api/commodity/edit
Description of body
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
mall_code | String | true | The code of the specified mall. | |
site_code | String | true | The code of the specified site. | |
commodity_code | String | true | The code of a specified commodity. Required. | |
title | String | false | The commodity title with up to 80 characters. | |
sub_title | String | false | The commodity subtitle with up to 250 characters. | |
description | String | false | The commodity description with up to 20,000 characters. Support rich text. | |
brand | String | false | The commodity brand with up to 30 characters. | |
first_category_code | String | false | The code of the level-1 category. | |
second_category_code | String | false | The code of the level-2 category. | |
third_category_code | String | false | The code of the level-3 category. | |
showcase_codes | List | false | The codes of the specified categories that are presented in the frontend. | |
video | String | false | The video to show the specified commodity. When this API is used, you must upload a video URL, so the video file can be accessed by using a browser. It only supports a video in the MP4 format, no more than 50 MB. The recommended duration is 9 to 30 seconds. | |
video_pic | String | false | The image to show the specified video. When this API is used, you must upload an image URL, so the image file can be accessed by using a browser. This field is required when video is not empty. | |
show_pictures | List | false | The image to show the specified commodity. When this API is used, you must upload an image URL, so the image file can be accessed by using a browser. It supports up to 10 images in the JPG, PNG, or GIF format. Each image file must be 500 KB or less in size, with a recommended size of 750 × 750 pixels. | |
is_jump | Boolean | false | Specifies whether to navigate to a third-party page. Valid values:
| |
jump_link | String | false | The navigation link of the specified commodity. This field is required if the value of is_jump is set to true . | |
publish | Boolean | false | Specifies whether to list the specified commodity. Valid values:
| |
sku_list | List | false | The list of SKUs. Maximum value: 100 . |
Description of sku_list
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
skuCode | String | false | The unique code of the specified SKU. This field is required when you modify an existing SKU. | |
skuPicList | List | false | The list of SKU images. When this API is used, you must upload an image URL, so the image file can be accessed by using a browser. It supports up to 10 images in the JPG, PNG, or GIF format. Each image must be 500 KB or less in size, with a recommended size of 750 × 750 pixels. | |
originalPrice | BigDecimal | false | The original price of the SKU. It supports up to two decimal places. If the value is empty, it defaults to 0 . | |
salePrice | BigDecimal | false | The sales price of the SKU. It supports up to two decimal places. If the value is empty, it defaults to 0 . | |
inventory | Integer | false | The inventory. It supports an integer. If the value is empty, it defaults to 0 . | |
weight | BigDecimal | false | The weight in kilograms (KG). It supports up to three decimal places. If the value is empty, it defaults to 0 . | |
externalCode | String | false | The external code. | |
supportOutStockBuy | Boolean | false | Specifies whether the buyers can place an order when the inventory is zero. | |
skuAttrList | List | false | The list of SKU attributes. |
Description of skuAttrList
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
attrCode | String | true | The code of the specified attribute. | |
attrValueId | Long | true | The ID of the specified attribute value. | |
attrName | String | false | The name of the specified attribute. | |
attrValueName | String | false | The name of the specified attribute value. |
Parameter name | Type | Description |
---|---|---|
result | CommodityAddOpenApiVO | The returned result. |
Description of result
Parameter name | Type | Description |
---|---|---|
commodity_code | String | The unique code of the specified commodity. |
POST: /v1.0/cloud/ecm/store/admin/api/commodity/edit
{
"mall_code": "8h4tiureddm***",
"site_code": "CN",
"commodity_code": "CMaplyr4bzck***",
"title": "Refrigerator",
"sub_title": "Hr Refrigerator X0",
"description": "<div><p>Smart refrigerator...</p><img src='https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg' /></div>",
"brand": "hr",
"first_category_code": "12",
"second_category_code": "1312",
"third_category_code": "131211",
"show_pictures": [
"https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg"
],
"video": "https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.mp4",
"video_pic": "https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg",
"showcase_codes": [
"Cbgrc6mvk***"
],
"is_jump": true,
"jump_link": "www.demo.com/home",
"publish": true,
"sku_list": [
{
"skuCode": "SKba0j4xcti***",
"skuPicList": [
"https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg"
],
"externalCode": "",
"inventory": 100,
"originalPrice": 1,
"salePrice": 2,
"supportOutStockBuy": false,
"skuAttrList": [
{
"attrCode": "ATci8mev9w0***",
"attrName": "Color",
"attrValueId": 6181512,
"attrValueName": "White"
}
],
"weight": 0
}
]
}
{
"result": {
"commodity_code": "CMaplyr4bzck***"
},
"t": 1624969838836,
"success": true
}
For more information, see error code.
Error code | Error message | Description |
---|---|---|
2000000 | params error | Parameter error. |
2001000 | shop does not exist | The store (site) does not exist. |
2000001 | character limit exceeded | Exceeded the character quantity limit. |
2002002 | commodity title already exists | The commodity title already exists. |
2002003 | category does not exist | The commodity category does not exist. |
2002004 | failed to add commodity | Failed to add the commodity. |
2002201 | sku exceeds the maximum limit | The number of SKUs exceeds the upper limit. |
2002202 | sku attribute does not exist | The SKU attribute does not exist. |
2002203 | the sku combination rule is wrong | The SKU is not combined according to the specified rules. |
2004000 | image size exceeds limit | The size of the media file exceeds the upper limit. |
2004001 | the number of pictures exceeds the limit | The number of images exceeds the upper limit. |
2004002 | picture error | Image error. |
2004003 | video error | Video file error. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback