Inspiration

Payment processing, billing, and transaction-related requests are often conducted by freelancers and businesses through spreadsheets and payment dashboards. While typical dashboards show numerical information, they do not provide any explanation of what that information means or how it can be used next.

The idea was to create something beyond the conventional payment dashboard, something which would not only understand financial information, answer questions, and make recommendations but also be accurate enough.

The core philosophy behind PayPilot AI is very simple: AI must explain the information presented in finances, not calculate anything. Finances require precision in calculations, thus, everything is done on the backend in integer minor units, not through the large language model itself.

What It Does

PayPilot AI is a dashboard built on AI for payment processing tasks, built on the PayPal Developer Platform.

It lets the user:

  • Create and capture payments: Create PayPal Sandbox transactions, approve payer by PayPal's hosted checkout, and capture the payments on the backend.
  • Query for transactions: Interact with an AI assistant to get a grasp of collections, pending payments, failed transactions, and the transactions overall.
  • Get insight: Analyze collection patterns, get payments that need a follow-up, and review transaction patterns.
  • Generate reports: Create reports in CSV, JSON, and in-printable financial forms.
  • Review demo mode: Test the software without the API credentials by using labeled simulation transactions.

The AI assistant will let users separate factual details from the suggestions, making it possible to separate the real transaction data from the recommended actions.

How I Built It

PayPilot AI was developed based on a React and FastAPI architecture.

Backend – FastAPI and Python 3.12

The backend architecture consists of layers, including routers, services, models, and schemas. For persistence, I used SQLAlchemy 2.0 and SQLite.

One of the main technical decisions that were made includes executing calculations in integer minor units (cents) to prevent floating-point errors.

For PayPal functionality, OAuth 2.0 client credentials authorization and Orders v2 API were used. The creation and capture of an order happen on the server side, and there is support for idempotency and validation of ownership, amount, and currency.

Frontend — React, TypeScript, and Vite

Frontend uses Tailwind CSS as the design system along with Recharts for charting finance-related data. The PayPal JS SDK provides the hosted checkout solution and makes sure that any sensitive card details do not enter our application server.

AI Integration

I have developed an abstraction layer that allows support for Groq, OpenAI, Anthropic and OpenAI compatible endpoints.

The AI helper uses a proven live configuration by Groq where the model used is openai/gpt-oss-120b.

Instead of sending raw transaction data and asking the model to calculate everything, the backend does all necessary aggregations. After this, the model gets limited context and is focused on the explanation and recommendation generation.

All responses of the model get validation via the very strict JSON schema. Transactions get filtered against known records and the response gets checked for a potential secret exposure.

In case there is no configured key for the AI API, a deterministic demo engine generates responses.

Challenges I Faced

  1. Preventing hallucinations of the AI in financial reactions

Inaccurate financial calculations might lead to the disruption of the main goal of the payment application. In my solution, I moved all mathematical operations to the backend, used integer calculations, and provided pre-calculated aggregates to the AI. Response validation is performed to guarantee that the output of the model matches the expected structure.

  1. Reliable PayPal payment procedures

Payment creation and capture demand thoughtful handling of retries and duplicate operations. To avoid those problems, I created PayPal request IDs to provide idempotency, saved operation IDs, and correctly handled payments which were captured before.

  1. Trust between demo and payment data

Despite the application being fully explorable without any API credentials, the simulated data should not be confused with the actual payments. All demo entries contain clear demo information, and the demo mode is visually indicated in the UI.

  1. Docker persistence and volumes setup

In the course of development, I found an issue in the Docker volume configuration: the whole application directory mount of the named volume made the application code invisible. I fixed it by mounting the volume only to /app/data, thus separating SQLite persistence from application files. Docker runtime checking is out of the scope of the final audit environment.

What I Learned

Building PayPilot AI helped me understand several important engineering concepts:

  • Integrating PayPal Orders v2 with server-side payment authority and secure checkout flows.
  • Designing AI integrations that rely on verified application data rather than trusting model-generated calculations.
  • Using integer minor-unit arithmetic for accurate financial computations.
  • Building a modular AI provider architecture that can support multiple model providers.
  • Implementing idempotency and validation for reliable payment operations.
  • Designing transparent demo experiences that clearly distinguish simulated data from real transactions.

I also learned that integrating an LLM into an application is not just about making API calls. The surrounding architecture, data boundaries, validation, and failure handling are equally important.

What's Next

PayPilot AI presently focuses on only one payment operation process per user. Future improvements may involve:

  • OAuth2/OIDC authentication, which will have multi-user capability.
  • PayPal webhooks that offer an asynchronous payment status update.
  • Transitioning to PostgreSQL with improved data isolation.
  • Multi-currency reporting with foreign exchange.
  • Team workspaces and multi-tenancy capabilities.

Development Transparency

AI-PayPilot was built using AI-powered coding using OpenCode. I oversaw the design and development of the software architecture, the code review process, and integration testing.

On November 4, 2026, I verified the end-to-end PayPal Sandbox flow from creation through to approval and capture and the Groq AI assistant against their corresponding services.

There are 237 unit tests for the backend test suite, and external services are mocked for unit testing purposes.

The core concept of AI-PayPilot is to combine the robustness of back-end engineering with AI reasoning, without letting the AI become the main source of information about the financial data.

Built With

  • api
  • artificial-intelligence
  • data-visualization
  • docker
  • fastapi
  • financial-analytics
  • financial-technology
  • fintech
  • generative-ai
  • gpt-oss
  • groq
  • large-language-models
  • oauth-2.0
  • payment-processing
  • paypal
  • paypal-developer-platform
  • paypal-sandbox
  • python
  • react
  • rest-api
  • sqlalchemy
  • sqlite
  • tailwind-css
  • typescript
  • vite
Share this project:

Updates

Submission history