Inspiration
Small sellers in India run their shops inside chat apps. We give them a tireless AI salesperson that speaks their customers' language and gets them paid with PayPal.
What it does
ShopPal is a Telegram bot backed by an LLM agent and PayPal. Customers chat naturally in English, Hindi or Hinglish. The agent searches the store catalog with real filters (size, colour, price) and only recommends products that exist at their real prices. It builds the cart, suggests matching items (cross-sell), and shows exact totals. On checkout it creates a PayPal order (Orders v2) with every line item and replies with a Pay with PayPal button. After the buyer approves, ShopPal captures the payment exactly once and sends a receipt in the chat. A verified PayPal webhook backs this up if the buyer closes the tab. The seller gets a Telegram alert with the items, buyer name and shipping address. Customers can ask for order status and the agent checks it.
How we built it
Python FastAPI web service with python-telegram-bot in webhook mode, so it runs on free hosting that sleeps. LLM tool calling via an OpenAI-compatible API on Groq, model openai/gpt-oss-120b. Tools: search_products, get_product, add_to_cart, remove_from_cart, view_cart, create_checkout, order_status. The current cart is injected into every turn so the agent never double-adds. PayPal Orders v2 REST API: create order with itemized breakdown, PayPal-Request-Id idempotency, get and capture. Webhooks (CHECKOUT.ORDER.APPROVED, PAYMENT.CAPTURE.COMPLETED) verified with verify-webhook-signature. SQLite for carts and orders; all money math happens in code, never in the model. Deployed on Render; code is MIT-licensed on GitHub with tests that mock PayPal and script the LLM.
Challenges we ran into
Keeping the LLM honest: product facts and totals had to come only from tools. We made totals code-computed and used soft category and colour filters so the model's guesses still find the right items. Agent loops: the model sometimes repeated searches; we capped tool steps and force a final text answer. Payment completion is asynchronous: the buyer may return or not. We finalize from both the return URL and the verified webhook, idempotently, so buyer and seller are notified exactly once. Free hosting sleeps, so the bot uses Telegram webhooks and connects to Telegram in the background with retries, keeping the PayPal endpoints up even if Telegram is slow.
Accomplishments that we are proud of
A complete, working commerce loop, from a casual Hinglish chat to a captured PayPal payment and a seller alert, in a single conversation with no app or website for the customer to install.
What we learned
How to design LLM tools so the model handles conversation while code owns the facts and the money, and how to build a robust PayPal Orders v2 and webhooks integration.
What is next for ShopPal
PayPal Vault for one-tap repeat purchases and PayPal Pay Later options. Seller onboarding with PayPal Partner Referrals so any shop can connect its own PayPal account. WhatsApp and Instagram DM channels, inventory sync from Google Sheets, and order tracking updates.