InvoicePilot

Turn freelancer work notes into human-reviewed PayPal sandbox invoices, with AI clarification and payment status from PayPal.

The problem

Finishing client work still leaves invoice administration: translating informal notes into descriptions, quantities, rates, payment terms, and a payment request. Missing details can cause incorrect invoices or extra back-and-forth.

What it does

InvoicePilot turns work notes into an editable invoice draft. Missing quantities and prices stay unanswered, and the AI asks clarification questions. The freelancer reviews the client, line items, amounts, and terms before creating an invoice in PayPal Sandbox. Editing the invoice clears the review checkbox.

Once created, the freelancer can activate a PayPal-hosted payment link without sending invoice emails and refresh the actual invoice status. PayPal remains the source of truth. The app also supports browser-local draft saving and JSON export.

PayPal and AI integration

Gemini 3.5 Flash-Lite uses the generateContent API with a JSON schema to extract client details, line items, terms, and questions. The server validates the response and calculates the invoice total in code. Gemini cannot create an invoice or initiate a payment.

PayPal Invoicing v2 is central to the workflow: the server obtains an OAuth token, creates sandbox invoice drafts, activates payment links with email notifications disabled, lists recent invoices, and reads their status. The API base URL is fixed to the free sandbox environment.

The demonstrated example uses six hours of landing-page design at $75 per hour plus a $150 icon set, totaling $600 USD. A separate missing-detail example returns null quantities/prices and clarification questions.

How it was built

This is a new solo project built during the hackathon. The application uses React, TypeScript, Vinext/Vite, Cloudflare Workers, Zod, and Lucide. Provider credentials stay in server runtime secrets. Authenticated server routes validate requests; writes check the request origin. There is no application database: PayPal stores invoices, and optional work-in-progress drafts stay in the current browser.

Codex assisted with implementation, provider integration, validation, arithmetic, tests, debugging, and documentation. The demo narration was generated in ElevenLabs. The actual application footage and narration were edited and exported on the participant's computer in Wondershare Filmora.

Challenges and verification

Provider/model compatibility and latency required iteration. The integration was validated with the model actually available to the project rather than relying on a sample fixture. Keeping unknown amounts incomplete and resetting review after edits were important product decisions.

Eight automated tests, TypeScript checking, and a production build passed. Live tests verified Gemini extraction and clarification, the hosted review reset, PayPal sandbox creation and readback, payment-link activation, and UNPAID status refresh. The PayPal-hosted invoice page was separately opened successfully.

No buyer payment has been completed, and PAID readback is not claimed. The demonstration uses test money only and shortens AI/network waiting time with cuts.

Run and evaluate

Public source and instructions: https://github.com/Youssef123ya/invoicepilot-paypal-ai

The complete application source, assets, dependency lockfile, and tests are in InvoicePilot-source.zip, with an MIT license visible at the repository root. Download and extract the archive, install Node.js 24+, run npm ci, configure your own PayPal sandbox seller and Gemini credentials using scripts/setup-connections.ps1, then run npm run dev. The README explains development sign-in and the exact demo steps. The hosted development application is owner-private; use the documented local setup for evaluation.

Public demo video: https://youtube.com/shorts/KYOtxpa2Lqk

What comes next

Verify a full sandbox buyer payment and PAID readback, complete broader mobile and retry acceptance testing, and explore per-user account connections. This prototype supports USD, EUR, and GBP with two decimal places. Taxes, discounts, attachments, reminders, partial payments, webhooks, and production payments are outside its current scope.

Built With

Share this project:

Updates

Submission history