Inspiration

Freelancers and small online sellers are paid by many clients through one PayPal account. Payments arrive on irregular dates and in different currencies, and PayPal fees quietly eat into income. We started with a simple sketch of a personal money tracker that PayPal could fill in automatically. Then we asked who would feel the pain most, and the answer was gig workers and online retailers. They can't easily see what they really earned, who still owes them, or which client they depend on too much.

What it does

PaySense connects to a PayPal sandbox account and turns the payment list into decisions:

  • See what you earn. It syncs 90 days of PayPal payments into a sortable AG Grid table, with PayPal's fee on every payment, income after fees, and a warning when one client is half of your income or more.
  • Get paid. An AI invoice assistant turns "invoice Acme RM500 for logo design, due in 14 days" into a real PayPal invoice that you review and send. A follow-up agent drafts reminders for overdue invoices.
  • Pay safely. In "Pay when done", an AI payments agent reads a delivery note and releases or holds a contractor payment through PayPal Payouts.
  • Plan ahead. It also gives a monthly profit and loss report, a 60-day cash-flow forecast, savings goals, subscription tracking, and AI Insights on spending.

How we built it

We used Next.js 16 and Payload CMS, with PostgreSQL on Render (SQLite locally) and Tailwind CSS. The PayPal sandbox APIs are OAuth, Transaction Search, Balances, Invoicing, Payouts and Subscriptions. The AI layer works with OpenAI, Claude or Gemini, using each user's own API key, stored encrypted. The app calculates every number, and the AI only explains it or makes a bounded decision. Every AI feature falls back to simple built-in rules when no AI account is connected.

The guardrails live in code, not in the AI:

  • Payments above RM 5,000 are never made automatically.
  • The payee and amount are fixed before the AI sees a task.
  • The AI can only make a decision stricter than the plain rules.
  • Reminders are capped at 3 per invoice, at least 3 days apart.

Everything runs in the PayPal sandbox, so no real money moves.

Challenges we ran into

  • PayPal's list isn't all payments. It also contains balance movements such as the opening balance, settlements and holds. At first these were counted as income and expenses and distorted every total. We now import only real payment events and clean up the old rows.
  • AI calls that hang. A slow Gemini answer once froze the sync. Every AI call now has a time limit and a fallback, and the user is told when the AI didn't answer.
  • Gemini models change constantly. A listed model can still refuse to answer for a new key. The app now asks Google which models a key can use, tests one, and explains what to do.
  • Keeping the AI honest. Reminder and invoice drafts are checked in code. They can't add links or emails, or change the amount.

Accomplishments that we're proud of

  • The AI can't move money on its own beyond limits written in code, and the user can see and change those limits.
  • The totals agree across the PayPal page, Insights and Reports, and we tested them with real PayPal sandbox payments rather than only demo data.
  • Every AI feature still works without an AI account, because a rules-based fallback takes over.
  • The app is live on Render with a Postgres database, not only running on a laptop.

What we learned

Put the money rules in code, and let the AI do only what code can't: read messy text, classify, and explain. Testing with real sandbox payments found bugs that demo data hid. Time limits and fallbacks matter as much as the AI feature itself.

What's next for Project PaySense

Live PayPal accounts, a mobile view, tax-ready exports, and support for more currencies.

Built With

  • ag-grid
  • ai-agents
  • anthropic-claude
  • google-gemini
  • next.js
  • node.js
  • openai
  • payload-cms
  • paypal
  • paypal-invoicing-api
  • paypal-payouts-api
  • paypal-subscriptions-api
  • paypal-transaction-search-api
  • postgresql
  • react
  • render
  • sqlite
  • tailwindcss
  • typescript
Share this project:

Updates

Submission history