Add Commodity

Last Updated on : 2024-01-12 02:37:18download

Add a commodity to the commodity database of the specified store.

API address

POST: /v1.0/sellercenter/commodity

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
mall_codeString trueThe code of the specified mall.
site_codeString trueThe code of the specified country or region.
typeInteger falseThe type of the specified commodity. Valid values:
  • 0: physical commodity.
  • 5: virtual commodity.
titleString trueThe commodity title with up to 80 characters.
descriptionString falseThe description of the specified commodity. You can enter detailed information about the commodity in this field in the rich text format (RTF), with up to 20,000 characters.
brandString falseThe commodity brand with up to 30 characters.
codeString falseThe commodity code or model with up to 50 characters.
pidString falseThe commodity product ID (PID) with up to 16 characters. This field is obsolete.
first_category_codeString falseThe code of the specified level-1 category.
second_category_codeString falseThe code of the specified level-2 category.
third_category_codeString falseThe code of the specified level-3 category.
showcase_codesList falseThe codes of the specified categories that are presented in the frontend.
videoString falseThe 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_picString falseThe 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_picturesList falseThe 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 must be 500 KB or less in size, with a recommended size of 750 × 750 pixels.
detail_picturesList falseThe image that shows the details of a commodity. This field is obsolete. 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 15 images in the JPG, PNG, or GIF format. Each image must be 3 MB or less in size, with a recommended size of 750 × 750 pixels.
sku_listList falseThe list of SKUs. Maximum value: 100.
postage_typeInteger falseThe type of postage. This field is obsolete. Valid values:
  • 1: free shipping.
  • 2: fixed postage.
postage_feeBigDecimal falseThe postage fee of the specified commodity. This field is obsolete. This field is required if the value of postageType is set to 2.
install_typeInteger falseThe installation type. This field is obsolete.
  • 1: no need to install. Default value.
  • 2: on-site installation.
  • 3: installation by users.
install_feeBigDecimal falseThe installation fee. This field is obsolete.
is_jumpBoolean falseSpecifies whether to navigate to a third-party page. Valid values:
  • true: Yes.
  • false: No. Default value.
jump_linkString falseThe navigation link of the specified commodity. This field is required if the value of isJump is set to true.
publishBoolean falseSpecifies whether to list the specified commodity. Valid values:
  • true: List the commodity at once. Default value.
  • false: Do not list the commodity.
sub_titleString falseThe commodity subtitle with up to 250 characters.
multiple_optionsBoolean falseSpecifies whether the SKU has multiple specifications. Valid values:
  • true: multiple specifications.
  • false: single specification.

Description of sku_list

Parameter nameTypeINRequiredDescription
sku_pic_listList falseThe 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.
original_priceBigDecimal falseThe original price of the SKU. It supports up to two decimal places. If the value is empty, it defaults to 0.
sale_priceBigDecimal falseThe sales price of the SKU. It supports up to two decimal places. If the value is empty, it defaults to 0.
inventoryInteger falseThe inventory. It supports an integer. If the value is empty, it defaults to 0.
weightBigDecimal falseThe weight in kilograms (KG). It supports up to three decimal places. If the value is empty, it defaults to 0.
external_codeString falseThe external code.
support_out_stock_buyBoolean falseSpecifies whether the buyers can place an order when the inventory is zero.
sku_attr_listList falseThe list of SKU attributes.

Description of sku_attr_list

Parameter nameTypeINRequiredDescription
attr_codeString trueThe code of the specified attribute.
attr_value_idLong trueThe ID of the specified attribute value.
attr_nameString falseThe name of the specified attribute.
attr_value_nameString falseThe name of the specified attribute value.

Return parameter

Parameter nameTypeDescription
resultCommodityAddOpenApiVOThe returned result.

Description of result

Parameter nameTypeDescription
commodity_codeStringThe unique code of the specified commodity.

Request example

POST: /v1.0/sellercenter/commodity
{
  "mall_code": "8h4tiureddm***",
  "site_code": "CN",
  "type": 0,
  "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",
  "code": "define_code",
  "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": false,
  "jump_link": "",
  "multiple_options": true,
  "publish": true,
  "sku_list": [
    {
      "sku_pic_list": [
        "https://image-demo.oss-cn-hangzhou.aliyuncs.com/exa****.jpg"
      ],
      "external_code": "",
      "inventory": 100,
      "original_price": 1,
      "sale_price": 2,
      "support_out_stock_buy": false,
      "sku_attr_list": [
        {
          "attr_code": "COLOR",
          "attr_value_id": 1001
        }
      ],
      "weight": 0
    }
  ]
}

Return example

{
    "result": {
        "commodity_code": "CMaplyr4bzck***"
    },
    "t": 1624969838836,
    "success": true
}

Error code

For more information, see error code.

Error codeError messageDescription
2000000params errorParameter error.
2001000shop does not existThe store (site) does not exist.
2000001character limit exceededExceeded the character quantity limit.
2002002commodity title already existsThe commodity title already exists.
2002003category does not existThe commodity category does not exist.
2002004failed to add commodityFailed to add the commodity.
2002201sku exceeds the maximum limitThe number of SKUs exceeds the upper limit.
2002202sku attribute does not existThe SKU attribute does not exist.
2002203the sku combination rule is wrongThe SKU is not combined according to the specified rules.
2004000image size exceeds limitThe size of the media file exceeds the upper limit.
2004001the number of pictures exceeds the limitThe number of images exceeds the upper limit.
2004002picture errorImage error.
2004003video errorVideo file error.