iotoms Docs

Get discounts given by type

GET
/api/v1/reports/sales/discounts

Returns the total discount given on non-voided sales in the date range. The per-type breakdown is currently returned empty, and discountTransactionCount counts all non-voided sales. 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

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?

Discount totals for the range.

Example Request
curl -X GET 'https://beta.iotoms.com/api/v1/reports/sales/discounts' \  -H 'X-TenantID: your-tenant-code'
Example Response
{  "status": "string",  "message": "string",  "data": {    "from": "2019-08-24",    "to": "2019-08-24",    "totalDiscountGiven": 0,    "discountTransactionCount": 0,    "breakdownByType": [      {        "discountType": "string",        "totalAmount": 0,        "count": 0      }    ]  }}