Bot WA AI untuk E-commerce

Panduan lengkap bot AI WhatsApp untuk toko online. Order, payment, shipping, customer service. All-in-one guide!

Bot WA AI untuk E-commerce
Bot WA AI untuk E-commerce

E-commerce + AI Bot = 24/7 Sales Machine!

Bot AI untuk e-commerce bisa handle product discovery, order processing, payment verification, shipping updates, dan customer service - semuanya otomatis!


E-commerce Bot Features

πŸ›’ FITUR LENGKAP:

DISCOVERY:
- Product search
- Recommendations
- Catalog browsing
- Price inquiry

ORDERING:
- Add to cart
- Checkout process
- Payment instructions
- Order confirmation

FULFILLMENT:
- Order tracking
- Shipping updates
- Delivery confirmation

SUPPORT:
- FAQ handling
- Return/refund
- Complaint handling
- Human escalation

System Architecture

πŸ—οΈ ARCHITECTURE:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           WhatsApp Users            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚      WhatsApp Bot (Baileys/API)     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         AI Engine (GPT/Claude)      β”‚
β”‚  β€’ Intent detection                 β”‚
β”‚  β€’ Response generation              β”‚
β”‚  β€’ Product matching                 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
     β–Ό         β–Ό         β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Product β”‚β”‚ Order   β”‚β”‚ Customerβ”‚
β”‚   DB    β”‚β”‚   DB    β”‚β”‚   DB    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Complete System Prompt

javascript

const ECOMMERCE_PROMPT = `Kamu adalah Tia, AI shopping assistant untuk [BRAND].

TENTANG TOKO:
- Toko fashion wanita online
- Berdiri sejak 2020, trusted seller
- Rating 4.9/5 dari 10,000+ reviews

PRODUK:
- Dress: Rp 150,000 - 500,000
- Blouse: Rp 100,000 - 250,000
- Celana: Rp 120,000 - 300,000
- Outerwear: Rp 200,000 - 450,000
- Aksesoris: Rp 50,000 - 150,000

KEBIJAKAN:
- Free ongkir Jabodetabek min. Rp 200,000
- Ongkir luar Jabodetabek: dari Rp 15,000
- Retur: 7 hari setelah terima (syarat berlaku)
- Garansi jahitan: 30 hari

PEMBAYARAN:
- Transfer: BCA 1234567890 a/n [BRAND]
- E-wallet: GoPay, OVO, DANA
- COD: Jabodetabek only

PENGIRIMAN:
- JNE, J&T, SiCepat
- Jabodetabek: 1-2 hari
- Jawa: 2-3 hari
- Luar Jawa: 3-5 hari

TUGAS KAMU:
1. Bantu customer cari produk yang cocok
2. Jawab pertanyaan dengan akurat
3. Proses order dengan lengkap
4. Update status pengiriman
5. Handle komplain dengan empati

GAYA KOMUNIKASI:
- Panggil "Kak"
- Ramah dan helpful
- Emoji secukupnya
- Bahasa Indonesia casual tapi sopan

ATURAN PENTING:
- Jangan membuat harga/promo yang tidak ada
- Jika tidak yakin, bilang akan cek ke tim
- Komplain serius β†’ eskalasi ke human
- Selalu konfirmasi sebelum proses order`;

Product Discovery

javascript

const productTools = [
    {
        type: 'function',
        function: {
            name: 'search_products',
            description: 'Search products by keyword, category, or filters',
            parameters: {
                type: 'object',
                properties: {
                    query: { type: 'string' },
                    category: { type: 'string' },
                    minPrice: { type: 'number' },
                    maxPrice: { type: 'number' },
                    color: { type: 'string' },
                    size: { type: 'string' }
                }
            }
        }
    },
    {
        type: 'function',
        function: {
            name: 'get_product_details',
            description: 'Get detailed info about a specific product',
            parameters: {
                type: 'object',
                properties: {
                    productId: { type: 'string' }
                },
                required: ['productId']
            }
        }
    },
    {
        type: 'function',
        function: {
            name: 'get_recommendations',
            description: 'Get product recommendations based on preferences',
            parameters: {
                type: 'object',
                properties: {
                    occasion: { type: 'string' },
                    style: { type: 'string' },
                    budget: { type: 'number' }
                }
            }
        }
    }
];

async function searchProducts({ query, category, minPrice, maxPrice, color, size }) {
    const filter = { active: true, stock: { $gt: 0 } };
    
    if (query) {
        filter.$text = { $search: query };
    }
    if (category) filter.category = category;
    if (minPrice) filter.price = { ...filter.price, $gte: minPrice };
    if (maxPrice) filter.price = { ...filter.price, $lte: maxPrice };
    if (color) filter.colors = color;
    if (size) filter.sizes = size;
    
    const products = await db.products
        .find(filter)
        .sort({ rating: -1, sales: -1 })
        .limit(5)
        .toArray();
    
    return products.map(p => ({
        id: p.id,
        name: p.name,
        price: p.price,
        colors: p.colors,
        sizes: p.sizes,
        rating: p.rating,
        image: p.images[0]
    }));
}

