Admin Catalog: Attributes
Create a new attribute
Creates an attribute with optional translations and options (for select/multiselect/checkbox types). The code must be unique, pass the Code rule (letters/digits/underscore), and not be a reserved word (type, attribute_family_id).
post/catalog/attributes
Request
- Base URLhttp://localhost:8000/api/admin
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"code": "material",
"admin_name": "Material",
"type": "select",
"swatch_type": "text",
"is_filterable": true,
"is_visible_on_front": true,
"position": 10,
"translations": {
"en": {
"name": "Material"
},
"fr": {
"name": "Matière"
}
},
"options": [
{
"admin_name": "Cotton",
"sort_order": 1,
"translations": {
"en": {
"label": "Cotton"
},
"fr": {
"label": "Coton"
}
}
}
]
}Response
Attribute created successfully. Returns the full attribute detail.
Changes
No recorded changes to this operation across all 8 revisions of this API.