Inspiration

Small businesses, street vendors, home bakers, and pop-up sellers often operate without dedicated point-of-sale (POS) systems. Managing product lists, calculating bills, and collecting digital payments can become time-consuming, especially when handling multiple products at once.

We wanted to simplify this experience. What if a seller could simply take a photograph of the products in front of them, let AI identify the items, and generate a payment-ready checkout in seconds?

That idea became Snap to Pay — an AI-powered visual commerce platform designed to make digital checkout accessible to small sellers without requiring expensive POS hardware.

What It Does

Snap to Pay transforms product photographs into payment-ready shopping carts.

The seller captures a photograph using their device camera or uploads an existing image. Our AI-powered recognition pipeline uses Google Gemini to identify visible products and match them against the seller's catalogue.

Recognized products and quantities are presented for seller review. If an item is not in the catalogue, the seller can manually enter its name and price and add it to the catalogue.

Once the seller confirms the cart, the backend retrieves trusted product prices from the database and calculates the total. Snap to Pay then creates a PayPal Sandbox payment order and generates a QR code containing the payment approval link.

The customer scans the QR code, completes the payment, and is redirected to a receipt showing the transaction status and PayPal capture reference.

How We Built It

We developed Snap to Pay using a modern full-stack architecture:

  • Frontend: Next.js, React, TypeScript, and Tailwind CSS.
  • Backend: Next.js API routes for product recognition, catalogue management, sales processing, and payment operations.
  • AI: Google Gemini for visual product identification and catalogue matching.
  • Database: Neon PostgreSQL with Drizzle ORM for catalogue and transaction management.
  • Authentication: Better Auth for seller registration, login, and protected dashboard access.
  • Payments: PayPal REST API Sandbox for order creation and server-side payment capture.
  • QR Generation: QR codes generated from PayPal payment approval URLs.
  • Deployment: Render.

A key architectural decision was separating AI recognition from financial calculations. The AI model identifies products and estimates quantities, but it never determines product prices or transaction totals. All monetary calculations are performed by backend code using trusted database values and integer-based currency arithmetic.

This ensures that the seller remains in control of the final cart and that the payment amount is calculated independently of AI output.

Challenges We Faced

One of our main challenges was making AI-based product recognition reliable enough for a real checkout workflow. Visual recognition can be uncertain, particularly when products overlap or are partially visible. We addressed this by constraining AI matching to catalogue entries and allowing sellers to review and correct the results before checkout.

Integrating PayPal also required careful handling of order creation, approval redirects, payment capture, and idempotency to avoid duplicate transactions. We tested the complete payment flow using PayPal Sandbox and deployed the application to Render.

We also worked through camera permissions, mobile image capture, database integration, authentication, and deployment configuration to make the experience work beyond a local prototype.

What We Learned

Building Snap to Pay helped us understand how to integrate generative AI into a practical business workflow while maintaining strict boundaries around financial operations.

We learned the importance of server-side validation, secure payment handling, database-backed pricing, authentication, and designing systems that account for uncertain AI outputs.

Most importantly, we learned that AI is most useful when it simplifies a real task without taking control away from the user.

What's Next

We are extending Snap to Pay with a cryptographic proof-of-sale system. The planned architecture uses canonical transaction records, SHA-256 hashing, and a hash-chained ledger to make transaction modifications detectable.

We also plan to introduce transaction verification, publicly accessible proof summaries, and external ledger checkpoint anchoring to strengthen the integrity of transaction records.

Our long-term vision is to make Snap to Pay a lightweight, trustworthy checkout solution for small businesses that need digital commerce without the complexity and cost of traditional POS infrastructure.

Built With

Share this project:

Updates

Submission history