stable本次发布有变化全部展示
来自 Shopee 官方资料快照 ·
- 当前资料结构化阅读页
- 固定快照已留存,可追溯
- 官方原文可核对
资料正文
§1 What is the difference between the various types of product attributes?
The product attribute type is determined by the “input_type”, “input_validation_type” and “format_type” fields returned by the “v2.product.get_attribute_tree” API. It is important to note that these fields were previously returned as strings by the “v2.product.get_attributes” API, but they are now returned as int by the “v2.product.get_attribute_tree” API.
- “input_type": It indicates the input type of the Attribute Value; the available types are as follows.
| input_type | Type | Definition | Description | Remarks |
| 1 | int | SINGLE_DROP_DOWN | Sellers can select only one value from the attribute value list ("attribute_value_list") returned by the “v2.product.get_attribute_tree” API to upload. | |
| 2 | int | SINGLE_COMBO_BOX | Sellers can select only one value from the attribute value list ("attribute_value_list") returned by the “v2.product.get_attribute_tree” API, or set a custom value to upload. | |
| 3 | int | FREE_TEXT_FILED | Sellers can set a custom value. | |
| 4 | int | MULTI_DROP_DOWN | Sellers can select multiple values from the attribute value list ("attribute_value_list") returned by the “v2.product.get_attribute_tree” API to upload. | A product can have up to 5 values selected. |
| 5 | int | MULTI_COMBO_BOX | Sellers can select multiple values from the attribute value list ("attribute_value_list") returned by the “v2.product.get_attribute_tree” API, or set custom values to upload.. | A product can have up to 5 values selected. |
- "input_validation_type": It indicates the data type of the input attribute value. When the "input_type" is 1 or 4, this field will only return 0; when the "input_type" is 2, 3, or 5, the corresponding explanation of the return value of this field is as follows.
| input_validation_type | Type | Description | Remarks |
| 0 | int | VALIDATOR_NO_VALIDATE_TYPE | |
| 1 | int | VALIDATOR_INT_TYPE | |
| 2 | int | VALIDATOR_STRING_TYPE | |
| 3 | int | VALIDATOR_FLOAT_TYPE | |
| 4 | int | VALIDATOR_DATE_TYPE, including two formats:DD/MM/YYYYY, e.g. 31/06/2021MM/YYYYY, e.g. 06/2021 | When adding or editing a product, for attributes with a date data type, please enter the timestamp in Unix timestamp format. However, when retrieving detailed product attribute values, the “original_value_name” will return the value in a readable date format. |
- "format_type":It indicates whether the attribute has units.
| format_type | Type | Description | Remarks |
| 1 | int | Non-unit attributes; Sellers are not required to enter a value in the unit field when adding/editing products. | |
| 2 | int | Attributes with units; Sellers are required to upload the unit value listed in the “attribute_unit_list” field when adding/editing products. | The API returns the “attribute_unit_list” field only if “format_type”: 2. |
