Attributes for a category
GET/v1/categories/{id}/attributes
scope catalog.read
The attributes a listing in this category must carry, including everything inherited from parent categories. Nothing can be published until the required ones are supplied — send these ids back in attributes when creating a product.
Query parameters#
| Name | Example | |
|---|---|---|
lang | ro | Language for names and option values |
Response#
| Field | Type | Description |
|---|---|---|
category_id | integer | The category these attributes belong to. |
language | string | Which language the names and option values came back in. |
count | integer | How many attributes. |
data | array | The attributes for this category. Read this BEFORE your first push: which are mandatory is decided per category, and a create missing one fails with missing_required_attribute. |
data[]. | integer | The MASTER id, and what you send as attributes[].field_id. |
data[]. | integer | This attribute's id in the requested language. For matching only. |
data[]. | string | Display name — Brand, Frame size, and so on. |
data[]. | string | A stable machine-readable name. Map your own field onto this, not onto the translated label. |
data[]. | string | How the attribute is answered. Anything carrying options takes an option_id; a free-text type takes value instead. |
data[]. | boolean | Whether a product in this category must carry it. This is the list that decides whether your create succeeds. |
data[]. | array | The allowed values, where the attribute has a fixed list. Absent or empty means free text. |
data[]. | integer | The MASTER option id, and what you send as attributes[].option_id. |
data[]. | integer | The option id in the requested language. For matching only. |
data[]. | string | The option as buyers see it. |
data[]. | string | A stable name for the option. Map your own values onto this rather than the translated text. |
Example
{
"category_id": 4291,
"language": "ro",
"count": 9,
"data": [
{
"id": 32,
"tid": 32,
"name": "Brand",
"slug": "brand",
"type": "checkbox_multiple",
"required": true,
"options": [
{
"id": 226,
"tid": 226,
"value": "Avid",
"slug": "avid"
}
]
}
]
}