Inspiration

Small businesses make financial decisions every day, from collecting customer payments to managing expenses and preparing for upcoming bills. However, understanding how these activities affect future cash availability isn't always straightforward.

A business might expect a healthy balance at the end of the week but still struggle to pay a supplier tomorrow.

That challenge inspired a question:

What if small businesses could not only track and verify their payments but also understand their financial position, simulate future scenarios, and identify potential cash shortages before they happen?

That's how Clearflow — AI-Powered PayPal Payment Intelligence & Cash-Flow Planning was created.

Clearflow brings together verified PayPal Sandbox payments, financial analytics, a local AI assistant, and interactive cash-flow planning in one application.

What It Does

Clearflow is an AI-assisted financial decision-support application designed to help small businesses understand financial activity and plan ahead.

It includes five interconnected dashboard sections.

1. Business Home

A financial overview displaying income, expenses, net cash flow, transaction activity, and financial observations through interactive visualizations.

2. Money Activity

Users can record, manage, and review synthetic INR transactions stored in a local SQLite database.

3. Payment Centre — PayPal Integration

Clearflow integrates with PayPal Sandbox REST APIs to demonstrate a working payment workflow.

Users can:

  • Create PayPal Sandbox checkout orders.
  • Approve and capture test payments.
  • Retrieve order and capture information.
  • Verify payment statuses and amounts.
  • Synchronize known, verified payment records into SQLite.

The integration was successfully tested using a completed $1 USD Sandbox transaction.

4. AI Financial Advisor

Clearflow integrates Ollama with the Qwen2.5 3B language model, running locally.

Users can ask questions about financial activity and receive natural-language explanations.

Python-calculated financial metrics are supplied to the model as context, allowing the AI to assist with interpretation while the application retains responsibility for financial calculations.

5. Interactive Cash-Flow Planner

The Cash-Flow Planner allows users to explore hypothetical financial scenarios.

Features include:

  • Separate INR and USD planning environments.
  • 7-, 14-, and 30-day planning horizons.
  • Adjustable opening balances and minimum cash reserves.
  • Expected income and expense transactions.
  • Interactive daily cash-flow projections using Plotly.
  • Detection of minimum-reserve breaches.
  • Identification of potential cash shortfalls.
  • Deterministic financial risk assessments.
  • AI-assisted scenario explanations.
  • SQLite-based scenario saving and loading.

A Real Example of Clearflow's Value

Consider a business with an opening cash balance of $250.

After entering its expected income and expenses, Clearflow projects an ending balance of $3,750.

At first glance, the business appears financially healthy.

However, the daily cash-flow simulation reveals that the balance temporarily falls to −$250.

With a minimum cash reserve of $200, Clearflow identifies a $450 reserve shortfall.

This demonstrates an important financial principle:

A positive future balance doesn't necessarily mean a business has enough cash to meet its immediate obligations.

Clearflow helps users identify these potential problems and consider practical actions, such as collecting payments earlier or rescheduling expenses.

How I Built It

Clearflow was developed as a Python-based FinTech prototype using a modular application architecture.

Frontend and user experience

The interface was developed using Streamlit, with a custom dark-themed financial dashboard and interactive Plotly visualizations.

PayPal payment integration

PayPal Sandbox REST APIs were integrated to support OAuth authentication, order creation, order retrieval, approved-payment capture, and payment verification.

Database and persistence

SQLite stores synthetic financial transactions, synchronized PayPal Sandbox records, and saved cash-flow planning scenarios.

AI integration

Ollama runs the Qwen2.5 3B language model locally. Clearflow uses it to generate contextual financial explanations based on application-provided data.

Financial simulation

A dedicated Python calculation engine processes expected income and expenses, calculates projected balances, identifies reserve breaches, and generates risk assessments.

Decimal-based monetary calculations help maintain consistent financial arithmetic.

API verification

Postman was used to validate PayPal Sandbox authentication and payment retrieval.

Six automated payment-verification tests passed during local testing.

Challenges I Faced

Integrating PayPal's payment workflow

Implementing the PayPal Sandbox workflow required understanding OAuth authentication, order creation, buyer approval, payment capture, and retrieval of verified payment details.

Testing these steps independently helped confirm that the application was communicating with PayPal's APIs correctly.

Maintaining financial accuracy

Financial applications require reliable calculations.

Rather than allowing the language model to calculate critical financial figures, Clearflow uses deterministic Python logic for balances, forecasts, and reserve-risk detection.

The AI provides explanations, while the application calculates the underlying financial values.

Separating currencies and financial data

Clearflow works with synthetic INR transactions and PayPal Sandbox USD payments.

I designed separate financial calculations and scenario-planning environments to prevent currencies from being silently combined.

Building reusable scenario planning

Implementing scenario saving and loading required preserving opening balances, minimum reserves, planning periods, and expected transactions.

SQLite persistence and Streamlit session-state management were used to restore saved scenarios without losing their assumptions.

Developing a usable financial dashboard

Another challenge was presenting payment information, financial analytics, AI responses, and planning tools without overwhelming the user.

The final dashboard organizes these capabilities into five dedicated sections.

Accomplishments That I'm Proud Of

  • Built a working PayPal Sandbox payment integration rather than relying solely on simulated API responses.
  • Successfully created, captured, retrieved, and verified Sandbox payment information.
  • Passed 6 out of 6 automated PayPal payment-verification tests in Postman.
  • Integrated a locally running language model without requiring a paid cloud AI API.
  • Developed separate INR and USD financial scenario planners.
  • Implemented deterministic cash-flow risk detection and reserve-shortfall calculations.
  • Added SQLite scenario persistence and restoration.
  • Created interactive financial charts and a unified Streamlit dashboard.
  • Published the source code and recorded a working product demonstration.

Most importantly, Clearflow demonstrates how payment verification, AI-assisted interpretation, and scenario planning can work together to support better financial decisions.

What I Learned

Building Clearflow strengthened our understanding of:

  • PayPal REST APIs and OAuth authentication.
  • Payment authorization and capture workflows.
  • Financial data modeling and SQLite persistence.
  • Integrating local language models into practical applications.
  • Separating AI-generated explanations from deterministic financial calculations.
  • Building interactive Streamlit applications.
  • Cash-flow forecasting and scenario-based risk analysis.
  • Testing and documenting a complete application for external evaluation.

One of the biggest lessons was that useful financial AI is not just about generating answers — it's about grounding those answers in reliable data and transparent calculations.

What's Next for Clearflow

Clearflow is currently a working local hackathon prototype.

Future improvements could include:

  • Broader PayPal transaction-history integration and automated reconciliation.
  • AI-assisted identification of unusual payment patterns.
  • Improved forecasting using historical transaction data.
  • Multi-user accounts and secure cloud deployment.
  • Automated cash-flow alerts and payment reminders.
  • Additional currencies and explicit exchange-rate conversion.
  • More advanced scenario comparisons.
  • Exportable financial reports.
  • Human-approved AI agents for financial workflow automation.

The long-term vision is to make Clearflow a practical financial decision-support workspace that helps small businesses move from simply tracking payments to proactively managing cash flow.

Important Note

Clearflow is a hackathon demonstration using synthetic INR records, PayPal Sandbox transactions, and hypothetical planning scenarios.

No real-money payments are processed.

AI-generated explanations are informational and may contain inaccuracies. Forecasts are illustrative and do not constitute professional financial advice.

Project Links

GitHub Repository: https://github.com/JyothiSrinivasan/Clearflow

Working Demo Video: https://youtu.be/TnzLOMaOFPA

Built With

Share this project:

Updates

Submission history