đź’ˇ Inspiration
Freelancers, agencies, and merchants waste hours manually converting unstructured client briefs and emails into formal invoices. At the same time, automated payment portals face a growing risk of high-velocity checkout fraud, synthetic accounts, and anomalous settlements. We built PayGenius AI to bridge conversational commerce with enterprise-grade fraud defense—turning plain-English project descriptions into instant, verifiable PayPal checkouts.
🚀 What it does
PayGenius AI is an autonomous billing and risk telemetry platform powered by FastAPI and the PayPal Developer ecosystem:
- AI Prompt-to-Invoice Ingestion: Converts natural language briefs (e.g., "Bill CloudOps $650.00 for Kubernetes deployment") into structured, itemized billing records with collision-resistant invoice IDs.
- Native PayPal Smart Buttons Checkout: Integrates the official PayPal JavaScript SDK and v2 Orders API (
/v2/checkout/orders) inside a dynamic checkout modal for seamless sandbox payment authorization and capture. - PayGuard AI Risk Engine: Before funds settle, our heuristic scoring engine evaluates transaction amounts, velocity patterns, and payer email metadata—assigning an explainable risk score ($0\% - 100\%$) and classification (
LOW RISK,REVIEW, orFLAGGED) directly to the audit ledger. - Executive Operations Dashboard: Tracks real-time settled volume, active invoices, AI parsing latency, and fraud shield efficiency in a responsive fintech interface.
🛠️ How we built it
- Backend & API: Built with Python 3.13, FastAPI, and Uvicorn to handle asynchronous invoice parsing, PayPal OAuth 2.0 token flows, and order capture endpoints.
- Payments Integration: Connected directly to the PayPal REST API v2 and embedded the PayPal Smart Buttons SDK on the frontend.
- Database Layer: Engineered with SQLAlchemy 2.0 in dual-mode—supporting local SQLite for rapid testing and cloud PostgreSQL (Supabase) for scalable persistence.
- Frontend & Hosting: Designed a responsive dark-mode fintech UI using Jinja2, HTML5, CSS Grid/Flexbox, and deployed globally via Netlify serverless functions (
MangumASGI adapter) and Render.
đź§ Challenges we ran into
- Cloud Database Pooler Routing & Driver Compatibility: Migrating between Python 3.13 local SQLite and cloud PostgreSQL poolers (
psycopgv3 vspsycopg2) required configuring dual-mode connection pooling and fallback logic so the app stays resilient across environments. - Starlette / Jinja2 Template Rendering: Updating positional
TemplateResponsearguments to match newer FastAPI/Starlette signatures to eliminate dictionary hashing errors during server-side rendering. - Serverless ASGI Deployment: Adapting a stateful FastAPI application with database seeding to run smoothly on Netlify's serverless architecture.
🏆 Accomplishments that we're proud of
- Delivering a complete, end-to-end working prototype—from plain-English prompt ingestion to live PayPal Sandbox capture and risk logging—in under 200ms execution latency.
- Building an explainable fraud telemetry layer (PayGuard) that gives merchants transparent risk scores rather than opaque black-box rejections.
📚 What we learned
- Implementing the full PayPal v2 Orders lifecycle with dynamic Smart Buttons rendering.
- Structuring Python web applications for seamless multi-cloud deployment across both traditional containers (Render) and serverless edge functions (Netlify).
What's next for PayGenius AI
- Multi-Currency & Recurring Subscriptions: Expanding natural language parsing to support automated PayPal Subscriptions and international tax rules.
- Deep LLM Anomaly Reasoning: Upgrading PayGuard with real-time natural language explanations for why a specific transaction was flagged for review.
- Webhook Automation:Adding automated email and Slack alerts when high-value invoices are settled.
Built With
- css
- css-grid-/-flexbox
- fastapi
- html
- javascript
- jinja
- jinja2-**payments-integration**:-paypal-rest-api-v2
- mangum
- natural-language-brief-parsing-&-entity-extraction-**deployment-&-cloud-infrastructure**:-render-web-service-(`render.yaml`)
- netlify
- netlify-serverless-functions-(`netlify.toml`-+-mangum-asgi)-**frontend-architecture**:-semantic-html5
- paypal
- paypal-smart-buttons-javascript-sdk-(sandbox-environment)-**database-&-orm**:-sqlalchemy-2.0-(dual-mode:-sqlite-for-local-execution
- postgresql
- pydantic
- python-3.13
- restapi
- sqlalchemy
- supabase
- supabase-/-postgresql-for-cloud-scaling)-**ai-&-security-layer**:-payguard-anomaly-heuristics
- uvicorn