Create SKU Attribute

Last Updated on : 2023-06-15 05:55:59

Create a stock keeping unit (SKU) attribute for the specified commodity. When creating a multi-specification SKU, you need to pass in the created attributes. For the attributes created by calling this API, you can get them through the attribute query API (GET:/v1.0/sellercenter/sku/attrs).

API address

POST: /v1.0/cloud/ecm/store/admin/api/sku/attr/add

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
mall_codeStringbodytrueThe code of the specified mall.
site_codeStringbodytrueThe code of the specified site.
attr_codeStringbodyfalseThe code of the specified attribute. Either attribute code or attribute name is required.
attr_nameStringbodyfalseThe attribute name with up to 30 characters. Either attribute code or attribute name is required.
attr_value_name_listListbodyfalseThe name of the specified attribute value with up to 30 characters in a list of strings.

Return parameter

Parameter nameTypeDescription
resultBooleanThe returned result.

Request example

POST: /v1.0/cloud/ecm/store/admin/api/sku/attr/add
{
  "mall_code": "8h4tiureddm***",
  "site_code": "CN",
  "attr_code": "",
  "attr_name": "Color",
  "attr_value_name_list": [
    "Green",
    "Blue"
  ]
}

Return example

{
    "tid": "6423776effa311ed8c2baaa860023be5",
    "result": true,
    "t": 1685531274400,
    "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.
2002206the sku attribute name length exceeds the maximum limitThe SKU attribute name exceeds the upper limit.