Skip to content

Targeting Rules

Rules are evaluated against the current product, cart, and shopper context.

UpsellBay Create Offer - Targeting Rules Section

Every rule must match.

A single matching rule is enough.

Here is the complete list of supported rule types, their expected values, and supported operators.

Rule TypeDescriptionValue TypeSupported Operators
cart_productCart contains productList (Products - Multi-select)contains, not_in
cart_categoryCart contains categoryList (Categories - Multi-select)contains
cart_tagCart contains tagList (Tags - Multi-select)contains
cart_subtotalCart subtotal isNumbergt, gte, lt, lte, eq, neq
viewed_productCurrently viewing productList (Products - Multi-select)contains
user_roleUser role isList (Roles - Multi-select)contains
customer_order_countCustomer order count isNumbergt, gte, lt, lte, eq, neq
customer_lifetime_spendCustomer lifetime spend isNumbergt, gte, lt, lte, eq, neq
stock_statusOffered product stock status isStock Statuseq
exclude_if_product_in_cartExclude if cart contains productList (Products - Multi-select)not_in

Note: lifetime_spend is accepted as an alias for customer_lifetime_spend, and exclude_product_in_cart is accepted as an alias for exclude_if_product_in_cart.

The system normalizes operators and accepts various aliases to make API integration easier.

Canonical OperatorDescriptionAccepted Aliases
eqEqualsis
neqDoes not equalis_not
containsContainsin, eq*
not_inDoes not containnot_contains, neq*
gtGreater thangreater_than, >
gteGreater than or equal togreater_or_equal, >=
ltLess thanless_than, <
lteLess than or equal toless_or_equal, <=

*If eq is passed for a rule that expects contains, it will automatically be normalized to contains. The same applies for neq mapping to not_in.

  • Numeric rules (cart_subtotal, customer_order_count, customer_lifetime_spend) require numeric values.
  • List rules accept single values or arrays of values. In the visual builder, Product, Category, Tag, and Role rules utilize a multi-select interface with infinite scrolling to easily manage large datasets.
  • Unsupported operators are rejected.
  • Unsupported stock states are rejected (supported states: instock, outofstock, onbackorder).
  • Empty rule values are rejected for active offers.