# What the MOVEIN file would carry

`GET /businesses/{bid}/exports/movein/preview`

Requires the `export` scope.

Without writing anything: the number of movements, documents and expenses, what an earlier file already carried, the warnings (an expense category with no card, a sale over ₪5,000 to a customer with no tax id), the customers with no card number of their own, and the first movements.

## Path parameters

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

## Query parameters

| Name | Type | | Description |
|---|---|---|---|
| `from` | string | **required** |  |
| `to` | string | **required** |  |
| `onlyNew` | boolean |  |  Default `true`. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean |  |  |
| `configured` | boolean |  |  |
| `summary` | object |  |  |
| `warnings` | array of object |  |  |
| `missingCards` | array of object |  |  |
| `sample` | array of object |  |  |

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 GET "$BASE/businesses/$BID/exports/movein/preview?from=&to=&onlyNew=" \
  -H "X-Api-Key: $KEY"
```
### Node

```node
const res = await fetch(`${BASE}/businesses/${BID}/exports/movein/preview`, {
  method: 'GET',
  headers: {
    'X-Api-Key': KEY,
  },
})
const data = await res.json()
if (!data.ok) throw new Error(data.reason)
```
### Python

```python
import requests
res = requests.get(
    f"{BASE}/businesses/{BID}/exports/movein/preview",
    headers={"X-Api-Key": KEY},
)
data = res.json()
```