[POST] .../v1/stock/get
Returns stocks with paging and filters. Use this method to retrieve stocks for documents, POS setup, user access configuration and warehouse reference selectors. The response returns paged Stock records with next_offset and total and supports filters, sort_orders, limit and offset for stock id, firm id, name search, deleted_mark and update-date selection. The caller must have stock select permission and a valid current-user context; missing body, invalid current user, denied access, invalid filters or sorting and storage 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. The value is limited by server settings. |
| offset | Int32 | Optional | Offset from the beginning of the result set. |
| search | String | Optional | Search string for the name field. |
| sort_orders | Array of Stock_SortOrder | Optional | Output data sorting. |
Filterable Fields
| Field | Type | Description |
|---|---|---|
| deleted_mark | bool | Deletion mark. |
| firm_id | int | Company IDs. |
| id | int | Stock IDs. |
| name | string |
Sortable Fields
| Field |
|---|
| id |
| last_update |
| name |
Request Example
{
"filters": [
{
"Field": "firm_id",
"Operator": "In",
"Value": "2"
},
{
"Field": "name",
"Operator": "Like",
"Value": "Main"
},
{
"Field": "deleted_mark",
"Operator": "Equal",
"Value": "false"
}
],
"sort_orders": [
{
"column": "name",
"direction": "ASC"
}
],
"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 Stock | Result array. |
| total | Int64 | Total number of result items. |
Response Example
{
"ok": true,
"result": [
{
"id": 8,
"name": "Main store",
"address": "Tashkent, Buyuk Ipak Yuli 10",
"firm": {
"id": 2,
"name": "REGOS Retail",
"group": {
"id": 1,
"name": "Retail group"
}
},
"area": 120.500,
"description": "Primary retail stock",
"deleted_mark": false,
"last_update": 1712345600
}
],
"next_offset": 0,
"total": 1
}