Factuarea APIDevelopers
Added

Variants in the inventory

The stock movements and the commitments of an article can be read for one variant, a variant declares its own reorder point and reorder quantity, the product publishes a stock summary and a price summary that count its variants, a line of a product with active variants names its variant, and the stock mode of a variant changes only when it holds no stock. 48 updated operations and the MCP tools that mirror them.

2 December 2026 — The inventory of an article now reaches its variants. The stock movement ledger and the commitments can be read for a single variant, each commitment says which variant it lowers, and a variant that manages its own stock declares a reorder point and a reorder quantity of its own, which the reorder suggestions use. The product publishes a stock summary and a price summary that count its variants, a line of a product with active variants names its variant, and the stock mode of a variant changes only when the variant holds no stock. No operation is new: the 48 that change are listed at the end of this page and link to their API Reference page.

Movements and commitments of one variant

Three reads take an optional variant_id, the public id of a variant of the article:

  • GET /v1/companies/{company}/products/{product}/stock-movements lists only the movements booked to that variant.
  • GET /v1/companies/{company}/stock-movements, the ledger of the whole company, takes variant_id together with product_id: without it the request is a 400 parameter_missing on product_id.
  • GET /v1/companies/{company}/stock-availability/{product}/commitments lists only the commitments that lower the stock of that variant, which add up to its physical balance minus its available balance.

What the filter does and does not do:

  • The balance of each row does not change. stock_after is still the balance of the article at that moment, not the one of the variant alone: the filter decides which rows are listed.
  • An id that is not a variant of the article —one of another article or company, or one that does not exist— returns an empty page, an empty list in the commitments, and never the whole ledger. A variant that was deleted can still be read in the ledger.
  • An id that is not valid is rejected. In the ledger of an article and in the commitments it is 422 invalid_param_value on variant_id; in the ledger of the company it is 400 parameter_invalid_uuid, like the other identifiers of that endpoint.

Each commitment also publishes variant_id: the variant whose stock it lowers, or null when it lowers the stock of the article itself, which is also the case of a variant that does not manage its own stock. A commitment of one variant never lowers the availability of another.

GET /v1/companies/{company}/stock-movements?product_id=01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a10&variant_id=01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a21

Reorder point and reorder quantity of each variant

A variant that manages its own stock (manage_stock: true) declares two thresholds next to low_stock_threshold:

FieldWhat it is
reorder_pointWhen the physical stock of the variant is at or below it, the variant enters the reorder suggestions. It replaces low_stock_threshold as the trigger of the purchase.
reorder_quantityThe quantity to replenish when the variant crosses its reorder point; without it the suggestion proposes the missing quantity. A declared 0 counts as not declared.

Both are in base units, decimal strings with four decimals ("10.0000") or null when they are not configured. They are written with POST /v1/companies/{company}/products/{product}/variants and PATCH /v1/companies/{company}/products/{product}/variants/{variant}, and read with GET /v1/companies/{company}/products/{product}/variants, with the variants embedded in the product and in the snapshot of the product.* events.

PATCH /v1/companies/{company}/products/{product}/variants/{variant}
{
  "reorder_point": "10.0000",
  "reorder_quantity": "60.0000"
}
  • Optional and nullable. Non-negative, with up to four decimals. On PATCH, an absent key keeps the current value, null removes it and a number sets it.
  • Only with their own stock. A variant that does not manage its own stock refuses a value that is not null with 422 business_rule_violation, subcode product_invalid_reorder_point and param reorder_point or reorder_quantity; null is always accepted. A variant that stops managing its own stock loses both values.
  • No inheritance, in either direction. The variant does not use the reorder point or the quantity of the article, and the article is not triggered by those of its variants. They are independent from low_stock_threshold, which keeps driving the low-stock alert.

What the reorder suggestions do with them

