Skip to main content

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

ParameterTypeExampleRequiredDescription
external_idstring"1234"YesCustom field ID
namestring"color"YesCustom field name
entity_typestring"product"
"sku"
"order"
"line_order"
YesEntity type
requiredboolfalseYesWhether the field is required or not
value_typestring"unicode"
"int"
"float"
"bool"
"enum"
"date"
YesThe type of data in the field
default_valuestring"black"YesDefault value of the custom field
enum_valuesobject{"one": 1, "two": 2}Yes,
if value_type == enum
The value of each property in a custom field with type "enum"

JSON

[ 
{
"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
}
]