Question

I'm having a little trouble with the Magmi Datapump API and setting a stock to zero (and out of stock).

I am able to update stock, for example if I send this to ingest, it updates and puts it in stock:

array (
  'sku' => '1234',
  'qty' => 77,
  'price' => '26.80',
)

However if I send this, it does not change the stock value to zero (it stays what it was before) and it does not change to out of stock:

array (
  'sku' => '1234',
  'qty' => 0,
  'price' => '26.80',
)

I have also tried:

array (
  'sku' => '1234',
  'stock_item' => 
  array (
    'qty' => 0,
    'is_in_stock' => 0,
  ),
)

Any ideas on how to zero out stock and set an item to out of stock?

Was it helpful?

Solution

I believe your values (including quantity) need to be string values, so you need to wrap them all in single or double quotes:

array (
    'sku' => '1234',
    'qty' => '0',
    'price' => '26.80',
    'is_in_stock' => '0'
)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top