# POST /api/v1/bills/{bill_id}/payments

> Add payment to bill

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

## Description

Create a new payment for a specific bill.

## Authentication

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

## Parameters

- `bill_id` (path, string, required)

## Request body

Schema: `BillPaymentRequest`

- `transaction_id` (string · required) — UUID of the bank transaction representing the payment.
- `amount` (integer · required) — Payment amount in cents. Must be > 0.
- `paid_on` (string · date-time) — Override payment date (ISO 8601). Defaults to the transaction datetime if omitted.

## Responses

### 201 — Successful Response

Schema: `BillPaymentResponse`

- `id` (string · required) — Payment record UUID.
- `bill_id` (string · required) — UUID of the bill being paid.
- `transaction_id` (string · required) — UUID of the bank transaction.
- `amount` (integer · required) — Payment amount in cents.
- `currency` (string) — Currency for the payment (USD, CAD, AUD, EUR, or GBP).
- `paid_on` (string · date-time · required) — Payment date.
- `created_at` (string · date-time · required) — Record creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.
- `business_id` (string · required) — Business UUID.

### 400 — Bad Request - Invalid input

### 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 POST 'https://api.ondayzero.com/api/v1/bills/{bill_id}/payments' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "transaction_id": "string",
  "amount": 0
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "transaction_id": "string",
  "amount": 0
}

response = httpx.post("https://api.ondayzero.com/api/v1/bills/{bill_id}/payments", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/bills/create-bill-payment
- OpenAPI slice: https://www.ondayzero.com/docs/reference/bills/create-bill-payment/openapi.json
- Other endpoints in **bills**: https://www.ondayzero.com/docs/reference/bills
