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:

products
string or array
optional
b2b b2c

Product IDs, passed as string or array of strings "products": "123" or "products": ["124", "125"]

uri
string
optional
b2b b2c

Product URI "uri": "the-uri-of-the-product"

quantity
int
optional
b2b b2c

Maximum number of returned products. Recommended range: between 10 and 100

offset
int
optional
b2b b2c

Offset in the filtered list from where results will be returned

silkProduct
string
optional
b2b b2c

Centra product ID.

silkVariant
string
optional
b2b b2c

Centra variant ID.

categories
string or array of strings
optional
b2b b2c

Filter on the category ID for the products. "categories": "123" or "categories": ["123", "124"].

sku
string
optional
b2b b2c

Filter on product SKU.

market
string or int
optional
b2b b2c

Filter on market ID.

preview
boolean
optional
b2b b2c

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.

Previous article: Shop API - Get Products
Next article: Order API (REST)