# The VAT return figures for a period

`GET /businesses/{bid}/reports/vat`

Requires the `export` scope.

What the PCN874 file would say, without writing it: the four figures of the periodic return (taxable sales, VAT on sales, zero-rated/exempt sales, input VAT on equipment and on everything else, VAT to pay or reclaim), every entry, and the warnings.

## Path parameters

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

## Query parameters

| Name | Type | | Description |
|---|---|---|---|
| `period` | string | **required** | YYYY-MM. |
| `months` | integer |  |  One of: `1`, `2`. Default `1`. |

## Response

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

| Field | Type | | Description |
|---|---|---|---|
| `ok` | boolean | **required** |  |
| `report` | object | **required** |  |
| `report.period` | object |  |  |
| `report.totals` | VatTotals |  | The periodic VAT return in whole shekels, signed (a period of credit notes can go negative). |
| `report.entries` | array of object |  |  |
| `report.warnings` | array of VatWarning |  |  |

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/reports/vat?period=&months=" \
  -H "X-Api-Key: $KEY"
```
### Node

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