Skip to main content

getBlocksByPageUrl

Get the blocks linked to a page by its URL.

Description​

Fetches the blocks attached to the page with the given url and resolves to an array of IPositionBlock objects.

.getBlocksByPageUrl(

,

);

Parameters schema​

Schema

url(required): string
Page URL.
example: "about"

langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"

Examples​

Minimal example​

const response = await Pages.getBlocksByPageUrl('catalog');

Example with langCode​

const response = await Pages.getBlocksByPageUrl('catalog', 'en_US');

Example response​

[
{
"id": 1,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Product Block"
},
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "product_block",
"templateIdentifier": null,
"isVisible": true,
"isSync": false,
"attributeValues": {},
"countElementsPerRow": 1,
"quantity": 1,
"products": [
{
"id": 2959,
"localizeInfos": {
"title": "Split"
},
"isVisible": true,
"isSync": false,
"sku": null,
"price": 120,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"categories": [
"catalog"
],
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"templateIdentifier": null,
"shortDescTemplateIdentifier": "product_preview",
"attributeValues": {
"p": {
"type": "float",
"value": 120,
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"p1": {
"type": "float",
"value": 40,
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
},
"p2": {
"type": "float",
"value": 60,
"isIcon": false,
"position": 2,
"additionalFields": {},
"isProductPreview": false
},
"p3": {
"type": "float",
"value": 20,
"isIcon": false,
"position": 3,
"additionalFields": {},
"isProductPreview": false
},
"currency": {
"type": "string",
"value": "usd",
"isIcon": false,
"position": 4,
"additionalFields": {},
"isProductPreview": false
}
},
"attributeSetIdentifier": "test",
"position": 1,
"rating": {},
"moduleFormConfigs": [
{
"id": 12,
"formIdentifier": "review",
"moduleIdentifier": "catalog",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "catalog",
"isNested": true
}
],
"formDataCount": 823,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
}
]
},
{
"id": 4,
"attributeSetIdentifier": "block",
"localizeInfos": {
"title": "test"
},
"version": 31,
"position": 2,
"identifier": "test",
"type": "common_block",
"templateIdentifier": null,
"isVisible": true,
"isSync": true,
"attributeValues": {
"block-text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": {}
},
"interval": {
"type": "timeInterval",
"value": [
{
"values": [
{
"id": "bbc82c9f-1bc4-4c86-b83c-c062016eb7cb",
"dates": [
"2025-04-14T00:00:00.000Z",
"2025-04-14T00:00:00.000Z"
],
"times": [
[
{
"hours": 9,
"minutes": 0
},
{
"hours": 10,
"minutes": 0
}
],
[
{
"hours": 10,
"minutes": 0
},
{
"hours": 11,
"minutes": 0
}
],
[
{
"hours": 11,
"minutes": 0
},
{
"hours": 12,
"minutes": 0
}
]
],
"intervals": [],
"exceptions": [],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12",
"inEveryWeek": true,
"inEveryMonth": true
}
],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12"
}
],
"position": 1,
"additionalFields": {}
}
}
},
{
"id": 6,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Frequently ordered"
},
"version": 2,
"position": 3,
"identifier": "freq_ordered",
"type": "frequently_ordered_block",
"templateIdentifier": "frequently_ordered_block_default",
"isVisible": true,
"isSync": false,
"attributeValues": {}
}
]

Response schema​

Schema: IPositionBlock[]

id: number
Object ID.
example: 1

attributeSetIdentifier: string | null
Marker of the attribute set, or null if none is assigned.
example: "block"

localizeInfos: ILocalizeInfo
Localized data of the block; contains its title.
example:

{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}

version: number
Version number of the object; changes with each update.
example: 0

position: number
Position of the object, used for sorting.
example: 1

identifier: string
Text identifier (marker) of the object.
example: "product_block"

type: BlockType
Block type.
example: "product_block"

templateIdentifier: string | null
Marker of the linked template, or null when none is linked.
example: null

isVisible: boolean
Whether the block is visible.
example: true

