AI for EcommerceModule 2

2.1AI Chatbots for Customer Service — WhatsApp + Daraz

30 min 5 code blocks Practice Lab Quiz (4Q)

AI Chatbots for Customer Service — WhatsApp + Daraz

A Daraz message arrives at 11 PM: "Bhai, yeh product kitne din main aa jayega? Mera event kal hai." You're asleep. By morning, the buyer has bought from a competitor who replied at midnight. This is the Pakistan ecommerce reality. Customers expect instant responses, but hiring 24/7 customer service reps costs PKR 30,000-50,000 monthly. AI chatbots automate 80% of conversations—answering FAQs, processing returns, confirming orders—freeing your time for high-value work. In this lesson, you'll build an AI chatbot for WhatsApp and Daraz messaging using no-code tools.

Why Chatbots Matter for Pakistan Sellers

Pakistani buyers expect:

  • Instant responses (within 1 hour)
  • Urdu support (or Roman Urdu)
  • Payment flexibility (cash on delivery, installments)
  • Trust signals (order status, return guarantees)

Manual customer service can't scale. A chatbot can handle 1,000 conversations simultaneously. Yet most Pakistani sellers still manually message buyers. This is a competitive moat—automate first, undercut competitors.

Building a Chatbot with Make.com (Formerly Zapier)

Make.com is a no-code automation platform. No coding required.

Step 1: Set Up WhatsApp Integration

  1. Sign up at make.com (free tier available; paid plans start at $10/month)
  2. Create a "Scenario" (a workflow)
  3. Trigger: WhatsApp message from a phone number
  4. Action: Send response via Gemini AI

Make.com Workflow (visual setup):

code
Trigger: WhatsApp message received (from customer)
  ↓
Check: Is this message a common question? (e.g., "Delivery time?" "Refund policy?")
  ↓
If YES → Send templated response (fast, accurate)
If NO → Send to Gemini for AI response
  ↓
Action: WhatsApp sends reply

Step 2: Create a Chatbot Knowledge Base

Your AI chatbot needs context. Create a "Prompt" document in Gemini that covers:

Knowledge Base Template:

code
You are a customer service chatbot for [YOUR STORE NAME] on Daraz and WhatsApp.
You help Pakistani customers with:
- Order status & delivery times
- Return and refund policies
- Payment methods (cash on delivery, JazzCash, Easypaisa)
- Product questions

STORE POLICIES (customer must believe you):
- Delivery time: 24-48 hours in Karachi/Lahore, 3-7 days elsewhere
- Returns: 14 days, original packaging
- Refunds: Within 7 business days of return received
- Payment: COD, JazzCash, Easypaisa, bank transfer

COMMON QUESTIONS (respond exactly):
Q: "Mera order kab aayega?" (When will my order arrive?)
A: "Shukriya for your order! If ordered in Karachi/Lahore, delivery is 24-48 hours.
Other cities: 3-7 days. You'll get an SMS with your tracking number."

Q: "Kya yeh original hai?" (Is this original?)
A: "100% original guaranteed. We source directly from authorized distributors.
30-day money-back if you're not satisfied."

Q: "Refund kaise hoga?" (How do I get a refund?)
A: "Reply with 'REFUND' + order number. We'll send a prepaid return label.
Once received, refund within 7 days."

RULES:
- Always be friendly, not robotic.
- Use Urdu/Roman Urdu when customer initiates in Urdu.
- If unsure, say: "Ek moment. Let me connect you with our team."
- Never make up policies.
- Prioritize customer satisfaction.

Paste this into your Make.com Gemini integration.

Step 3: Daraz Messaging Integration

Daraz Seller Center has built-in messaging. Use Make.com to bridge Daraz → Chatbot:

  1. In Make.com, add Daraz as a trigger (via API)
  2. Daraz → Chatbot → Daraz reply

Setup steps:

  1. Get your Daraz Seller API credentials from your Daraz account
  2. Create a Make.com scenario with Daraz as trigger
  3. Connect to Gemini chatbot
  4. Reply goes back to Daraz

Daraz API docs: seller.daraz.pk/api

Building a WhatsApp Chatbot with Twilio

Twilio is phone-native; it connects your chatbot to WhatsApp directly.

Step 1: Set Up Twilio WhatsApp

  1. Sign up at twilio.com (free $15 trial credit)
  2. Get a WhatsApp Business Account (connected to your phone number)
  3. Enable WhatsApp messaging in Twilio Console
  4. Link it to your phone number

Step 2: Connect to AI Engine

Use Twilio + Python to route messages to Gemini:

Simple Python script (Twilio + Gemini):

python
from twilio.rest import Client
from google import genai

