Counts

[POST] .../v1/retailreport/counts

Returns retail sale and return counters for the selected period. Retrieve aggregate retail counters for sales and returns over a reporting period. The request requires start_date and end_date as Unix time in seconds, optionally limits data by operating_cash_ids and returns result with sale_count, return_count, debt_amount, debt_paid_amount and gross_profit. The method reads report data only and does not change documents; it requires the current request user to have retail report access, validates that start_date is before end_date and that the period is not longer than one month and returns validation, permission and storage failures as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
end_date Int64 Required Period end date as Unix time in seconds.
operating_cash_ids Array of Int64 Optional Operating cash register IDs.
start_date Int64 Required Period start date as Unix time in seconds.

Request Example

{
  "end_date": 1,
  "operating_cash_ids": [
    1
  ],
  "start_date": 1
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Array of RetailReportCount Result array.

Response Example

{
  "ok": true,
  "result": [
    {
      "debt_amount": 1.0,
      "debt_paid_amount": 1.0,
      "gross_profit": 1.0,
      "return_count": 1,
      "sale_count": 1
    }
  ]
}