Skip to main content

Filtering

Most list queries (orders, brands, warehouses, paymentTransactions, repaymentRequests, …) accept a filter argument that lets you build complex conditions, optionally combined with boolean logic.

Filter structure

The filter argument has type <Entity>ComplexFilterInput (e.g. OrderComplexFilterInput). It is a @oneOf input, so each filter object contains exactly one member, usually one of:

  • fields: the per-field conditions (type <Entity>ComparisonInput)
  • and: a list of filters that must all match
  • or: a list of filters where at least one must match
  • not: a filter that must not match

Because it is @oneOf, you cannot mix fields and and in the same object: to combine several conditions, wrap each one in its own object inside an and / or list. Filters can be nested arbitrarily.

# single condition
filter: { fields: { status: { equals: completed } } }

# multiple conditions combined with AND
filter: {
and: [
{ fields: { createdAt: { greaterThanOrEqualsTo: "2026-01-01T00:00:00.000Z" } } }
{ fields: { createdAt: { lessThanOrEqualsTo: "2026-04-01T00:00:00.000Z" } } }
]
}

Comparing fields

Inside fields, every key is a field of the entity and its value is a comparison input, also @oneOf (use one operator at a time). The available operators depend on the field's type:

TypeAvailable operators
Stringequals, notEquals, in, notIn, match (see Pattern matching)
ID, Boolean, enums (e.g. OrderStatus)equals, notEquals, in, notIn
Numbers (Float, Int) and dates (ISO8601DateTime)equals, notEquals, in, notIn, greaterThan, greaterThanOrEqualsTo, lessThan, lessThanOrEqualsTo

Enum values are written without quotes:

filter: { fields: { status: { in: [completed, shipped, delivered] } } }

Pattern matching with match

match is available for String fields and performs a wildcard match against the whole field value (a simple wildcard matcher, not a regex engine). Its value has the format <version>/<pattern>/<options>, both / separators required:

PartMeaning
<version>The pattern syntax version. Currently only v1.
<pattern>In v1: . matches any one character, * matches zero or more characters, every other character matches itself. Prefix a character with \ to match it literally (e.g. \. for a literal dot, written \\. inside a GraphQL string).
<options>In v1: empty, or i to make the match case insensitive.

Because the pattern must match the whole value, wrap it in * for a "contains" search:

# contains: orders whose number contains "118" (matches "1181", "63118", "211857", …)
filter: { fields: { number: { match: "v1/*118*/" } } }

# starts with: orders whose number starts with "1854"
filter: { fields: { number: { match: "v1/1854*/" } } }

# case-insensitive equality: warehouses in "torino", "Torino", "TORINO", …
filter: { fields: { city: { match: "v1/torino/i" } } }

A match value that does not follow the format is rejected with a FILTER_INVALID error.

Relations and lists

Some fields are not scalars but other objects or lists:

  • Relation fields (e.g. billing, channel) take a nested <Entity>ComplexFilterInput:

    filter: { fields: { billing: { fields: { email: { equals: "customer@example.com" } } } } }
  • List fields (e.g. shippings, lines) take a <Entity>ListComparisonInput, a @oneOf input with any, all, none, each wrapping a nested <Entity>ComplexFilterInput:

    # orders that have at least one shipping in a given fulfillment status
    filter: {
    fields: {
    shippings: { any: { fields: { fulfillmentStatus: { in: [pending, partial] } } } }
    }
    }
  • Scalar list fields (e.g. codes on Warehouse, type [String!]) take a scalar list comparison input (e.g. StringListComparisonInput), where any, all, none wrap a scalar comparison input:

    # warehouses that have "MIL" among their codes
    filter: { fields: { codes: { any: { equals: "MIL" } } } }

The exact fields and operators available for each entity are listed in its input types in the GraphQL schema (e.g. OrderComplexFilterInput and OrderComparisonInput). See Query orders with filters for complete, runnable examples.