Skip to content

List Sections ​

The published sections of the current channel's active theme, in the order they are drawn.

Endpoint ​

MethodPathPurpose
GET/api/shop/sectionsList sections

Query parameters ​

ParameterDescription
typeExact match on the section type.
pagePage number (1-based).
per_pageItems per page (default 10, max 100).

Response fields ​

FieldTypeDescription
idintegerSection ID.
themeCodestringTheme the section belongs to.
channelIdintegerChannel the section belongs to.
typestringOne of the six section types.
namestringSection name.
sortOrderintegerPosition in the page.
statusintegerAlways 1 — only published sections are returned.
createdAtstringISO 8601.
updatedAtstringISO 8601.
translationobject | nullContent for the current locale.
translation.idintegerTranslation row ID.
translation.sectionIdintegerSection the translation belongs to.
translation.localestringLocale code.
translation.optionsstringJSON-encoded content.
translationsarrayEvery locale the section has content for, same shape as translation.

Use cases ​

  • Render a home page — request without type, then switch on each section's type to pick a component, and parse options for its content.
  • Render just the footer — ?type=footer_links returns the one footer section the channel has.

Best practices ​

  • options is a JSON string, not an object. Parse it before reading fields out of it, in both translation and each entry of translations.
  • Draw them in the order returned. The response is already in render order; sorting by sortOrder yourself is unnecessary and gets the footer wrong.
  • An empty array means the channel's active theme has no published sections, not that something failed — a freshly switched theme starts empty.

Permissions ​

Public. Requires only the storefront key.

Released under the MIT License.