# Correct with a storno

`POST /businesses/{bid}/expenses/{id}/correction`

Requires the `expenses` scope.

A recorded expense is immutable; a correction writes a reversing row (הוראה 23). Pass `redraft: true` to also open a fresh DRAFT carrying the same fields and a copy of the receipt file: fix it and record again. The storno stands even if the draft fails.

## Path parameters

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

## Body (optional)

| Field | Type | | Description |
|---|---|---|---|
| `redraft` | boolean |  | Also return a `draft` cloned from the corrected row. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `expense` | Expense | **required** | The purchase side of the ledger. A recorded expense is immutable; correct it with a storno. |
| `draft` | Expense |  | The purchase side of the ledger. A recorded expense is immutable; correct it with a storno. |

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

## Examples

### cURL

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

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