# Download the file

`GET /businesses/{bid}/business-documents/{id}/file`

Requires the `businesses` scope.

The bytes as uploaded, with their Content-Type.

## Path parameters

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

## Response

`200`: raw `application/pdf` bytes.

Errors: `400`, `401`, `403`, `404`, `409`, `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/business-documents/$DOC_ID/file" \
  -H "X-Api-Key: $KEY"
  -o document.pdf
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/business-documents/${DOC_ID}/file`, {
  method: 'GET',
  headers: {
    'X-Api-Key': KEY,
  },
})
const pdf = Buffer.from(await res.arrayBuffer())
```
### Python

```python
import requests
res = requests.get(
    f"{BASE}/businesses/{BID}/business-documents/{DOC_ID}/file",
    headers={"X-Api-Key": KEY},
)
open("document.pdf", "wb").write(res.content)
```