Create a new attribute for products.
Body Parameters
Unique identifier for the attribute
Display label for the attribute
Type of attribute. One of: text, textarea, number, decimal, date, datetime, boolean, select, multiselect, color, image, file
Whether the attribute is required
Array of options for select/multiselect types
Validation rules for the attribute
{
"code": "color",
"label": "Color",
"project": 1,
"attribute_type": "select",
"is_required": true,
"options": ["red", "blue", "green"],
"validation_rules": {
"min_selections": 1,
"max_selections": 1
}
}
{
"id": 1,
"code": "color",
"label": "Color",
"attribute_type": "select",
"created_at": "2024-01-01T12:00:00Z"
}