Inspiration

Agentic commerce is arriving faster than merchant controls. If an AI can “buy things,” a household or a store still needs four boring, load-bearing pieces: a coherent cart from messy human intent, real payment rails (not a fake checkout button), an explainable risk decision before capture, and an ops view of what agents are doing.

Most demos stop at a generated shopping list. AgentCheckout is the full loop — plan, risk, PayPal order, capture, dashboard — built so a judge can run it end to end.

What it does

  1. You type a shopping intent, like “coffee pods and oat milk under $40.”
  2. An AI planner (LLM when a key is present, otherwise a deterministic heuristic fallback) maps that request onto a demo catalog, respects the stated budget, and explains why each line item is there.
  3. Regular code — not the model — adds the total and enforces the budget cap.
  4. The app creates a PayPal Orders v2 payment (sandbox API when credentials exist; a labeled mock that mirrors the same order shape when they don’t).
  5. A risk engine scores the cart with structured signal codes (TICKET_OK, HIGH_TICKET, URGENCY_LANGUAGE, GIFT_CARD_MIX, and others) and an LLM or template narrative for merchants. High-risk carts get a review / hold recommendation instead of auto-capture.
  6. Buyer approval happens through PayPal Buttons in sandbox, or a clearly labeled “Simulate PayPal Capture (Mock)” button in demo mode.
  7. Every order lands in an AG Grid merchant dashboard with intent, amount, status, risk level/score, and PayPal IDs.

How we built it

  • App: Next.js (App Router) + TypeScript + Tailwind, hosted on Vercel.
  • PayPal: Server-side OAuth2 client-credentials against api-m.sandbox.paypal.com, POST /v2/checkout/orders and POST /v2/checkout/orders/{id}/capture, plus @paypal/react-paypal-js Buttons that return the server-created order id.
  • AI planner: Gemini / OpenAI / Groq / Nebius when a key is set; a keyword-and-budget heuristic planner otherwise, so the demo never hard-depends on a model key.
  • Risk: Deterministic signal scoring in TypeScript, with an optional LLM narrative on top of the structured report. Recommendations are approve or review (hold for a human before capture).
  • Ops: AG Grid Community on /dashboard — sortable, filterable, auto-refreshing order intelligence.
  • Honesty: /api/status and UI badges always show paypalMode (mock | sandbox) and aiMode (llm | heuristic).

Challenges we ran into

Getting a payment demo that judges can actually finish, without asking them for sandbox buyer accounts, was the hard product constraint. We solved it with a dual-mode checkout that is visually labeled, uses the same API shapes, and never pretends mock is live PayPal.

Keeping the model from being the system of record was the other one. Totals, budget checks, and risk scores are computed in ordinary TypeScript so a planner hallucination cannot quietly raise a cap or auto-capture a high-risk cart.

Vercel’s serverless instances keep the in-memory order store per instance, so the dashboard can briefly look empty if a request lands on a cold instance. The demo copy calls that out; a persistent store is the obvious next step.

Accomplishments that we're proud of

  • A complete, hosted path: natural language → budget-aware cart → PayPal order → risk brief → capture → AG Grid.
  • PayPal and AI are both load-bearing, not logos on a slide.
  • Dual-mode honesty: judges can finish the flow today, and the sandbox Orders v2 path is in the repo for a credentialed run.
  • A risk brief that shows its work — scores, signal codes, and a hold recommendation on urgent high-ticket / gift-card carts.
  • Sponsor-lane depth with AG Grid as the merchant ops surface, not a decorative table.

What we learned

An agent that can spend money needs a boring supervisor. The interesting part of this project is not the planner’s prose; it is the seam where structured code takes over — totals, budget, risk signals, and a PayPal order the merchant can audit. Labeled mock mode also turned out to be a feature, not a compromise: it made the product demoable without weakening the real sandbox implementation.

What's next

  • Wire a PayPal Developer sandbox app on the hosted deploy and film a live Buttons capture.
  • Persist orders (and risk history) so the dashboard survives instance rotation.
  • Add a hard block in the UI when the risk recommendation is review or decline, not just a hold recommendation.
  • Optional Zapier webhook on capture, and a secondary host, if we pursue those sponsor lanes further.

Built With

Share this project:

Updates

Submission history