API documentation
Method list
Test your request
Changelog


addInventoryStocktake
The method allows you to create a new stocktake (inventory count) in draft status. For non-manual scopes, the product list is automatically populated based on the selected scope and warehouse.


Input parameters
warehouse_idintWarehouse identifier. The list of identifiers can be retrieved using the method getInventoryWarehouses.
scopeintStocktake scope defining which products are included: 0 - all products, 1 - manual product selection, 3 - specific warehouse zones, 4 - specific location prefixes, 5 - random product selection
namevarchar(80)(optional) Stocktake name/description
priorityint(optional) Priority: 0 - low (default), 1 - medium, 2 - high, 3 - urgent
assigned_toint(optional) Assigned employee identifier
date_scheduledint(optional) Execution scheduled date (unix timestamp)
date_dueint(optional) Execution due date (unix timestamp). Must be later than or equal to date_scheduled.
approval_methodtext(optional) Approval method: "immediate" (default) - stocktake is completed immediately after counting, "confirm" - requires secondary approval step after counting
blind_countbool(optional) If true, hides the expected quantity from the counter. Default: false
confirm_locationbool(optional) If true, forces the user to scan/confirm the location before counting. Default: false
allow_add_remove_itemsbool(optional) If true, allows adding or removing products during the counting phase. Default: false. Always true for manual scope.
product_idsarray(optional) List of simple product or variant identifiers to include. Required when scope is 1 (manual).
scope_zonesarray(optional) List of warehouse zone identifiers. Required when scope is 3 (zones).
scope_locations_prefixvarchar(255)(optional) Semicolon-separated location name prefixes to filter by. Required when scope is 4 (locations). Example: "A-1;B-2"
scope_random_countint(optional) Number of random products to select. Required when scope is 5 (random). Must be a positive integer.



Output data
The method returns the data in JSON format.
statusvarchar(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
stocktake_idintCreated stocktake identifier
stocktake_numbervarchar(50)Generated stocktake document number
items_preparation_statustextStocktake items preparation status: ready or pending



Sample
Input data:
Output data:
A sample request in PHP: