# GET /api/v1/bills

> List bills

- **Tag:** bills
- **Operation ID:** `list_bills`

## Description

Retrieve all bills for a business with cursor-based pagination. Can filter by vendor name (fuzzy search) or associated journal entry.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `id` (query, array · string, optional) — Filter bills by specific bill UUIDs (batch fetch — avoids N+1 single-bill requests)
- `vendor_search` (query, string, optional) — Fuzzy search bills by vendor name (uses PostgreSQL trigram matching)
- `journal_entry_id` (query, string, optional) — Filter bills by associated journal entry UUID
- `payment_method` (query, string, optional) — Filter bills by payment method: 'Wire Transfer', 'ACH', 'Check', 'Credit Card'
- `vendor_id` (query, string, optional) — Filter bills by vendor UUID
- `status` (query, string, optional) — Filter by bill status (e.g. draft, approved, received, paid, canceled)
- `search` (query, string, optional) — Search bills by bill number, description, or vendor name (case-insensitive partial match)
- `bill_number` (query, string, optional) — Filter bills by invoice/bill number (case-insensitive partial match)
- `due_date_from` (query, string, optional) — Filter bills with due date on or after this date (YYYY-MM-DD)
- `due_date_to` (query, string, optional) — Filter bills with due date on or before this date (YYYY-MM-DD)
- `on_hold` (query, boolean, optional) — true: only bills with an active payment hold; false: only bills without one
- `cursor` (query, string, optional) — Cursor for pagination
- `limit` (query, integer, optional) — Pagination limit
- `direction` (query, string, optional) — Pagination direction: 'next' or 'prev'
- `include_total_count` (query, boolean, optional) — Whether to include total count (expensive - avoid if possible)
- `sort_by` (query, string, optional) — Column name to sort by (e.g. 'created_at', 'amount', 'name'). When changing sort, reset cursor to None.
- `descending` (query, boolean, optional) — Sort direction: true for descending (newest/largest first), false for ascending

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_BillsListResponse_`

- `success` (boolean)
- `message` (string)
- `code` (string)
- `data` (BillsListResponse)

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/bills' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/bills', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

response = httpx.get("https://api.ondayzero.com/api/v1/bills", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/bills/list-bills
- OpenAPI slice: https://www.ondayzero.com/docs/reference/bills/list-bills/openapi.json
- Other endpoints in **bills**: https://www.ondayzero.com/docs/reference/bills (markdown bundle: https://www.ondayzero.com/docs/reference/bills.md, OpenAPI: https://www.ondayzero.com/docs/reference/bills/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
