# Update a party

`PATCH /businesses/{bid}/parties/{id}`

Requires the `businesses` scope.

## Path parameters

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

## Body

| Field | Type | | Description |
|---|---|---|---|
| `name` | string |  |  |
| `taxId` | string |  |  |
| `phone` | string |  |  |
| `email` | string |  |  |
| `address` | string |  |  |

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

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

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