Location stock history
There are 2 different endpoints about stock history:
- Stock history: only contains changes of the stock levels of a product. This gives you every product coming in or going out of your warehouse. Mentioned stock levels are on a product-warehouse basis.
- Location stock history (this page): gives stock changes on a per location basis. Which means that it also tracks stock movements inside the same warehouse. Mentioned stock levels are on a product-location basis.
Get full location stock history
You can filter the history with the following parameters. Add these filters as querystring parameters to the URL.
|sincedate||Get the history that is added after this date and time.||2022-01-01 12:00:00|
|idproduct||Get the history for this product.||1106133|
|idlocation||Get the history in this location.||9823|
Get single history item
Stock changes can be found as change_type "mutation". These are the same as can be found in the stock history endpoint. If you want to know the reason or the user, use that endpoint.
When stock is moved between locations, this endpoint will show 2 entries. One entry for each location, with a positive and a negative amount. The change_type is "movement".
The attribute contra_idlocation gives you the other side of the movement. A movement from location 12 to 77 will give you 2 entries: [idlocation: 12, contra_idlocation: 77] and [idlocation: 77, contra_idlocation: 12].
Of course it is not possible to change history. Therefor you cannot POST, PUT or DELETE history items.
But you can change the stock. See the products endpoint for information about changing current stock levels.