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 AI Checkout Agent

💡 Inspiration

Checkout is still a chore: open ten tabs, compare prices, re-type your details, confirm, wait. Meanwhile, AI agents can understand what you want in plain language, and PayPal can move money instantly.

We wanted the shortest path between "I want to buy a bluetooth headset for $49.99" and a paid order — a conversation, not a checkout form. PayPal's own push for agentic commerce made this the obvious build for the hackathon.

⚙️ What it does

PayPal AI Checkout Agent is a chat UI that turns natural language into real PayPal orders.

The user experience is dead simple:

  1. You type what you want to buy and at what price
  2. The agent understands your intent
  3. It creates a real PayPal order in the Sandbox
  4. It returns a clickable payment link
  5. You click → PayPal's official checkout page opens
  6. You approve → the order is complete

What makes it different:

  • 🗣️ Natural language checkout — no forms, no fields, no friction
  • 🌍 Fully multilingual — English, French, and Spanish (both UI and AI responses)
  • 🎨 Premium interface — glassmorphism, animated PayPal watermark background, polished chat UX
  • 🤖 Multi-provider LLM — Groq (primary, free, fast) + Gemini (fallback)
  • 🧪 Mock mode — judges can test the full UX without any credentials
  • 💳 Real PayPal Sandbox integration — creates actual orders, not mockups

🏗️ How we built it

Architecture (3 layers):

  1. Web layer (Flask) — serves the chat UI and the /api/chat endpoint
  2. Agent layer (Groq + Gemini) — detects purchase intent and creates PayPal orders
  3. PayPal integration (Orders v2 API) — handles OAuth2, order creation, and approval URLs

Key technical decisions:

  • Deterministic intent detection: Instead of relying on the LLM to decide whether to call a tool, we detect the amount with a regex and create the order directly. This guarantees a PayPal order is always created when a price is present, regardless of the LLM's behavior.

  • Multi-provider LLM: Groq (LLaMA 3.3 70B) is the primary provider — free, no credit card required, 30 requests/minute. Google Gemini is the fallback. This ensures the app never goes down due to quota limits.

  • Mock mode: If no credentials are found, the app automatically switches to a simulated mode. Judges can clone the repo, run python run.py, and see the full UX without configuring anything.

  • Vanilla JS frontend: No build step, no framework overhead. Judges can read the code directly.

The stack:

  • LLM: Groq (LLaMA 3.3 70B) + Google Gemini 3.8 Flash (fallback)
  • Payments: PayPal Orders v2 API (REST)
  • Backend: Python 3.11+, Flask 3.0, Gunicorn
  • Frontend: Vanilla HTML / CSS / JavaScript
  • i18n: Custom translation system (EN/FR/ES)
  • Deployment: Render (free tier)

🧗 Challenges we ran into

  • Model churn: The Gemini model we started with was retired mid-build. We switched to Groq to avoid quota limits and keep the project free to run.

  • LLM tool-calling reliability: Some models refuse to call tools unless prompted aggressively. We solved this by making intent detection deterministic (regex) and using the LLM only for the natural-language reply.

  • Sandbox ≠ real PayPal: Approving a test order requires separate sandbox test accounts. Your real PayPal login doesn't work there. This cost us some confused minutes.

  • Free tier cold starts: Render's free tier spins down after inactivity. The first request can take 30-50 seconds. We documented this in the README and live demo badge.

🏆 Accomplishments that we're proud of

  • Real end-to-end purchase in the PayPal Sandbox: agent → order → human approval → PayPal checkout page — verified, not mocked
  • Multilingual UI + AI responses: English, French, and Spanish — the agent always replies in the user's language
  • Zero-credential demo mode: judges can test the full experience without any API keys
  • Premium UI: glassmorphism, animated PayPal watermark background, smooth chat animations
  • Live deployment: the app runs 24/7 on Render

📚 What we learned

  • The hard part of AI + payments is the boundary: The model can be creative about what should happen, but must be completely predictable about how it happens. We put the flexibility in the parser and kept the executor deterministic.

  • Approved ≠ paid: In PayPal's flow, the capture call is where money actually moves. The human approval step is the right trust boundary for agents that spend money.

  • Provider flexibility matters: Having Groq as primary and Gemini as fallback saved us when we hit quota limits.

🚀 What's next

  • Live product catalog: Replace the free-text description with a real product search (e.g., Channel3 API)
  • Webhook-driven capture: Instead of relying on the browser redirect, use PayPal webhooks to capture orders
  • Refunds and disputes: Add agent tools for capture_order, refund, and dispute management
  • PayPal Agent Toolkit: Explore deeper integration with PayPal's official agent toolkit
  • More languages: Add support for more languages (German, Portuguese, etc.)

🔗 Links

Built With

Share this project:

Updates

Submission history