Get

[POST] .../v1/itemoperation/get

Returns history operations with items. Use this method to inspect performed stock movement history for one catalog item across purchase, return, movement, in/out, wholesale, aggregation and retail synchronization sources. The response returns paged ItemOperation records with next_offset and total, translated document type names, optional cost fields when the caller has item operation cost view permission and supports item_id, stock_id, firm_id, date, start_date and end_date filters plus sort_orders, limit and offset. The caller must have item operation select permission, the item_id filter is required, stock access is limited by the current user's allowed stocks, tariff display_period may clamp or reject old dates and validation failures, denied access, tariff errors such as 7503, filter or sorting errors and database errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
filters Array of Filter Required Filters by fields available for this API method. Required filter fields: item_id.
limit Int32 Optional Maximum number of records to return. Values above the server query_limit are replaced by the server query_limit.
offset Int32 Optional Offset from the beginning of the result set. Negative values are treated as 0 by the current implementation.
sort_orders Array of ItemOprOrder Optional Output parameter sorting. Supported columns are stock_name, firm_name, quantity, date and doc_type.

Filterable Fields

Field Type Required Description
date int Optional
end_date int Optional Period end date as Unix time in seconds. May be rejected by tariff display_period when it requests data older than allowed.
firm_id int Optional
item_id int Required Item ID. Required and must be greater than 0.
start_date int Optional Period start date as Unix time in seconds. May be clamped by tariff display_period when omitted.
stock_id int Optional

Sortable Fields

Field
date
doc_type
firm_name
quantity
stock_name

Request Example

{
  "filters": [
    {
      "Field": "item_id",
      "Operator": "Equal",
      "Value": "24"
    },
    {
      "Field": "stock_id",
      "Operator": "In",
      "Value": "1"
    },
    {
      "Field": "firm_id",
      "Operator": "In",
      "Value": "1"
    },
    {
      "Field": "date",
      "Operator": "GreaterOrEqual",
      "Value": "1711929600"
    },
    {
      "Field": "date",
      "Operator": "LessOrEqual",
      "Value": "1714521599"
    }
  ],
  "sort_orders": [
    {
      "column": "date",
      "direction": "DESC"
    }
  ],
  "limit": 50,
  "offset": 0
}

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 ItemOperation Result array.
total Int64 Total number of result items.

Response Example

{
  "ok": true,
  "result": [
    {
      "date": 1712345600,
      "document_id": 7001,
      "document_type": {
        "id": 1,
        "name": "Purchase",
        "name_var": "app_purchase"
      },
      "document_type_name": "Purchase",
      "document_code": "PUR-00007001",
      "doc_type_name": "Purchase",
      "doc_code": "PUR-00007001",
      "stock": {
        "id": 1,
        "name": "Main warehouse",
        "firm": {
          "id": 1,
          "name": "REGOS"
        },
        "deleted_mark": false,
        "last_update": 1712345600
      },
      "quantity": 5,
      "cost": 31500.25,
      "additional_expenses_amount": 1200,
      "price": 42000,
      "price2": 45000,
      "exchange_rate": 1,
      "positive": true,
      "vat_value": 0,
      "vat_calculation_type": "No"
    }
  ],
  "next_offset": 0,
  "total": 1
}