> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# Filter and sort

Use query parameters to filter and sort the data returned by the Paddle API.

---

Most list endpoints let you filter and sort the data returned by the Paddle API.

## Filter

You can filter returned results using query parameters. For example, use the `collection_mode` query parameter to filter [transactions](https://developer.paddle.com/api-reference/transactions/list-transactions.md) or [subscriptions](https://developer.paddle.com/api-reference/subscriptions/list-subscriptions.md) by collection mode:

{% api-endpoint method="GET" path="/transactions?collection_mode=manual" %}

{% /api-endpoint %}

Some query parameters have the type `array[string]`. In this case, you pass a comma separated list to filter by multiple values. For example, to return any products that have the tax category `standard`, `saas`, or `digital-goods`:

{% api-endpoint method="GET" path="/products?tax_category=standard,saas,digital-goods" %}

{% /api-endpoint %}

Check the API reference for a specific endpoint to learn more about the parameters available for filtering.

### Advanced operators

When [listing transactions](https://developer.paddle.com/api-reference/transactions/list-transactions.md), you can use operators to work with date query parameters. Advanced operators are only supported for transactions.

| Operator | Description |
|---|---|
| `[LT]` | Less than. Return entities created before the specified date and time. |
| `[LTE]` | Less than or equal to. Return entities created before or on the specified date and time. |
| `[GT]` | Greater than. Return entities created after the specified date and time. |
| `[GTE]` | Greater than or equal to. Return entities created after or on the specified date and time. |

For example, to return transactions that were created in May 2024:

{% api-endpoint method="GET" path="/transactions?created_at[GT]=2024-05-01T00:00:00Z&created_at[LT]=2024-06-01T00:00:00Z" %}

{% /api-endpoint %}

## Sort

You can sort returned results using the `order_by` parameter, followed by a field and direction:

| Direction | Description |
|---|---|
| `[ASC]` | Ascending. Sort returned entities in ascending order. |
| `[DESC]` | Descending. Sort returned entities in descending order. |

You can sort by the `id` field when working with most list endpoints.

Paddle IDs are lexicographically sortable. Sorting by Paddle ID results in the same order as sorting by the creation date of an entity.

List endpoints return entities created newest first, meaning `id[DESC]`.

## Search

Some entities include a `search` parameter that lets you search using a string. For example, to return customers with a name or email address that contains `paddle`:

{% api-endpoint method="GET" path="/customers?search=paddle" %}

{% /api-endpoint %}

Remember to [percent-encode query strings](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding). For example, pass `max%2Bpaddle%40example.com` for `max+paddle@example.com`.