Need to create rules based on bundles?
Learn more
LogoLogo
APIsChangelog
  • Getting started
  • Rules
  • Conditions
    • Scope
    • Aggregations
    • Nested
    • Dynamic values
  • Actions
    • Types
      • Percentage
      • Fixed amount
      • Fixed price
      • Buy X pay Y
      • Every X discount Y
    • Bundle
      • Balanced
      • Every
    • Aggregation
    • Limit
  • Matchers
  • Operators
  • Check and validation
  • Core API integration
    • Order rules
    • Price rules
    • Virtual relationships
  • Resources
    • Promotions
    • Price lists
  • Use cases
    • Promotions
      • Discount line items based on item's price
      • Get a discount when paying by credit card
      • Discount an order based on promo item and total number of items
      • Offer a specific shipping method for free in a specific country
      • Discount items with large stock availability
      • Discount all the SKU in an order based on the shipping country
      • Discount all the SKU in an order based on the customer email domain
    • Price lists
      • Discount all prices greater than or equal to a specific value
      • Discount specific SKUs for new clients
      • Change strike-through price based on customer email domain
On this page
  • Value required
  • Array match
  • Aggregations
  • Value not required

Matchers

The list of available condition's matchers based on field and value types

PreviousLimitNextOperators

Last updated 4 months ago

The valid matchers you can use in a or depend on the type of field on which you want to check the condition or perform the aggregation (e.g. you cannot check if a string such as a tag or an SKU code is greater than another). (e.g. eq, gteq, et.) require a value to be compared against, (e.g. null, present, etc.) don't.

For the comparison to work, the provided value must be of the correct type (e.g. you cannot check if a string such as a tag or an SKU code is equal to a number).

Value required

You can find here below the complete list of the available matchers the require a value to be defined in the related in order to work:

Matcher
Field type
Value type
Description

eq

IntegerStringDatetimeBoolean
IntegerStringDatetimeBoolean

Matches if the field value is equal to the provided value.

not_eq

IntegerStringDatetimeBoolean
IntegerStringDatetimeBoolean

Matches if the field value is not equal to the provided value, not including null values.

lt

IntegerDatetime
IntegerDatetime

Matches if the field value is less than the provided value.

lteq

IntegerDatetime
IntegerDatetime

Matches if the field value is less than or equal to the provided value.

gt

IntegerDatetime
IntegerDatetime

Matches if the field value is greater than the provided value.

gteq

IntegerDatetime
IntegerDatetime

Matches if the field value is greater than or equal to the provided value.

multiple

Integer
Integer

Matches if the field value is a multiple of the provided value (i.e it can be divided by the provided value without a remainder).

matches

String
String

does_not_match

String
String

start_with

String
String

Matches if the field value starts with the provided value.

not_start_with

String
String

Matches if the field value does not start with the provided value.

end_with

String
String

Matches if the field value ends with the provided value.

not_end_with

String
String

Matches if the field value does not end with the provided value.

gt_lt

IntegerDatetime
Array

Matches if the field value is greater than the first value of the provided value array and lower than the second.

gteq_lt

IntegerDatetime
Array

Matches if the field value is greater than or equal to the first value of the provided value array and lower than the second.

gt_lteq

IntegerDatetime
Array

Matches if the field value is greater than the first value of the provided value array and lower than or equal to the second.

gteq_lteq

IntegerDatetime
Array

Matches if the field value is greater than or equal to the first value of the provided value array and lower than or equal to the second.

is_in

IntegerStringDatetime
Array

Matches if the field value is included in the provided value array.

is_not_in

IntegerStringDatetime
Array

Matches if the field value is not included in the provided value array.

array_match

Array
Object

Array match

When the field value is an array, the array_match matcher enables you to check multiple inclusion/exclusion conditions on different arrays provided within the value object using the following additional operators:

Operator
Type

in_and

Array

Matches if the field array contains all the items of the provided in_and array.

in_or

Array

Matches if the field array contains contains at least one of the items of the provided in_or array.

not_in_and

Array

Matches if the field array contains none of the items of the provided not_in_and array.

not_in_or

Array

Matches if the field array does not contain at least one of the items of the provided in_or array.

Each of the operators above can be used once within the value object of the array_match matcher. If different operators are present, they are evaluated according to and AND logic (i.e. the array_match will match only if all the conditions in the value object are satisfied).

Example

The following condition identifies the products in an order that are tagged as "man-accessories" or "women-accessories" and at the same time are not associated with both "sales" and "black-friday" tags (e.g. a line item associated with an SKU tagged as "men-accessories" and "sales" would match, while a line item associated with an SKU tagged as "women-accessories", "sales", and "black-friday" wouldn't match).

"conditions": [
  {
    "field": "order.line_items.sku.tags.name",
    "matcher": "array_match",
    "value": {
      "in_or": [ "men-accessories", "women-accessories" ],
      "not_in_and": [ "sales", "black-friday" ]
    },
    "group": "accessories-not-already-on-sale",
  },
]

Aggregations

  • eq

  • not_eq

  • lt

  • lteq

  • gt

  • gteq

  • multiple

For the same reason also the value attribute to be used within an aggregation must be of type integer.

Value not required

Matcher
Description

blank

The field value is null or empty.

present

The field value is not null and not empty.

null

The field value is null.

not_null

The field value is not null.

Matches if the field value matches the pattern in the provided value .

Matches if the field value does not match the pattern in the provided value .

Matches if the field array meets all the requirements specified within the value object (learn more ).

The matchers you can use when aggregating the or the are a subset of the . Namely (since they have to be checked against the results of an aggregation performed via that return numbers), the ones that can be applied to integer fields:

You can find here below the complete list of the available matchers for which you don't have to provide a value in the related :

condition
matches of a condition
targets of an action
operators
list above
regular expression
regular expression
here
condition
condition
Some matchers
some others
aggregation