Ana içeriğe geç

getBlocksByPageUrl

Receiving objects for a related block by page URL.

Description

Get PositionBlock objects for page by url. It returns a Promise that resolves to an array of IPositionBlock objects.

Pages.getBlocksByPageUrl(

url*, langCode

);

Parameters schema

Schema

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

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

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

Example with attributes

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

Example response

[
{
"id": 1,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Product Block"
},
"isVisible": true,
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "product_block",
"templateIdentifier": null,
"isSync": false,
"attributeValues": {},
"countElementsPerRow": 1,
"quantity": 1,
"products": [
{
"id": 2959,
"localizeInfos": {
"title": "Split"
},
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"attributeSetIdentifier": "test",
"position": 1,
"templateIdentifier": null,
"shortDescTemplateIdentifier": "product_preview",
"price": 120,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"sku": null,
"isSync": true,
"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
}
},
"categories": [
"catalog"
],
"rating": {},
"isVisible": true,
"moduleFormConfigs": [
{
"id": 12,
"formIdentifier": "review",
"moduleIdentifier": "catalog",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "catalog",
"isNested": true
}
],
"formDataCount": 582,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"2954": 582
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
}
]
},
{
"id": 4,
"attributeSetIdentifier": "block",
"localizeInfos": {
"title": "test"
},
"isVisible": true,
"version": 31,
"position": 2,
"identifier": "test",
"type": "common_block",
"templateIdentifier": null,
"isSync": true,
"attributeValues": {
"block-text": {
"type": "string",
"value": "some text",
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"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,
"timeIntervals": [
[
"2025-04-07T09:00:00.000Z",
"2025-04-07T10:00:00.000Z"
],
[
"2025-04-07T10:00:00.000Z",
"2025-04-07T11:00:00.000Z"
],
[
"2025-04-07T11:00:00.000Z",
"2025-04-07T12:00:00.000Z"
],
"..."
]
}
],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12"
}
],
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
}
}
},
{
"id": 6,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Frequently ordered"
},
"isVisible": true,
"version": 2,
"position": 3,
"identifier": "freq_ordered",
"type": "frequently_ordered_block",
"templateIdentifier": "frequently_ordered_block_default",
"isSync": false,
"attributeValues": {}
},
"..."
]

Response schema

Schema: IPositionBlock[]

id: number
The identifier of the object.
example: 1

attributeSetIdentifier: string | null
Set of attributes id.
example: "block"

localizeInfos: ILocalizeInfo
The name of the page, taking into account localization.
example:

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

version: number
The version number of the object.
example: 0

position: number
The position of the object.
example: 1

identifier: string
The textual identifier for the record field.
example: "product_block"

type: BlockType
Block type.
example: "product"

templateIdentifier: string | null
User id of the linked template.
example: null

isVisible: boolean
A sign of page visibility.
example: true

isSync: boolean
Indication of page indexing.
example: false

attributeValues: IAttributeValues
Map of attribute values keyed by marker; empty object when none.
example:

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

countElementsPerRow: number
Number of elements displayed per row in the block, if applicable.
example: 3

quantity: number
Quantity pages in block.
example: 1

similarProducts: IProductsResponse
Similar products response (total + items). Present only for "similar_products_block" blocks and only when traffic-saving mode is off.

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

similarProducts.items: IProductsEntity[]
An array of product entities.
example:

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

products: IProductsEntity[]
Array of products associated with the block. Present only for "product_block" blocks and only when traffic-saving mode is off.

products.id: number
The unique identifier.
example: 12345

products.localizeInfos: ILocalizeInfo
The name of the products, taking into account localization.
example:

{}

products.statusIdentifier: string | null
Product page status identifiers (may be null).
example: "in_stock"

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

{ "title": "Sale" }

products.attributeSetIdentifier: string | null
Set of attributes id.
example: "set_12345"

products.position: number
Item number (for sorting).
example: 1

products.price: number | null
The value of the product page price taken from the index.
example: 150.00

products.additional: object
Additional value from the index.
example:

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

products.sku: string | null
Product SKU (Stock Keeping Unit), may be null.
example: "SKU_12345"

products.isSync: boolean
Indication of page indexing.
example: true

products.attributeValues: IAttributeValues
Array of attribute values from the index, represented.
example:

[
{
"id": "color",
"value": "red"
}
]

products.categories: string[]
Product categories.
example:

[
1,
2,
3
]

products.isVisible: boolean
A sign of page visibility.
example: true

products.moduleFormConfigs: Array<IFormConfig>
Module form configurations (optional).

products.rating: IRating
Rating data.

products.isPositionLocked: boolean
Sorting position lock indicator (optional).
example: false

products.relatedIds: number[]
Ids of related product pages.
example:

[
12345,
67890
]

products.paymentStages: unknown
Payment stages data (may be null).
example: null

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

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

{}

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

products.shortDescTemplateIdentifier: string | null
User id of the linked template for a short description.
example: "short_desc_template_12345"

products.signedPrice: string
The signed price of the product is obtained along with the product data when signPrice is set.
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

products.productPages: IProductPageRef[]
Array of product page references linking the product to its pages.
example:

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

products.blocks: string[]
Array of block identifiers.
example:

[
"block_12345",
"block_67890"
]

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