# POST /api/v1/invoices/bulk-payments

> Bulk mark invoices paid

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

## Description

Mark a selection of invoices paid in one call, recording the payment date you supply and optionally matching one or more bank transactions to each invoice.

## Authentication

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

## Request body

Schema: `BulkMarkInvoicesPaidRequest`

- `invoices` (array · BulkInvoicePaymentRow · required) → `BulkInvoicePaymentRow` — Invoices to settle (1-500 rows).
  - `invoice_id` (string · required) — UUID of the invoice to settle.
  - `paid_on` (string · date-time) — Payment date for this invoice (YYYY-MM-DD or full ISO 8601). Overrides the batch-level `paid_on`. When transactions are linked and no date is given anywhere, the transaction's own date is recorded.
  - `transactions` (array · BulkInvoicePaymentAllocation) — Bank transactions to match to this invoice. One or many — a customer who paid an invoice in two deposits gets two entries. Leave empty to mark the invoice paid without linking a transaction.
- `paid_on` (string · date-time) — Payment date applied to every row that does not carry its own (YYYY-MM-DD or full ISO 8601). This is the date recorded as the invoice's 'Paid on' — not the date the request was made.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_BulkMarkInvoicesPaidResponse_`

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

### 400 — Bad Request - Invalid input

### 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 POST 'https://api.ondayzero.com/api/v1/invoices/bulk-payments' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "invoices": []
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/invoices/bulk-payments', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "invoices": []
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "invoices": []
}

response = httpx.post("https://api.ondayzero.com/api/v1/invoices/bulk-payments", headers=headers, json=payload)
data = response.json()
```

## See also

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