Order Processing

javascript

const orderTools = [
    {
        type: 'function',
        function: {
            name: 'add_to_cart',
            description: 'Add product to cart',
            parameters: {
                type: 'object',
                properties: {
                    productId: { type: 'string' },
                    size: { type: 'string' },
                    color: { type: 'string' },
                    quantity: { type: 'number' }
                },
                required: ['productId', 'size', 'color']
            }
        }
    },
    {
        type: 'function',
        function: {
            name: 'view_cart',
            description: 'View current cart contents'
        }
    },
    {
        type: 'function',
        function: {
            name: 'create_order',
            description: 'Create order from cart',
            parameters: {
                type: 'object',
                properties: {
                    customerName: { type: 'string' },
                    phone: { type: 'string' },
                    address: { type: 'string' },
                    courier: { type: 'string' },
                    paymentMethod: { type: 'string' }
                },
                required: ['customerName', 'address']
            }
        }
    }
];

async function createOrder(userId, orderData) {
    const cart = await getCart(userId);
    
    if (!cart || cart.items.length === 0) {
        return { success: false, message: 'Cart kosong' };
    }
    
    // Calculate totals
    const subtotal = cart.items.reduce((sum, item) => 
        sum + item.price * item.quantity, 0
    );
    
    const shipping = calculateShipping(orderData.address, orderData.courier);
    const total = subtotal + shipping;
    
    // Check free shipping
    const freeShipping = subtotal >= 200000 && isJabodetabek(orderData.address);
    const finalTotal = freeShipping ? subtotal : total;
    
    // Create order
    const order = {
        orderId: generateOrderId(),
        oderId
userId,
        customerName: orderData.customerName,
        phone: orderData.phone || userId.replace('@s.whatsapp.net', ''),
        address: orderData.address,
        items: cart.items,
        subtotal,
        shipping: freeShipping ? 0 : shipping,
        total: finalTotal,
        courier: orderData.courier || 'jne',
        paymentMethod: orderData.paymentMethod || 'transfer',
        status: 'pending_payment',
        createdAt: new Date(),
        expiresAt: new Date(Date.now() + 24 * 60 * 60 * 1000)
    };
    
    await db.orders.insertOne(order);
    await clearCart(userId);
    
    return {
        success: true,
        order: {
            orderId: order.orderId,
            items: order.items,
            subtotal: order.subtotal,
            shipping: order.shipping,
            total: order.total,
            paymentMethod: order.paymentMethod,
            expiresAt: order.expiresAt
        }
    };
}

Payment Handling

javascript

async function handlePaymentConfirmation(userId, imageBuffer) {
    // 1. Analyze payment proof with Vision AI
    const analysis = await analyzePaymentProof(imageBuffer);
    
    if (!analysis.isValid) {
        return `Maaf kak, bukti transfernya kurang jelas πŸ˜”

Pastikan:
- Screenshot dari aplikasi banking
- Nominal dan tanggal terlihat jelas
- Bukan foto screen (kualitas rendah)

Bisa kirim ulang kak?`;
    }
    
    // 2. Find matching order
    const pendingOrders = await db.orders.find({
        oderId
userId,
        status: 'pending_payment',
        total: { $gte: analysis.amount * 0.99, $lte: analysis.amount * 1.01 }
    }).toArray();
    
    if (pendingOrders.length === 0) {
        return `Hmm, aku tidak menemukan order dengan nominal Rp ${analysis.amount.toLocaleString()}.

Bisa kasih tau nomor ordernya kak?`;
    }
    
    const order = pendingOrders[0];
    
    // 3. Update order status
    await db.orders.updateOne(
        { orderId: order.orderId },
        {
            $set: {
                status: 'paid',
                paidAt: new Date(),
                paymentProof: {
                    amount: analysis.amount,
                    bank: analysis.bank,
                    date: analysis.date,
                    reference: analysis.reference
                }
            }
        }
    );
    
    // 4. Send confirmation
    return `βœ… Pembayaran Dikonfirmasi!

Order #${order.orderId}
πŸ’° Rp ${analysis.amount.toLocaleString()}
🏦 ${analysis.bank}

Pesanan akan segera kami proses dan kirim!
Estimasi kirim: ${getEstimatedShipDate()}

Terima kasih sudah belanja di [BRAND]! πŸ’•`;
}

Order Tracking Integration

javascript

