WooCommerce · Update stock — Sets or adjusts a product's stock — changes how many of a product your store has. Use it to set stock after a count, or to add or take away a number when goods arrive or leave another way.

Who can do this

Workspace Admins and Editors, on every plan. Viewers see the step's settings but cannot change them.

Before you start

  • A WooCommerce connection with a Read/Write key — see Connect WooCommerce.
  • The product's id — id from Find a product, or from a WooCommerce trigger.

Steps

  1. Select + where the step should go. In the step picker, open Apps, select WooCommerce, then Update stock.
  2. In Connection, choose your WooCommerce connection.
  3. In Product, the product's id — for example {{ $json.id }}.
  4. In Change, choose Set to or Add or take away.
  5. In Quantity, a whole number — 25. With Add or take away, a minus takes away: -3.
  6. Select Run this step to try it.

Output

The product after the change, with the same fields as Find a product — id, name, sku, stockQuantity, stockStatus and the rest. See Create, update or find a WooCommerce product.

Good to know

  • Stock tracking is switched on for the product (Manage stock? in WooCommerce) if it was off.
  • Add or take away reads the stock first, then sets the new number. Two runs changing the same product at the same moment can miss one of the changes. A product not tracking stock until now counts from zero.
  • The product as a whole. For a variable product, this sets the parent product's stock, not a variation's.

If something goes wrong

What you see Why What to do
Quantity is not a whole number. Quantity has a decimal or a word in it. Use a whole number, with a minus to take away.
Product is empty when the step ran — an earlier step may not have given the value it names. The value came out empty. Check the value it reads.
WooCommerce refused: Invalid ID. No product has that id. Use id from Find a product.