CityXmart: a 41-second WhatsApp checkout
Customers browse the catalogue, fill a cart and pay by UPI without leaving WhatsApp. The store owner gets an alert the moment an order is paid.
- Order to paid
- 41 Sec
- App install
- 0 MB
- Stack
- Meta WhatsApp Business API / UPI webhooks / Node.js / PostgreSQL
- IP
- Transferred to the client
CityXmart runs six neighbourhood grocery stores in Jaipur. Orders arrived by phone. Staff took them down by hand, payment was collected on delivery, and reconciliation happened at the end of the day in a spreadsheet. The owner had no visibility into which store was busy, which products were running low, or whether an order had been paid.
Constraints
- Customers would not install a new app; WhatsApp was the only channel they would use
- UPI had to be official and reconcilable, so grey payment gateways were ruled out
- The store owner needed to manage everything from a phone, not a laptop
- The system had to work even if a customer's WhatsApp flow was interrupted mid-order
AGA built a conversational commerce system inside WhatsApp using the official Meta Business API. Customers browse a catalogue, add items to a cart, receive a UPI payment link, and pay without leaving the chat. The owner receives a WhatsApp alert the moment an order is paid, with the full order detail and the reconciled bank reference. A human handoff system escalates edge cases to store staff.
How the system is structured.
Simplified. Implementation details are withheld where they are commercially sensitive.
- 01
WhatsApp message received
Meta Cloud API webhook → our Node.js server
- 02
Session management
Redis stores cart state across conversation turns
- 03
Intent parsing
Structured message parsing maps customer input to catalogue actions
- 04
Catalogue lookup
PostgreSQL product database with store-level inventory
- 05
Cart operations
Add, remove, update quantities via conversational buttons
- 06
Payment link
HDFC UPI payment link generated and sent as a WhatsApp message
- 07
Payment webhook
HDFC webhook confirms payment and marks order paid in database
- 08
Owner alert
WhatsApp notification to store owner with order summary and bank reference
- 09
Human handoff
Edge cases escalated to store staff via WhatsApp
What makes it hold up.
- Idempotent webhook handlers, so duplicate payment events never create duplicate orders
- Conversation state persisted in Redis with 24-hour TTL to survive interrupted sessions
- Graceful degradation: if the payment service is down, the customer is told and the order is queued
- Rate limiting on inbound WhatsApp webhooks to prevent abuse
- All UPI amounts validated server-side before links are generated
- Order state machine with clear transitions: CART → PENDING_PAYMENT → PAID → DISPATCHED
Key decisions, and why we made them.
- 01
Official Meta Business API instead of third-party WhatsApp gateway
Grey gateways are blocked periodically, violate Meta's terms, and cannot be used with UPI payment links officially. The Business API costs more but provides reliability and compliance.
- 02
HDFC Bank direct integration instead of Razorpay or Stripe
The client had an existing HDFC business account and preferred direct bank reconciliation. HDFC's webhook API provided the settlement reference needed for accounting.
- 03
Redis for session state instead of database
Conversation state is temporary and high-frequency. Redis provides sub-millisecond reads and automatic TTL expiry without accumulating stale session rows in the main database.
More shipped work and related services.
- 01Jaipur garment ERP: six logbooks, one dashboardA garment manufacturer in Jaipur replaced six paper logbooks with one system for job cards, inventory and GST-ready invoicing, used on 10-inch tablets on the shop floor.Shop-Floor & Management
- 02Saymico & Parpple: dating apps, shipped end to endTwo consumer dating apps taken from design to the App Store and Google Play: matching, AI photo verification, real-time chat and a moderation console.iOS & Android Release
- 03AI & Automation servicesChatbots, WhatsApp commerce and workflow automation that take repetitive work off your team.Services
- 04Build servicesWeb apps, mobile apps, SaaS products and online stores, engineered to production standard.Services
- 05Technology StackThe tools we use and why each one earns its place.Engineering
Need something similar?
Describe your project and we'll scope it, design the architecture and send a fixed-price quote within 24 hours.
- Written scope
- Within 24 hours
- Pricing
- Fixed per milestone
- Ownership
- 100% of code and IP