> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartwpplugins.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick stock

> See and change stock for every product and variation on one screen

Quick stock lists every product and variation with its stock on one screen. Type a number, press Enter, and the next row is ready.

**Shows in:** Stock tab

<Note>
  Quick stock needs WooCommerce's stock management. Turn on **Enable stock management** in **WooCommerce → Settings → Products → Inventory**. Until then the power-up won't switch on.
</Note>

## Turn it on

1. Go to **WooCommerce → Powerups** and switch on **Quick stock**.
2. Click **Stock** on its row (or **Configure**, then the **Stock** tab).

There's nothing to set up. Anyone who can manage WooCommerce and edit products can use the tab.

<Frame caption="The Stock tab with a stock amount being edited">
  ![The Stock tab with a stock amount being edited](https://placehold.co/1600x900/png?text=quick-stock-1)
</Frame>

## The Stock tab

One table with **Product**, **SKU**, **Stock** and **Status**. Simple products and variations are listed; variations sit under their parent. Grouped and external products are left out.

* **Search**: by name, SKU or ID.
* **Filters**: stock status (**In stock**, **Low stock**, **Out of stock**, **On backorder**, **Not tracked**), product type and category. Click **Filter**; **Clear** removes them.
* **Sort** by product name, SKU or stock.
* **Per page**: 20, 50, 100 or 200.
* A variable product links to its variations ("3 variations"). **Show all products** goes back to the full list.

Draft, pending, scheduled and private products carry a badge. Staff who can't see other people's private or draft products in WooCommerce don't see them here either.

## Change stock

<Steps>
  <Step title="Type the new amount">
    Click a stock amount and type, for example 15 → 30.
  </Step>

  <Step title="Press Enter">
    Enter saves and moves to the next row. Leaving the field saves too. Esc puts the old value back.
  </Step>

  <Step title="Check the toast">
    A message confirms the change ("Hoodie: 15 → 30") with **Undo**.
  </Step>
</Steps>

The mouse wheel never changes a focused amount. Negative amounts are allowed, since stock can already be negative after orders.

### Products that don't track stock

* **Status**: pick the stock status from the select.
* **Track**: starts tracking stock. Type the amount in stock (0 or more) and press Enter.
* Variations that use their parent's stock show **Parent's stock** and a **Track separately** button.
* Variable products show their stock per variation. To switch tracking on or off for the parent, use the product editor.

### Low stock

A product is low on stock when its amount is at or below its own low-stock amount (or else its parent's, or else the store's), above the out-of-stock amount, and its status is **In stock**. This can differ slightly from the low-stock count in Analytics.

**Not tracked** leaves out variable parents and variations that use their parent's stock.

## When stock changes while you edit

Changes are saved as a difference. If an order comes in while you save, the order still counts, and the message says "(another change came in while saving)".

If someone changed the product after the page loaded, the save is refused and the row shows the current value:

> Stock changed to 12 since this page loaded (an order may have come in). Enter the new amount again.

If a save didn't go through, you'll see "The change wasn't saved. Here is the product as it is now; try again."

Quick stock saves one change per product at a time. If another change to the same product is still being saved here, yours is refused with "Another change to this product is being saved. Try again in a moment."

<Note>
  Edits made here don't send WooCommerce's low-stock or out-of-stock emails. A developer can turn them on with the `apwc_quick_stock_send_stock_alerts` filter.
</Note>

While WooCommerce rebuilds its product lookup table, an alert says filters and sorting may be incomplete until it finishes.

## On phones

On a phone, each row of the table stacks into a block instead of scrolling sideways.

## Data

| Item | What it is |
| - | - |
| **Stock changes** | Quantities and statuses you change are saved on the products in WooCommerce. They stay when the power-up is off or removed. |
| **Edit locks** | Short-lived rows that stop two saves of the same product overlapping. One left by a request that stopped half way expires after 30 seconds. |

## Known limitations

* If an order changes stock by exactly the opposite amount at the same moment (you set 10 → 12 while an order takes 2), the save counts but shows "wasn't saved". The row shows the correct stock.

## For developers

The Stock tab saves through three REST routes. They exist only while Quick stock is on, and use WordPress's usual REST authentication (logged-in cookie plus a `wp_rest` nonce, or an application password).

| Route | Method | Parameters | What it does |
| - | - | - | - |
| `apwc/v1/quick-stock/{id}/stock` | POST | `quantity` (required; whole number, negative allowed), `expected` (required; the amount you last saw) | Sets the stock amount. It's written as a difference through WooCommerce, so an order that comes in meanwhile still counts. |
| `apwc/v1/quick-stock/{id}/status` | POST | `status` (required; a WooCommerce stock status such as `instock`, `outofstock` or `onbackorder`), `expected` (optional; the status you last saw) | Sets the stock status of a product that doesn't track stock. Changes are checked for only when `expected` is sent. |
| `apwc/v1/quick-stock/{id}/manage` | POST | `quantity` (required; whole number, 0 or more) | Starts tracking stock with that amount. Unlike the page, it also accepts a variable parent product, as WooCommerce's product editor does. |

`{id}` is a product or variation ID. Amounts go up to 999,999,999.

### Permissions

The user needs `manage_woocommerce` and `edit_products`, then `edit_product` on that product (on the parent product for a variation). Developers can change the per-product answer with the `apwc_quick_stock_can_edit` filter. Trashed, auto-draft, grouped and external products answer as not found.

### Responses

A successful call returns:

```json theme={null}
{
  "row_html": "<tr>…</tr>",
  "parent_html": null,
  "message": "Hoodie: 15 → 30",
  "old": 15,
  "new": 30,
  "changed": true
}
```

`parent_html` is the redrawn parent row for a variation. `changed` is false when the value was already the same ("Hoodie: no change").

| Status | Code | When |
| - | - | - |
| 400 | `apwc_bad_quantity` | Not a number, not a whole number, too large, or below 0 for `/manage`. |
| 400 | `apwc_bad_status` | `status` isn't one of WooCommerce's stock statuses. |
| 401 / 403 | `apwc_cannot_edit` | You can't edit this product. |
| 404 | `apwc_no_product` | The product doesn't exist or isn't listed by Quick stock. |
| 409 | `apwc_busy` | Another save of the same product is still running. |
| 409 | `apwc_stock_changed` | The stock or status changed since `expected`. `data.current` holds the value now. |
| 409 | `apwc_not_tracked` | `/stock` on a product that doesn't track stock. |
| 409 | `apwc_parent_stock` | A variation that uses its parent's stock. |
| 409 | `apwc_status_computed` | `/status` on a product whose status follows its stock, or on a variable product. |
| 409 | `apwc_already_tracked` | `/manage` on a product that already tracks stock. |
| 500 | `apwc_not_saved` | Nothing was written. |

Every 409 and 500 error includes `data.row_html`, the product's row as it is now.

After a change, the `apwc_quick_stock_updated` action runs. Low-stock and out-of-stock emails are sent only when `apwc_quick_stock_send_stock_alerts` returns true.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.