# Update or archive a branding theme

`PATCH /businesses/{bid}/branding-themes/{tid}`

Requires the `businesses` scope.

Patch semantics like the business's own branding: a key present overrides, `null` removes. `archived: true` takes the theme out of every picker; `false` brings it back. Documents already issued keep the look they were issued in.

## Path parameters

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

## Body

| Field | Type | | Description |
|---|---|---|---|
| `name` | string |  |  |
| `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. |
| `bankDetails` | object,null |  |  |
| `phone` | string |  |  |
| `email` | string |  |  |
| `archived` | boolean |  |  |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `theme` | BrandingTheme | **required** | Another look for the same business's documents (Xero calls them branding themes): its own logo, colour, design, tagline, footer, website, signature and, optionally, a bank account, phone and email to print. The business's own `branding` is the main design. A theme never changes who issues: the business's name, tax id and address head every document whatever theme it prints in. Archived, never deleted. |

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 PATCH "$BASE/businesses/$BID/branding-themes/{tid}" \
  -H "X-Api-Key: $KEY"
```
### Node

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