# PUT /api/v1/bills/{bill_id}

> Update bill

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

## Description

Update an existing bill. Optionally include 'recurring' config to create a recurring template.

## Authentication

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

## Parameters

- `bill_id` (path, string, required)

## Request body

Schema: `BillUpdateRequest`

- `status` (string) — Bill status name: draft, pending_approval, forecasted or canceled. received, partially_paid and paid are set by their own flows (mark received, add payment) and are rejected here.
- `description` (string)
- `bill_number` (string)
- `vendor_id` (string)
- `payment_term_id` (string) — Change (or, when set to null, clear) the payment term recorded on this bill. It does not move `due_on`; send that separately.
- `type` (string)
- `expected_amount` (integer)
- `expected_paid_on_date` (string · date-time | string · date | string)
- `amount` (integer)
- `due_on` (string · date-time | string · date | string)
- `received_on` (string · date-time | string · date | string)
- `s3_key` (string)
- `source_inventory_order_id` (string)
- `purpose` (string) — What an inventory bill pays for: goods (PO material), deposit, freight, duty, handling or other. Decides the debit ledger when the bill posts; unset means goods for a PO-linked bill and the chosen ledger otherwise.
- `payment_method` (string) — Payment method override: 'Wire Transfer', 'ACH', 'Check', 'Credit Card', or empty string to clear. Takes precedence over the method inferred from a linked payment transaction.
- `recurring` (RecurringConfig) — If provided, creates a recurring template from this bill.

## Example request

```json
{
  "amount": 250000,
  "description": "Office rent - March",
  "due_on": "2026-03-01",
  "payment_method": "ACH"
}
```

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_BillResponse_`

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

### 400 — Bad Request - Invalid input

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 401 — Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 403 — Forbidden - Insufficient permissions

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

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

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

### 422 — Validation Error

Schema: `ErrorResponse`

- `error` (string · required) — Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`.
- `message` (string · required) — Human-readable explanation, safe to show to end users.
- `code` (string · required) — Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`).
- `request_id` (string) — Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied.
- `errors` (object) — Field-level validation messages keyed by field name. Present on 400/422 validation failures only.

## Code samples

### cURL

```bash
curl -X PUT 'https://api.ondayzero.com/api/v1/bills/{bill_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 250000,
  "description": "Office rent - March",
  "due_on": "2026-03-01",
  "payment_method": "ACH"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/bills/{bill_id}', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "amount": 250000,
  "description": "Office rent - March",
  "due_on": "2026-03-01",
  "payment_method": "ACH"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {'amount': 250000,
 'description': 'Office rent - March',
 'due_on': '2026-03-01',
 'payment_method': 'ACH'}

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

## See also

- HTML version: https://www.ondayzero.com/docs/reference/bills/update-bill
- OpenAPI slice: https://www.ondayzero.com/docs/reference/bills/update-bill/openapi.json
- Other endpoints in **bills**: https://www.ondayzero.com/docs/reference/bills (markdown bundle: https://www.ondayzero.com/docs/reference/bills.md, OpenAPI: https://www.ondayzero.com/docs/reference/bills/openapi.json)
- Endpoint catalog: https://www.ondayzero.com/docs/reference/index.md
