Skip to content

Attribute Options

Attribute options are the selectable values for a select / multiselect attribute (color values, sizes, brands, etc.).

Most clients should prefer reading options inline via GET /api/shop/attributes/{id} — that returns options scoped to a single attribute. Use these endpoints when you need the full option catalog or want to look up an option by ID without knowing its parent attribute.

⚠️ The URL is flat, not nested under an attribute: /attribute-options, NOT /attributes/{id}/options.

Endpoints

MethodPathPurpose
GET/api/shop/attribute-optionsPaginated flat list of every option
GET/api/shop/attribute-options/{id}Single option by ID

Request Headers

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesStorefront API key (pk_storefront_…)

Query Parameters (collection only)

ParameterTypeDefaultDescription
pageinteger1Page number (1-based)
per_pageinteger10Items per page. Max 50.

Pagination headers are emitted on the collection. See Pagination.

Attribute Option Object Fields

FieldTypeDescription
idintegerOption primary key — use this value when filtering products by an attribute
adminNamestringInternal admin label
sortOrderintegerDisplay order within its parent attribute
translationobjectCurrent-locale translation: { id, attributeOptionId, locale, label }
translationsarrayAll locale-specific labels (each { id, attributeOptionId, locale, label }). Empty [] if no other locales have stored labels.

The parent attribute is not embedded in this response. To find which attribute an option belongs to, fetch the attribute itself.

Use Cases

  • Pre-load all option labels in every storefront locale for offline / SPA caching.
  • Resolve historical option IDs stored against orders or carts back to readable labels.
  • Build admin-style "find option by label" search.
  • Look up the localized label for a specific option in a non-default locale.

Released under the MIT License.