# Send a quote

`POST /businesses/{bid}/quotes/{id}/send`

Requires the `documents` scope.

Numbers it, freezes the offer, renders the PDF and mints `publicUrl`, the page where the customer reads it and accepts or declines. Re-sending keeps the same number AND the same link and re-freezes the offer (`revisedAt`), so a link already in a WhatsApp thread never breaks and never shows a stale price. Emits `quote.sent`.

## Path parameters

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

## Body (optional)

| Field | Type | | Description |
|---|---|---|---|
| `branding` | Branding |  | Appearance of the rendered PDF. Stored once per business; a logo is stored as a file and referenced by hash, never re-frozen into each document. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `quote` | Quote | **required** | הצעת מחיר: an OFFER, and deliberately not a document: it carries no statutory number, it is freely editable and deletable, and it appears in no export, no VAT return and no income report. What it becomes when the customer accepts is an ordinary draft document (`POST .../convert`). |
| `pdf` | object |  | Null when the render failed. The offer still went out and the page still shows it. |
| `pdf.fileId` | string |  |  |
| `pdf.slug` | string |  |  |
| `pdf.path` | string |  | The public PDF path on this host. |

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 POST "$BASE/businesses/$BID/quotes/$DOC_ID/send" \
  -H "X-Api-Key: $KEY"
```
### Node

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

```python
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/quotes/{DOC_ID}/send",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```