Inspiration
Late invoices are choking Australian small businesses — chasing them is the most hated, lowest-leverage work in any company. There's literally a person whose full-time job is begging clients to pay. That's a textbook role for an autonomous agent: painful, repetitive, and perfectly suited to AI. So we asked — what if that person never had to exist?
What it does
Aria runs the full accounts-receivable loop autonomously. It sees overdue invoices, decides a tailored action per debtor — tone, channel, terms — using gpt-4o structured output, drafts and negotiates the message in a chat inbox, then collects via Pinch: a reusable percentage "Pay-in-3" Plan + Subscription + live Payment Link. A signed webhook reconciles the invoice the moment it's paid.
How we built it
Next.js 16 (App Router) + TypeScript + Tailwind + shadcn/ui + Framer Motion. The brain is OpenAI gpt-4o with zod-guarded structured outputs and a deterministic fallback. A typed Pinch REST client handles OAuth token caching and every Pinch primitive (Payer, Plan, Subscription, Payment Link, realtime). Supabase Postgres holds state; a signed HMAC webhook reconciles. Deployed on Vercel.
Challenges we ran into
OpenAI strict structured outputs reject .optional() zod fields — we switched to .nullable(). Next.js 16 makes every request API async. Our Vercel deploy 404'd until we set framework=nextjs explicitly. Pinch uses Application IDs, not merchant IDs, so we remapped our client. We also hardened Supabase (RLS + security_invoker view) after the advisor flagged it. Each was a real debugging dive.
Accomplishments that we're proud of
It's genuinely live, end-to-end, on real rails — not a mockup. A real gpt-4o decision produces a real Pinch Plan, Subscription, and Payment Link; paying a test card fires a real signed webhook that flips the invoice to Paid. The wow moments land: the agent visibly thinks, invoices flip in 3D with confetti, and the recovered-cash counter counts up. It feels like magic that's actually wired.
What we learned
Payment integrations live or die on small details — exact field names, strict schema rules, signature formats, framework detection. Structured outputs are powerful but opinionated. The gap between a demo and a product is the last 10%: idempotent reconciliation, graceful fallbacks, and a UI that makes the intelligence visible. Resilience — a fallback agent and simulate path — saved the demo.
What's next for Aria
Wire real Xero/MYOB ingest (the typed adapter is already designed), add live email/SMS/WhatsApp channels, and bring card capture in-page via Pinch CaptureJs for a fully embedded pay experience. Then expand from AR into the broader autonomous finance department — payables, forecasting, financing against recovered-cash data. The wedge is receivables; the prize is the whole back office.
Built With
- app-router
- canvas-confetti
- framer-motion
- gpt-4o
- hmac
- next.js
- node.js
- oauth2
- openai
- pinch-payments
- postgresql
- react
- react-server-components
- rest
- shadcn/ui
- structured-outputs
- supabase
- tailwind-css
- turbopack
- typescript
- vercel
- webhooks
- zod
Log in or sign up for Devpost to join the conversation.