saveStocktaking

Create or update a physical stocktaking act.

Creating the act is the first step in physical stocktaking. Next, it must be filled with quantities counted in the warehouse. After all quantities have been recorded and verified, the act must be confirmed. Finally, surplus quantities should be taken into stock with an Inventory Registration and missing quantites written off with an Inventory Write-off. Note that just confirming the act will not update your inventory yet!

Inventory Registrations and Write-offs can be created manually in Erply back-end.

For related API calls, see getStocktakings, deleteStocktaking, getStocktakingReadings, saveStocktakingReadings and incrementStocktakingReading.

Input parameters

Parameter name Description Possible value Required
stocktakingID Id of edited stocktaking act. Integer
warehouseID Id of a warehouse, required for new stocktaking act creation. Cannot be updated or changed on existing stocktaking act. Integer yes
confirmed 0 or 1, by default 0.

Always create the stocktaking initially in unconfirmed state (you may just omit this flag). Only when it has been finalized and all counts entered and double-checked, confirm the stocktake by re-saving it with flag confirmed = 1. If you want to unconfirm the stocktaking, set this flag to 0.
Integer
recordCurrentQuantities 0 or 1, by default 0. Only for new stocktaking acts, cannot be updated.

Whether the stocktaking sheet should be pre-populated with a list of products that you have in stock, and their quantities at the current moment. Some fields are used to specify set of added products more exactly.

You are STRONGLY recommended to set this flag to 1. If you do not pre-populate the sheet, products will be added to the list as you count them — but then the stocktaking won't catch items that have an inventory quantity in Erply, but which are no longer to be found in the warehouse, and you woun't be able to write them off.
Integer
includeProducts Only for new stocktaking acts, cannot be updated. This field only works if you set recordCurrentQuantities = 1. Specifies the products to be included. Possible values:
  • ALL - all products
  • POSITIVE_STOCK - products in stock
  • NEGATIVE_STOCK - products with negative stock
  • NON_ZERO_STOCK - products with non-zero amount in stock
If omitted, 'NON_ZERO_STOCK' will be selected as default.
String
productGroupID Only for new stocktaking acts, cannot be updated. Product group (and it's subgropus) used for new stocktaking act, used as a filter for recordCurrentQuantities = 1 and saved in stocktaking act information. Integer
productCategoryID Only for new stocktaking acts, cannot be updated. Product category (and it's subcategories) used for new stocktaking act, used as a filter for recordCurrentQuantities = 1 and saved in stocktaking act information. Integer
brandID Only for new stocktaking acts, cannot be updated. Brand used for new stocktaking act, used as a filter for recordCurrentQuantities = 1 and saved in stocktaking act information. Integer
supplierID Only for new stocktaking acts, cannot be updated. Supplier used for new stocktaking act, used as a filter for recordCurrentQuantities = 1 and saved in stocktaking act information. Integer
locationInWarehouse Only for new stocktaking acts, cannot be updated. Location in warehouse used for new stocktaking act, used as a filter for recordCurrentQuantities = 1 and saved in stocktaking act information. String
excludeReservations 0 or 1, by default 0. Only for new stocktaking acts, cannot be updated.

Set it to 1 if reserved items (items on layby) are physically located in another place, and won't be counted during stocktaking.
Integer
onlyItemsWithoutWarehouseLocation 0 or 1, by default 0. Only for new stocktaking acts, cannot be updated. Integer

Response

Field name Type Description
stocktakingID Integer