Find the top product matching query, pick the cheapest
in-stock variant within budget, and add it to a fresh cart owned
by the agent’s customer.
Decision (A) from kickoff: always create a NEW cart per call. Predictable for agents that chain find-and-add → find-and-buy on the cart they just received. The customer’s storefront cart is untouched.
Pre-flight budget check raises 402 before creating the cart so the agent can fail fast on intents that exceed the cap.
Documentation Index
Fetch the complete documentation index at: https://docs.stella-commerce.com/llms.txt
Use this file to discover all available pages before exploring further.
Agent → Stella: POST /api/agent/intent/find-and-add.
Run a natural-language intent through the search engine, pick the best match (top-ranked, in-stock, cheapest variant by default), and put it in a fresh cart owned by the agent's customer.
1 - 512Number of units to add. Capped at 10 — agents that need bulk should call find-and-add multiple times so each decision shows up in the audit trail.
1 <= x <= 10Optional ceiling — if the cheapest matching variant exceeds this, the call returns 404 with no_affordable_match instead of adding it. Use to enforce 'under £30' style intents.
0 <= x <= 10000000Successful Response
Response shape for POST /api/agent/intent/find-and-add.
Includes the chosen product + variant so the agent doesn't need a follow-up call to render a confirmation message; the cart summary makes the impact visible at a glance.
LLM-shape cart snapshot. Mirrors the storefront cart but in
integer-cents currency and with summary_for_llm for the
one-line agent-readable digest.
LLM-shape product.
summary_for_llm is the single-paragraph natural-language summary
an LLM can read to decide if this matches a user's intent. The
structured fields below it are for follow-up calls (cart adds,
detail renders) and reasoning attribution. Keep this shape FLAT —
LLMs handle nesting poorly.