Rules Engine Overview

The Rules Engine feature allows you to set up rules that automatically set safety stock values on location inventory, enforce purchase limits on B2B accounts, and support custom return policies.

Enable Rules Engine

Contact Kibo Support to enable this feature, including information about which rule types you intend to implement.

Restricted Content

Internal-Only Note

Multiple tenant attributes control the Rules Engine and may need to be enabled in different combinations depending on which features they wan to utilize. These attributes are:

  • catalog-admin-ProductRulesEnabled (This is required in order to access Purchase Limit Rules, as well as create a base product rule while configuring any other type of rule. If a client only wants to use B2B Order Release based on account priority without any configuring any rules, this tenant attribute must still be enabled.)
  • catalog-admin-PurchaseLimitRulesEnabled
  • catalog-admin-SafetyStockRulesEnabled
  • catalog-admin-ReturnRulesEnabled

Product and Customer Rules

The three rule types (safety stock, return, and purchase limit rules) are based on expressions called product and customer rules. Product rules can be based on product type, code, variant, static category, attribute, and some other first class fields. Customer rules can be based on either a customer account or customer segment. 

Product and customer rules cannot be shared across rule types. For instance, a product rule originally made for a safety stock rule will only be available for other safety stock rules and cannot be used to build a return rule.

Expression Format

Expressions are made up of a set of conditions that can be used with logical operators (such as OR or AND) that apply across conditions. For example, the following product rule would apply to products where Color = Blue and Brand = Adidas. 

  • Operator: AND
  • Condition 1: Color = blue (product property option)
  • Condition 2: Brand = Adidas (parent product property)

Manage Product and Customer Rules

While configuring a maximum purchase limit, safety stock, or return rule, you can either create a new product/customer rule or select an existing one. These are not accessible on their own dashboard, and are only created or managed within the configurations of a larger rule.

The product and customer rule selections

Creating or editing a rule will open an expression editor that you can view in Query, JSON, or Text format. Here you can define one or more conditions by entering a product property, logical operator, and value to compare the property against and grouping them as needed. Click Preview to view a list of records that would be impacted by the expression. 

The product rule expression editor

Required User Behaviors

The following user behaviors are required to view and update rules. You can give users behaviors only for a specific type of rule, such as only allowing them to manage safety stock, but be aware that product and customer rules are the foundation of other rule types. This means that if a user does not have product rule behaviors, they will not be able to create a safety stock rule because doing so requires selecting or creating a product rule.

The Admin and SuperAdmin roles include all of these behaviors by default.

  • Product Rule
    • Product Rule Read, Product Rule Create, Product Rule Update, Product Rule Delete
  • Customer Rule
    • Customer Rule Read, Customer Rule Create, Customer Rule Update, Customer Rule Delete
  • Safety Stock Rule
    • Safety Stock Rule Read, Safety Stock Rule Create, Safety Stock Rule Update, Safety Stock Rule Delete
  • Return Rule
    • Return Rule Read, Return Rule Create, Return Rule Update, Return Rule Delete
  • Purchase Limit Rule 
    • Purchase Limit Rule  Read, Purchase Limit Rule Create, Purchase Limit Rule Update, Purchase Limit Rule Delete