Conversational CommerceLive in production

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
01 · The challenge

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
02 · What we built

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.

03 · Architecture

How the system is structured.

Simplified. Implementation details are withheld where they are commercially sensitive.

Conversational Commerce · request flow9 stages
  1. 01

    WhatsApp message received

    Meta Cloud API webhook → our Node.js server

  2. 02

    Session management

    Redis stores cart state across conversation turns

  3. 03

    Intent parsing

    Structured message parsing maps customer input to catalogue actions

  4. 04

    Catalogue lookup

    PostgreSQL product database with store-level inventory

  5. 05

    Cart operations

    Add, remove, update quantities via conversational buttons

  6. 06

    Payment link

    HDFC UPI payment link generated and sent as a WhatsApp message

  7. 07

    Payment webhook

    HDFC webhook confirms payment and marks order paid in database

  8. 08

    Owner alert

    WhatsApp notification to store owner with order summary and bank reference

  9. 09

    Human handoff

    Edge cases escalated to store staff via WhatsApp

04 · Engineering detail

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
05 · Decision log

Key decisions, and why we made them.

  1. 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.

  2. 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.

  3. 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.

Next step

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