iotoms Docs

List top-selling items

GET
/api/v1/reports/sales/top-items

Returns the best-selling items ranked by revenue (default) or quantity via sortBy (revenue or qty). limit defaults to 10 (max 50); registerId narrows results to one register. 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.

Formatdate
to?string

End date, YYYY-MM-DD.

Formatdate
limit?integer

Max 50, default 10

Formatint32
Default10
sortBy?string

revenue (default) or qty

Default"revenue"
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?array<>|

Top-selling items, best first.

Example Request
curl -X GET 'https://beta.iotoms.com/api/v1/reports/sales/top-items' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": [    {      "rank": 0,      "itemId": "string",      "itemName": "string",      "qtySold": 0,      "totalRevenue": 0    }  ]}