iotoms Docs

Get sales summary

GET
/api/v1/reports/sales/summary

Returns aggregated sales totals for the date range. Pass expand=summary to include a daily breakdown, paginated with 0-based page and size (default 20, max 100). registerId narrows the sales totals to one register but not the returns total or the daily breakdown. from and to are dates (YYYY-MM-DD) and both default to today.

Authorization

BearerAuth
headerAuthorizationBearer <JWT>

Query Parameters

from?string

Start date (YYYY-MM-DD), defaults to today

Formatdate
to?string

End date (YYYY-MM-DD), defaults to today

Formatdate
expand?string

Optional expansions. Use 'summary' to include daily breakdown rows.

page?integer

Page number for summary breakdown when expand=summary (default 0)

Formatint32
Default0
size?integer

Page size for summary breakdown when expand=summary (default 20, max 100)

Formatint32
Default20
registerId?integer

Optional — scope results to a single register/terminal (used by the mobile app to show only its own device's sales)

Formatint64

Header Parameters

X-TenantID*string

Your merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.

Response Body

OK

*/*
  1. response
status*string

Outcome of the call: SUCCESS when it worked, ERROR when it failed.

message*string

Short human-readable message describing the outcome, for example "Vendor created". Do not parse it.

data?

Sales totals for the range, with an optional daily breakdown.

Example Request
curl -X GET 'https://beta.iotoms.com/api/v1/reports/sales/summary' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": {    "from": "2019-08-24",    "to": "2019-08-24",    "totalRevenue": 0,    "totalTransactions": 0,    "averageOrderValue": 0,    "totalDiscount": 0,    "totalReturns": 0,    "netRevenue": 0,    "cashCollected": 0,    "creditTotal": 0,    "dailyBreakdown": {      "content": [        {          "date": "2019-08-24",          "revenue": 0,          "transactions": 0,          "returns": 0,          "averageOrderValue": 0,          "netSales": 0,          "discount": 0        }      ],      "page": 0,      "size": 0,      "totalElements": 0,      "totalPages": 0,      "hasNext": true,      "hasPrevious": true    }  }}