shop.feature.add
Adds a new product feature. The 'settings' access right is required.
Parameters
-
code
POST
Feature identifier.
-
type
POST
Feature type: 'varchar', 'double', 'text', 'boolean', 'color'.
-
name
POST
Feature name.
-
selectable
POST
Flag (0 or 1) meaning that a feature can offer more than one value for selection on product-editing page.
-
multiple
POST
Flag (0 or 1) meaning that more than one value of a feature can be selected on product-editing page.
-
available_for_sku
POST
Optional
Flag (0 or 1) denoting whether feature’s values can be edited in product variants’ properties.
-
default_unit
POST
Optional
Default measurement unit (for features with the 'dimension' type).
-
format
GET
Optional
Sets response format. Available options:
json
(default),xml
.
Return value
Feature data array with the following keys:
- id int Feature ID.
- code string Feature identifier editable in the store settings.
- status strong Feature visibility in the storefront: 'private' (not visible), 'public' (visible).
- name string Feature name.
- type strong Feature type.
- selectable int Flag denoting the possibility to select feature values from a pre-defined list in the product editor: 0 (available), 1 (unavailable).
- multiple int Flag denoting the possibility to select multiple feature values from a pre-defined list in the product editor: 0 (available), 1 (unavailable).
- count int Number of products associated with the feature’s values.
- available_for_sku int Flag denoting the possibility to select feature values in product variants’ properties.
- default_unit string Default measure unit selected in the feature settings.
- builtin int Flag denoting whether it is a system feature: 0 (ordinary), 1 (system).
- values array Array with the list of feature values, for features with the selectable flag, with the following keys:
- values[]['id'] int Value ID.
- values[]['sort'] int Feature value’s sort order value starting with 1.
- values[]['value'] mixed Feature value (available not for all feature types).