# The sales report

`GET /v1/invoices/export` (permission `invoices:read`) answers a CSV file (`text/csv`, as an attachment): one row per invoice, ordered by issue day, series and number.

Filters, all optional: `status` (as in `GET /v1/invoices`), `from` and `to` (issue days, `YYYY-MM-DD`, inclusive), `series`, `customer_doc_number`.

```http
GET https://api.invox.page/v1/invoices/export?from=2026-10-01&to=2026-10-31&status=accepted
```

The columns, in this fixed order (a new one is only ever added at the end):

| # | Column |
| --- | --- |
| 1 | `issue_date` |
| 2 | `type` |
| 3 | `series` |
| 4 | `number` |
| 5 | `full_number` |
| 6 | `status` |
| 7 | `customer_id_type` |
| 8 | `customer_id_number` |
| 9 | `customer_name` |
| 10 | `currency` |
| 11 | `taxable` |
| 12 | `exempt` |
| 13 | `unaffected` |
| 14 | `tax` |
| 15 | `total` |
| 16 | `status_reason` |
| 17 | `sunat_code` |
| 18 | `external_ref` |
| 19 | `accepted_at` |
| 20 | `voided_at` |
| 21 | `externally_reversed_at` |
| 22 | `id` |

- UTF-8 with a byte-order mark, CRLF line ends, RFC 4180 quoting. Amounts are plain decimals.
- At most 50000 invoices per file. More is [`export_too_large`](https://api.invox.page/v1/errors/export_too_large), never a file cut short: narrow the period and export in parts. `X-Export-Rows` says how many rows the file holds.
- A customer name is text a third party wrote. A cell a spreadsheet would run as a formula (it starts with `=`, `+`, `-`, `@`, a tab or a carriage return) is written with an apostrophe in front: it shows as text. Strip that apostrophe only if you load the file into something that is not a spreadsheet.