An active variant that manages its own stock, of an active article, is a candidate of its own in the reorder suggestions:

  • Trigger. Its reorder_point when it declares one, its low_stock_threshold when it does not, or a negative balance, with the same precedence as an article. trigger.reorder_point and trigger.reorder_quantity are the ones of the variant, and the row names it in product_variant_id.
  • Quantity. Its reorder_quantity when it is declared and above zero; otherwise, what is missing to get back to the trigger.
  • Stock. The variant has its own committed and available quantities, so a variant with physical stock and everything committed comes out as stock_state all_reserved.
  • Counts. products_with_threshold_count includes the article that has an active variant declaring only its reorder point.

An article with a reorder point of 50 and a physical stock of 100 does not trigger its variants, and a variant with a reorder point of 10 and a physical stock of 8 is a candidate even if the article is above its own.

The replacement of a base unit converts reorder_point and reorder_quantity, of the article and of each variant, with the same rule as the other thresholds. Its preview lists each one as an item of the plan with kind reorder_point or reorder_quantity: an integration that enumerates kind must accept both values.

Stock and price of a product with variants

The full view of a product, in the REST API and in the MCP tools that return it, publishes two summaries that the server computes with a single definition, so an integration does not have to add up the variants itself:

FieldWhat it carries
stock_summarytotal, the sum of the balances of the destinations of the product, in base units; destinations, how many balances it adds; and state, the worst of them: negative, out_of_stock, below_minimum or ok.
price_summarymin and max, the lowest and the highest net price per base unit among the active variants; varies, true when they differ; and variants_with_own_price, how many active variants carry their own price.
  • Destinations. Each active variant with its own stock is a destination, and so is the shared stock of the product, where the variants without stock of their own sell from. The shared stock counts when the product manages stock and some active variant uses it, when its balance is not zero, or when no active variant has stock of its own. With no variant that has stock of its own, destinations is 1 and total is the stock of the product.
  • State. The minimum of a destination is its own low_stock_threshold when it is greater than zero and, if it has none, the default low-stock threshold of the company. is_low_stock and the low_stock filter of the list follow the same worst state: they are true when stock_summary.state is below_minimum, out_of_stock or negative.
  • Price. Each active variant is worth its own base_price_override or, if it has none, the price of the product, without VAT, price list or promotion. Presentations and configurations are not counted, because their price is per package. A product without active variants has min and max equal to its price.
  • Services. stock_summary is null when neither the product nor any active variant manages stock. stock keeps being the balance of the product itself.
{
  "stock": "120.0000",
  "stock_summary": { "total": "895.0000", "destinations": 3, "state": "below_minimum" },
  "price_summary": { "min": "6.2000", "max": "6.9000", "varies": true, "variants_with_own_price": 1 }
}

The variant of a line

A line that sells, buys, orders or moves a product with at least one active variant names that variant: variant_id in the lines of invoices, corrective invoices, quotes, proformas, delivery notes, recurring invoices, sales orders, purchase invoices and storefront sessions and orders, and product_variant_id in the lines of purchase orders and stock transfers. The variant decides the price of the line and the stock balance it moves. Without it the request is a 422 catalog_variant_required whose error.param is lines.N.variant_id (lines.N.product_variant_id in purchase orders and transfers) and whose error.line_index is the zero-based position of the line; with a single line, param is the field itself. It applies when the selection is created or changed, in the REST API, in the imports and in the MCP tools.

{
  "error": {
    "type": "invalid_request_error",
    "code": "catalog_variant_required",
    "param": "lines.1.variant_id",
    "line_index": 1,
    "doc_url": "https://docs.factuarea.com/guides/errors#catalog_variant_required"
  }
}

A variant is not required for:

  • A product without active variants. Deactivated and deleted variants do not count.
  • A line the document already stored without a variant, when it is sent again untouched. In an edit, a product that the document already stored without any variant is not rejected again, while a product new to the document, or one the document stored with a variant, is judged as on create. A purchase order line edited by its id keeps its variant and is not asked for it again.
  • Purchase and transfer lines that use the shared stock. They only move stock, so they may omit the variant when the product manages stock and at least one active variant has no stock of its own: the line goes to the shared balance of the product. If every active variant has its own stock, or the product does not manage stock, the variant is required.

