# Record digital-document consent

`POST /businesses/{bid}/parties/{id}/consent`

Requires the `businesses` scope.

Stamps the party as having consented to receiving documents digitally (מסמכים ממוחשבים) rather than on paper. Required before you deliver a document by link or email.

## Path parameters

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

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `party` | Party | **required** | A saved customer. Optional: a document may carry an inline party instead. |

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

## Examples

### cURL

```bash
curl -X POST "$BASE/businesses/$BID/parties/$DOC_ID/consent" \
  -H "X-Api-Key: $KEY"
```
### Node

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