# Update a business

`PATCH /businesses/{bid}`

Requires the `businesses` scope.

Profile, branding and `requireAllocation`. The tax id and dealer type of a business that has already issued documents are not editable.

## Path parameters

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

## Body

| Field | Type | | Description |
|---|---|---|---|
| `name` | string |  |  |
| `address` | string |  |  |
| `phone` | string |  |  |
| `email` | string |  |  |
| `requireAllocation` | boolean |  | Strict mode for allocation numbers. |
| `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

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `business` | Business | **required** | One Israeli dealer (עוסק), one of your end users. |

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

## Examples

### cURL

```bash
curl -X PATCH "$BASE/businesses/$BID" \
  -H "X-Api-Key: $KEY"
```
### Node

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