---
title: "Filtering"
description: "How to filter list responses in the Fenerum API."
url: https://www.fenerum.com/en-DK/docs/api/guides/filtering/
updated_at: "2026-05-20T00:00:00"
---
## Filtering

Most list endpoints in the Fenerum API accept query-string filters to narrow down the result set. The exact set of filters supported by each endpoint is listed in the **Parameters** section of that endpoint's reference page — the description below covers the conventions used across all of them.

### Exact-match filters

Filter by a specific field value:

```bash
<!-- filename: Request GET /api/v1/invoices/ -->
GET /api/v1/invoices/?status=open
```

```bash
<!-- filename: Request GET /api/v1/accounts/ -->
GET /api/v1/accounts/?code=CUST001
```

Multiple filters can be combined; they are AND-ed together:

```bash
<!-- filename: Request GET /api/v1/invoices/ -->
GET /api/v1/invoices/?status=due&collection_method=invoice
```

### Comparison filters

For numeric and date fields, Fenerum exposes Django-style lookup suffixes:

| Suffix                         | Meaning                        | Example                        |
| ------------------------------ | ------------------------------ | ------------------------------ |
| `__lt`                         | Less than                      | `amount__lt=100`               |
| `__lte`                        | Less than or equal             | `created_date__lte=2025-12-31` |
| `__gt`                         | Greater than                   | `amount__gt=50`                |
| `__gte`                        | Greater than or equal          | `created_date__gte=2025-01-01` |

Date filters accept ISO date strings (`YYYY-MM-DD`).

### Date-range example

Get invoices created in December 2025:

```bash
<!-- filename: Request GET /api/v1/invoices/ -->
GET /api/v1/invoices/?created_date__gte=2025-12-01&created_date__lt=2026-01-01
```

### Negated filters

A few endpoints expose `_not` variants for exclude-style queries. Check the endpoint's **Parameters** for what's available, for example on Invoices:

```bash
<!-- filename: Request GET /api/v1/invoices/ -->
GET /api/v1/invoices/?status_not=paid&account_not=CUST001
```

### Combining with pagination

Filters are preserved across pages — the `next`/`previous` URLs in a paginated response carry your filter parameters forward. See [Pagination](https://www.fenerum.com/en-DK/docs/api/guides/pagination.md) for the page/page\_size envelope.

```bash
<!-- filename: Request GET /api/v1/invoices/ -->
GET /api/v1/invoices/?account=CUST001&page=2&page_size=50
```

The `count` field in the response reflects the total _filtered_ result count, not the unfiltered total.

### Looking up by alternative identifier

A small set of endpoints (currently Plans and Plan Terms) accept a `Lookup-Field` **HTTP header** that switches how the URL path identifier is interpreted — useful when you don't have the UUID but do know the resource's external `code`:

```bash
<!-- filename: Request GET /api/v1/plans/{identifier}/ -->
GET /api/v1/plans/enterprise/
Lookup-Field: code
```

Allowed values are documented on the affected endpoints (typically `uuid` and `code`).

### Best practices

- **Filter before paginating.** Pulling smaller result sets is faster and counts against your rate limit less.
- **Use ISO dates.** All date fields accept `YYYY-MM-DD`; some also accept ISO datetimes (`YYYY-MM-DDTHH:MM:SSZ`).
- **Check the endpoint's parameters.** Filter names vary per resource — the **Parameters** block on each operation lists exactly what's available (look for the blue `query` badge).

---

## Navigation

Up: [Subscription management & financial insights on autopilot](https://www.fenerum.com/en-DK/index.md) › [Documentation](https://www.fenerum.com/en-DK/docs.md) › [API Documentation](https://www.fenerum.com/en-DK/docs/api.md)

Full site index: https://www.fenerum.com/llms.txt
