# POST /api/v1/bills/upcoming/{upcoming_bill_id}/convert

> Push an upcoming bill into a real bill

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

## Description

Creates a **draft** bill from the estimate and marks the forecast row converted. The bill posts nothing to the ledger until it is approved and marked received, exactly like a hand-entered bill.

## Authentication

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

## Parameters

- `upcoming_bill_id` (path, string, required)

## Request body

Schema: `UpcomingBillConvertRequest`

- `amount` (integer) — Actual amount in cents. Defaults to the estimate.
- `due_date` (string · date) — Due date for the bill. Defaults to the expected date.
- `bill_number` (string) — Vendor's invoice number, when known.
- `s3_key` (string) — Attachment key for the received document.

## Responses

### 201 — Successful Response

Schema: `SuccessEnvelope_UpcomingBillResponse_`

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

### 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/upcoming/{upcoming_bill_id}/convert' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "amount": 0,
  "due_date": "2026-01-01",
  "bill_number": "string",
  "s3_key": "string"
}'
```

### JavaScript

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

### Python

```python
import httpx

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

payload = {
  "amount": 0,
  "due_date": "2026-01-01",
  "bill_number": "string",
  "s3_key": "string"
}

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

## See also

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