emfasemfas
Filtering

Operators

Operator matrix and value shape per attribute type

Every attribute belongs to one of five filter categories. The category determines which operators are valid.

Categories

CategoryAttribute types
textplain text, HTML text, URL, color, country, identifier, taxonomy, options
presetselect, metaobject, category, image, boolean, product reference, variant reference
numericnumber, price, weight, dimension, volume
datetimedate-time
datedate

Operator matrix

Operatortextpresetnumericdatetimedate
EQUALS
NOT_EQUALS
CONTAINS
NOT_CONTAINS
IN
NOT_IN
GREATER_THAN
LESS_THAN
BEFORE
AFTER
IN_THE_LAST
NOT_IN_THE_LAST
EMPTY
NOT_EMPTY

Value shape

The value field's expected JSON shape depends on the operator.

Operator(s)Value typeNotes
EQUALS, CONTAINS, NOT_CONTAINS (text)stringPlain string match — CONTAINS is case-insensitive substring.
EQUALS, NOT_EQUALS, GREATER_THAN, LESS_THAN (numeric)numberFor price attributes, the value is in the major currency unit (e.g. 100 means 100 USD, not 100 cents).
BEFORE, AFTER, EQUALS (datetime)stringRFC3339 (2024-01-15T00:00:00Z).
BEFORE, AFTER, EQUALS (date)stringYYYY-MM-DD.
IN_THE_LAST, NOT_IN_THE_LASTstringDuration like 7d, 24h, 30d.
IN, NOT_INarray of stringsFor preset attributes, the array contains the identifiers of the referenced entities (the same identifiers you'd use elsewhere in the API).
EMPTY, NOT_EMPTYomitThe value field is not used.

Examples

Text contains:

{ "product.description": [{ "operator": "CONTAINS", "value": "organic" }] }

Numeric range — two entries on the same key combine as AND within the key:

{ "product.price": [
  { "operator": "GREATER_THAN", "value": 100 },
  { "operator": "LESS_THAN", "value": 500 }
] }

Preset IN:

{ "product.color": [{ "operator": "IN", "value": ["red", "blue"] }] }

Recent updates:

{ "_updated_at": [{ "operator": "IN_THE_LAST", "value": "7d" }] }

Missing attribute:

{ "product.description": [{ "operator": "EMPTY" }] }