# List quotes

`GET /businesses/{bid}/quotes`

Requires the `documents` scope.

## Path parameters

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

## Query parameters

| Name | Type | | Description |
|---|---|---|---|
| `status` | string |  | `expired` is derived (sent, past its validity), not a stored value. One of: `draft`, `sent`, `expired`, `accepted`, `declined`, `cancelled`. |
| `partyId` | string |  |  |
| `q` | string |  | Customer name, title, or the quote number. |
| `from` | string |  |  |
| `to` | string |  |  |
| `take` | integer |  |  Default `200`. |
| `skip` | integer |  |  Default `0`. |
| `counts` | string |  | Add per-state totals over the same filters. One of: `1`. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `quotes` | array of Quote | **required** |  |

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/quotes?status=&partyId=&q=" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/quotes`, {
  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}/quotes",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```