Filter and sort
Use query parameters to filter and sort the data returned by Paddle.
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 or subscriptions by collection mode:
Return entities that match the specified collection mode.
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
:
Return entities that match the specified tax category. Use a comma-separated list to specify multiple tax categories.
Check the API reference for a specific endpoint to learn more about the parameters available for filtering.
Advanced operators
When listing transactions, you can use operators to work with date query parameters. The following operators are available:
[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:
Return entities created at a specific time. Pass an RFC 3339 datetime string, or use [LT]
(less than), [LTE]
(less than or equal to), [GT]
(greater than), or [GTE]
(greater than or equal to) operators. For example, created_at=2023-04-18T17:03:26
or created_at[LT]=2023-04-18T17:03:26
.
Sort
You can sort returned results using the order_by
parameter, followed by a field and direction:
[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 (i.e. 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
:
Return entities that match a search query.
Remember to percent-encode query strings. For example, to search max+paddle@example.com
:
Return entities that match a search query.