Stock mode of a variant

manage_stock in PATCH /v1/companies/{company}/products/{product}/variants/{variant}, and in the MCP tool update_product_variant, decides whether the variant keeps its own stock (true) or sells from the stock of the product (false). The change is accepted only when the variant holds no stock that the other mode would lose track of; otherwise it is a 422 variant_stock_mode_change_blocked with param manage_stock, details.variant_id and the cause in subcode:

subcodeThe variant hasDirection that it blocks
has_own_stockA total balance other than zero.Own stock to the stock of the product.
has_warehouse_balancesA total of zero but a warehouse that keeps a balance other than zero: a +5 and a −5 add up to zero and are still two balances.Own stock to the stock of the product.
has_live_reservationsHeld reservations that have not expired.Both.
has_open_delivery_notesQuantity committed on delivery notes of a sales order that were not delivered.Both.
has_stock_in_transitQuantity shipped by a transfer and not yet received.Both.

Going from own stock to the stock of the product requires zero balances in every warehouse and none of the three commitments above. Going the other way only checks the three commitments, because what the variant set aside from the stock of the product while it sold from it would be served against an own balance that starts at zero. Once accepted, the variant starts with zero own stock, its earlier movements stay on the stock of the product, and a stock other than zero sent in the same request is recorded as an entry in the ledger (goods_in). The entry goes to the warehouse that a manual adjustment would use. When the company has no warehouse yet and another request is creating it at the same time, the update answers 409 resource_conflict without writing anything: send the same request again.

{
  "error": {
    "type": "invalid_request_error",
    "code": "variant_stock_mode_change_blocked",
    "subcode": "has_live_reservations",
    "param": "manage_stock",
    "details": { "variant_id": "01931b3e-7c4a-7f2e-9a8b-3c5d6e7f8a21" },
    "doc_url": "https://docs.factuarea.com/guides/errors#variant_stock_mode_change_blocked"
  }
}

MCP tools

The tools below keep their name and take the same fields as their REST operations. The company comes from the MCP session. See the tool catalog.

ToolScopeWhat it takes now
list_product_stock_movementsproducts:readvariant_id, to read the movements of one variant of the article.
search_stock_movementsproducts:readvariant_id, together with product_id.
list_stock_availability_commitmentsproducts:readvariant_id, and each commitment carries its variant_id.
create_product_variantproducts:writereorder_point and reorder_quantity.
update_product_variantproducts:writereorder_point and reorder_quantity, with the same absent, null and number rules as PATCH, and the 422 variant_stock_mode_change_blocked when manage_stock changes.
search_productsproducts:readThe low_stock filter follows the worst state of stock_summary; the products carry stock_summary and price_summary.

The tools that create or update documents with lines answer the 422 catalog_variant_required with the same param and line_index, the latter in error.data.line_index.

Operations that change

  • Stock movements and commitments. The three reads above gain variant_id, and each commitment gains variant_id.
  • Variants. products.variants.create, products.variants.list and products.variants.update carry reorder_point and reorder_quantity, and the update can answer variant_stock_mode_change_blocked.
  • Products. The operations that return a product publish stock_summary and price_summary and embed its variants, which carry both reorder fields: creating, reading, listing, searching, updating, finding by SKU or external id, activating or deactivating, adjusting the stock and uploading the video of a product, and the low-stock report.
  • Lines. The operations that create or change documents with lines can answer catalog_variant_required: invoices (create, update, bulk create and corrective), quotes, proformas, delivery notes, recurring invoices, sales orders (lines), purchase invoices, purchase orders (create, update and lines), stock transfers (create and lines), the acceptance of a reorder suggestion and the storefront sessions and orders.
  • Base unit replacement. Its preview and its execution handle the two new thresholds.
  • Events and webhook deliveries. The events feed and the deliveries of a webhook endpoint carry the product snapshot with the new fields in the product.* events.

