Operations

[POST] .../v1/retailreport/operations

Returns retail sale and return operation totals grouped by item. Use this method to retrieve retail sale and return operation totals grouped by item for a selected reporting period. The request requires start_date and end_date as Unix time in seconds, optionally limits data by operating_cash_ids, supports item search by name, articul or code and returns result with next_offset and total for paged output. 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 business errors.

Request Parameters

Name Type Required Description
end_date Int64 Required Period end date as Unix time in seconds.
limit Int32 Optional Maximum number of records to return.
offset Int32 Optional Offset from the beginning of the result set.
operating_cash_ids Array of Int64 Optional Operating cash register IDs.
search String Optional Searches by item fields: name, articul and code. The code is compared only when the trimmed search term is an unsigned integer.
start_date Int64 Required Period start date as Unix time in seconds.

Request Example

{
  "end_date": 1,
  "limit": 1,
  "offset": 1,
  "operating_cash_ids": [
    1
  ],
  "search": "string",
  "start_date": 1
}

Response Parameters

Name Type Description
next_offset Int32 Offset for the next data page.
ok Boolean Indicates whether the request completed successfully.
result Array of RetailReportOperation Result array.
total Int64 Total number of result items.

Response Example

{
  "next_offset": 1,
  "ok": true,
  "result": [
    {
      "item": {
        "articul": "string",
        "assemblable": true,
        "barcode_list": "string",
        "base_barcode": "string",
        "brand": {
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "code": 1,
        "color": {
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "comission_tin": "string",
        "compound": true,
        "country": {
          "alfa2": "string",
          "alfa3": "string",
          "code": "string",
          "fullname": "string",
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "deleted_mark": true,
        "department": {
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "description": "string",
        "disassemblable": true,
        "fields": [
          {
            "data_type": "string",
            "is_custom": true,
            "key": "string",
            "metadata": "string",
            "name": "string",
            "required": true,
            "value": "string"
          }
        ],
        "fullname": "string",
        "group": {
          "child_count": 1,
          "id": 1,
          "last_update": 1,
          "name": "string",
          "parent_id": 1,
          "path": "string"
        },
        "has_child": true,
        "icps": "string",
        "id": 1,
        "image_url": "string",
        "is_labeled": true,
        "last_update": 1,
        "min_quantity": 1,
        "name": "string",
        "origin": "BuyingAndSelling",
        "package_code": "string",
        "parent_id": 1,
        "partner_id": 1,
        "producer": {
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "size": {
          "id": 1,
          "last_update": 1,
          "name": "string"
        },
        "type": "Item",
        "unit": {
          "description": "string",
          "id": 1,
          "last_update": 1,
          "name": "string",
          "type": "non_pcs"
        },
        "vat": {
          "enabled": true,
          "id": 1,
          "last_update": 1,
          "name": "string",
          "value": 1.0
        }
      },
      "return_amount": 1.0,
      "return_quantity": 1.0,
      "sale_amount": 1.0,
      "sale_quantity": 1.0
    }
  ],
  "total": 1
}