usage of stock removal API? #7187
Unanswered
StormTrooper
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I think I found the answer. If I use &in_stock=1 it seems to solve one issue, but that leads me to another issue. If I have 2 stock items each with say 5 pieces, and I call the remove stock API for quantity of 6. How do I handle this? Remove 5 from one of the stock items and 1 from the other stock item? That's going to get messy then as I then first have to query the quantity of each stock item and work out how much to remove and how to split the removal across all the stock items? There must be a another way I'm not aware of? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've got a python script to remove stock from a part which works most of the time. I've been trying to track down a stock removal issue on my script which I think I found the cause of.
I don't think I understand the stock removal process correctly or I'm missing something.
To use the API to remove stock you need to specify the amount of stock to remove and the StockItem number.
My script does a API request for example for part 911:
This then returns the PK number for the stock item where I then call
and specify the PK and Quantity to remove. This works 100% for a part number like 82 on the demo site (Which has a single stock item)
The problem I have is when there are other stock items listed, like "consumed by build order'
Programmatically how do I know I am supposed to remove stock from PK 1223, rather than 1227 as both are returned?
Beta Was this translation helpful? Give feedback.
All reactions