Skip to main content

Overview

The Reports API provides comprehensive business intelligence and analytics for your sales data. Access daily metrics, payment method distribution, top products, and hourly sales patterns.

Get Dashboard Report

Retrieves comprehensive dashboard metrics for a specific date, including KPIs, hourly sales breakdown, top products, payment method distribution, and active cash session information.
This endpoint requires admin privileges.

Query Parameters

fecha
date
default:"today"
Target date for the report in YYYY-MM-DD format. Defaults to today’s date if not specified.Example: 2024-03-15

Response

fecha
date
The date for which the report was generated
kpis
object
Key performance indicators for the day:
total_ventas
number
Total sales amount (gross) including all taxes
total_neto
number
Total net sales amount (before taxes)
total_iva
number
Total IVA (tax) amount collected
num_ventas
integer
Number of sales transactions (invoices and receipts only)
ticket_promedio
number
Average ticket size (total_ventas / num_ventas)
num_notas_credito
integer
Number of credit notes issued
total_notas_credito
number
Total amount of credit notes issued
ventas_por_hora
array
Hourly breakdown of sales activity:
hora
string
Hour of the day in HH:00 format (e.g., 09:00, 14:00)
cantidad
integer
Number of sales transactions in that hour
total
number
Total sales amount for that hour
top_productos
array
Top 5 best-selling products by revenue:
nombre
string
Product name
sku
string
Product internal code/SKU
cantidad
number
Total quantity sold
total
number
Total revenue from this product
medios_pago
array
Payment method distribution:
nombre
string
Payment method name (e.g., “Efectivo”, “Tarjeta Débito”)
codigo
string
Payment method code (e.g., “EFECTIVO”, “DEBITO”)
transacciones
integer
Number of transactions using this payment method
total
number
Total amount processed through this payment method
caja
object
Information about the currently active cash session (null if no session is open):
id
integer
Cash session ID
inicio
datetime
Session start timestamp (ISO format)
fondo
number
Starting cash amount (fondo de caja)
curl -X GET "https://api.torn.com/reports/dashboard?fecha=2024-03-15" \
  -H "Authorization: Bearer YOUR_TOKEN"

Document Type Filtering

The dashboard report includes specific document types:

Included Document Types

  • Type 33: Facturas (Invoices)
  • Type 39: Boletas (Receipts)
  • Type 61: Notas de Crédito (Credit Notes) - counted separately

Excluded Document Types

Other document types like quotes, delivery notes, or internal documents are not included in the sales metrics.

Use Cases

Display live business metrics on a management dashboard. Update every few minutes to show:
  • Current day’s sales performance
  • Busiest hours for staffing decisions
  • Most popular products for inventory planning
  • Payment method preferences
Generate comprehensive daily reports for managers:
  • Sales vs. target tracking
  • Credit note analysis (returns/refunds)
  • Cash session reconciliation
  • Performance by hour to identify peak times
Compare performance across different stores or locations by calling this endpoint for each tenant/location.
Retrieve reports for past dates to analyze trends:
curl "https://api.torn.com/reports/dashboard?fecha=2024-03-01"
curl "https://api.torn.com/reports/dashboard?fecha=2024-03-08"
curl "https://api.torn.com/reports/dashboard?fecha=2024-03-15"

Best Practices

Time Zone Considerations: The date parameter uses the system’s configured time zone. Ensure your application handles time zones correctly when requesting reports for specific dates.
Caching: Dashboard data for past dates is unlikely to change. Consider caching historical reports to improve performance and reduce API calls.
Access Control: This endpoint requires admin privileges (require_admin dependency). Regular users cannot access these reports. Ensure your frontend properly handles 403 Forbidden responses.

Build docs developers (and LLMs) love