async function handleTrackingQuery(userId, message) {
    // Find user's orders
    const orders = await db.orders.find({
        oderId
userId,
        status: { $nin: ['delivered', 'cancelled'] }
    }).sort({ createdAt: -1 }).limit(3).toArray();
    
    if (orders.length === 0) {
        return `Kak, tidak ada pesanan aktif saat ini.

Mau belanja? Ketik KATALOG untuk lihat produk! πŸ›οΈ`;
    }
    
    let response = `πŸ“¦ Status Pesanan Kakak:\n\n`;
    
    for (const order of orders) {
        response += `#${order.orderId}\n`;
        response += `Status: ${getStatusEmoji(order.status)} ${formatStatus(order.status)}\n`;
        
        if (order.trackingNumber) {
            const tracking = await trackShipment(order.trackingNumber, order.courier);
            response += `Posisi: ${tracking.currentLocation}\n`;
            response += `Estimasi: ${tracking.estimatedDelivery}\n`;
        }
        
        response += `\n`;
    }
    
    response += `Ketik nomor order untuk detail lebih lengkap!`;
    
    return response;
}

function getStatusEmoji(status) {
    const emojis = {
        pending_payment: '⏳',
        paid: 'βœ…',
        processing: 'πŸ“¦',
        shipped: '🚚',
        out_for_delivery: 'πŸŽ‰',
        delivered: 'βœ…'
    };
    return emojis[status] || '❓';
}

Complete Conversation Example

πŸ‘€: Hai, mau cari dress buat kondangan

πŸ€–: Hai Kak! 😊 Mau cari dress kondangan ya!

Aku punya beberapa rekomendasi nih:

1️⃣ *Dress Brukat Elegan*
   πŸ’° Rp 350.000
   🎨 Navy, Maroon, Black
   ⭐ 4.9/5 (Best seller!)

2️⃣ *Midi Dress Satin*
   πŸ’° Rp 425.000
   🎨 Dusty Pink, Champagne
   ⭐ 4.8/5

3️⃣ *A-Line Dress Floral*
   πŸ’° Rp 299.000
   🎨 Sage, Cream
   ⭐ 4.7/5

Mau lihat detail yang mana kak?

---

πŸ‘€: Yang nomor 1, ada size M ga?

πŸ€–: Dress Brukat Elegan size M? Ada kak! βœ…

πŸ“‹ Detail Produk:
- Bahan: Brukat premium + furing
- Size M: LD 90cm, Panjang 100cm
- Warna tersedia: Navy, Maroon, Black

Stok size M:
- Navy: 5 pcs βœ…
- Maroon: 3 pcs βœ…
- Black: 2 pcs βœ…

Mau order yang warna apa kak?

---

πŸ‘€: Navy dong, 1 aja

πŸ€–: Siap kak! Aku tambahin ke keranjang:

πŸ›’ Keranjang:
- Dress Brukat Elegan
- Size M, Navy
- 1 pcs
- Rp 350.000

Mau checkout sekarang atau tambah produk lain?

---

πŸ‘€: Checkout aja

πŸ€–: Oke kak! Untuk checkout, aku butuh:

1️⃣ Nama lengkap penerima
2️⃣ Alamat lengkap (dengan kode pos)
3️⃣ No. HP penerima (jika beda)

Boleh diisi kak? 😊

---

πŸ‘€: Dina Pratiwi, Jl. Sudirman No. 123, Jakarta Selatan 12190

πŸ€–: Terima kasih kak! Aku rangkum ordernya:

πŸ“‹ KONFIRMASI ORDER
━━━━━━━━━━━━━━━━━━━━
πŸ‘€ Dina Pratiwi
πŸ“ Jl. Sudirman No. 123
   Jakarta Selatan 12190

πŸ›οΈ Items:
- Dress Brukat Elegan M Navy x1
  Rp 350.000

πŸ’° Subtotal: Rp 350.000
🚚 Ongkir: GRATIS! πŸŽ‰
━━━━━━━━━━━━━━━━━━━━
πŸ’΅ TOTAL: Rp 350.000

Pembayaran:
🏦 Transfer ke BCA 1234567890 a/n [BRAND]

Sudah benar kak? Reply OK untuk konfirmasi!

---

πŸ‘€: OK

πŸ€–: βœ… ORDER BERHASIL!

πŸ“‹ Order #ORD-20260217-001

Silakan transfer Rp 350.000 ke:
🏦 BCA 1234567890
πŸ“ a/n [BRAND]

⏰ Batas bayar: 24 jam
πŸ“Έ Setelah transfer, kirim bukti ke sini ya!

Terima kasih sudah belanja di [BRAND]! πŸ’•

Best Practices

DO βœ…

- Complete product info
- Clear pricing
- Easy checkout flow
- Payment verification
- Proactive shipping updates
- Quick complaint resolution

DON'T ❌

- Hidden fees
- Complicated ordering
- Slow payment confirm
- No tracking updates
- Ignore complaints
- Over-promise delivery

FAQ

Berapa conversion rate yang bagus?

10-20% dari inquiry ke order. Dengan AI yang baik bisa 25-30%.

Perlu integrasi marketplace?

Optional tapi recommended. Sync stock dari Tokopedia/Shopee untuk accuracy.


Kesimpulan

E-commerce AI Bot = 24/7 Sales Team!

ManualAI Bot
Limited hours24/7
1 CS = 50 chats1 Bot = unlimited
InconsistentConsistent

Build E-commerce Bot β†’


Artikel Terkait