# Set where a series starts

`POST /businesses/{bid}/numbering`

Requires the `businesses` scope.

Sets the next number of a series that has issued nothing (a series that has issued keeps its sequence, as the gapless rule requires, and comes back in `refused`). The choice is recorded, so a later import of numbering from previous software never moves it. Owner only.

## Path parameters

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

## Body

| Field | Type | | Description |
|---|---|---|---|
| `next` | object | **required** | Document type code → the next number, e.g. `{ "305": 10001 }`. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `series` | array of NumberingSeries | **required** |  |
| `refused` | array of integer |  | Types left as they were because they already issued. |

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

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