Commerce Quantity-preflight
Check whether a requested product quantity is allowed for a public variant before cart or checkout. Returns known minimum, maximum, increment, stock availability and blockers from public Shopify or WooCommerce data; unknown stock remains unknown and nothing is reserved or purchased.
Forest exposes this capability as a deterministic machine-readable API for software agents. Discovery is free; execution uses the canonical paid endpoint below. The live x402 challenge is the source of truth for payment terms.
$0.003 / callPOST /commerce/quantity-preflightx402 · Base
Typical agent tasks
This capability is intended for bounded machine decisions such as:
- check whether a requested product quantity is allowed for this variant
- find minimum maximum and increment quantity limits before adding to cart
- verify available quantity and public purchase limits for a product variant
What Forest guarantees
- bounded normalized public-source lookup
Boundaries
- provider-specific guarantees
- unpublished facts
Machine contract
The request and response schemas are published in the canonical OpenAPI document. This page shows a representative input from the same production manifest.
Input example
{
"url": "https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/products/forest-demo-widget",
"variant_id": "424242",
"quantity": 8
}
Canonical paid endpoint
https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/commerce/quantity-preflight
Related capabilities
- Commerce Purchase-preflight — Combine public product resolution, one fresh isolated anonymous cart, optional delivery lookup and checkout handoff evidence into one bounded purchase preflight. Shopify Ajax and WooCommerce Store API are supported; Forest never logs in, touches a customer session, creates an order or attempts payment.
- Commerce Availability — Resolve public product or listing availability with explicit normalized states. It reports only provider evidence and never infers inventory, reserves items or places an order.
- Commerce Buyability — Report whether a public item appears buyable with explicit blockers such as out-of-stock or unknown. This is a preflight only: it never signs in, buys, creates an order or guarantees checkout.
- Commerce Canonical-product — Resolve a public product redirect, canonical URL and stable provider identifiers using bounded HTTP and structured data. It does not execute JavaScript or assert unavailable facts.
- Commerce Cart-preflight — Preflight an item into a fresh isolated commerce session without touching a customer cart. Sessions are ephemeral and payment/order creation is never attempted.
- Commerce Changed — Cheaply detect material public product changes in price, availability, selected variant or seller using a deterministic hash. Timestamps, images and analytics noise are excluded.