addInventoryStocktakeItems
The method allows you to add items to an existing stocktake in draft status. Entering a product with the same ID and matching parameters updates the previously saved position. If any parameter differs, a new item will be added.
Input parameters
| stocktake_id | int | Stocktake identifier |
| items | array | List of items to add to the stocktake |
| | - product_id | int | Product identifier |
| | - quantity | int | Expected quantity. Must be a non-negative integer. |
| | - location_name | varchar(255) | (optional) Storage location name |
| | - expiry_date | varchar(10) | (optional) Expiry date in YYYY-MM-DD format (ISO 8601) |
| | - batch | varchar(128) | (optional) Batch number |
| | - serial_no | varchar(128) | (optional) Serial number |
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 |
| items | array | List of created/updated stocktake items |
| | - item_id | int | Item identifier |
| | - position | int | Item position in stocktake |
Sample
Input data:Output data:
A sample request in PHP: