Sales broken down by a chosen dimension
const url = 'https://api.emite.cr/v1/reports/sales?from=2026-06-01&to=2026-06-30&groupBy=day';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.emite.cr/v1/reports/sales?from=2026-06-01&to=2026-06-30&groupBy=day' \ --header 'Authorization: Bearer <token>'Grouped by groupBy (day/week/month/currency/paymentMethod/saleCondition/branch/terminal/activity; default month). All groupings filter by currency except currency itself, which returns one row per currency.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Example
2026-06-01Inclusive start (CR-local YYYY-MM-DD).
Example
2026-06-30Inclusive end (CR-local YYYY-MM-DD).
ISO 4217 code. Defaults to the tenant default currency.
When true: no currency filter — all documents aggregate in CRC via each document's snapshotted exchange rate. Takes precedence over currency.
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.
Responses
Section titled “Responses”object
The grouping applied: the one requested, or month by default.
Currency of the amounts: the filter applied, or CRC with convertToCrc. null when groupBy=currency without convertToCrc — each row is then in its own currency.
One row per group with documents: time buckets in time order, every other grouping by grandTotal, largest first.
object
Group key (date bucket, code, or id depending on groupBy).
Human label when resolvable (branch/terminal name); null otherwise.
Accepted documents in the group, credit notes not counted.
Net sales (Σ TotalVentaNeta), credit notes subtracted. Numeric string.
Σ TotalImpuesto, credit notes subtracted. Numeric string.
Σ TotalComprobante, credit notes subtracted. Numeric string.
Non-CRC documents excluded from the CRC equivalent for lacking a snapshot exchange rate. Only set with convertToCrc.
Example
{ "groupBy": "day"}