How to use API to update stock #4424
-
I'm busy trying to build some automation in that involves reading and updating stock quantities. Read the current stock I can do with If I want to change the stock quantities then this is where the confusion comes in. Maybe I'm not understanding how the stock system work. Looking at the API document I need to use stock / update Another query based off this is when I do find out how to use the quantity, if I want to reduce it by 2 using a API, I guess I first need to read the current stock, then subtract, and then write the new value back? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@StormTrooper you need to query the API for the stock you want - one Part can have many StockItems in many StockLocations. You could filter by part for example. You can also call |
Beta Was this translation helpful? Give feedback.
@StormTrooper you need to query the API for the stock you want - one Part can have many StockItems in many StockLocations. You could filter by part for example.
You can also call
/api/stock/remove/
or/api/stock/add/
to decrease or increase the quantity by a set amount. Please look at the API docs for more detail https://demo.inventree.org/api-doc/#stock-add-create