-
-
The ProcureAI overview page, one app covering both tracks: buying from suppliers and paying their invoices.
-
The owner describes what they need, and Channel3 pulls live products and real retail prices to use as a reference
-
Deals live in AG Grid, while a Bryntum Gantt tracks every payment milestone as PayPal events come in.
-
Buyer agent negotiates with seller agents, with every offer, counter-offer and reason logged. Totals are calculated in code, not guessed.
-
Orders over $20 need a supervisor's approval, then PayPal authorizes and holds the funds until delivery is confirmed.
-
Orders over $20 need a supervisor's approval, then PayPal authorizes and holds the funds until delivery is confirmed.
-
The seller creates and sends a real sandbox invoice through the PayPal Agent Toolkit, with no login pop-up.
-
Invoices arrive by PDF, email or supplier portal, and KERNEL fetches portal pages for the agent to read.
-
Before paying, the agent checks the invoice against the order and what was actually delivered.
-
Once everything matches, the supplier is paid with PayPal Payouts, end to end.
-
The web app, API and Postgres database all run on Render, deployed from one blueprint file in Singapore.
Inspiration
Small businesses rarely lose money because they can't talk to suppliers. They lose it in the messy middle: comparing quotes, chasing approvals, paying too early, and reconciling invoices after the fact. I wanted agents that actually negotiate, but money that only moves when policy and PayPal say so, never because a model "felt confident."
The PayPal AI Hackathon's two tracks sealed it: one product covering both an agent-to-agent marketplace and AI procurement & payables, sharing one trust model.
What it does
ProcureAI runs both tracks in one hosted app.
- Marketplace (buy side). The owner describes a need, and Channel3 pulls real market prices as a reference. A buyer agent negotiates with seller agents, offers rank live in AG Grid, and every back-and-forth is logged. A policy engine plus a signed, single-use HMAC mandate gates payment: anything over \( \$20 \) needs a supervisor. PayPal then runs AUTHORIZE → seller ships → owner confirms delivery → CAPTURE, so funds are only held until the goods arrive. Disputes can be raised and resolved from the dashboard through the PayPal Agent Toolkit (simulated in sandbox).
- Payables (pay side). Invoices come in three ways: a PDF upload, email, or a supplier portal page that KERNEL fetches. The agent extracts vendor, invoice number and amount, runs a match against the order and what was delivered, and only then pays the supplier with PayPal Payouts. Sellers can also create and send real sandbox invoices through the Agent Toolkit.
A Bryntum Gantt shows the live payment schedule (authorize → delivery → capture → payout), and AG Grid powers the comparison and order grids.
How I built it
- pnpm monorepo:
packages/agents(negotiation, scoring, policy, mandates, ledger),packages/paypal(REST client, Agent Toolkit and a sandbox-only MCP server),apps/api(Express, webhooks) andapps/web(Next.js dashboard). - Azure AI Foundry handles the language work: negotiation messages, requirement extraction and invoice reading. TypeScript owns everything that touches money: scoring, budget and deadline checks, approvals and payment transitions.
- PayPal sandbox: Orders AUTHORIZE/CAPTURE/VOID, Payouts, Invoicing via the Agent Toolkit, and verified webhooks feeding a replay-safe order ledger that rejects duplicates, illegal transitions and amount mismatches.
- Authorization sweep: held orders that miss their deadline are voided, reauthorized once from day 3, and voided at day 28 to stay inside PayPal's 29-day window.
- Sponsors on real paths: Channel3 (market prices), KERNEL (supplier portals), AG Grid (offers and orders), Bryntum Gantt (payment schedule), and Render (web, API and Postgres, deployed from one
render.yamlblueprint).
Challenges I ran into
- Keeping it safe and still realistic: tiny sandbox amounts, a hard spending cap, and refusing real PayPal calls when the environment is live.
- Authorize-before-approve traps: clear UI checkpoints so capture can never run without the owner confirming delivery.
- Webhook truth: PayPal events arrive late, twice or out of order, so the ledger had to be idempotent and enforce valid state transitions.
- Honest sponsor use: wiring Channel3, KERNEL, Bryntum and AG Grid into paths judges can click, not just logos.
- Bryntum with Next.js: client-only rendering, licensing on the web service, and React effect lint rules.
Accomplishments I'm proud of
- A full buy-to-pay loop on real PayPal sandbox APIs: negotiate, approve, hold, capture, dispute, invoice, match and pay out.
- Agents never move money on their own. Every payment needs a policy pass, a signed mandate and a human gate.
- Both hackathon tracks in one product with one trust model.
What I learned
Agents are great at conversation and terrible as cashiers. The pattern that works is that LLMs propose, while deterministic policy and PayPal holds decide. Building both tracks forced one shared trust model: the same spend caps, human gates and webhook-driven truth across marketplace and payables.
What's next for ProcureAI
- Durable background work on Render Workflows for long negotiations, retries and authorization-expiry checks.
- Live disputes using real PayPal dispute IDs, plus multi-currency (FX) payables.
- Automatic replenishment, so recurring supplies reorder within policy.
- An installable PWA and multi-approver workflows for larger teams.
Built With
- ag
- agent
- ai
- azure
- bryntum
- channel3
- drizzle
- express.js
- gantt
- grid
- kernel
- next.js
- node.js
- openai
- paypal
- pnpm
- postgresql
- react
- render
- slack
- sse
- toolkit
- typescript