# Reopen a debt closed by hand

`POST /businesses/{bid}/legacy-documents/{id}/reopen`

Requires the `documents` scope.

Only a debt closed by hand. One a BillOS document paid stays as it is.

## Path parameters

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

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `document` | LegacyDocument | **required** | A document issued by the software the business used before BillOS: its metadata as that system printed it, and the original file. Not a BillOS document: no number from any series, no signature, absent from every export and report. |

Errors: `401`, `403`, `404`, `409`, `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 POST "$BASE/businesses/$BID/legacy-documents/$DOC_ID/reopen" \
  -H "X-Api-Key: $KEY"
```
### Node

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