# The documents list as CSV

`GET /businesses/{bid}/reports/documents`

Requires the `export` scope.

דו"ח מסמכים: one row per issued document of the period (type, number, date, customer, description, payment, total, VAT, status) with its public download link. UTF-8 with a BOM, so Excel opens the Hebrew.

## Path parameters

| Name | Type | | Description |
|---|---|---|---|
| `bid` | string | **required** | Business id, from `POST /businesses`. |

## Query parameters

| Name | Type | | Description |
|---|---|---|---|
| `from` | string | **required** |  |
| `to` | string | **required** |  |

## Response

`200`: `{ "ok": true, … }`

Errors: `400`, `401`, `403`, `404`, `429`. Every failure answers `{ "error", "reason", "hint", "param", "doc_url", "retryable", "request_id" }`: branch on `reason`, and read `hint` for what to change (https://docs.billos.co.il/errors.md).

## Examples

### cURL

```bash
curl -X GET "$BASE/businesses/$BID/reports/documents?from=&to=" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/reports/documents`, {
  method: 'GET',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.get(
    f"{BASE}/businesses/{BID}/reports/documents",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```