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

> Update bill

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

## 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` (integer)
- `description` (string)
- `bill_number` (string)
- `vendor_id` (string)
- `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)
- `recurring` (RecurringConfig) — If provided, creates a recurring template from this bill.

## Responses

### 200 — Successful Response

Schema: `BillResponse`

- `id` (string · required) — Bill UUID.
- `business_id` (string · required) — Business UUID.
- `currency` (string) — Currency for the bill (USD, CAD, AUD, EUR, or GBP).
- `status` (integer | string · required) — Bill status (see schema description).
- `description` (string) — Bill description.
- `bill_number` (string) — Bill/invoice number from vendor.
- `vendor_id` (string · required) — Vendor UUID.
- `vendor_name` (string) — Vendor name (resolved).
- `vendor_email` (string) — Vendor email (resolved).
- `type` (integer | string · required) — Type: 'recurring' or 'one_time'.
- `expected_amount` (integer) — Expected amount in cents.
- `expected_paid_on_date` (string · date-time) — Expected payment date.
- `total_paid` (integer) — Total amount paid so far in cents.
- `amount` (integer) — Actual bill amount in cents.
- `s3_key` (string) — S3 key of attached document.
- `received_on` (string · date-time) — Date bill/goods received.
- `due_on` (string · date-time) — Payment due date.
- `paid_on` (string · date-time) — Date fully paid.
- `created_at` (string · date-time · required) — Creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.
- `signed_url` (string) — Signed URL to view attached document.
- `payments` (array · object) — List of payments made.
- `journal_entries` (array · object) — Associated accounting entries.
- `recurring_template_id` (string) — ID of recurring template if this bill was generated from one, or if one was created.
- `source_inventory_order_id` (string) — Source PO that produced this bill via the PO lifecycle. Non-null means this bill is visible on the Inventory -> Accounts Payable tab.

### 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 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 '{
  "status": 0,
  "description": "string",
  "bill_number": "string",
  "vendor_id": "string",
  "type": "string",
  "expected_amount": 0
}'
```

### 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({
  "status": 0,
  "description": "string",
  "bill_number": "string",
  "vendor_id": "string",
  "type": "string",
  "expected_amount": 0
}),
});
const data = await response.json();
```

### Python

```python
import httpx

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

payload = {
  "status": 0,
  "description": "string",
  "bill_number": "string",
  "vendor_id": "string",
  "type": "string",
  "expected_amount": 0
}

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
