Inspiration

Small businesses don't run out of work. They run out of cash while waiting to get paid for it. In 2026, 59% of US small businesses had invoices more than 30 days overdue. Yet their clients are often sitting on cash that earns almost nothing: 2% off for paying 30 days early is a return of about 36% a year. The deal is good for both sides, but nobody has time to negotiate it, so only about 15% of invoices are ever paid inside a discount window.

Every payment agent today chases invoices. We built one that negotiates them.

What it does

Terms gives a small business an AI agent that closes its cash gap by negotiating early payment with its clients' agents, and settles every deal on PayPal.

Maya runs a design studio. Payroll is due Friday and she's $6,200 short. She types: "I need $6,200 by Friday. Don't offer more than 1.2%, and don't contact Pinecrest or Birch."

  • It plans. Terms finds the cheapest mix of offers that covers the gap: a free reminder first, then small discounts only where needed. Protected clients are never touched.
  • It asks first. Nothing is sent until Maya approves the plan and its cost ceiling.
  • It negotiates. Her agent negotiates with each client's agent, and each side has its own rules. When Harbor asks for 1.5%, her agent counters at her 1.2% limit. Because that puts the plan $1 over budget, it asks her first.
  • It settles on PayPal. Agreed terms are written onto the PayPal invoice. A client's agent pays from its saved PayPal method, or a person pays the invoice. A deal counts as paid only when PayPal's verified webhook confirms it.

The outcome: payroll covered, with $6,689 committed for $61, and her clients earn 16–18.5% a year for paying early. For a discount $d$ paid $t$ days early, the client's return is

$$r = \frac{d}{1-d}\cdot\frac{365}{t}$$

Everybody wins.

How we built it

  • Policy in code, judgement in the model. AI agents choose each move, but discounts, budgets, hurdle rates and approval limits are enforced in code. No prompt can talk an agent past them.
  • Built on PayPal: Invoicing (live discounts and partial-payment minimums), Vault, Orders, Transaction Search and verified webhooks, through the APIMatic TypeScript SDK. Every payment write happens exactly once.
  • AI: Gemini through the Vercel AI SDK powers seven roles: goal parsing, both negotiators, reply reading, plan explanations, message writing and the Cash Studio strategist. Each has a deterministic fallback, so Terms never stalls.
  • AG Grid, AG Charts and AG Studio: the Workbench, Negotiation Room and Payables Desk are AG Grid Enterprise. The cash runway is AG Charts. Cash Studio is an AG Studio agent that answers what-if questions with a live widget.
  • Stack: a TypeScript monorepo with a shared typed contract, Express, Prisma and Postgres, React, and live updates. Hosted on Render.

Challenges we ran into

  • Two agents, two private policies. Each business's limits must stay secret from the other side, even on a shared deal. We gave every move a public reason and a private one only its owner sees.
  • Keeping AI honest about money. Every number an AI writes is checked against the real figures before anyone sees it.
  • Payments that must never happen twice. Every PayPal write is claimed first and sent with an idempotency key, so a retry can never double-charge.

Accomplishments that we're proud of

  • Two AI agents negotiating real payment terms, with every limit guaranteed by code.
  • A complete loop, from a plain-English goal to money on PayPal, with every step in an audit trail.
  • Over 450 automated tests against a real database, including property tests of the negotiation.

What we learned

Let AI decide, and let code define what's allowed. Defining our shared contract first let two developers build the API and the UI in parallel without stepping on each other.

How we used AI

Gemini powers the agents in the product. We built Terms with Claude Code, using the APIMatic Context Plugin for the PayPal integration.

Team

Tushar built the core: API, planner, negotiation engine, PayPal and AI. Amiya built the product experience: Workbench, Negotiation Room, Payables Desk and Cash Studio on AG Grid, AG Charts and AG Studio.

What's next for Terms

  • Live PayPal payments for real businesses.
  • QuickBooks and Xero import, so any small business can start in one click.

Built With

Share this project:

Updates

Submission history