Skip to content

Categories

Always filtered to status=1 — disabled categories are never returned. Disabled IDs respond 404.

If you need a hierarchical (nested) tree response, use Get Category Tree instead.

Endpoints

MethodPathPurpose
GET/api/shop/categoriesFlat, paginated list of active categories
GET/api/shop/categories/{id}Single category by ID

Use the example switcher above the curl block to flip between the two.

Request Headers

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesStorefront API key (pk_storefront_…)
X-LocaleNoOverride request locale
X-ChannelNoOverride channel scope

Query Parameters (collection only)

ParameterTypeDefaultDescription
pageinteger1Page number (1-based)
per_pageinteger15Items per page. Max 100 for this endpoint.
parent_idintegerReturn only direct children of this category ID. Accepts parentId as alias.

Pagination headers (X-Total-Count, X-Page, X-Per-Page, X-Total-Pages) are emitted on the collection. See Pagination.

Category Object Fields

Both endpoints return the same shape — the collection wraps an array of these objects, the single endpoint returns one.

FieldTypeDescription
idintegerCategory primary key
positionintegerDisplay order
statusboolean (0/1)Always 1 on this endpoint
displayModestringproducts_and_description, products, or description_only
logoPathstring | nullStorage path to the category image
logoUrlstring | nullFully-qualified image URL
urlstringStorefront URL for the category page
_lft, _rgtintegerNested-set tree pointers (internal; safe to ignore on the client)
createdAt, updatedAtstring (ISO-8601)Timestamps
translationobjectInline translation for the request locale (see below)
translationsarray of IRI stringsAll locale translations — GET <iri> to dereference
parentstring (IRI) | nullIRI to parent category. null for root categories
childrenarrayInline child category objects (one level deep). Empty [] for leaves
filterableAttributesarrayInline list of attributes flagged as filterable for this category

Inline translation fields

FieldTypeDescription
idintegerTranslation primary key
categoryIdintegerOwning category ID
localestringLocale code (en, fr, de, …)
localeIdintegerLocale primary key
namestringLocalized category name
slugstringURL slug (e.g. electronics)
urlPathstringFull URL path including any parent slugs
descriptionstringHTML description shown on the category page
metaTitlestringSEO <title> value
metaDescriptionstringSEO meta description
metaKeywordsstringSEO meta keywords

See IRIs & HATEOAS for how to dereference the IRI fields.

Use Cases

  • Render a flat category listing for a sidebar, footer, or admin search.
  • Get all direct children of a parent (?parent_id=N) for a "subcategories" widget without traversing the whole tree.
  • Read filterableAttributes to build a category-page faceted filter UI without an extra round trip.
  • Walk up to the parent for breadcrumbs by following the parent IRI.
  • Switch locales by following an entry in translations[] instead of re-issuing the request with a different X-Locale header.

Released under the MIT License.