We are building a POS application which is using the API in 4.3.6. There are some products as well as certain circumstances where we need to be able to transact a product through the POS (via API) that has an inventory of zero. If we attempt to do this, it raises an error that there is not enough inventory. Ok makes sense.
If we change the setting for CS Cart to "allow negative inventory", the order is processed correctly and the inventory changes to -1, -2, etc. BUT it also impact the web page in allowing anyone to buy everything even if not in stock, so that is not an option for us. So we are leaving that as "no"
In looking at the fn.cart.php function, there seems to be an exception for when changes are made with "order_management" which I assumed to be editing the order from admin.php, so we tested that. It raises some warnings, but does allow us to add additional qty to an order of an item that is not in stock, BUT it leaves the inventory at 1 afterwards, should be zero. I will report that as a bug.
What I need to do, is to treat the orders from the API as "order_management" or make a bunch of changes to fn.cart.php to allow the order to go through as if "allow negative inventory" is true, when it is actually false. I played around with this a bit and it appears doable, but I'd rather not hack up the code that much if I can avoid it.
The "text_api_error" is what is displayed back from the API. You can also see the order management exception