PayPilot AI — From Intention to Transaction
Inspiration
Freelancers and independent professionals often agree on work through informal conversations, but turning those agreements into accurate invoices requires repetitive administrative work.
We wanted to answer a simple question:
What if creating an invoice were as easy as describing what you wanted to do?
At the same time, financial operations require accountability. We didn't want an AI agent independently deciding who should receive an invoice or how much someone should pay.
PayPilot AI was built around a different principle: AI handles the preparation. Humans authorize the execution.
What It Does
PayPilot AI transforms natural-language instructions into structured, validated, editable PayPal invoice drafts.
For example:
Invoice Sarah €450 for website design, due November 20.
The application follows six stages:
Understand → Validate → Preview → Approve → Execute → Verify
- Understand: Google Gemini interprets the instruction and extracts invoice details.
- Validate: Zod validates the generated information. Missing details trigger clarification instead of invented data.
- Preview: The user reviews and edits invoice fields, with totals recalculated server-side.
- Approve: An explicit approval step is required before any PayPal operation.
- Execute: PayPilot creates an invoice draft through PayPal's Invoicing v2 sandbox API.
- Verify: The application retrieves the invoice from PayPal and verifies its genuine ID and
DRAFTstatus.
PayPilot deliberately does not automatically send invoices, capture payments, or transfer funds.
How We Built It
We developed PayPilot using:
- Next.js, React, and TypeScript for the application and server-side API routes.
- Tailwind CSS for the responsive interface.
- Google Gemini and the official Google Gen AI SDK for natural-language interpretation.
- Zod for strict validation of AI-generated and user-edited data.
- PayPal REST OAuth and Invoicing v2 APIs for sandbox invoice creation and verification.
- Vitest for automated testing of core application and integration behavior.
We designed the architecture to separate AI interpretation from financial execution, ensuring that generated content cannot bypass validation or human approval.
Challenges We Faced
One major challenge was configuring the PayPal sandbox integration.
Our initial invoice creation attempts were blocked because the sandbox application lacked the necessary Invoicing OAuth permission.
After enabling the permission and resolving a local TLS trust issue, we successfully authenticated and created a genuine PayPal sandbox invoice draft.
We then tested the complete workflow through the PayPilot application itself, successfully creating an invoice that appeared in the PayPal sandbox business dashboard.
This reinforced an important lesson: financial integrations require explicit verification, not assumptions about successful execution.
Accomplishments
We successfully implemented and tested PayPilot AI's complete AI-to-PayPal invoicing workflow.
During live testing, we:
- Entered a natural-language invoice request.
- Generated structured invoice data using Gemini.
- Reviewed and edited the invoice.
- Explicitly approved the invoice.
- Created a real PayPal sandbox invoice draft.
- Confirmed that the invoice appeared in the PayPal sandbox dashboard.
We also performed a controlled direct API integration test that returned HTTP 201 for invoice creation and HTTP 200 for verification, confirming a genuine DRAFT invoice.
No invoice was sent, and no payment was captured.
What We Learned
Building PayPilot demonstrated that AI is most valuable in financial workflows when it reduces repetitive work without removing human judgment.
We also learned the importance of structured AI outputs, strict server-side validation, permission management, idempotency, and independent verification of external API results.
What's Next
Future development could include:
- Secure user authentication.
- Persistent invoice histories.
- Production deployment.
- Expanded end-to-end testing.
- More complex invoice formats and recurring workflows.
- Additional PayPal capabilities with appropriate authorization.
Our long-term vision is to make PayPilot a reliable financial operations assistant for independent professionals.
PayPilot AI — From Intention to Transaction.
Built With
- google-gemini
- google-genai
- next.js
- node.js
- paypal
- react
- tailwindcss
- typescript
- vitest
- zod