# GET /api/v1/customer-statements/{customer_id}

> Get customer statement

- **Tag:** customer-statements
- **Operation ID:** `get_customer_statement_api_v1_customer_statements__customer_id__get`

## Description

Build an A/R statement for a customer over a date range.

## Authentication

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

## Parameters

- `customer_id` (path, string, required)
- `start_date` (query, string · date, optional) — Start of the statement period (defaults to 1 year ago).
- `end_date` (query, string · date, optional) — End of the statement period (defaults to today).
- `as_of_date` (query, string · date, optional) — Aging as-of date (defaults to end_date).

## Responses

### 200 — Successful Response

Schema: `CustomerStatementResponse`

- `customer_id` (string · required)
- `customer_name` (string)
- `customer_email` (string)
- `customer_address` (string)
- `business_name` (string)
- `start_date` (string · date · required)
- `end_date` (string · date · required)
- `as_of_date` (string · date · required)
- `opening_balance` (integer · required)
- `lines` (array · StatementLine · required) → `StatementLine`
  - `date` (string · date · required)
  - `type` (string · required) — invoice, payment, or credit.
  - `reference` (string) — Invoice or credit memo number.
  - `description` (string)
  - `charges` (integer) — Amount added to the balance, in cents.
  - `payments` (integer) — Amount reducing the balance, in cents.
  - `balance` (integer · required) — Running balance after this line, in cents.
- `total_charges` (integer · required)
- `total_payments` (integer · required)
- `closing_balance` (integer · required)
- `aging` (StatementAging · required) → `StatementAging`
  - `current` (integer)
  - `days_1_30` (integer)
  - `days_31_60` (integer)
  - `days_61_90` (integer)
  - `days_91_plus` (integer)
  - `total` (integer)

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 404 — Not Found - Resource does not exist

### 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/customer-statements/{customer_id}' \
  -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/customer-statements/{customer_id}', {
  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/customer-statements/{customer_id}", headers=headers)
data = response.json()
```

## See also

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