Custom fields array
The custom_fields
array is used to create custom fields for various market entities (order, order item, product, SKU). Contains objects, each of which creates one custom field.
The array is passed in the following API requests:
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
external_id | string | "1234" | Yes | Custom field ID |
name | string | "color" | Yes | Custom field name |
entity_type | string | "product" "sku" "order" "line_order" | Yes | Entity type |
required | bool | false | Yes | Whether the field is required or not |
value_type | string | "unicode" "int" "float" "bool" "enum" "date" | Yes | The type of data in the field |
default_value | string | "black" | Yes | Default value of the custom field |
enum_values | object | {"one": 1, "two": 2} | Yes, if value_type == enum | The value of each property in a custom field with type "enum" |
JSON
- JSON
- XML
[
{
"external_id": "12",
"name": "product_custom_field",
"entity_type": "product",
"required": true,
"value_type": "unicode",
"default_value": "data"
},
{
"external_id": "123",
"name": "sku_custom_field",
"entity_type": "sku",
"required": false,
"value_type": "int",
"default_value": 100
},
{
"external_id": "1234",
"name": "order_custom_field",
"entity_type": "order",
"required": false,
"value_type": "enum",
"default_value": {"one": 1, "two": 2}
},
{
"external_id": "1234",
"name": "order_custom_field",
"entity_type": "line_order",
"required": false,
"value_type": "bool",
"default_value": false
}
]
<xml>
<row>
<external_id>12</external_id>
<name>product_custom_field</name>
<entity_type>product</entity_type>
<required>true</required>
<value_type>unicode</value_type>
<default_value>data</default_value>
</row>
<row>
<external_id>123</external_id>
<name>sku_custom_field</name>
<entity_type>sku</entity_type>
<required>false</required>
<value_type>int</value_type>
<default_value>100</default_value>
</row>
<row>
<external_id>1234</external_id>
<name>order_custom_field</name>
<entity_type>order</entity_type>
<required>false</required>
<value_type>enum</value_type>
<default_value>
<one>1</one>
<two>2</two>
</default_value>
</row>
<row>
<external_id>1234</external_id>
<name>order_custom_field</name>
<entity_type>line_order</entity_type>
<required>false</required>
<value_type>bool</value_type>
<default_value>false</default_value>
</row>
</xml>