Inspiration

Small online stores often lose sales because mobile checkouts are cluttered with endless forms, menus, and account creation steps. Shoppers get stuck, and small merchants cannot afford a 24/7 support team. We wanted to bridge this gap: a conversational assistant that doesn't just answer questions, but actually drives sales, closes deals, and handles payments securely in a single chat bubble.

What it does

PayAgent is an open-source, AI-driven sales assistant that any online store can plug in with a single line of code.

  • Chat to Checkout: The customer tells the agent what they need. The AI searches the product catalog, confirms the item and quantity, and builds a secure PayPal checkout directly in the chat.
  • Security & Control: Prices never come from the AI; the server forces strict product catalog rates. Large purchases above a merchant's set limit and refund requests are held in a private Owner Dashboard for human approval.
  • Smart Refunds: Customers can request refunds and upload private damage evidence (images/videos) in the chat. Small refunds are automated, while larger ones require manual merchant validation before triggering the PayPal Refund API.

How we built it

The project was entirely built and deployed from a smartphone, showcasing high-velocity development:

  • Frontend: Built with Next.js and Tailwind CSS, deployed seamlessly on Vercel. It includes a drop-in widget.js script to integrate into any website.
  • Backend: Powered by FastAPI (Python) running on an independent server with an SQLite database to store persistent chat history, sessions, and order tracking.
  • AI & Payments: Integrated Meta's Muse Spark model (muse-spark-1.3) for advanced natural language understanding and reliable tool calling. Payments and webhooks are handled through the PayPal REST API (Orders v2 and Payments v2).

Challenges we ran into

The biggest challenge was implementing secure financial actions without giving the AI model too much autonomy. Allowing an LLM to move money or decide prices is a massive risk. We solved this by implementing strict server-side validation: the model only outputs the product ID and quantity, while the backend recalculates and enforces the exact prices from a locked products.json file. Furthermore, we built a robust idempotency system using deterministic PayPal-Request-Id headers to prevent duplicate charges or double-refunds from network retries.

Accomplishments that we're proud of

We are incredibly proud of building a production-grade software architecture featuring secure webhook signatures, AES-256-GCM credential encryption, visual evidence storage, and automated state-machines—all developed, tested, and deployed entirely from a smartphone. We proved that high-velocity, solo development is completely viable using the right modular tools.

What we learned

We learned how to design a bulletproof human-in-the-loop system for AI agents. By combining automated AI interactions with hard-coded financial thresholds and cryptographic encryption for merchant credentials, we proved that AI can safely manage commercial checkouts without compromising financial integrity.

What's next for PayAgent

We are transforming PayAgent into a multi-tenant SaaS platform. Merchants will be able to sign up, register their stores, upload products, and configure custom system prompts for their AI assistants.

The platform will generate a drop-in CDN script containing a unique store token and ID. Once injected into the merchant's site, the widget will automatically propagate. To ensure sustainability, we will introduce a subscription model tied to AI quota usage, replacing lifetime access.

On the security side, we will enforce strict zero-trust principles: the frontend will never read sensitive merchant data (like encrypted PayPal keys) or bypass human validation limits. Refund disputes will trigger an active server-side function to display a secure file-upload button, requiring customers to upload a 60-90 second video or photographic evidence for the owner to review before any money is moved.

Built With

Share this project:

Updates

Submission history