Inspiration

Teams paying contractors on PayPal need speed, but giving an AI direct access to checkout is risky: wrong amount, wrong recipient, no clear record of who approved what. I built Capstan as the operator layer. The agent can propose, but policy and humans decide before money moves.

What I built

Capstan is a Next.js app for milestone contractor payouts on PayPal sandbox:

  1. Draft — Operators describe a payout in plain language. A local parser fills the form by default (no OpenAI credits required). Optional OpenAI when configured.
  2. Policy — A configurable single payment cap (default $500) blocks overspend before any PayPal API call.
  3. Review — The operator confirms payee, amount, and milestone copy.
  4. Checkout — PayPal Orders v2 create and capture via the official React SDK.
  5. Audit — Every step is logged and shown in an AG Grid Community dashboard: presets, filters, row inspection, and CSV export.

Live demo: capstan-b7bg.vercel.app/app
Dashboard: capstan-b7bg.vercel.app/app/dashboard

How I built it

  • Next.js 15 with server routes for PayPal OAuth, Orders create and capture, policy checks, and agent draft.
  • PayPal: sandbox REST plus @paypal/react-paypal-js for buyer checkout.
  • AI: structured draft API with a local fallback at zero cost; OpenAI JSON mode when OPENAI_API_KEY is set.
  • AG Grid v33: custom event renderers, filter presets, natural language view shortcuts, export.
  • PayPal MCP documented as optional Cursor tooling to compare orders with the grid (docs/PAYPAL-MCP.md), separate from the in app checkout path.

Challenges

  • Sandbox pairing: reliable checkout required US Business app credentials and a US Personal buyer at the popup. Other pairings hit payee restriction errors. Steps are in the README for judges.
  • Serverless hosting: Vercel’s filesystem is ephemeral, so the hosted demo uses browser session storage to keep audit events while judges move between Console and Dashboard. A local clone uses file storage under frontend/.data/.

What I learned

The strongest agentic commerce demos are not “chat pays.” They show visible governance: policy blocks, explicit approval, PayPal lifecycle IDs, and a finance view operators would actually use.

What's next

Webhooks, payee allowlists, optional PayPal Agent Toolkit tools behind the same policy gate, and richer AG Grid analytics for production operators.

Built With

Share this project:

Updates

Submission history