Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

What we learned

What's next for Paypal

Inspiration

Freelancers and small business owners often struggle with unpaid and overdue invoices. Chasing payments manually is awkward and time-consuming. While PayPal provides reliable invoicing infrastructure[cite: 5], small businesses lack an intelligent assistant that proactively tracks aging invoices, drafts polite follow-ups, and closes the payment loop safely. We built PayPal RecoverIQ to automate recovery while keeping the merchant fully in control[cite: 5].

What it does

PayPal RecoverIQ is an AI-assisted revenue recovery and invoicing manager[cite: 5]:

  • Natural Language Invoicing: Merchants can type simple prompts (e.g., "Invoice Alex for 2 logo designs at $75 each, due in 7 days") and OpenAI extracts clean, structured invoice line items[cite: 5].
  • Human-in-the-Loop Safeguards: Write actions (creating drafts, sending invoices, reminders) require explicit merchant approval before executing via PayPal APIs[cite: 3, 5].
  • Smart Overdue Detection: Automated background scans (via Celery Beat) detect overdue invoices and generate polite payment reminder recommendations[cite: 3, 5].
  • Automated Follow-ups: Sends invoice reminders directly through PayPal Invoicing REST API v2, respecting rate limits of max 2 reminders per day[cite: 3, 5].
  • Authoritative Webhook Verification: Real-time webhook processing with cryptographic signature verification that fetches the authoritative state from PayPal[cite: 3, 5].

How we built it

  • Frontend: Next.js 14, React 19, TypeScript, and Tailwind CSS[cite: 2, 5].
  • Backend: FastAPI (Python 3.12) and SQLAlchemy async[cite: 3, 5].
  • Database & Workers: PostgreSQL for data and audit logs, and Redis + Celery (Worker & Beat) for background task queues and scheduled scans[cite: 3, 5].
  • Payment Integration: PayPal Invoicing REST API v2 and Webhook event subscriptions (INVOICING.INVOICE.*)[cite: 3, 5].
  • AI Engine: OpenAI API (GPT-4o-mini) with structured output extraction[cite: 3, 5].

Challenges we ran into

  • Strict Webhook Reliability: Deduplicating webhook event IDs and ensuring payloads cannot be spoofed by verifying PayPal's cryptographic signatures[cite: 3, 5].
  • Safe AI Integration: Preventing the AI from altering authoritative totals or taking actions without deterministic backend validation and explicit human approval[cite: 3].
  • Background Task Scheduling: Setting up Celery Beat for asynchronous scheduled overdue-invoice scans without relying on in-process timers[cite: 3].

Accomplishments that we're proud of

  • Creating an end-to-end working system with strict human-in-the-loop approval workflows and complete audit trails for every action[cite: 3, 5].
  • Implementing a secure webhook processor that uses events as triggers, but always fetches the current PayPal invoice resource before changing local payment state[cite: 3].
  • Handling all monetary math precisely using Decimal formats[cite: 5].

What we learned

  • Deep insights into PayPal's Invoicing v2 workflow, authentication flow, and webhook event lifecycle[cite: 3].
  • Best practices for designing zero-trust agentic workflows for mission-critical financial data.

What's next for PayPal RecoverIQ

  • Preparing the sandbox-to-live gate for production use with verified live PayPal Business credentials[cite: 3, 5].
  • Advanced reporting dashboards for outstanding amounts and recovery analytics.

Built With

Share this project:

Updates

Submission history