SKU Select API - Bloomreach Experience - Headless Digital Experience Platform

SKU Select API

In order to leverage SKU-based filtering on the Search and Category API, use the parameter fq on SKU-level attributes. 

Sample Request

This request has fq defined with the SKU-level attributes sku_color and sku_size:

GET http://core.dxpapi.com/api/v1/core/? account_id=<Bloomreach provided account ID>
&auth_key=jazzhands
&domain_key=example_com  
&request_id=8438674018839 &_br_uid_2=uid=7797686432023:v=11.5:ts=1428617911187:hc=55 &ref_url=http://www.example.com/home &url=http://www.example.com/index.html?q=dresses &request_type=search
&search_type=keyword
&q=dresses &fl=pid,title,brand,price,sale_price,thumb_image,url,description,sku_color,sku_size
&fq=sku_color : yellow
&fq=sku_size : medium
&rows=10
&start=0
API requests should be limited to 16K Bytes. API requests above this length will throw Error Code 414.

Request Parameter

Parameter

Required

Description

fq

Mandatory

The fq parameter applies a filter to the recall. Any facet that you want to filter on must be in your catalog. To learn about the SKU Variants catalog requirements, go to the Product Catalog section. 

 

The fq parameter can be applied on these 5 static attributes:

  • sku_price

  • sku_sale_price

  • sku_color

  • sku_color_group

  • sku_size

 

You can also apply the same on any other SKU-level dynamic attributes. 

 

Read more about using the fq parameter in the "Simple Filtering" section in the Faceting and filtering page.

 
Note: Child Faceting/Filtering is supported only on fq and not on efq. 
Note: The parameter stats.field is not supported for SKU level attributes. 

Migrating to SKU (child attribute) Faceting  

If you are, for example, currently using fq=color (where color is defined at a product level) and are moving to SKU faceting for the same attribute, you must use fq=sku_color instead. These apply to the 5 static fields listed above

For dynamic SKU facets, the naming convention will remain the same. 

Sample Response 

docs: 

[
  {
    sale_price: 13.25,
    price: 15.25,
    description: "",
    title: "Bodycon Knee Length Dress",
    url: "",
    brand: "Acme Corp",
    pid: "PID012345",
    thumb_image: "https://acmecorp.com/image/123_456",
    sale_price_range: 
      [
        10.99,
        250.99
      ],
    price_range: 
      [
        15.99,
        30.99
      ],
    variants: 
      [
        {
          sku_color: "Blue",
          sku_swatch_images: 
            [
              "0123456"
            ],
          sku_thumb_images: 
            [
              "https://acmecorp.com/image/123_456"
            ]
        }
      ]
  }
]

Hero SKU in the Variants section of the API

The Hero SKU's variant data will be ranked at the top of the variants section of the API. 

Facet Count returned in the API

For an SKU attribute, the count of the facet corresponds to the product count and not the SKU count.

A sample for facet count returned in the API is as shown below:

facet_fields: 
{
  categoryFacet: 
  [
    {
      count: 20,
      name: "S"
    },
    {
      count: 24,
      name: "M"
    }
  ]
}

Another example of facet count using sample data:

 

SKU 1

SKU 2

SKU 3

Filter count for size returned

Product A

size:s, color:red

size:m, color:red 

size:s, color:green

S (2)

M (2)

L (1)

The above numbers represent product count. 

Product B 

size:s, color:red

size:m, color:red 

size:l, color:green

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?