30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

Get Stock

store/get-stock reports a product’s stock level, its stock status and its backorder setting.

It also reports which record actually holds the number, which is the part that prevents the most common silent inventory mistake there is.

At a glance

Abilitystore/get-stock
ToolsetWooCommerce — toolset/woocommerce
GroupWooCommerce › Inventory
RequiresWooCommerce, active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Abilities Manager 0.0.34 and later

How it works

A variation can manage its own stock, or it can draw on its parent product’s. When the parent manages it, the variation still has a stock field — and that field is read by nothing. Writing to it changes a number no part of WooCommerce consults, and the shop carries on selling from the parent’s pool.

That failure is completely silent. The write succeeds, the number is visibly different, and stock behaviour does not change. It is the reason this ability exists.

So the response names the authority: managed_by_id is the record that holds the real number, managed_here says whether that is the product you asked about, and authoritative_stock is the quantity the shop actually uses. own_row_quantity is the raw field on the record you named, for comparison.

When those two differ, you are looking at a product somebody has already written to incorrectly.

Input

NameTypeRequiredWhat it is
idintegerYesProduct or variation ID.

What comes back

NameTypeWhat it is
manage_stockbooleanWhether stock is tracked at all.
authoritative_stockintegerThe quantity the shop actually uses.
own_row_quantityintegerThe raw field on the record you asked about.
managed_by_idintegerThe record that holds the real number.
managed_herebooleanWhether that is the record you asked about.
stock_statusstringIn stock, out of stock or on backorder.
backordersstringThe backorder setting.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

How many of the large black t-shirt do we have?

It resolves to one call:

{
  "ability": "store/get-stock",
  "parameters": {
    "id": 8134
  }
}

Worth knowing

  • authoritative_stock is the real number. own_row_quantity may be anything.
  • managed_here false means writing to this record’s stock field does nothing.
  • Stock status is derived, not independent. It follows the quantity and the backorder setting.
  • Always read this before adjusting stock on a variation.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading