Skip to content

Get Product Sales Stats

Get Product Sales Stats

Retrieves a set of product sales stats.

Important things to note: 1. Your datetime filters will be clamped to a maximum range of seven days following the processes laid out in DateTime Handling. 2. You can only specify one machineIdentifier or siteId at a time. Specifying more than one will result in a TOO_MANY_FILTERS error. 3. You can only filter on one type of identifier at a time. If you provide both a machineIdentifier and a siteId, the siteId will be ignored and only the machineIdentifier will be used. 4. -1 is a valid productId. This occurs if a product is vended that is not configured in our system. 5. startDate/endDate window on the reporting batch's date, not the individual vend's own timestamp, for every filter combination, so an org-wide total always reconciles with its machine- and site-scoped breakdowns over the same range. A vend right at a range boundary is counted by whichever side of the boundary its batch falls on, which can differ from its own timestamp.

Verb POST
Endpoint {base-url}/reports/product-sales-stats
Max Page Size 1000

Request Body

{
    "requestFilter": {
        "organizationIds": [1],
        "siteIds": [1],
        "machineIdentifiers": ["11485", "11486"],
        "startDate": "2025-01-01T19:07:05.477",
        "endDate": "2025-01-29T20:07:05.477"
    }
}

Filters Honored

  • RequestFilter
    • organizationIds
    • siteIds
    • machineIdentifiers
    • startDate
    • endDate

Returns

On Success

The requested list of product sales stats.

Response Body

[
    {
        "productId": 50138,
        "totalSalesInTimeFrame": 3
    }
]

On Error

HTTP Code Error Code Definition
400 TOO_MANY_FILTERS More than one siteId was provided; only one is allowed per request.
400 TOO_MANY_FILTERS More than one machineIdentifier was provided; only one is allowed per request.