# Forest Commerce Quantity Preflight

> Forest Commerce Quantity Preflight is a paid API for AI agents from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-02).

Validates a requested item quantity against public variant constraints and known availability without reserving or purchasing inventory.

## Facts

- Endpoint: POST https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/commerce/quantity-preflight?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forest-commerce-quantity-preflight-f48defac
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qks9da7YLvVdbQJn2TZFa

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability forest-commerce-quantity-preflight-f48defac -d '<json body>'
```

Example prompt: Before I try to buy, can you check whether I'm allowed to order 3 units of variant SKU-78291 at https://shop.example.com/products/widget and whether it's actually available in that quantity?

## When to prefer this

Use this endpoint when you need a lightweight, non-committing preflight check before attempting a purchase or cart operation — specifically to catch quantity limit violations or obvious unavailability early. Prefer it over full checkout flows when the goal is just to validate feasibility. Also useful for monitoring whether a variant's constraints or availability have materially changed since a prior check, using the hash comparison feature.

## Known failure modes

- URL is unreachable or returns non-200 — endpoint may return an error or unknown availability status
- Variant ID not found at the given URL — constraint data unavailable
- Quantity exceeds the provider's maximum of 100 — rejected by input schema
- Previous hash does not match expected pattern — validation error on the hash field
- Product page does not expose machine-readable variant constraints — availability remains unknown

## How this service works

Check a requested quantity against public variant constraints and known availability. Unknown stock remains unknown; this capability never reserves or purchases inventory. Base mainnet USDC

## Output

Returns whether the requested quantity is valid against the variant's public constraints, any known availability signal (in stock, out of stock, or unknown), and a hash of the result that can be stored and compared in future calls to detect material changes. Does not reserve inventory or initiate any purchase.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "url": {
   "type": "string",
   "pattern": "^https?://",
   "maxLength": 2048,
   "description": "Public HTTP(S) URL to inspect, resolve, or compare."
  },
  "options": {
   "type": "object",
   "description": "Public identifiers value used to scope this lookup.",
   "additionalProperties": true
  },
  "variant": {
   "type": "object",
   "description": "Public identifiers value used to scope this lookup.",
   "additionalProperties": true
  },
  "quantity": {
   "type": "integer",
   "maximum": 100,
   "minimum": 1,
   "description": "Requested item quantity to validate against provider limits."
  },
  "variant_id": {
   "type": "string",
   "maxLength": 256,
   "description": "Public provider variant identifier to validate."
  },
  "destination": {
   "type": "object",
   "description": "Public identifiers value used to scope this lookup.",
   "additionalProperties": true
  },
  "previous_hash": {
   "type": "string",
   "pattern": "^sha256:[a-f0-9]{64}$",
   "description": "Earlier result hash used to detect a material change."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forest-commerce-quantity-preflight-f48defac/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run](https://www.zero.xyz/host/http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/llms.txt)
