# GET /api/v1/bills/duplicate-check

> Check for possible duplicate bills

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

## Description

Advisory, read-only check used during bill entry. Returns existing bills that may duplicate the one being entered (same bill number, or same vendor and amount within ~90 days). Never blocks creation — it is purely a heads-up so the user can confirm before saving.

## Authentication

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

## Parameters

- `bill_number` (query, string, optional) — In-progress bill/invoice number to match (optional).
- `vendor_id` (query, string, optional) — In-progress vendor UUID to match (optional).
- `amount` (query, integer, optional) — In-progress amount in cents to match (optional).
- `received_on` (query, string · date, optional) — Invoice date (YYYY-MM-DD); bounds the vendor+amount lookback window.

## Responses

### 200 — Successful Response

Schema: `SuccessEnvelope_DuplicateBillCheckResponse_`

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

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 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 GET 'https://api.ondayzero.com/api/v1/bills/duplicate-check' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/bills/duplicate-check', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
  },
});
const data = await response.json();
```

### Python

```python
import httpx

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

response = httpx.get("https://api.ondayzero.com/api/v1/bills/duplicate-check", headers=headers)
data = response.json()
```

## See also

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