API documentation
Method list
Test your request
Changelog


addInventoryDocumentItems
The method allows you to add items to an existing inventory document, or to update the quantity and price of an existing item by item_id. The document must be in draft status.


Input parameters
document_idintDocument identifier
itemsarrayList of document items to add or update. At most 1000 items with item_id can be updated at a time
| - item_idint(optional) Existing item identifier. When provided, only quantity and price can be updated, at least one of them is required
| - product_idintThe product ID, required when item_id is not provided
| - quantityintThe quantity of this line item in the document, required when item_id is not provided
| - pricedecimal(10,2)(optional) Item unit price
| - location_namevarchar(255)(optional) Source storage location
| - target_location_namevarchar(255)(optional) Target storage location (only for Internal Transfer documents)
| - expiry_datevarchar(10)(optional) The expiry date. Date format YYYY-MM-DD (ISO 8601)
| - batchvarchar(128)(optional) Batch number
| - serial_novarchar(128)(optional) The product serial number
| - commentsvarchar(255)(optional) Item comments or notes



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
itemsarrayList of created or updated document items
| - item_idintItem identifier
| - positionintItem position in document



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