Skip to content

Export a report to CSV or XLSX

GET
/v1/reports/{report}/export
curl --request GET \
--url 'https://api.emite.cr/v1/reports/overview/export?from=2026-06-01&to=2026-06-30&groupBy=day&format=csv&limit=10' \
--header 'Authorization: Bearer <token>'

Serializes one of overview/sales/customers/products/tax-summary/compliance/sales-by-province with the same filters as its view endpoint. format=csv (default) returns the primary table; format=xlsx returns a styled multi-sheet workbook. Every export is recorded in the audit log as report.exported.

report
required
string
Allowed values: overview sales customers products tax-summary compliance sales-by-province

The report to export; it takes the query parameters of its view endpoint (GET /v1/reports/{report}).

from
string
Example
2026-06-01

Inclusive start (CR-local YYYY-MM-DD).

to
string
Example
2026-06-30

Inclusive end (CR-local YYYY-MM-DD).

currency
string

ISO 4217 code. Defaults to the tenant default currency.

convertToCrc
boolean

When true: no currency filter — all documents aggregate in CRC via each document's snapshotted exchange rate. Takes precedence over currency.

groupBy
string
default: month
Allowed values: day week month currency paymentMethod saleCondition branch terminal activity

How to group the documents. day, week (weeks start on Monday) and month bucket them by their Costa Rica emission date; currency gives one row per currency and drops the currency filter; paymentMethod groups by the first payment method (its Hacienda MedioPago code), saleCondition by the CondicionVenta code, branch and terminal by the issuing branch or terminal, and activity by the economic activity code.

format
string
default: csv
Allowed values: csv xlsx

csv returns the report's primary table only, as UTF-8 text; xlsx returns a workbook with every table of the report, one sheet each. The file is named <report>-<from>_<to>.<format>; with convertToCrc every money column header ends in (CRC).

limit
number
default: 10 >= 1 <= 5000

Row cap for the ranked reports (customers, products); the other reports ignore it. Without it an export carries the same 10 rows the report shows; up to 5000.

The file, named <report>-<from>_<to>.csv or .xlsx after the Costa Rica calendar days of the resolved range. CSV: the report's primary table only, UTF-8 with a byte-order mark, comma-separated, CRLF line endings. XLSX: one sheet per table of the report. Column headers are in Spanish; with convertToCrc every money column header ends in (CRC).

string format: binary
Content-Disposition
string

attachment; filename="<report>-<from>_<to>.<csv|xlsx>".

REPORT_NOT_EXPORTABLE: report is not one of the exportable reports.