Inspiration
Ask any freelancer, solo consultant, or boutique agency owner what part of running their business they dread most, and the answer is almost always identical: chasing overdue payments.
Sending payment reminders is emotionally exhausting. Reach out too early or sound too stern, and you risk offending a good client and burning a relationship that took months to build. Wait too long out of politeness, and your personal cash flow evaporates while you absorb unnecessary stress. Most independent workers end up procrastinating, staring anxiously at unpaid bills, or agonizing over stiff, apologetic emails late at night.
We built PayNudge to solve this painful bottleneck. Our vision was simple: remove the emotional friction of chasing unpaid client invoices with an intelligent, tone-calibrated system that secures prompt payment without ever burning bridges.
What it does
PayNudge is a streamlined payment recovery assistant built on real payment rails:
- Conversational Invoice Creation: Instead of filling out tedious forms, sellers describe work in plain English (e.g. "Logo design for Sara, \$300, due Friday. [email protected]"). PayNudge parses the line items, price, and deadline instantly.
- Tone-Calibrated AI Reminders: When an invoice slips past its due date, PayNudge automatically drafts a respectful follow-up. The tone naturally and professionally escalates based strictly on how many days overdue it is—ranging from a gentle heads-up to a polite check-in to a firm, respectful nudge.
- Strict Human-in-the-Loop Safeguards: AI drafts the copy, but the human seller retains final review and approval. The AI is strictly barred from sending messages, altering dollar figures, or inventing fees without human authorization.
- Live PayPal Invoicing & Checkout: Generates official PayPal invoices with authentic pay links, verifies PayPal payments in real time, and auto-stamps invoices as PAID on the seller's ledger.
- Time-Travel Demo Clock: A built-in 12 days time-shift button allows judges and reviewers to fast-forward time instantly, watching invoices slip into overdue states and observing the AI adapt its tone on the fly.
- Weekly Financial Memo: Delivers a clear 3-sentence Monday morning brief summarizing total receivables, pending collections, and overdue risks.
How we built it
PayNudge is built on a modern, full-stack TanStack Start (React 19) foundation backed by PostgreSQL, Edge-ready server functions, and real-time payment webhooks:
Separation of Math and Copywriting: We enforced an absolute architectural barrier between deterministic business logic and generative language:
- All dollar amounts, balances, and due-date calculations are computed exclusively in pure TypeScript functions with 100% unit test coverage.
- Days overdue is strictly evaluated using deterministic calendar math:
Days Late = Today - Due Date. - Pre-tested code assigns the exact tone bracket based on days late:
- Friendly heads-up (0 or fewer days late, invoice due soon)
- Friendly nudge (1 to 3 days late)
- Polite but clear (4 to 10 days late)
- Firm but respectful (10+ days late, strictly no legal threats or invented late fees)
- The Lovable AI Gateway takes this fixed tone parameter and drafts high-empathy, context-specific outreach copy.
Real Payment Rails (PayPal v2 API & Webhooks):
- Connects to PayPal's Invoicing v2 API to create genuine invoices, calculate tax/totals, and fetch live buyer payment URLs.
- Built an Edge-compatible webhook endpoint (
/api/public/paypal/webhook) that cryptographically verifies PayPal webhook signatures and independently re-fetches invoice status from PayPal's servers to prevent payload tampering. - Implemented an automatic 10-second polling fallback to keep status stamps in sync even if webhooks encounter transit delays.
Distinctive Visual Design: We deliberately rejected generic SaaS dashboards and purple gradients in favor of our bespoke Night Ledger aesthetic: midnight navy canvas, tactile warm-ivory paper receipts, electric-mint financial counters, and dynamic rubber-stamp status seals (Paid, Waiting, Late).
Challenges we ran into
- Deterministic Time-Travel in a Reactive App: Building the 12 days demo clock required offsetting all date-difference algorithms across both client state and server functions without corrupting actual timestamp records stored in the database.
- Secure Webhook Verification in Serverless Environments:
Verifying PayPal's cryptographic signature headers (
PAYPAL-AUTH-ALGO,PAYPAL-TRANSMISSION-SIG, etc.) in an edge/serverless runtime required meticulous handling of raw payload streams and public certificate caching. - Preventing AI Financial Hallucinations:
Early experiments showed that LLMs occasionally guessed missing client emails or miscalculated subtotal sums. We solved this by enforcing strict JSON Schema validation: if an email or amount is not explicitly stated in user input, the parser returns
nulland our deterministic validation pipeline marks the field as missing.
Accomplishments that we're proud of
- 100% Deterministic Financial Integrity: 26 automated unit and routing tests verify that not a single dollar amount, tax rate, or reminder tone is ever guessed or hallucinated by an LLM.
- Genuine API Proof: We didn't build a static UI mockup. PayNudge issues legitimate PayPal sandbox invoices, opens live buyer checkout portals, and handles real payment webhooks.
- Zero-Friction Testing Experience: Creating the time-travel demo clock ensures that hackathon judges can evaluate an end-to-end 3-week payment collection lifecycle in under 30 seconds.
- Aesthetic Distinction: The custom night ledger theme brings warmth, craft, and tactility back into financial software.
What we learned
- Confine LLMs to What They Do Best: Generative models excel at tone, empathy, and natural language translation, but should never be trusted with arithmetic, tax calculation, or calendar operations. Strict schema boundaries make AI software reliable enough for money.
- Treat Webhooks as Notifications, Not State: Incoming webhook payloads should never be blindly saved as the ground truth. The safest architecture is to use the webhook as an alert to trigger a verified, authenticated read directly from the source API.
- Empathy in Financial UX: Freelancers procrastinate on invoicing because traditional accounting software feels cold and punitive. A tool that approaches overdue payments with tact and calm reduces user anxiety and accelerates cash flow.
What's next for PayNudge
- Multi-Rail Payments: Expanding beyond PayPal to support Stripe Invoicing, ACH/SEPA direct bank transfers, and Wise for borderless freelance transactions.
- One-Click Email & SMS Dispatch: Allowing sellers to send approved nudges directly through integrated Gmail, Outlook, or SMS connectors without leaving the dashboard.
- Smart Timing Optimization: Machine-learning recommendations that identify the ideal day and time of the week to send reminders based on client payment history.
- Client Payment Plans: Automatically offering structured milestone split-payments when an invoice crosses the 14-day overdue threshold to rescue troubled accounts without confrontation.
Built With
- ai
- financial-tech
- json-schema
- lovable
- lucide-icons
- openai
- paypal
- postgresql
- radix-ui
- react
- rest-api
- supabase
- tailwind-css
- tanstack-start
- typescript
- vite
- vitest
- webhooks