isSync: boolean
Whether the block's attribute index is up to date for the requested language.
example: false

attributeValues: IAttributeValues
Attribute values keyed by marker; an empty object when there are none.
example:

{
"block-text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": {}
}
}

countElementsPerRow: number
Number of items per row in the block, if set.
example: 3

quantity: number
Number of products the block shows, from its product settings.
example: 1

similarProducts: IProductsResponse
Similar products, as total and items. Present only for similar_products_block blocks, and only when traficLimit is off.

similarProducts.total: number
Total number of products found.
example: 100

similarProducts.items: IProductsEntity[]
Products in this response.
example:

[
{
"id": 12345,
"title": "Product 1"
},
{
"id": 67890,
"title": "Product 2"
}
]

similarProducts.totalFound: number
Number of products matched before limits are applied; returned by block product endpoints (similarProducts, cart/wishlist recommendations, frequently ordered). Optional.
example: 2

products: IProductsEntity[]
Products linked to the block. Present only for product_block blocks, and only when traficLimit is off.

products.id: number
ID of the product.
example: 12345

products.localizeInfos: ILocalizeInfo
Localized product data, such as the title.
example:

{}

products.statusIdentifier: string | null
Marker of the product status, or null.
example: "in_stock"

products.statusLocalizeInfos: ILocalizeInfo
Localized status name for the product.
example:

{ "title": "Sale" }

products.attributeSetIdentifier: string | null
Marker of the attribute set, or null if none is assigned.
example: "set_12345"

products.position: number
Position used for sorting. Present on catalog/list/ids//blocks entities; absent from vector (semantic) search results, so typed optional.
example: 1

products.price: number | null
Product price from the search index.
example: 150.00

products.additional: object
Extra values computed by the search index, such as the price range in prices.min and prices.max.
example:

{
"prices": {
"min": 5,
"max": 150
}
}

products.sku: string | null
Product SKU from the search index, or null.
example: "SKU_12345"

products.isSync: boolean
Whether the product's attribute index is up to date for the requested language. When false, an empty or partial attributeValues means the values are not published yet, not that there are none.
example: true

products.attributeValues: IAttributeValues
Attribute values keyed by attribute marker (an object, not an array).
example:

{
"product-name": {
"type": "string",
"value": "Split",
"position": 0
},
"price": {
"type": "integer",
"value": 150,
"position": 1
}
}

products.categories: string[]
URLs of the catalog pages the product belongs to.
example:

[
"catalog"
]

products.isVisible: boolean
Whether the product is visible.
example: true

products.moduleFormConfigs: Array<IFormConfig>
Form configurations of the module.

products.rating: IRating
Rating data: average value, likes and dislikes, and the calculation method.

products.isPositionLocked: boolean
Whether the sorting position is locked.
example: false

products.relatedIds: number[]
IDs of related products.
example:

[
12345,
67890
]

products.paymentStages: unknown
Payment stages of the product: an array of { title, value, marker } objects, or null when none are set.
example: null

products.distance: number
Relevance distance in vector (semantic) search. Present only in vector search results.
example: 0.42

products.discountConfig: Record<string, unknown>
Discount configuration.
example:

{}

products.templateIdentifier: string | null
Marker of the linked template.
example: "template_12345"

products.shortDescTemplateIdentifier: string | null
Marker of the template used for the short description.
example: "short_desc_template_12345"

products.signedPrice: string
Signed token (JWT) that fixes the product price for an order. Returned when signPrice is set.
see: Fixed product price
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

products.productPages: IProductPageRef[]
Links between the product and the catalog pages it belongs to.
example:

[
{
"id": 16,
"pageId": 4,
"productId": 15,
"positionId": 244,
"categoryPath": "products"
}
]

products.blocks: string[]
Markers of the blocks shown on the product page (not the blocks whose selection includes the product).
example:

[
"block_12345",
"block_67890"
]

signedPrice is a signed token that carries the locked price. Pass it back when you create an order. See Fixed product price (signedPrice).