Stock balances and inventory
Table of contents
- Introduction
- The different quantities in GetInventory and GetInventoryByQuery
- Stock balance formulas
- The difference between GetInventory and GetInventoryItems
Introduction
The inventory describes which articles are in stock. There are several different functions for retrieving the inventory data from the API:
- GetInventory - The most basic inventory function. Returns the inventory information for all articles, summarized per article.
- GetInventoryByQuery - Returns the inventory information for a selection of articles, summarized per article.
- GetInventoryItems - Returns detailed stock information, not summarized per article. This function can be used, for instance, if you want to know exactly which serial numbers or batches are in stock.
Note that these functions also return the basic article data (such as weight, dimensions and description) for each article. There is no separate function for getting the basic article data. Thus, in order to get the article registry, GetInventory should be used.
The different quantities in GetInventory and GetInventoryByQuery
When you call GetInventory and GetInventoryByQuery, you will receive several different quantities for each article:
NumberOfItemsDecimal
NumberOfItemsDecimal is the total, physical stock stored in the warehouse.
NumberOfBookedItemsDecimal
NumberOfBookedItemsDecimal is the number of items which have been ordered but which have not yet been picked.
AllocatedNumberOfItems
AllocatedNumberOfItems is the number of items which have been allocated to orders but have not yet been picked. Some warehouses use this two-step process of first allocating goods, and then picking them. Other warehouses use a one-step process (directly picking the goods), in which case AllocatedNumberOfItems will always be 0.
NumberOfLockedItems
NumberOfLockedItems counts article items where either:
- the article item is allocated (the allocated quantity can also be accessed via AllocatedNumberOfItems),
- the article item is in a warehouse location which has been locked,
- the article item is subject to stock-taking activities, or
- the article item is locked by the warehouse workers for other reasons (e.g. the item could be of unknown condition and is under investigation).
LockedForSaleNumberOfItems
LockedForSaleNumberOfItems counts article items where either:
- the article item is allocated (the allocated quantity can also be accessed via AllocatedNumberOfItems),
- the article item has been specifically locked for sale.
ToReceiveNumberOfItems
ToReceiveNumberOfItems has no relationship to the rest of the values. It describes how large a quantity of goods is expected to arrive in the warehouse, that is, how large a quantity exists on a purchase order but is not yet received.
PickedToBeCollectedNumberOfItems
PickedToBeCollectedNumberOfItems is the number of items which have been picked by the warehouse, and which are on orders whose statuses are strictly below "Collected" (< 500). That is to say, this is the number of items which have been picked by the warehouse but where the warehouse does not yet consider the orders to be completely done. This field is generally only used by ERP integrations when running the daily stock comparison.
ReceivedToBeFinishedNumberOfItems
ReceivedToBeFinishedNumberOfItems is the number of items which have been received and which are on inorders whose statuses are strictly below "Received" (< 500). That is to say, this is the number of items which have been received by the warehouse but where the warehouse does not yet consider the inorders to be completely done. This field is generally only used by ERP integrations when running the daily stock comparison.
Venn diagram illustration
The following Venn diagram illustrates the relation between the different quantities.
Stock balance formulas
There are various ways to compute the stock balance of a particular article, depending on exactly what kind of stock balance you require.
Physical stock balance
The number of items which are physically present in the warehouse is simply NumberOfItemsDecimal.
Sellable stock balance - basic formula
It is common to want to know how much stock there is in the warehouse which is available for selling. In general this can be achieved by the following formula:
Sellable stock balance = NumberOfItemsDecimal - NumberOfBookedItemsDecimal
Note that this formula can become negative. This formula is suitable for most cases, including web shops.
Sellable stock balance - advanced formula
One issue with the the basic formula is that it considers locked items to be sellable. For instance, if the warehouse has locked some items because they are under investigation for quality reasons, then the basic formula will still consider those items to be sellable.
In most cases, the basic formula is enough. But if you are sure that you don't want to count locked items as sellable when calculating available stock, use the below formula instead:
Sellable stock balance = NumberOfItemsDecimal - NumberOfBookedItemsDecimal - NumberOfLockedItems + AllocatedNumberOfItems
Keep in mind that article items could be locked by standard warehouse activities like stock-taking. This can lead to available stock being zero or negative during the stock-taking activity.
Sellable stock balance - advanced formula - version which takes "locked for sale" into account
This formula is similar to the standard advanced formula above, but it resolves the problem where goods can be counted as non-sellable if they are locked by standard warehouse activities like stock-taking.
Note that this formula is only applicable if the warehouse supports it. The warehouse needs to have a process where they are distinguish between "locking an item for some internal purpose" and "locking an item for sale". You must confirm this with the warehouse before using this formula.
This formula computes the sellable stock balance, but only counts goods as locked if they have been specifically "locked for sale":
Sellable stock balance = NumberOfItemsDecimal - NumberOfBookedItemsDecimal - LockedForSaleNumberOfItems + AllocatedNumberOfItems
ERP daily comparison formula
In integrations with ERP systems, it is common to run a daily comparison between the stock balances in Ongoing and the stock balances in the ERP. In this case, neither the physical stock balance nor the sellable balance is of interest.
What is required here is a formula which takes into account the fact that:
- Items may have been picked in Ongoing, but the ERP does not yet know about them because the warehouse has not yet finalized the order, and
- Items may have been received in Ongoing, but the ERP does not yet know about them because the warehouse has not yet finalized the inorder.
ERP stock balance = NumberOfitems + PickedToBeCollectedNumberOfItems - ReceivedToBeFinishedNumberOfItems
The difference between GetInventory and GetInventoryItems
The fundamental difference between GetInventory and GetInventoryItems is that:
- GetInventory will summarize the various quantities per article.
- GetInventoryItems will simply give you the raw data, without any summarization.
- Which serial numbers are in stock?
- Which batches are in stock, and how many of each?
- What is the article item status ("Blocked", "Quarantine", "Investigation", etc) of each item?
- Which warehouse locations are used for my goods?
As an example, let us say that you have an article called A1 with the following items in stock:
- 5 pieces with batch number B1.
- 10 pieces with batch number B2.
- The first InventoryItem will have Batch = B1 and NumberOfItems = 5.
- The second InventoryItem will have Batch = B2 and NumberOfItems = 10.