# Generate a מבנה אחיד export

`POST /businesses/{bid}/exports/openfrmt`

Requires the `export` scope.

The regulatory filing artifact (OPENFRMT v1.31): one zip holding INI.TXT and BKMVDATA.TXT under the exact directory tree the spec mandates. This is what an accountant or an auditor asks for. Download the zip through `GET /files/{id}`.

## Path parameters

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

## Body

| Field | Type | | Description |
|---|---|---|---|
| `from` | string | **required** |  |
| `to` | string | **required** |  |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `exportRun` | ExportRun | **required** | One OPENFRMT (מבנה אחיד) generation, with its verification summary. |
| `file` | FileMeta |  |  |

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

## Examples

### cURL

```bash
curl -X POST "$BASE/businesses/$BID/exports/openfrmt" \
  -H "X-Api-Key: $KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "2026-07-01",
    "to": "2026-07-31"
  }'
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/exports/openfrmt`, {
  method: 'POST',
  headers: {
    'X-Api-Key': KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "from": "2026-07-01",
    "to": "2026-07-31"
  }),
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.post(
    f"{BASE}/businesses/{BID}/exports/openfrmt",
    headers={"X-Api-Key": KEY},
    json={
      "from": "2026-07-01",
      "to": "2026-07-31"
    },
)
data = res.json()
```