Skip to main content

getProducts

Search all product objects with pagination and filter.

Description​

Fetches products that match the filter conditions in body; userQuery sets pagination and sorting. Resolves to an IProductsResponse: the products are in items, the total count in total.

.getProducts( , , );

Parameters schema​

Schema

body: IFilterParams[]
Request body. Default: [].
example:

[
{
"attributeMarker": "price",
"conditionMarker": "mth",
"statusMarker": "waiting",
"conditionValue": 1,
"pageUrls": [
"23-laminat-floorwood-maxima"
],
"isNested": false,
"title": ""
},
{
"attributeMarker": "price",
"conditionMarker": "lth",
"conditionValue": 3,
"pageUrls": [
"23-laminat-floorwood-maxima"
],
"isNested": false,
"title": ""
}
]

body.attributeMarker: string
Marker of the indexed attribute to filter by. Optional: a filter entry can select by statusMarker, pageUrls or title alone, for example { statusMarker: "in_stock" }.
example: "color"

body.conditionMarker: string | null
Marker of the filter condition, such as eq. Default: null.
example: "eq"

body.conditionValue: number | string | null
Value to compare against. Required together with attributeMarker. Default: null.
example: "new"

body.pageUrls: string[] | null
URLs of the category pages.
example: ["23-laminat-floorwood-maxima"]

body.statusMarker: string | null
Marker of the product status. Not set by default.
example: "in_stock"

body.title: string | null
Product name.
example: "Laminatboden Maxima"

body.isNested: boolean
Whether to include products from the nested categories of the pages in pageUrls. Default: false.
example: true

body.ids: number[]
Restrict the result to these product IDs.
example: [2954, 2957]

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

userQuery: IProductsQueryBase
Optional query parameters.
example:

{
"limit": 30,
"offset": 0,
"sortOrder": "DESC",
"sortKey": "id",
"signPrice": "my_order"
}

userQuery.offset(required): number
Number of records to skip. Default: 0. offset + limit must not exceed 200; a larger window is rejected with 400.

userQuery.limit(required): number
Maximum number of records to return. Default: 30.

userQuery.sortOrder(required): string
Sort order: "DESC" or "ASC". Default: "DESC".

userQuery.sortKey(required): string
Field to sort by: "id", "position", "title", "date", "price" or "status". Default: "position".

userQuery.signPrice: string
Marker of the order storage to fix prices for. When set, each product comes with a signedPrice that holds the price for a limited time. Must be an existing orders storage marker of the project, e.g. "my_order"; a marker with no such storage fails the whole request with 404 Specified orders storage for price signature not found.
see: Fixing the price

aggregate: IProductsAggregate
Group the result instead of a flat list; it travels next to filter, not inside a filter entry. When set, the response is an IAggregatedProductsResponse of groups and response validation is skipped.
see: getProducts

aggregate.aggregateBy(required): 'attribute' | 'title'
Group by an attribute value or by title.

aggregate.aggregateAttr: string
Text marker of the attribute to group by; required with aggregateBy: "attribute", ignored with "title". Must match /^[A-Za-z]+[a-zA-Z0-9_-]*$/.

Record limit. If the user group's permission for this method allows only restricted reading, the API returns at most the number of records set in the project settings (10 by default), whatever limit you pass. With full read access, limit works as usual. See Module permissions (opens in a new tab).

signPrice locks the returned price for a limited time. Set it to your order storage marker. See Fixing the price (signPrice).

Examples​

Minimal example​

const response = await Products.getProducts();

Example with body parameter​


const body = [
{
,
,
,
,
],
,
},
{
,
,
,
],
,
}
];

const response = await Products.getProducts(body);

Use filters to find specific products:

attributeMarker: The text identifier of the indexed attribute by which values are filtered. conditionMarker: The type of condition to apply to the attribute value.

MarkerMeaningExample
eqEqualcolor = "red"
neqNot equalcategory ≠ "archived"
inContains (case-insensitive substring match)brand contains "app"
ninDoes not contain (case-insensitive substring match)brand does not contain "fake"
mthGreater thanprice > 100
lthLess thanprice < 50
exsExists (has value)Has description
nexsDoes not existNo image
patMatches a regular-expression pattern where each * stands for exactly one character and _ for a space. With search indexing on, the pattern must match the whole valuecurrency matches "s" (finds "usd")
sameHas the same value as at least one other product. conditionValue is ignoredproducts that share a price
same_partHas the same value as another product once the last segments are cut off. conditionValue is delimiter|count (default -|2); a value with count or fewer segments is compared wholeSKUs "ABC-1-S" and "ABC-1-M" share "ABC"

conditionValue: The value to compare against.

Example response​

{
"items": [
{
"id": 3445,
"localizeInfos": {
"title": "Subscription"
},
"isVisible": true,
"isSync": false,
"sku": null,
"price": 150,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"categories": [
"catalog"
],
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"templateIdentifier": null,
"shortDescTemplateIdentifier": "product_preview",
"attributeValues": {
"price": {
"type": "integer",
"value": 150,
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"currency_products": {
"type": "string",
"value": "USD",
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
}
},
"attributeSetIdentifier": "subscription",
"isPositionLocked": false,
"position": 1,
"rating": {},
"paymentStages": null,
"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,
"showAggregatedRating": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"2954": 823
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
},
{
"id": 2960,
"localizeInfos": {
"title": "Percent split"
},
"isVisible": true,
"isSync": false,
"sku": null,
"price": 180,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"categories": [
"catalog"
],
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"templateIdentifier": null,
"shortDescTemplateIdentifier": "product_preview",
"attributeValues": {
"s0": {
"type": "float",
"value": 180,
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"s1": {
"type": "float",
"value": 60,
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
},
"s2": {
"type": "float",
"value": 40,
"isIcon": false,
"position": 2,
"additionalFields": {},
"isProductPreview": false
},
"currency": {
"type": "string",
"value": "",
"isIcon": false,
"position": 3,
"additionalFields": {},
"isProductPreview": false
}
},
"attributeSetIdentifier": "percent_split",
"isPositionLocked": false,
"position": 2,
"rating": {},
"paymentStages": [
{
"title": "s1",
"value": 108,
"marker": "s1"
},
{
"title": "s2",
"value": 72,
"marker": "s2"
}
],
"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,
"showAggregatedRating": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"2954": 823
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
},
{
"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",
"isPositionLocked": false,
"position": 3,
"rating": {},
"paymentStages": [
{
"title": "p1",
"value": 40,
"marker": "p1"
},
{
"title": "p2",
"value": 60,
"marker": "p2"
},
{
"title": "p3",
"value": 20,
"marker": "p3"
}
],
"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,
"showAggregatedRating": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"2954": 823
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
}
],
"total": 6
}

Response schema​

Schema: IProductsResponse

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

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

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

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

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

{}

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

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

{ "title": "Sale" }

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

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

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

items.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
}
}

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

items.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

items.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
}
}

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

[
"catalog"
]

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

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

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

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

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

[
12345,
67890
]

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

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

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

{}

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

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

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

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

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

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

[
"block_12345",
"block_67890"
]

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

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


Usage examples​

Step-by-step walkthroughs in the documentation:

  • Filter by attributes: filter products by an attribute value using condition markers (eq, neq, in, mth, lth, etc.).
  • Price range: narrow products down to a specific price range with mth / lth filters.

Try it live​

Run this method in the JS SDK sandbox. On your first visit, connect your Project URL and App Token, then open:

  • Filter by attributes: filter products by an attribute value using condition markers (eq, neq, in, mth, lth, etc.).
  • Price range: narrow products down to a specific price range with mth / lth filters.