getInventoryStocktakes
The method allows you to retrieve a paginated list of stocktakes from BaseLinker storage. It supports filtering by stocktake, warehouse, status, series, number, and creation date range.
Input parameters
| filter_stocktake_id | int | (optional) Filter by a specific stocktake identifier |
| filter_warehouse_id | int | (optional) Filter by warehouse identifier |
| filter_stocktake_status | int | (optional) Filter by stocktake status: 0 - draft, 1 - commissioned, 2 - in progress, 3 - completed, 4 - counted, 5 - rejected |
| filter_series_id | int | (optional) Filter by numbering series identifier |
| filter_stocktake_number | varchar(50) | (optional) Filter by stocktake number (partial match) |
| filter_date_from | int | (optional) Minimum creation date (unix timestamp) |
| filter_date_to | int | (optional) Maximum creation date (unix timestamp) |
| page | int | (optional) Results page number (100 stocktakes per page, numbered from 1) |
Output data
The method returns the data in JSON format.
| status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
| stocktakes | array | List of stocktakes |
| | - stocktake_id | int | Stocktake identifier |
| | - stocktake_number | varchar(50) | Full stocktake document number |
| | - name | varchar(80) | Stocktake name |
| | - stocktake_status | int | Stocktake status: 0 - draft, 1 - commissioned, 2 - in progress, 3 - completed, 4 - counted, 5 - rejected |
| | - series_id | int | Numbering series identifier |
| | - warehouse_id | int | Warehouse identifier |
| | - priority | int | Priority: 0 - low, 1 - medium, 2 - high, 3 - urgent |
| | - assigned_to | int | Assigned employee identifier. 0 if not assigned. |
| | - items_count | int | Total number of items in the stocktake |
| | - verified_items_count | int | Number of items that have been verified (counted) |
| | - total_quantity | int | Total expected quantity of products |
| | - verified_total_quantity | int | Total verified (actually counted) quantity |
| | - compliant_items_count | int | Number of items where verified quantity matches expected quantity |
| | - not_compliant_items_count | int | Number of items where verified quantity differs from expected quantity |
| | - missing_items_count | int | Number of items with expected stock > 0 but verified quantity = 0 |
| | - date_created | int | Stocktake creation date (unix timestamp) |
| | - date_completed | int | Stocktake completion date (unix timestamp). 0 if not completed. |
| | - date_scheduled | int | Execution scheduled date (unix timestamp). 0 if not set. |
| | - date_due | int | Execution due date (unix timestamp). 0 if not set. |
| | - notes | text | Stocktake notes |
| | - items_preparation_status | text | Stocktake items preparation status: ready, pending, or error |
Sample
Input data:Output data:
A sample request in PHP: