Get sales trend versus previous period
GET
Compares revenue and transaction count for the requested range against the previous period of the same length, ending the day before from. from and to are dates (YYYY-MM-DD) and both default to today.
BearerAuthheader
AuthorizationBearer <JWT>from?stringStart date, YYYY-MM-DD.
Format
dateto?stringEnd date, YYYY-MM-DD.
Format
dateX-TenantID*stringYour merchant's tenant code — the value typed in the Domain field on the iotoms login screen. See Concepts.
OK
*/*- response
status*stringOutcome of the call: SUCCESS when it worked, ERROR when it failed.
message*stringShort human-readable message describing the outcome, for example "Vendor created". Do not parse it.
data?Current and previous period totals with the change between them.
Example Request
curl -X GET 'https://beta.iotoms.com/api/v1/reports/sales/trend' \ -H 'X-TenantID: your-tenant-code'Example Response
{ "status": "string", "message": "string", "data": { "currentPeriod": { "from": "2019-08-24", "to": "2019-08-24", "totalRevenue": 0, "totalTransactions": 0 }, "previousPeriod": { "from": "2019-08-24", "to": "2019-08-24", "totalRevenue": 0, "totalTransactions": 0 }, "revenueChange": 0, "revenueChangePercent": 0.1, "transactionChange": 0, "transactionChangePercent": 0.1 }}