# GET /api/v1/invoices

> List invoices

- **Tag:** invoices
- **Operation ID:** `get_invoices_api_v1_invoices_get`

## Description

Retrieve invoices with optional filtering by customer, product, or status.

## Authentication

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

## Parameters

- `id` (query, string, optional) — Filter by specific invoice UUID
- `customer_id` (query, string, optional) — Filter by customer UUID
- `product_id` (query, string, optional) — Filter by product UUID
- `variant_id` (query, string, optional) — Filter by variant UUID
- `status` (query, array · string, optional) — Filter by status. Supports repeated params (?status=open&status=partially-paid) or bracket notation (?status[]=open&status[]=partially-paid).
- `search` (query, string, optional) — Search invoices by number, description, or customer name (case-insensitive partial match)
- `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: `InvoiceListResponse`

- `items` (array · InvoiceResponse · required) → `InvoiceResponse` — List of items
  - `id` (string · required) — Invoice UUID.
  - `business_id` (string · required) — Business UUID.
  - `created_at` (string · date-time · required) — Creation timestamp.
  - `updated_at` (string · date-time · required) — Last update timestamp.
  - `status` (string · required) — Status: draft, open, partially_paid, manual_paid, stripe_paid, void.
  - `currency` (string) — Currency for the invoice (USD, CAD, AUD, EUR, or GBP).
  - `stripe_invoice_id` (string) — Stripe invoice ID if synced.
  - `total` (integer) — Total amount in cents.
  - `total_paid` (integer) — Running total of payments received in cents.
  - `balance_due` (integer) — Remaining balance in cents (total - total_paid).
  - `description` (string) — Invoice description/notes.
  - `customer_id` (string · required) — Customer UUID.
  - `customer_name` (string) — Customer name (resolved).
  - `customer_email` (string) — Customer email (resolved).
  - `due_date` (string) — Due date (YYYY-MM-DD).
  - `line_items` (array · LineItemResponse) — Invoice line items.
  - `pdf_url` (string) — URL to download invoice PDF.
  - `number` (string) — Invoice number (assigned on finalize).
  - `delivered` (boolean) — Whether invoice was delivered.
  - `delivered_on` (string · date-time) — Delivery timestamp.
  - `hosted_invoice_url` (string) — URL for customer payment portal.
  - `paid_on` (string · date-time) — Payment timestamp.
  - `journal_entries` (array · object) — Associated accounting journal entries.
  - `payments` (array · InvoicePaymentResponse) — Payment records linking bank transactions to this invoice.
  - `recurring_template_id` (string) — ID of recurring template if invoice was generated from one, or if one was created.
- `total` (integer) — Total number of items (null when not calculated for performance)
- `limit` (integer) — Pagination limit
- `next_cursor` (string) — Cursor for next page
- `prev_cursor` (string) — Cursor for previous page
- `has_next` (boolean · required) — Whether there are more items
- `has_prev` (boolean · required) — Whether there are previous items

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X GET 'https://api.ondayzero.com/api/v1/invoices' \
  -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/invoices', {
  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/invoices", headers=headers)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/invoices/get-invoices
- OpenAPI slice: https://www.ondayzero.com/docs/reference/invoices/get-invoices/openapi.json
- Other endpoints in **invoices**: https://www.ondayzero.com/docs/reference/invoices
