Delegate the purchase — not control of the money

AgentCart turns a natural-language shopping goal into an explainable, budget-bounded PayPal checkout. Give it a goal such as “Set up a home office for $200”: it plans the cart, negotiates when the budget is tight, re-plans around the result, and keeps the buyer in control of approval.

What it does

  1. Parses the goal and hard budget.
  2. Builds a cart from in-stock catalog items without duplicates.
  3. Negotiates a 5% bundle discount on the priciest item when that can unlock a skipped need.
  4. Substitutes the best-rated same-category item if stock changes.
  5. Shows a decision trace, then creates a PayPal order and waits for human approval before capture.
  6. Supports a partial refund after capture.

The budget gate runs before order creation. In the reproducible mock scenario, the negotiated home-office cart totals $199.55 against a $200 budget (withinBudget=true), with 13 trace events and an order result.

Technological Implementation

The app is Express + TypeScript on Node 20. A PayPalGateway interface keeps the same flow across LiveSandboxGateway (PayPal Orders v2 create/approve/capture/refund) and MockGateway (zero credentials, deterministic judge run). The agent can use the default scripted planner or an optional OpenAI/Mistral tool-calling planner over the same typed catalog/cart/order tools. A sandbox hard-lock rejects any PAYPAL_ENV other than sandbox.

Design

The single-page UI puts the goal, live cart, budget boundary, decision trace, and payment state in one timeline. The buyer can inspect the plan and must explicitly approve before money moves; capture and refund are visible state transitions rather than hidden agent actions.

Potential Impact

Delegated shopping is useful only if convenience does not mean blind spending. AgentCart demonstrates a concrete path to fewer manual shopping decisions while preserving a hard budget, human approval, and an auditable explanation of what the agent selected, skipped, negotiated, substituted, and refunded.

Innovation / Idea

The differentiator is the negotiation → re-plan → substitution → refund loop. AgentCart does not stop at recommendations or a cart: it earns room inside the budget, revisits skipped needs, handles a stock change, and keeps every money-moving step behind PayPal approval and the same budget boundary.

Presentation

The demo video shows AgentCart as a working product, not a slide deck: a goal and budget become a traced cart, then a human-approved PayPal payment flow. The public code includes a reproducible mock mode for judges and a documented PayPal Sandbox path for the live integration.

How to run

Clone the repository, use Node 20, run npm ci, then start the demo in its default scripted/mock mode. No API key is required for the reproducible path. Sandbox credentials are needed only for the optional live PayPal Sandbox path; live production payments are intentionally unreachable.

Built with

Express, TypeScript, PayPal Orders v2 REST API, Node.js, OpenAI API, Mistral AI.

What we learned

Agentic commerce is a budgeting and trust problem, not only a browsing problem. The meaningful decisions happen when money runs out: what to drop, what to negotiate, what to substitute, and when to ask the buyer.

What's next

Real merchant catalogs, persistent carts, multi-merchant split payments, and an approval experience tailored for delegated purchases.

Built With

Share this project:

Updates

Submission history