setInventoryStocktakeStatus
The method allows you to change the status of a stocktake. When completing a stocktake, verified quantities are applied to warehouse stock and corresponding documents are generated.
Input parameters
| stocktake_id | int | Stocktake identifier |
| status | int | Target stocktake status: 0 - draft, 1 - commissioned, 2 - in progress, 3 - completed, 4 - counted, 5 - rejected |
| completed_items | array | (optional) List of verified items with counted quantities. Can be provided when changing status to in progress (2), counted (4), or completed (3). |
| | - item_id | int | Item identifier |
| | - completed_quantity | int | Verified (actually counted) quantity. Must not be negative. |
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 |
Sample
Input data:Output data:
A sample request in PHP: