Create an Inventory Write-Off or update an existing one.
Inventory Write-Off is a document that removes products from inventory; it has a list of items and quantities.
Non-stock products and bundles cannot be on Inventory Write-Offs (these items do not have inventory).
Products can be added to stock with Inventory Registrations (see getInventoryRegistrations and saveInventoryRegistration) and moved between locations with Inventory Transfers (see getInventoryTransfers and saveInventoryTransfer).
To retrieve a list of Inventory Write-Offs, see getInventoryWriteOffs.
|Parameter name||Description||Possible value||Required|
|inventoryWriteOffID||Inventory write-off ID.
Set this parameter to update an existing Inventory Write-Off.
If the Erply account has upgraded inventory module (indicated by the (i) signifier at the lower right corner, after version number, in Erply backend), and the write-off is already in confirmed status, it is no longer possible to change:
|creatorID||Company user unique ID||Integer|
|reasonID||ID of the reason. See
|warehouseID||ID of the warehouse||Integer||yes|
|stocktakingID||ID of the inventory stocktaking act, returns error 1186 if provided inventory stocktaking is already connected with inventory write-off.||Integer|
|recipientID||ID of the recipient of goods||Integer|
|currencyCode||Currency code: EUR, USD. Currency must be present in the system.
If omitted, default currency will be used.
If omitted, current date will be used.
|confirmed||By default 1||0 or 1|
|*****||Document lines (rows). Send document lines as a flat list, each line defined by the following set of parameters. Replace # with set number (1, 2, 3, ...). For example: productID1, amount1, price1 for the first Inventory Write-Off row, productID2, amount2, price2 for the second one and so on.|
|stableRowID#||Stable ID of the inventory write-off row.||Integer|
|productID#||Product ID for this document line.||Integer||yes|
|amount#||Amount for this document line||Decimal||yes|
|price#||Unit cost. NB! It is typically unnecessary to set this field, because Erply removes items from stock according to FIFO principle (items are subtracted from the oldest batch currently in stock) and the cost is taken automatically from that batch.||Decimal|
|*****||Additional attributes associated with this item.
Attributes must be supplied as a flat list, each attribute defined by the following set of three parameters. Replace # with set number (1, 2, 3, ...). When updating an existing entry, API will only update the attributes specified in input data and leave all other existing attributes unchanged. To delete an attribute, set its value to 'null' or 'undefined'.
|attributeName#||Attribute name. Name can only contain the following symbols: A-Z, a-z, 0-9, dash and underscore.||String|
|attributeType#||Attribute type, possible types are 'text', 'int' and 'double'. By default 'text'.||String|
|attributeValue#||Value of the attribute. Set value to 'null' or 'undefined' to delete an attribute.
'text' attribute can be any string, maximum 255 characters.
'int' must be a signed 32-bit integer.
'double' must be a decimal number.
|inventoryWriteOffID||Integer||ID of the newly-created item|