Inspiration
My teammate Jay asked for something simple: an AI that shows where his money goes and tells him when a payment is stuck. Freelancers and small sellers live inside PayPal. Clients pay late, invoices get forgotten, subscriptions pile up, and chasing people means clicking through several screens. PayPal already has all the data and the tools; it just needed someone to talk to.
Then there's the other everyday money headache: splitting a restaurant bill. Someone pays, someone does the maths on a phone calculator, and three people "will pay you back later". We wanted to fix that with one photo.
What it does
PayPal Copilot is an AI money agent built on the PayPal developer platform.
Talk to your money: ask "Where is my money going this month?" and get spending by category and merchant, subscriptions and net cash flow.
Pending-payment alerts: unsettled payouts and unpaid or overdue invoices are polled from PayPal (or pushed by webhooks) and shown in a banner, the notification bell, the insights card and the chat.
Send, request and chase: "Pay Rohan $40 for groceries" creates a PayPal Payout. "Request 80 EUR from [email protected]" creates and emails a PayPal invoice. "Remind overdue" drafts a polite invoice reminder for each late client.
Human in the loop: the AI can only propose. Every money movement appears as a confirmation card, and nothing reaches PayPal until you press Confirm.
Split a bill (snap, share, settle): the host photographs the bill and Gemini vision extracts every item, tax, service charge and tip. Friends join from AirDrop / Quick Share, a QR code or an NFC tag, with no accounts or contacts needed. The host approves each friend by matching an emoji pair shown on both phones. Everyone taps what they had (or types "paneer tikka and a lassi" and the AI ticks it), then pays their exact share with PayPal Checkout. The bill settles itself when everyone has paid.
How we built it
Frontend: React 19, TypeScript, Vite and Tailwind CSS, mobile-first for the bill-split flow.
Backend: Express 5 and TypeScript, hard-locked to the PayPal sandbox so no real money can ever move.
PayPal APIs: OAuth 2.0; Payouts v1 for sending money; Invoicing v2 for requests, reminders, cancellations and paid detection; Orders v2 with JS SDK Smart Buttons for adding money and for each friend's bill-split payment; Webhooks with signature verification for status updates.
AI: Gemini Flash with function calling over 11 tools. 7 read tools ground every number in real account data, and 4 propose tools can only create confirmation cards. Gemini vision with a JSON response schema reads bill photos. A free rule-based local agent uses the same tools, so the whole app also runs with zero API keys.
Phone features: Web Share API (AirDrop / Quick Share), QR codes and Web NFC, served over HTTPS on the local network.
The split maths runs in whole cents. Each person pays for the items they claimed (shared dishes are split between the people who claimed them), plus an equal part of any unclaimed items, plus a part of tax, service and tip in proportion to what they had. Guests' shares are rounded down to the cent, and the host, who paid the restaurant, takes whatever is left. So the shares always add up to the bill total exactly.
Challenges we ran into
Sandbox country limits: our India-region sandbox accounts couldn't send Payouts or domestic invoices ("You live in a country that is not allowed to send this payout"). Switching to US sandbox accounts fixed it.
Currencies PayPal can't take: Indian restaurant bills come in INR, which PayPal merchants can't accept, so those shares are charged in USD at an approximate rate that every guest can see.
Free-tier AI limits: Gemini Flash models were often overloaded or ran out of daily quota. The server lists the available Flash models, moves to the next one when a model is busy or out of quota, and falls back to the local agent so the demo never breaks.
Keeping the AI truthful: the model must never say "sent!" when it only proposed something. The result of every confirmed or rejected action is fed back into the conversation, and multi-step tool calls keep the model's turns intact so its reasoning carries across steps.
A real-world split bug: in testing, the first friend to pay could close the bill before slower friends had even joined. The bill now settles only when the table is full, or when the host taps Finish.
What we learned
PayPal's Invoicing API makes a great "request money" building block: a hosted payment page, emails, reminders and status tracking all come with it.
Agentic finance needs hard guardrails outside the model: server-side validation, a per-action limit ($500), balance checks, and a human click to confirm.
Designing for a crowded restaurant table (no sign-ups, approve with emojis, pay in two taps) matters as much as the AI itself.
What's next
Detecting recurring payments and suggesting which subscriptions to cancel, multi-currency balances, and PayPal Pay Later for splitting bigger bills.
Built With
- express.js
- function-calling
- gemini
- google-gemini-api
- node.js
- paypal
- paypal-checkout
- paypal-javascript-sdk
- paypal-orders-api
- paypal-payouts
- paypal-rest-api
- paypal-webhooks
- qrcode
- react
- tailwindcss
- typescript
- vite
- web-nfc
- web-share-api