Attributes
Attributes describe customer-facing or internal properties of a product (SKU, name, color, size, etc.). For select / multiselect types, every selectable value is inlined under options[] — fetch a single attribute and you have its full option set in one request.
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/shop/attributes | Paginated list of attributes |
| GET | /api/shop/attributes/{id} | Single attribute by ID |
Use the example switcher above to flip between the list and single calls.
Request Headers
| Header | Required | Description |
|---|---|---|
Accept | Yes | application/json |
X-STOREFRONT-KEY | Yes | Storefront API key (pk_storefront_…) |
Query Parameters (collection only)
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-based) |
per_page | integer | 10 | Items per page. Max 50. |
Pagination headers are emitted on the collection. See Pagination.
Attribute Object Fields
Both endpoints return the same shape — the collection wraps an array of these objects, the single endpoint returns one.
| Field | Type | Description |
|---|---|---|
id | integer | Attribute primary key |
code | string | Unique attribute code (sku, color, size, …) |
adminName | string | Internal admin label |
type | string | text, textarea, price, boolean, select, multiselect, datetime, date, image, file, checkbox |
swatchType | string | null | dropdown, text, color, image — only for visual selection attributes |
position | integer | Display order in admin |
isRequired | boolean (0/1) | Whether values are required when saving a product |
isUnique | boolean (0/1) | Whether values must be unique across products |
isFilterable | boolean (0/1) | Whether the attribute appears in storefront layered filters |
isComparable | boolean (0/1) | Whether the attribute appears in product comparison |
isConfigurable | boolean (0/1) | Whether the attribute can be used to build configurable variants |
isUserDefined | boolean (0/1) | 1 for custom attributes, 0 for system attributes |
isVisibleOnFront | boolean (0/1) | Whether the attribute is shown on the product detail page |
valuePerLocale | boolean (0/1) | Whether values can differ per locale |
valuePerChannel | boolean (0/1) | Whether values can differ per channel |
enableWysiwyg | boolean (0/1) | Whether textarea type uses a WYSIWYG editor |
validations | string | Serialized validation rules (e.g. "{ required: true }") |
columnName | string | Storage column on product_attribute_values |
createdAt, updatedAt | string (ISO-8601) | Timestamps |
options | array | Inline list of AttributeOption objects (empty for non-select types) |
translation | object | null | Translation for the current request locale ({ id, attributeId, locale, name }) |
translations | array of IRI strings | Links to all locale translations — see IRIs & HATEOAS |
Embedded options[]
Each option carries:
| Field | Type | Description |
|---|---|---|
id | integer | Option primary key |
adminName | string | Internal admin label |
sortOrder | integer | Display order within the attribute |
translation | object | Current-locale translation ({ id, attributeOptionId, locale, label }) |
translations | array | All locale-specific labels |
For non-select types (text, textarea, boolean, price, date, …), options is an empty array [].
Use Cases
- Build the attribute set for the product editor / filter sidebar.
- Discover which attributes are filterable (
isFilterable=1) for a category page. - Resolve
code→idmappings for filter query parameters on/products. - Render a configurable product's variant selectors (fetch the attribute once, get every option inline).
- Resolve attribute metadata (
type,validations) before building a product-edit form.
Related Resources
- Attribute Options
- Attribute Translations
- Get Products — pass
?<attribute_code>=<option_id>to filter - Introduction → IRIs & HATEOAS