# Twilio credentials
TWILIO_ACCOUNT_SID = "your_sid"
TWILIO_AUTH_TOKEN = "your_token"
TWILIO_PHONE = "+1234567890"

# Gemini setup
GEMINI_API_KEY = "your_key"
client = genai.Client(api_key=GEMINI_API_KEY)

twilio_client = Client(TWILIO_ACCOUNT_SID, TWILIO_AUTH_TOKEN)

def handle_whatsapp_message(sender, message_body):
    # Send to Gemini
    response = client.models.generate_content(
        model="gemini-2.5-flash",
        contents=f"""
        You are a WhatsApp chatbot for a Daraz seller in Pakistan.
        Customer message: {message_body}

        Knowledge base: [paste your store policies here]

        Respond in the same language as the customer (Urdu or English).
        Keep response under 160 characters (WhatsApp single message).
        Be helpful, friendly, professional.
        """
    )

    reply = response.text

    # Send WhatsApp reply
    twilio_client.messages.create(
        from_="whatsapp:+1234567890",
        body=reply,
        to=f"whatsapp:{sender}"
    )

    return reply

# Example usage
handle_whatsapp_message("+923001234567", "Order mera kab aayega?")

Deploy this on a cloud platform (Render.com, Replit, Railway) and it runs 24/7.

No-Code Alternative: Chatbase + Daraz Messenger

If coding intimidates you, use Chatbase (no-code chatbot builder):

  1. Sign up at chatbase.co
  2. Upload your knowledge base (PDF, webpage, or text)
  3. Train a custom chatbot
  4. Embed in Daraz or WhatsApp via API
  5. Charge: Free tier (20 conversations/day) → Paid ($20/month for unlimited)

Recommended flow for beginners:

  • Use Chatbase for knowledge base training
  • Connect to Make.com for WhatsApp/Daraz routing
  • No coding required

Handling Escalations (Chatbot Limitations)

Not every conversation should be automated. Implement a workflow:

code
Is the message a FAQ? (Delivery time, refund, return)
  ↓ YES → Chatbot responds
  ↓ NO → Escalate to human agent

Queue for Human Review:
- Order issues (shipping lost, item damaged)
- Complaints (customer unhappy, 1-star feedback)
- Custom requests (special orders, bulk discounts)

Tools: Use a shared Google Sheet or Airtable to track escalations.
Respond within 2 hours for urgent issues.

Analytics & Optimization

After 2 weeks of chatbot use, analyze:

  1. Conversation volume: How many customers messaged?
  2. Automation rate: What % of conversations were fully automated?
  3. Customer satisfaction: Did automations improve or hurt sentiment?
  4. Top questions: What questions repeat most often?

Use these insights to improve your knowledge base.

Example: If 30% of customers ask "Kya payment plan hai?" (Do you offer payment plans?), and you DON'T offer it, now you know your next product feature.

Practice Lab

Practice Lab

Task 1: Write a knowledge base for a hypothetical product (e.g., wireless earbuds on Daraz). Include 10 FAQs (customer question + AI response). Paste into ChatGPT and ask: "Are these responses friendly and helpful for Pakistani buyers?"

Task 2: Sign up for Make.com (free tier). Create a simple scenario: WhatsApp trigger → Gemini response → WhatsApp output. Don't deploy; just show me the workflow design.

Task 3: Brainstorm 3 customer service issues that a chatbot CANNOT solve (e.g., "I received a damaged product"). For each, write a human escalation message that is apologetic and solution-focused.

Pakistan Example

Store: SialkotCraft (wooden desk organizers on Daraz) Chatbot knowledge base:

code
Q: "Delivery time?"
A: "Shukriya for your interest! In Karachi/Lahore: 24-48 hours. Other cities: 3-7 days.
You'll receive an SMS with tracking info."

Q: "Is it handmade?"
A: "Yes! Each organizer is handcrafted by artisans in Sialkot.
This means slight variations make each piece unique."

Q: "Refund guarantee?"
A: "Bilkul! 14-day money-back guarantee. If you're not 100% happy,
return it in original packaging. Full refund within 7 days."

Q: "What's the size?"
A: "Length: 30cm, Width: 15cm, Height: 10cm. Perfect for office desks and home use."

Q: "Is wood waxed?"
A: "Yes, natural beeswax finish. Food-safe, chemical-free, eco-friendly."

Result: 90% of customer messages are auto-answered. You only handle escalations. Saves 10 hours/week.

Lesson Summary

Includes hands-on practice lab5 runnable code examples4-question knowledge check below

Quiz: AI Chatbots for Customer Service

4 questions to test your understanding. Score 60% or higher to pass.