Shop API - Get Filtered Products
Get filtered products
POST *base*/products/filter
Fetches a list of products based on the provided filter parameters. The GET calls below filter the product list on the parameter given in the URI. If you want to filter on several fields at once, you should use POST to /products/filter
.
Parameters
One, or many (for POST), of the following parameters can be specified:
Product IDs, passed as string or array of strings
"products": "123"
or "products": ["124", "125"]
Product URI
"uri": "the-uri-of-the-product"
Maximum number of returned products. Recommended range: between 10 and 100
Offset in the filtered list from where results will be returned
Centra product ID.
Centra variant ID.
Filter on the category ID for the products.
"categories": "123"
or "categories": ["123", "124"]
.
Filter on product SKU.
Filter on market ID.
Return products not being activated yet.
"preview": true
return products for preview"preview": false
only return live products
Request example
POST <base>/products/filter HTTP/1.1
Content-type: application/json
{
"market": 123,
"products": ["514", "515"],
"categories": 1
}
Response
200
Content-type: application/json
The object returned will have the productId
for each product as the key. The product object is explained under Product data model.
Response example
HTTP/1.1 200 OK
Content-type: application/json
{
"1": {"product-object"},
"2": {"product-object"},
}
Error example
HTTP/1.1 404 Not Found
Content-type: application/json
{
"errors" : {
"categories" : "not found: 1"
}
}
Filter on categories
GET *base*/products/categories/*categories*
Parameters explained under Multi parameter filtering parameters.
Filter on internal IDs
GET *base*/products/silk-product/*silkProduct*
GET *base*/products/silk-variant/*silkVariant*
Parameters explained under Multi parameter filtering parameters.
Filter on SKU or URI
GET *base*/products/sku/*sku*
GET *base*/products/uri/*uri*
Parameters explained under Multi parameter filtering parameters.