# Download the PDF

`POST /businesses/{bid}/documents/{id}/prints`

Requires the `documents` scope.

Israeli law delivers the origin (מקור) exactly once, per הוראה 18(ב)2. `auto` is what a download button should send: it serves the origin on the first ever print and a copy forever after, so a repeat click never errors, and the `X-Print-Variant` header tells you which one you got.

A `pdf_pending` response never consumes the origin.

## Path parameters

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

## Body (optional)

| Field | Type | | Description |
|---|---|---|---|
| `kind` | string |  | `auto` recommended. `origin` succeeds exactly once per document. `copy` is watermarked העתק and unlimited. One of: `auto`, `origin`, `copy`. Default `copy`. |

## Response

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

Response header `X-Print-Variant`: Which variant these bytes are.

Errors: `400`, `401`, `403`, `404`, `409`, `429`. Every failure answers `{ "error": …, "reason": … }`. Branch on `reason`.

## Examples

### cURL

```bash
curl -X POST "$BASE/businesses/$BID/documents/$DOC_ID/prints" \
  -H "X-Api-Key: $KEY"
  -o document.pdf
```
### Node

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

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