The Block Details API provides comprehensive information about the structure and properties of blocks in your storefront. This documentation outlines all available fields and their values that you can access and modify through the API.
The following table outlines all fields available in a block object:
Field | Type | Description |
---|---|---|
block_id |
integer | A unique identifier of the block. |
type |
string | The type of the block, which determines its functionality and available properties. |
properties |
object | Configuration settings specific to the block type that control its behavior and appearance. |
company_id |
integer | ID of the vendor associated with this block. |
lang_code |
string | Two-letter language code (e.g., en , es , fr ) that specifies which language version of the block this is. |
name |
string | The display name of the block as it appears in the admin interface. |
content |
object | Content data specific to the block type. Available for certain block types like banners , html_block , etc. |
Different block types have unique properties and content requirements. Here are some common block types and their specific properties:
html_block
){ "block_id": 42, "type": "html_block", "properties": { "template": "blocks/html_block.tpl" }, "company_id": 1, "lang_code": "en", "name": "Special Offer Banner", "content": { "content": "<div class=\"offer-banner\">Limited Time Offer: 20% Off All Orders</div>" } }
products
){ "block_id": 43, "type": "products", "properties": { "template": "blocks/products/grid_list.tpl", "item_number": 8, "hide_options": false, "show_price": true, "show_rating": true }, "company_id": 1, "lang_code": "en", "name": "Featured Products", "content": { "items": { "filling": "bestsellers", "limit": 8 } } }
menu
){ "block_id": 44, "type": "menu", "properties": { "template": "blocks/menu/dropdown_horizontal.tpl" }, "company_id": 1, "lang_code": "en", "name": "Main Navigation Menu", "content": { "items": { "menu_id": 12 } } }
While each block type has unique properties, several common properties are shared across multiple block types:
Property | Type | Description |
---|---|---|
template |
string | The template file used to render the block on the storefront. |
width |
string | Width of the block. Possible values: full_width , content_width , or a specific pixel value. |
wrapper |
string | CSS class for the block wrapper for custom styling. |
user_class |
string | Additional CSS classes to apply to the block. |
animation |
object | Settings for visual animations when the block enters the viewport. |
The content
object varies significantly based on the block type:
content
: String containing the HTML content to displayitems.filling
: Method for selecting products. Options include manually
, newest
, bestsellers
, rating
, on_sale
items.item_ids
: For manual filling, a comma-separated list of product IDsitems.limit
: Maximum number of products to displayitems.filling
: Method for selecting categories. Options include manually
, dynamic_tree
, full_tree
items.item_ids
: For manual filling, a comma-separated list of category IDs