[POST] .../v1/docstockaggregation/get
Returns documents aggregated operations by warehouse. Use this read-only method to inspect stock aggregation documents created by the stock aggregation process for compound item retail movements. The response returns paged DocStockAggregation records with next_offset and total, supports filters by id, stock_id and date. The persistent layer always intersects requested stock_ids with the current user's allowed_stocks context, so the result is limited to warehouses available to the request user. Missing body, denied access to stock aggregation documents, invalid filters or sort_orders, database failures and paging errors are returned as HTTP 200 ErrorResult business errors.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| filters | Array of Filter | Optional | Optional filters by fields available for this API method. |
| limit | Int32 | Optional | Maximum number of records to return. Server settings define the effective maximum. |
| offset | Int32 | Optional | Offset from the beginning of the result set. Negative values are treated as 0. |
| sort_orders | Array of DocStockAggregationColumn | Optional | Output data sorting. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| date | int | |
| end_date | int | Period end date as Unix time in seconds. |
| id | int | Stock aggregate operation document IDs. |
| start_date | int | Period start date as Unix time in seconds. |
| stock_id | int | Stock IDs. |
Sortable Fields
| Field |
|---|
| amount |
| amount2 |
| code |
| date |
| last_update |
| performed |
| stock.name |
| uuid |
Request Example
{
"filters": [
{
"field": "stock_id",
"operator": "In",
"value": "3"
},
{
"field": "date",
"operator": "GreaterOrEqual",
"value": "1767225600"
}
],
"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 DocStockAggregation | Result array. |
| total | Int64 | Total number of result items. |
Response Example
{
"ok": true,
"result": [
{
"id": 9101,
"code": "AGR-000091",
"date": 1767312000,
"stock": {
"id": 3,
"name": "Main stock"
},
"amount": 125000,
"amount2": 132000,
"performed": true,
"last_update": 1767312000
}
],
"next_offset": 0,
"total": 1
}