Skip to main content
The Reports API provides comprehensive business intelligence including sales reports, dashboard statistics, and top-selling item analytics.

Features

  • Dashboard Metrics: Real-time overview of today’s performance
  • Sales Reports: Detailed sales analysis with daily breakdowns
  • Payment Method Analysis: Revenue distribution by payment type
  • Top Items Report: Best-selling menu items by quantity and revenue
  • Date Range Filtering: Flexible date-based reporting

Authentication

Requires authentication and the reports:read permission.

Base URL

https://api.restai.app/v1/reports

Dashboard Statistics

Get real-time metrics for today’s performance.

Endpoint

GET /reports/dashboard

Response

success
boolean
Request success status
data
object
totalOrders
number
Number of orders today
totalRevenue
number
Revenue today in cents
averageOrderValue
number
Average order value in cents
activeOrders
number
Orders currently in progress (pending, confirmed, preparing, ready)
occupiedTables
number
Number of occupied tables
totalTables
number
Total tables in branch

Example Request

curl https://api.restai.app/v1/reports/dashboard \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "totalOrders": 45,
    "totalRevenue": 125000,
    "averageOrderValue": 2778,
    "activeOrders": 8,
    "occupiedTables": 12,
    "totalTables": 20
  }
}

Sales Report

Get detailed sales analysis with daily breakdown and payment method distribution.

Endpoint

GET /reports/sales

Query Parameters

startDate
string
required
Start date in ISO 8601 format (YYYY-MM-DD)
endDate
string
required
End date in ISO 8601 format (YYYY-MM-DD)

Response

success
boolean
Request success status
data
object
totalOrders
number
Total completed orders in period
totalRevenue
number
Total revenue in cents
totalTax
number
Total tax collected in cents
totalDiscount
number
Total discounts given in cents
days
array
Daily breakdown
date
string
Date (YYYY-MM-DD)
orders
number
Orders for this day
revenue
number
Revenue for this day in cents
paymentMethods
array
Payment method distribution (percentages)
name
string
Payment method name
value
number
Percentage of total revenue (0-100)

Example Request

curl "https://api.restai.app/v1/reports/sales?startDate=2026-03-01&endDate=2026-03-07" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "totalOrders": 234,
    "totalRevenue": 567890,
    "totalTax": 87234,
    "totalDiscount": 12340,
    "days": [
      {
        "date": "2026-03-01",
        "orders": 35,
        "revenue": 89000
      },
      {
        "date": "2026-03-02",
        "orders": 42,
        "revenue": 95000
      }
    ],
    "paymentMethods": [
      {
        "name": "cash",
        "value": 45
      },
      {
        "name": "card",
        "value": 35
      },
      {
        "name": "yape",
        "value": 20
      }
    ]
  }
}

Top Selling Items

Get the best-selling menu items ranked by quantity or revenue.

Endpoint

GET /reports/top-items

Query Parameters

startDate
string
required
Start date in ISO 8601 format (YYYY-MM-DD)
endDate
string
required
End date in ISO 8601 format (YYYY-MM-DD)
limit
number
default:"10"
Number of items to return (1-50)

Response

success
boolean
Request success status
data
array
Array of top items (ordered by quantity sold)
name
string
Menu item name
totalQuantity
number
Total units sold
totalRevenue
number
Total revenue from this item in cents

Example Request

curl "https://api.restai.app/v1/reports/top-items?startDate=2026-03-01&endDate=2026-03-07&limit=5" \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "data": [
    {
      "name": "Hamburguesa Clásica",
      "totalQuantity": 87,
      "totalRevenue": 34800
    },
    {
      "name": "Pizza Margarita",
      "totalQuantity": 65,
      "totalRevenue": 32500
    },
    {
      "name": "Lomo Saltado",
      "totalQuantity": 54,
      "totalRevenue": 37800
    },
    {
      "name": "Ceviche",
      "totalQuantity": 48,
      "totalRevenue": 28800
    },
    {
      "name": "Tacos al Pastor",
      "totalQuantity": 45,
      "totalRevenue": 18000
    }
  ]
}

Use Cases

Daily Operations Dashboard

Use /reports/dashboard to display real-time metrics on your POS dashboard showing today’s performance.

Weekly Sales Review

Use /reports/sales with a 7-day range to analyze weekly trends and payment method preferences. Use /reports/top-items to identify best-sellers and underperforming items for menu planning.

Monthly Reporting

Generate month-over-month comparisons by calling /reports/sales with different date ranges.

Build docs developers (and LLMs) love