Updated endpoints48

EndpointDescription
GET/v1/companies/{company}/products/{product}/stock-movementsList stock movements of a product
GET/v1/companies/{company}/stock-movementsList the stock movements of the company
GET/v1/companies/{company}/stock-availability/{product}/commitmentsList the commitments over an article
POST/v1/companies/{company}/products/{product}/variantsCreate a product variant
GET/v1/companies/{company}/products/{product}/variantsList product variants
PATCH/v1/companies/{company}/products/{product}/variants/{variant}Update a product variant
POST/v1/companies/{company}/productsCreate a product
PATCH/v1/companies/{company}/products/{product}Update a product
GET/v1/companies/{company}/products/{product}Retrieve a product
GET/v1/companies/{company}/productsList all products
GET/v1/companies/{company}/products/searchSearch products
POST/v1/companies/{company}/products/find-by-external-idFind a product by external ID
POST/v1/companies/{company}/products/find-by-skuFind a product by SKU
GET/v1/companies/{company}/products/low-stock-reportList products below the stock threshold
POST/v1/companies/{company}/products/{product}/toggle-activeToggle product active state
PATCH/v1/companies/{company}/products/{product}/stockUpdate product stock
POST/v1/companies/{company}/products/{product}/videoUpload a video to a product
POST/v1/companies/{company}/products/{product}/base-unit-replacement/previewPreview a base unit replacement
POST/v1/companies/{company}/products/{product}/base-unit-replacementReplace a product by changing its base unit
GET/v1/companies/{company}/eventsList all events
GET/v1/companies/{company}/events/{event}Retrieve an event
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveriesList webhook deliveries
GET/v1/companies/{company}/webhook-endpoints/{webhook_endpoint}/deliveries/{delivery}Retrieve webhook delivery
POST/v1/companies/{company}/invoicesCreate an invoice
PATCH/v1/companies/{company}/invoices/{invoice}Update an invoice
POST/v1/companies/{company}/invoices/bulk-createBulk create invoices
POST/v1/companies/{company}/invoices/{invoice}/correctiveGenerate corrective invoice
POST/v1/companies/{company}/quotesCreate a quote
PATCH/v1/companies/{company}/quotes/{quote}Update a quote
POST/v1/companies/{company}/proformasCreate a proforma
PATCH/v1/companies/{company}/proformas/{proforma}Update a proforma
POST/v1/companies/{company}/delivery-notesCreate a delivery note
PATCH/v1/companies/{company}/delivery-notes/{delivery_note}Update a delivery note
POST/v1/companies/{company}/recurring-invoicesCreate a recurring invoice
PATCH/v1/companies/{company}/recurring-invoices/{recurring_invoice}Update a recurring invoice
POST/v1/companies/{company}/sales-orders/{sales_order}/linesAdd a line to a sales order
PATCH/v1/companies/{company}/sales-orders/{sales_order}/lines/{line}Update a line of a sales order
POST/v1/companies/{company}/purchase-invoicesCreate an expense
PATCH/v1/companies/{company}/purchase-invoices/{purchase_invoice}Update an expense
POST/v1/companies/{company}/purchase-ordersCreate a purchase order
PATCH/v1/companies/{company}/purchase-orders/{purchase_order}Update a purchase order
POST/v1/companies/{company}/purchase-orders/{purchase_order}/linesAdd a line to a purchase order
POST/v1/companies/{company}/stock-transfersCreate a stock transfer
POST/v1/companies/{company}/stock-transfers/{stock_transfer}/linesAdd a line to a stock transfer
POST/v1/companies/{company}/purchase-reorder-suggestions/acceptAccept a reorder suggestion
POST/v1/companies/{company}/storefront/sessionsCreate a cart session
PATCH/v1/companies/{company}/storefront/sessions/{session}Update a cart session
POST/v1/companies/{company}/storefront/ordersCreate a storefront order

On this page

Need a hand?Contact support