# POST /api/v1/advisory-firms/{firm_id}/settlements

> Record an intercompany settlement (netting entry)

- **Tag:** intercompany-cleanup
- **Operation ID:** `record_settlement_api_v1_advisory_firms__firm_id__settlements_post`

## Description

Books a netting journal entry in each entity (debit due-to / credit due-from) after the repayment transfer has been matched, and marks the pair's open eliminations as posted. Refuses to net more than both gross balances support.

## Authentication

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

## Parameters

- `firm_id` (path, string, required)

## Request body

Schema: `RecordSettlementRequest`

- `payer_business_id` (string · required)
- `payee_business_id` (string · required)
- `amount_cents` (integer · required)
- `settlement_date` (string · date · required)
- `memo` (string)

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_RecordSettlementResponse_`

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

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

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

### 422 — Validation Error - Invalid data format

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/settlements' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "payer_business_id": "string",
  "payee_business_id": "string",
  "amount_cents": 0,
  "settlement_date": "2026-01-01"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/settlements', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "payer_business_id": "string",
  "payee_business_id": "string",
  "amount_cents": 0,
  "settlement_date": "2026-01-01"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "payer_business_id": "string",
  "payee_business_id": "string",
  "amount_cents": 0,
  "settlement_date": "2026-01-01"
}

response = httpx.post("https://api.ondayzero.com/api/v1/advisory-firms/{firm_id}/settlements", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/intercompany-cleanup/record-settlement
- OpenAPI slice: https://www.ondayzero.com/docs/reference/intercompany-cleanup/record-settlement/openapi.json
- Other endpoints in **intercompany-cleanup**: https://www.ondayzero.com/docs/reference/intercompany-cleanup
