getProductsByIds
Get multiple products by their IDs.
Description
Fetches the products whose IDs you pass as a comma-separated string, and resolves to an array of IProductsEntity objects.
.getProductsByIds(
,
,
);
Parameters schema
Schema
ids(required): string
Comma-separated product IDs.
example: "12345,67890"
langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"
userQuery: IProductsByIdsQuery
Optional query parameters.
example:
{
"signPrice": "orders"
}
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.
signPricelocks 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.getProductsByIds('2954,3445');
Example with userQuery
userQuery takes only signPrice. Pagination and sorting fields are not applied: the method returns every product whose ID is in ids.
const userQuery = {
"signPrice": "orders"
};
const response = await Products.getProductsByIds('2954,3445', 'en_US', userQuery);
Example response
[
{
"id": 2954,
"localizeInfos": {
"title": "Box"
},
"isVisible": true,
"isSync": false,
"sku": null,
"price": 51,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"categories": [
"catalog"
],
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"templateIdentifier": null,
"shortDescTemplateIdentifier": "product_preview",
"attributeValues": {
"product-name": {
"type": "string",
"value": "product-name",
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"price": {
"type": "integer",
"value": 51,
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
},
"currency_products": {
"type": "string",
"value": "usd",
"isIcon": false,
"position": 2,
"additionalFields": {},
"isProductPreview": false
},
"img": {
"type": "image",
"value": {
"size": 742690,
"filename": "files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.jpeg",
"contentType": "image/jpeg",
"previewLink": {
"default": [
"data:image/webp;base64,UklGRmwAAABXRUJQVlA4IGAAAADQAQCdASoQABAABUB8JbACdACZZ3P8AAD+wGsUXBs/r069WpdrcuaTNfVxqWIetuaIdIvOMkSp9iJRxE+KhA2YHbrVehhMRj/j5+DUdjWn1v5YtZ7vw0IgPi9R5vkAAAA=",
"https://your-project.oneentry.cloud/cloud-static/files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.preview.default.jpeg"
]
},
"downloadLink": "https://your-project.oneentry.cloud/cloud-static/files/project/product/2954/image/48853cbf-4462-42c6-8b99-d14f721c21a2.jpeg",
"defaultPreview": "default"
},
"isIcon": false,
"position": 3,
"additionalFields": {},
"isProductPreview": true
}
},
"attributeSetIdentifier": "products",
"isPositionLocked": false,
"position": 1,
"rating": {},
"paymentStages": null,
"productPages": [
{
"id": 2847,
"pageId": 10,
"productId": 2954,
"positionId": 3190,
"categoryPath": "catalog"
}
],
"blocks": [
"product_block",
"test",
"similar"
],
"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,
"entityFormDataCount": {
"2954": 823
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
},
{
"id": 2955,
"localizeInfos": {
"title": "Product"
},
"isVisible": true,
"isSync": false,
"sku": null,
"price": 150,
"additional": {
"prices": {
"min": 51,
"max": 180
}
},
"categories": [
"catalog"
],
"statusIdentifier": "sale",
"statusLocalizeInfos": {
"title": "Sale"
},
"templateIdentifier": null,
"shortDescTemplateIdentifier": null,
"attributeValues": {
"p": {
"type": "float",
"value": 150,
"isIcon": false,
"position": 0,
"additionalFields": {},
"isProductPreview": false
},
"p1": {
"type": "float",
"value": 50,
"isIcon": false,
"position": 1,
"additionalFields": {},
"isProductPreview": false
},
"p2": {
"type": "float",
"value": 50,
"isIcon": false,
"position": 2,
"additionalFields": {},
"isProductPreview": false
},
"p3": {
"type": "float",
"value": 50,
"isIcon": false,
"position": 3,
"additionalFields": {},
"isProductPreview": false
},
"currency": {
"type": "string",
"value": "USD",
"isIcon": false,
"position": 4,
"additionalFields": {},
"isProductPreview": false
}
},
"attributeSetIdentifier": "test",
"isPositionLocked": false,
"position": 2,
"rating": {},
"paymentStages": [
{
"title": "p1",
"value": 50,
"marker": "p1"
},
{
"title": "p2",
"value": 50,
"marker": "p2"
},
{
"title": "p3",
"value": 50,
"marker": "p3"
}
],
"productPages": [
{
"id": 2848,
"pageId": 10,
"productId": 2955,
"positionId": 3191,
"categoryPath": "catalog"
}
],
"blocks": [
"product_block",
"test",
"similar"
],
"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,
"entityFormDataCount": {
"2954": 823
},
"nestedEntityIdentifiers": [
"catalog"
],
"exceptionIds": []
}
],
"discountConfig": {}
}
]
Response schema
Schema: IProductsEntity[]
id: number
ID of the product.
example: 12345
localizeInfos: ILocalizeInfo
Localized product data, such as the title.
example:
{}
statusIdentifier: string | null
Marker of the product status, or null.
example: "in_stock"
statusLocalizeInfos: ILocalizeInfo
Localized status name for the product.
example:
{ "title": "Sale" }
attributeSetIdentifier: string | null
Marker of the attribute set, or null if none is assigned.
example: "set_12345"
position: number
Position used for sorting.
example: 1
price: number | null
Product price from the search index.
example: 150.00
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
}
}
sku: string | null
Product SKU from the search index, or null.
example: "SKU_12345"
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
attributeValues: IAttributeValues
Attribute values keyed by attribute marker.
example:
{
"color": {
"type": "string",
"value": "red",
"isIcon": false,
"position": 0,
"additionalFields": {}
}
}
categories: string[]
URLs of the catalog pages the product belongs to.
example:
[
"catalog"
]
isVisible: boolean
Whether the product is visible.
example: true
moduleFormConfigs: Array<IFormConfig>
Form configurations of the module.
rating: IRating
Rating data: average value, likes and dislikes, and the calculation method.
isPositionLocked: boolean
Whether the sorting position is locked.
example: false
relatedIds: number[]
IDs of related products.
example:
[
12345,
67890
]
paymentStages: unknown
Payment stages of the product: an array of { title, value, marker } objects, or null when none are set.
example: null
distance: number
Relevance distance in vector (semantic) search. Present only in vector search results.
example: 0.42
discountConfig: Record<string, unknown>
Discount configuration.
example:
{}
templateIdentifier: string | null
Marker of the linked template.
example: "template_12345"
shortDescTemplateIdentifier: string | null
Marker of the template used for the short description.
example: "short_desc_template_12345"
signedPrice: string
Signed token (JWT) that fixes the product price for an order. Returned when signPrice is set.
see: Fixed product price
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
productPages: IProductPageRef[]
Links between the product and the catalog pages it belongs to.
example:
[
{
"id": 16,
"pageId": 4,
"productId": 15,
"positionId": 244,
"categoryPath": "products"
}
]
productPages.id: number
ID of the product-to-page link record.
example: 16
productPages.pageId: number
Identifier of the page the product is linked to.
example: 4
productPages.productId: number
Product ID.
example: 15
productPages.positionId: number
ID of the position record that stores the product's sort order.
example: 244
productPages.categoryPath: string
Category path of the page the product belongs to.
example: "products"
blocks: string[]
Markers of the blocks attached to the product.
example:
[
"block_12345",
"block_67890"
]
signedPriceis 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 walkthrough in the documentation:
- Get products by IDs: fetch multiple products at once with a comma-separated list of IDs.
Try it live
Run this method in the JS SDK sandbox. On your first visit, connect your Project URL and App Token, then open:
- Get products by IDs: fetch multiple products at once with a comma-separated list of IDs.