Dynamic Categories API Overview

The dynamic category expression controls the product membership of the dynamic category.

Dynamic Category Types

There are two types of dynamic categories: precomputed and realtime.

Precomputed Categories

The product membership of precomputed categories is calculated when products are indexed in the catalog, such as when products are added, updated, or deleted from the catalog, and also when the categories themselves are updated, such as when their expressions change.

For example, you have a precomputed category that includes all products that have a property of red, and you currently have a red dress in your catalog. This red dress is included in your precomputed category; however, if you removed the property of red from the dress and saved the change, this dress would be removed from the precomputed category when you save the change.

Realtime Categories

The product membership of realtime categories is calculated in realtime and on demand when a shopper navigates to the realtime category. When the shopper navigates to the realtime category, Kibo performs a query for products in the catalog that should be included in the category. This allows Kibo to evaluate dynamic product fields such as product pricing after discounts have been applied.

For example, you have a realtime category that includes all products that have a discounted sale price, and you currently have a discount on all dresses. When a shopper navigates to this realtime category, Kibo performs a query to identify the products that have a discounted sale price, and it finds the dresses that are discounted. These dresses then appear on the realtime category page.

You cannot target realtime categories for discounts.

Setting the Category Type

The categoryType field controls whether the dynamic category is precomputed or realtime. When you set this field to DynamicPreComputed, the category is a dynamic precomputed category and you can select it as a discount target. When set to DynamicRealTime, the category is a dynamic realtime category and you cannot select it as a discount target.

Comparison of Dynamic Categories

Refer to the following table for more information about the differences between precomputed and realtime dynamic categories:

Feature Category Type
Dynamic Precomputed Dynamic Realtime
Can evaluate a product's sale price and sale price type (the price after a discount is applied) as part of the membership expression No Yes
Can evaluate catalog list prices as part of the membership expression Yes Yes
Can evaluate product properties as part of the membership expression Yes Yes
Navigating to a parent category displays products included in the child category Yes No
Can be used as target criteria for a discount Yes No
Becomes a complex search filter at runtime No Yes

Expression Fields

When you write a dynamic category expression, you define values for the supported fields in order to build out the expression.

Refer to the following table for the supported expression fields and their operators:

Precomputed and Realtime Categories

Field Operators Data Type Allow Null Values?
ProductCode EQ (is equal to)
NE (does not equal)
IN (is one of the following)
String No
Categories.CategoryCode EQ (is equal to)
REQ (is equal to and includes child categories)
NE (does not equal)
IN (is one of the following)
String No
ProductTypeId EQ (is equal to)
NE (does not equal)
IN (is one of the following)
Integer No
Price.CatalogListPrice EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal No
Price.CatalogSalePrice

This field refers to the sale price of a product entered on the product page in Admin, or in the product properties.
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
DaysAvailableInCatalog

This field is calculated using the First Available Date field in the product properties.
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Integer No
FulfillmentTypesSupported EQ (is equal to)
NE (does not equal)
IN (is one of the following)

String
Valid values: "DirectShip", "InStorePickup", "Digital"

No
Measurements.Package
Weight.Value
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
Measurements.Package
Height.Value
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
Measurements.Package
Width.Value
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
Measurements.Package
Length.Value
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
properties.

This field is based on the available product properties and uses the fully-qualified name (FQN) of the property.
The supported operators of this field are dependent on the selected property. The value of this field is dependent on the selected property's value. Yes

Realtime Categories Only

Field Operators Data Type Allow Null Values?
Price.SalePrice

This field refers to the post discount price of a product.
EQ (is equal to)
NE (does not equal)
LT (is less than)
LE (is less than or
equal to)
GT (is greater than)
GE (is greater than or
equal to)
IN (is one of the following)
Decimal Yes
Price.SaleType EQ (is equal to)
NE (does not equal)
IN (is one of the following)

String
Valid values:
"CatalogSalePrice",
"DiscountedListPrice",
"DiscountedCatalogSalePrice"

Refer to Sale Type Values for more information about these values.

Yes

Sale Type Values

The price.SaleType field has three different values that each apply to a product's various sale types: Catalog Sale Price, Discounted List Price, and Discounted Catalog Sale Price. Refer to the following table for more information about each of these values and their relationship to a product's various sale prices.

Value Description
CatalogSalePrice The price specified in a product's Sale Price field.
DiscountedList The product's list price after applicable discounts are applied.
DiscountedCatalogSalePrice The price specified in a product's Sale Price field after applicable discounts are applied.

Expression Examples

Example 1

The following example shows a precomputed dynamic category expression that includes all products that have been in the catalog for 30 days or less:

Tree View

{
    "type": "container",
    "logicalOperator": "or",
    "nodes": [
        {
            "type": "predicate",
            "left": "daysavailableincatalog",
            "right": 30,
            "operator": "le"
        }
    ]
}

Text View

daysavailableincatalog le 30

Example 2

The following example shows a precomputed dynamic category expression that includes all products with the property color set to red:

Tree View

{
    "type": "container",
    "logicalOperator": "or",
    "nodes": [
        {
            "type": "predicate",
            "left": "properties.color",
            "operator": "eq",
            "right": "red"
        }
    ]
}

Text View

properties.color eq "red"

Example 3

The following example shows a precomputed dynamic category expression that includes all products with the property color set to red and are in the apparel category.

Tree View

{
    "type": "container",
    "logicalOperator": "and",
    "nodes": [
        {
            "type": "predicate",
            "left": "Categories.CategoryCode",
            "operator": "eq",
            "right": "apparel"
        },
        {
            "type": "predicate",
            "left": "properties.color",
            "operator": "eq",
            "right": "red"
        }
    ]
}
>}

Text View

Categories.CategoryCode eq "apparel" and properties.color eq "red"

Example 4

The following example shows a realtime dynamic category expression that includes all products with a discounted sale price and are in the apparel category. You must set the categoryType field to DynamicRealTime in order to access the dynamic realtime fields.

Tree View

{
    "type": "container",
    "logicalOperator": "and",
    "nodes": [
        {   
            "type": "container",
            "logicalOperator": "and",
            "nodes": [              
                {
                    "type": "predicate",
                    "left": "Price.SaleType",
                    "operator": "eq",
                    "right": "DiscountedList"
                },
                {
                    "type": "predicate",
                    "left": "Categories.CategoryCode",
                    "operator": "eq",
                    "right": "apparel"
                }
            ]
        }
    ]
}

Text View

(Price.SaleType eq "DiscountedList" and Categories.CategoryCode eq "apparel")