InsufficientStockForRemove

nathanoertelnathanoertel Member Posts: 1

I'm receiving the error: InsufficientStockForRemove when attempting to update an item. This only occurs on a small subset of products, 3 or 4 out of 100,000+ which are all created and maintained in the exact same way. I was told that there may be an issue due to a color selection but this error is blocking any API update to the item and any attempt to update it via the management console also fails with an unknown error.

To perform the update, the integration retrieves the item from the API, modifies the stock levels and then sends the updated content back. This is the item as retrieved:

{"@attributes":{"count":"1"},"Item":{"itemID":"162933","systemSku":"210000170950","defaultCost":"24","avgCost":"24","discountable":"true","tax":"true","archived":"false","itemType":"default","serialized":"false","description":"Toms Womens Classics Black\/Black Canvas Slip Ons 6.5","modelYear":"0","upc":"886468517409","ean":"","customSku":"OLGTA1-IF8P-65","manufacturerSku":"","createTime":"2016-06-22T15:55:33+00:00","timeStamp":"2019-03-23T17:07:00+00:00","publishToEcom":"false","categoryID":"786","taxClassID":"2","departmentID":"0","itemMatrixID":"24986","manufacturerID":"1281","seasonID":"0","defaultVendorID":"0","ItemShops":{"ItemShop":[{"itemShopID":"1639973","qoh":"3","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2019-01-29T20:58:11+00:00","itemID":"162933","shopID":"0","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639974","qoh":"2","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-10-17T18:36:38+00:00","itemID":"162933","shopID":"1","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639975","qoh":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2016-06-22T15:55:34+00:00","itemID":"162933","shopID":"2","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639976","qoh":"1","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2019-01-29T20:58:11+00:00","itemID":"162933","shopID":"4","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639977","qoh":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2016-06-22T15:55:34+00:00","itemID":"162933","shopID":"6","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639980","qoh":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2016-06-22T15:55:34+00:00","itemID":"162933","shopID":"12","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639981","qoh":"1","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2018-07-12T14:54:11+00:00","itemID":"162933","shopID":"14","m":{"layaways":"0","specialorders":"0","workorders":"0"}},{"itemShopID":"1639982","qoh":"0","backorder":"0","componentQoh":"0","componentBackorder":"0","reorderPoint":"0","reorderLevel":"0","timeStamp":"2016-06-22T15:55:34+00:00","itemID":"162933","shopID":"16","m":{"layaways":"0","specialorders":"0","workorders":"0"}}]},"Prices":{"ItemPrice":[{"amount":"48","useTypeID":"1","useType":"Default"},{"amount":"48","useTypeID":"2","useType":"MSRP"},{"amount":"0","useTypeID":"4","useType":"VOID"},{"amount":"0","useTypeID":"6","useType":"void2"}]}}}

This is the request that is posted to https://api.merchantos.com/API/Account/{{accountID}}/Item/162933 to update the item:

{"itemID":162933,"systemSku":"210000170950","defaultCost":24,"avgCost":24,"tax":true,"discountable":true,"itemType":"default","description":"Toms Womens Classics Black\/Black Canvas Slip Ons 6.5","upc":"886468517409","customSku":"OLGTA1-IF8P-65","categoryID":786,"taxClassID":2,"itemMatrixID":24986,"manufacturerID":1281,"ItemShops":{"ItemShop":[{"itemShopID":1639973,"qoh":3,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":0},{"itemShopID":1639974,"qoh":2,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":1},{"itemShopID":1639975,"qoh":0,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":2},{"itemShopID":1639976,"qoh":1,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":4},{"itemShopID":1639977,"qoh":0,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":6},{"itemShopID":1639980,"qoh":0,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":12},{"itemShopID":1639981,"qoh":0,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":14},{"itemShopID":1639982,"qoh":0,"backorder":0,"componentQoh":0,"componentBackorder":0,"reorderPoint":0,"reorderLevel":0,"shopID":16}]},"Prices":{"ItemPrice":[{"amount":48,"useTypeID":1,"useType":"Default"},{"amount":48,"useTypeID":2,"useType":"MSRP"},{"amount":0,"useTypeID":4,"useType":"VOID"},{"amount":0,"useTypeID":6,"useType":"void2"}]}}

This is the response to that request:

{"httpCode":"400","httpMessage":"Bad Request","message":"Items were not removed because there is not enough stock available for some items.","errorClass":"InsufficientStockForRemove"}

I contacted support and was told that the issue may be due to an empty color name in the item matrix attribute set but any attempt to change that via the API or the management console fails. When looking at the item as retrieved from the API there 4 units across 3 stores but the total stock level (qoh for itemShopID=0) is 3 for some reason. When looking at the management console it is 0. I'd imagine this may have some impact since that seems to be an error in the stock level in lightspeed but I have no way of correcting that. How can I resolve this issue?

Sign In or Register to comment.