> For the complete documentation index, see [llms.txt](https://docs.thewalletcrew.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thewalletcrew.io/developers-guides/integration-guides/wallet/filter-and-query-operators.md).

# Filter and query operators

Filter and paginate The Wallet Crew passes list API with field conditions, string and set operators, and offset-based pagination, with examples.

Several pass-related endpoints accept a `filter` array that narrows results by pass field. Use filters together with pagination to retrieve exactly the set of passes you need.

Filtering is supported on these endpoints:

* [`GET /api/{tenantId}/passes`](https://docs.thewalletcrew.io/api-reference/pass-management/pass.md) — list passes
* [`POST /api/{tenantId}/passes/pushUpdate`](https://docs.thewalletcrew.io/api-reference/pass-management/pass.md) — trigger a push update on a filtered set
* [`POST /api/{tenantId}/passes/export/token`](https://docs.thewalletcrew.io/api-reference/pass-management/pass.md) — export a filtered set

## Filter request shape

Each filter condition is a `FilterModel` object with three fields:

| Field      | Type      | Description                                                                                                                                                                       |
| ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `field`    | string    | The pass field to filter on (see the list below)                                                                                                                                  |
| `operator` | string    | The comparison operator (see below). Required: a filter without an operator returns `400`. Only automation filters stored in configuration treat an omitted operator as `equals`. |
| `value`    | string\[] | One or more values to compare against, sent as repeated `value` parameters (several only for `in` and `notIn`). Omit for `isEmpty` and `isNotEmpty`.                              |

### Fields

A filter accepts only these fields. Any other field returns `400`.

* `id`, `passType` and `themeId`
* `creationDate` and `lastUpdateDate` (UTC)
* `installationStatus`: the installed wallets, concatenated as `""`, `apple`, `google` or `applegoogle`. Test it with `contains`.
* `identifiers.{key}`: an external identifier, for example `identifiers.shopify.customerId`
* `metadata.{key}`: a metadata field computed from the pass template's metadata definition. It is compared as the type the tenant's metadata configuration gives it.

Numbers use `.` as decimal separator, booleans are `true` or `false`, and dates are ISO 8601 with a time zone. A value that contains `{{`, `{%` or `{#` is rendered as a Liquid template first, for example `{{ 'now' | date: '%Y-%m-%d' }}`.

Filters are passed as indexed query parameters:

```
filter[0].field=passType&filter[0].operator=equals&filter[0].value=boarding
```

Multiple conditions are combined with logical AND:

```
filter[0].field=passType&filter[0].operator=equals&filter[0].value=boarding
&filter[1].field=metadata.loyaltyTier&filter[1].operator=isNotEmpty
```

## Operators

### String operators

These operators compare the field value against a single string.

| Operator     | Behavior                                |
| ------------ | --------------------------------------- |
| `equals`     | Exact match                             |
| `notEquals`  | Does not match                          |
| `contains`   | Field contains the value as a substring |
| `startsWith` | Field starts with the value             |
| `endsWith`   | Field ends with the value               |

Example — passes with a loyalty tier that contains "gold":

```
filter[0].field=metadata.loyaltyTier&filter[0].operator=contains&filter[0].value=gold
```

### Presence operators

These operators check whether a field has a value. No `value` parameter is required.

| Operator     | Behavior                   |
| ------------ | -------------------------- |
| `isEmpty`    | Field is absent or null    |
| `isNotEmpty` | Field has a non-null value |

Example — passes where the `externalId` identifier is not set:

```
filter[0].field=identifiers.externalId&filter[0].operator=isEmpty
```

### Comparison operators

`greaterThan`, `lessThan`, `greaterThanOrEqual` and `lessThanOrEqual` compare numbers or dates. Use them on typed `metadata.{key}` fields.

### Set operators

These operators match against a list of values. Repeat the `value` parameter to supply multiple entries.

| Operator | Behavior                                     |
| -------- | -------------------------------------------- |
| `in`     | Field matches any value in the list          |
| `notIn`  | Field matches none of the values in the list |

Example — passes of type `boarding` or `loyalty`:

```
filter[0].field=passType&filter[0].operator=in&filter[0].value=boarding&filter[0].value=loyalty
```

{% hint style="info" %}
`in` and `notIn` are available via the API only. The admin console passes table does not expose these operators in its filter controls.
{% endhint %}

## Pagination

The passes list endpoint uses offset-based pagination.

| Parameter   | Type    | Default | Description                                                                     |
| ----------- | ------- | ------- | ------------------------------------------------------------------------------- |
| `pageIndex` | integer | `0`     | Zero-based page index                                                           |
| `pageSize`  | integer | `20`    | Number of results per page. `0` returns an empty page with the total still set. |

The response includes an `x-pagination-total` header with the total number of matching passes across all pages.

To retrieve all passes in batches, increment `pageIndex` until the full count is consumed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.thewalletcrew.io/developers-guides/integration-guides/wallet/filter-and-query-operators.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
