Inspiration

Running a small online store means juggling a storefront, the PayPal dashboard, invoices, disputes and deliveries, usually with no help. We asked a simple question: what if an AI agent did the dashboard work, while a human stays in charge of the money? ShopMate is our answer: a full store where AI helps shoppers find products and helps merchants run the business, with PayPal at the center.

What it does

For shoppers

  • An AI shopping assistant searches the real catalog, shows product cards, adds items to the cart and answers order-status questions from live data.
  • Checkout runs through PayPal. The shopper always approves the payment in PayPal's own popup, so the agent never moves money on its own.
  • Live order tracking on a map, plus chat with the delivery driver.

For merchants

  • A Merchant AI Copilot built on the PayPal Agent Toolkit that reads PayPal data: recent transactions, disputes and invoices.
  • Write actions (like creating an invoice) are only proposed first. Nothing is sent to PayPal until the admin clicks Confirm.
  • Every order gets an AI risk check (approve, review or flag) with a plain-language reason shown in the admin dashboard.
  • Quick-action buttons fetch data directly from PayPal without calling a language model, so the dashboard stays useful even when the AI is rate-limited.

For drivers

  • Go online, receive deliveries, update status, confirm delivery with an OTP, and chat with the customer.

How we use PayPal

  • Orders v2: create and capture, with totals computed on the server, never trusted from the browser, and idempotency keys to prevent double charges.
  • Webhooks: signature-verified handling of capture completed, denied and refunded events.
  • PayPal Agent Toolkit: the copilot calls PayPal tools (transactions, disputes, invoices) through the toolkit in sandbox mode.
  • Shipment tracking: when a driver confirms delivery, tracking details are sent to the PayPal transaction.

How we use AI

  • Google Gemini with function calling. The model can only call tools we expose, and our server validates every argument and checks ownership.
  • Rules first, AI second for fraud screening: clear cases are decided by rules, and only borderline orders go to the model.
  • Human in the loop: the AI proposes, the human confirms, and our code decides prices and payment status.
  • Graceful degradation: every AI call has timeouts and fallbacks, so checkout, login and delivery never depend on the model being available.

How we built it

  • Frontend: Next.js 16, React 19, TypeScript, Tailwind CSS, deployed on Vercel
  • Backend: Express 5 and TypeScript on Render, with MongoDB, Redis (Upstash), RabbitMQ background workers, Socket.IO for real-time updates, and Cloudinary for images
  • AI and payments: Gemini API, PayPal REST APIs and the PayPal Agent Toolkit

Challenges we ran into

  • Production services failing in surprising ways. A read-only Redis user broke the cart, and an unreachable queue stalled order processing. We rebuilt optional services (cache, queue, AI) to fail soft so core flows always keep working.
  • PayPal sandbox quirks. Domestic-country account rules, currency support and missing app permissions each produced confusing errors until we understood them.
  • AI quotas and honesty. Free-tier limits taught us to make tool results truthful: a permission error must never be shown as "0 results", and the UI should say what really happened.
  • Making agents safe around money. We settled on strict boundaries: read-only tools run automatically, write tools require explicit confirmation, and the server owns all amounts.

What we learned

Agentic commerce works best when the AI is useful but never trusted with authority. Good tool design, truthful error handling and clear human approval steps mattered more than clever prompts.

What's next

  • PayPal Payouts so drivers are paid automatically after delivery
  • Subscriptions and multi-currency pricing
  • Smarter delivery assignment and ETA messages
  • More merchant automation, always with human approval for write actions

Built With

Share this project:

Updates

Submission history