For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • Overview
  • Learning Plans
    • Developer Foundations
    • Composable Developer
    • Stencil Developer
    • B2B Developer
  • Courses
        • Widget Templates
        • Lab - Widget Template
    • Learning Changelog
Dev Portal
LogoLogo
On this page
  • Create a Widget Template
  • Get All Widget Templates
  • Get a Widget Template
  • Update a Widget Template
  • Delete a Widget Template
CoursesWidgets - REST APIModule 3: Widget Templates

Widget Templates

Was this page helpful?
Previous

Lab - Regions

Next

Lab - Widget Template

Built with

Plan: Stencil Developer

Lesson 6 of 22 · 15 min

Widget templates are reusable Handlebars-enabled HTML templates which define the structure of the widget on a page. You can use built-in Handlebars helpers such as {{if}} and {{each}} to add conditional logic to a widget template. Widget templates can be reused to build multiple widgets.

There is a limit of 1000 custom widget templates per store.

Create a Widget Template

POST /v3/content/widget-templates

Creates a widget template.

Required Fields

  • name
  • template

Get All Widget Templates

GET /v3/content/widget-templates

Returns a list of widget templates.

Request Parameters:

  • page - (integer) Specifies the page number in a limited (paginated) list of products.
  • limit - (integer) Controls the number of items per page in a limited (paginated) list of products.
  • widget_template_kind (string) - The kind of widget template.

Get a Widget Template

GET /v3/content/widget-templates/{uuid}

Returns a single widget template.

Update a Widget Template

PUT /v3/content/widget-templates/{uuid}

Updates a widget template.

Delete a Widget Template

DELETE /v3/content/widget-templates/{uuid}

Deletes a widget template.