# POST /api/v1/bills/received

> Create bill in received status

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

## Description

Create a new bill directly in 'received' status, ready for payment. Creates both the bill AND journal entry when ledger_id is provided.

## Authentication

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

## Request body

Schema: `BillReceivedCreateRequest`

- `vendor_id` (string · required) — UUID of the vendor this bill is from (required).
- `amount` (integer · required) — Bill amount in cents (required).
- `description` (string) — Description of what the bill is for.
- `bill_number` (string) — Bill/invoice number from the vendor. Auto-generated if not provided.
- `currency` (string) — Currency for the bill (USD, CAD, AUD, EUR, or GBP). Defaults to business default.
- `type` (string) — Bill type: 'recurring' or 'one_time'. Defaults to 'one_time'.
- `received_on` (string · date-time | string) — Date the bill was received (ISO 8601). Defaults to now.
- `due_on` (string · date-time | string) — Payment due date (ISO 8601).
- `s3_key` (string) — S3 key of uploaded bill document (PDF/image).
- `ledger_id` (string) — UUID of the expense ledger for journal entry creation. If provided, creates journal entry automatically. Ignored when line_items is provided.
- `line_items` (array · JournalEntryLineItem) — Split journal entry lines. Each line specifies a debit account and amount. The credit side is always Accounts Payable. When provided, ledger_id is ignored.
- `journal_entry_date` (string · date-time | string · date | string) — Date for the accounting journal entry (ISO 8601 or YYYY-MM-DD). Defaults to received_on if not provided.

## Responses

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

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/bills/received', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "vendor_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 = {
  "vendor_id": "string",
  "amount": 0
}

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

## See also

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