Inspiration Late B2B payments lock up working capital for thousands of businesses, and chasing debts manually over email or WhatsApp is slow, confrontational, and error-prone. We wanted to see what happens when you put an empathetic AI agent behind the PayPal Invoicing platform: an autonomous agent that can negotiate payment plans with clients while maintaining strict Human-In-The-Loop control for finance managers.

What it does FacturaBot combines financial ledger management, conversational AI with banking guardrails, and human supervisor authorization into a unified split-screen experience:

  • Active Monitoring & PayPal Reminders: Finance teams monitor outstanding vs. recovered balances in real time and trigger official PayPal Invoicing v2 reminders directly from an interactive AG Grid table.
  • Autonomous Credit Negotiation: Clients communicate their constraints in natural language. Google Gemini 3.5 Flash enforces credit policies and guardrails, calculates viable installment plans (such as 4 payments of $5,500 USD), and structures a formal proposal.
  • Human-In-The-Loop Governance: The AI proposes, but humans authorize. With one click on APPROVE IN PAYPAL, our backend configures the live PayPal Sandbox invoice to enable official partial payments.
  • Real-Time Reconciliation: The client receives their official PayPal checkout button. Upon payment, live PayPal Webhooks reconcile the ledger automatically.

How we built it

  • PayPal Developer Platform: Complete OAuth 2.0 and PayPal Invoicing v2 API integration handling invoice drafts, dispatching, reminders, partial payments, and webhook reconciliation.
  • AI Engine: Google Gemini 3.5 Flash with structured JSON outputs, banking guardrails, conversation history, and bilingual English and Spanish fallback.
  • Frontend & Table: NiceGUI with AG Grid dark theme featuring column filters, sort, and live language switching (EN / ES).
  • Backend & Cloud: FastAPI and SQLAlchemy deployed live on Render, with API verification using Postman.

Challenges we ran into Preventing prompt injections and off-topic hallucinations was our primary challenge. We engineered strict financial guardrails so the agent refuses non-collection questions (like physics or trivia) and audits the live PayPal ledger status before acknowledging payment claims.

Accomplishments that we are proud of Building an end-to-end autonomous flow where natural-language client negotiation directly alters the credit configuration of an official PayPal Sandbox invoice, fully governed by human supervisor approval.

What is next for FacturaBot Direct WhatsApp Cloud API webhooks integration, multi-currency support, and predictive AI credit risk scoring for enterprise vendors.

Built With

Share this project:

Updates

Submission history