> ## Documentation Index
> Fetch the complete documentation index at: https://developers.weticket.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering and sorting

> Narrow down lists and choose their order.

## Filters

Filters have the form `filters[field][operator]=value`. Combine several to narrow down further.

| Endpoint | Filters |
| - | - |
| `GET /events` | `filters[status][$eq]` (`draft`, `published`), `filters[startDate][$gte]`, `filters[startDate][$lt]`, `filters[endDate][$gt]`, `filters[updatedAt][$gte]` |
| `GET /orders` | `filters[eventId][$eq]`, `filters[status][$eq]` (`completed`, `awaiting-payment`, `draft`, `expired`, `failed`), `filters[createdAt][$gte]`, `filters[updatedAt][$gte]` |
| `GET /tickets` | `filters[eventId][$eq]`, `filters[orderId][$eq]`, `filters[status][$eq]` (`valid`, `canceled`), `filters[updatedAt][$gte]` |

Dates are ISO 8601 with a time zone, for example `2026-12-01T00:00:00Z`. In a URL, encode `$` as `%24`
or escape it in your shell.

For sales figures you usually want completed orders only:
`GET /orders?filters[status][$eq]=completed`.

## Sorting

Sort with `sort=field:asc` or `sort=field:desc`.

| Endpoint | Sortable fields | Default |
| - | - | - |
| `GET /events` | `startDate`, `endDate`, `updatedAt` | `startDate:asc` |
| `GET /orders` | `createdAt`, `updatedAt` | `createdAt:asc` |
| `GET /tickets` | `createdAt`, `updatedAt` | `createdAt:asc` |

An unknown filter value or sort field gets `400 Bad Request`, with the allowed values in the message.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.