Skip to main content
Innovatrix Infotech — home
Shopify + WhatsApp + AI: How to Build a Support System That Runs Itself cover
AI Automation

Shopify + WhatsApp + AI: How to Build a Support System That Runs Itself

Learn how to build an AI-powered WhatsApp support system for your Shopify store using n8n and GPT-4o. Covers BSP selection, order tracking automation, Hindi-English support, and real cost breakdown. Based on a real implementation that saved 130+ hours/month.

Photo of Rishabh SethiaRishabh SethiaFounder & CEO11 November 202514 min read2.2k words
#shopify#whatsapp#ai-automation#n8n#customer-support#d2c

Your D2C brand's customer support inbox looks the same every morning: 47 unread WhatsApp messages. Half are "Where is my order?" The other half are return requests and sizing questions. Your support agent — if you even have one — spends four hours daily copy-pasting tracking numbers.

We know this because we built a WhatsApp + AI support system for a D2C laundry services client that handles exactly these queries. The result: 130+ hours per month of manual customer handling eliminated. Order status queries, return requests, FAQ responses — all handled automatically, 24/7, in both Hindi and English.

Here is exactly how we built it, and how you can replicate it for your Shopify store.

What You Will Learn

  • How to connect WhatsApp Business API to your Shopify store using n8n
  • Setting up automated order status responses (no AI needed — pure API logic)
  • Adding a GPT-4o layer for open-ended queries like sizing, complaints, and product recommendations
  • Handling Hindi-English code-switching that is standard in Indian D2C
  • WhatsApp BSP comparison for India and UAE markets (WATI vs Interakt vs 360dialog)
  • TRAI and UAE telecom compliance essentials
  • Real cost breakdown at scale

Prerequisites

  • A Shopify store with the Admin API enabled
  • A WhatsApp Business Account (Meta Business Suite)
  • An n8n instance (self-hosted or cloud — we recommend self-hosted on a $10/month VPS)
  • An OpenAI API key (for the GPT-4o layer)
  • A WhatsApp Business Solution Provider account (we will help you choose one below)

Step 1: Choose Your WhatsApp Business API Provider

This is where most tutorials get it wrong. They jump straight into code without addressing the BSP decision, which determines your cost structure for the next 12 months.

Since July 2025, Meta shifted WhatsApp from conversation-based pricing to per-message pricing for business-initiated templates. This changes the economics significantly.

For Indian D2C stores, here is our honest comparison:

WATI — Starts at approximately ₹2,499/month. Adds roughly 20% markup on Meta's per-message rates. Decent UI, good for non-technical teams. Drawback: the markup adds up fast at scale. If Meta charges ₹0.86 per marketing message, WATI charges approximately ₹1.03.

Interakt — Starts at ₹2,757/quarter (roughly ₹919/month). More affordable entry point. Their Growth plan includes broadcast campaigns, shared inbox, and automation. Per-message rates: ₹0.882 for marketing, ₹0.129 for authentication, ₹0.160 for utility. Service conversations are free since November 2024.

360dialog — Pure API play. No markup on Meta rates. You pay Meta's rates directly plus a platform fee. Best for technical teams who want maximum control. This is what we use for client projects where we are building custom integrations.

For UAE/GCC stores: All three providers work in the UAE market. 360dialog has the strongest presence in the Middle East. WATI has a Dubai office. Interakt is primarily India-focused but supports international numbers.

Our recommendation: If you have a developer (or are hiring us), go with 360dialog for the lowest per-message cost. If you need a plug-and-play solution and your volume is under 5,000 messages/month, Interakt offers the best value in India.

Step 2: Set Up Shopify Order Webhooks

Your Shopify store needs to notify your n8n workflow whenever an order event happens. This is the foundation of automated order status updates via WhatsApp.

In your Shopify Admin, navigate to Settings → Notifications → Webhooks and create webhooks for these events:

Order creation    → https://your-n8n-instance.com/webhook/order-created
Order fulfillment → https://your-n8n-instance.com/webhook/order-fulfilled  
Order delivery    → https://your-n8n-instance.com/webhook/order-delivered

Each webhook sends a JSON payload containing the order details, customer phone number, and fulfillment status. The phone number is critical — it is how we match incoming WhatsApp messages to Shopify orders.

Important gotcha we learned the hard way: Shopify stores phone numbers in multiple formats. A customer might have +919876543210 in their order but message you from 919876543210 (without the plus) on WhatsApp. Always normalize phone numbers by stripping the + prefix and any spaces before matching.

// Phone number normalization in n8n Function node
const normalizePhone = (phone) => {
  return phone.replace(/[\s\+\-\(\)]/g, '');
};

const incomingPhone = normalizePhone($input.first().json.from);
const orderPhone = normalizePhone($input.first().json.customer.phone);

Step 3: Build the Inbound Message Handler

This is the core workflow. When a customer sends "Where is my order?" on WhatsApp, here is what happens:

  1. n8n receives the webhook from your WhatsApp BSP with the customer's message and phone number
  2. Extract and normalize the phone number
  3. Query Shopify Orders API by phone number to find their most recent order
  4. Format the response with order status, tracking number, and estimated delivery date
  5. Send the response back via WhatsApp API

Here is the n8n workflow structure:

WhatsApp Webhook Trigger
  → Function Node: Normalize phone number
  → HTTP Request: GET Shopify Orders API (filter by phone)
  → Switch Node: Check if order found
    → YES: Function Node: Format order status message
      → HTTP Request: Send WhatsApp reply
    → NO: Route to AI Agent (Step 4)

The Shopify Orders API query looks like this:

GET https://your-store.myshopify.com/admin/api/2024-01/orders.json?phone={normalized_phone}&status=any&limit=1&order=created_at+desc

Critical design decision: For order status queries, we never use AI. This is deterministic data. The order is either "confirmed," "shipped," "out for delivery," or "delivered." Using GPT to answer order status questions introduces hallucination risk — the AI might confidently state an incorrect delivery date. Always use the Shopify API directly for factual order data.

Step 4: Add the AI Layer for Open-Ended Queries

Not every customer message is about order status. People ask about sizing, product materials, return policies, store hours, and sometimes they just want to complain. This is where GPT-4o earns its keep.

In your n8n workflow, after the Switch node determines the message is not an order query, route it to an AI agent:

// System prompt for the WhatsApp AI agent
const systemPrompt = `You are the customer support assistant for [Brand Name], 
a D2C brand on Shopify. You handle queries about:
- Product sizing and materials
- Return and exchange policies (7-day return window, original packaging required)
- Shipping timelines (metro cities: 3-5 days, tier-2: 5-7 days)
- Product recommendations based on customer preferences

Rules:
- NEVER guess order status. If asked about an order, say: 
  "Let me check your order status" and return {"action": "check_order"}
- Respond in the same language the customer uses
- Keep responses under 200 words
- Be friendly but professional
- If the query needs human intervention (refund disputes, damaged goods),
  return {"action": "escalate", "reason": "[reason]"}`;

The AI agent handles the conversational layer while the deterministic system handles factual data. This hybrid approach gives you the best of both worlds: accurate order tracking and intelligent, empathetic responses for everything else.

Step 5: Handle Hindi-English Code-Switching

If you are selling to Indian consumers, your customers will write messages like: "Mera order kab aayega? I ordered 3 din pehle" (When will my order come? I ordered 3 days ago).

GPT-4o handles Hindi-English code-switching natively. You do not need a separate translation layer. Just add this to your system prompt:

Respond in the same language mix the customer uses. If they write 
in Hindi, respond in Hindi. If they mix Hindi and English, you can 
mix too. Always use Devanagari script for Hindi words, not 
transliteration, unless the customer uses transliteration.

From our testing across 2,000+ conversations for our laundry services client, GPT-4o correctly identified the customer's language preference 96% of the time without any additional configuration.

Step 6: Compliance — TRAI (India) and UAE Telecom Regulations

For India (TRAI regulations):

  • Customers must explicitly opt-in to receive WhatsApp messages from your business
  • Include an opt-out mechanism in every promotional message ("Reply STOP to unsubscribe")
  • Do not send promotional messages between 9 PM and 9 AM IST
  • Maintain a DND (Do Not Disturb) registry check before sending marketing messages

For UAE (TRA regulations):

  • Similar opt-in requirements apply
  • All commercial communications must identify the sender clearly
  • Data storage must comply with UAE data protection laws — if you are using a BSP, ensure their servers are in the region or that they have appropriate data processing agreements

The good news: Meta's WhatsApp Business API enforces opt-in at the platform level. You cannot send template messages to customers who have not opted in. The compliance burden is lighter than SMS, but you still need to maintain your own opt-in records.

Cost Breakdown at Scale

Here is what this system actually costs to run for a Shopify store handling 3,000 customer conversations per month:

Infrastructure:

  • n8n self-hosted VPS (DigitalOcean/AWS Lightsail): ₹800-1,200/month
  • WhatsApp BSP subscription (Interakt Growth): ~₹919/month

Per-message costs (Meta rates for India, post-July 2025):

  • Service conversations (customer-initiated): Free
  • Utility templates (order updates, shipping notifications): ₹0.160 per message
  • Marketing templates (promotions, re-engagement): ₹0.882 per message

AI costs:

  • GPT-4o API for ~1,000 open-ended queries/month: approximately ₹2,500-4,000/month (depending on response length)

Total monthly cost: approximately ₹5,000-7,000/month for handling 3,000 conversations that would otherwise require a dedicated support agent costing ₹15,000-25,000/month.

That is a 60-70% cost reduction with 24/7 availability and instant response times.

Common Issues and Fixes

Problem: WhatsApp webhook not triggering n8n workflow Fix: Ensure your n8n instance has a valid SSL certificate. WhatsApp BSPs require HTTPS endpoints. Use Cloudflare or Let's Encrypt.

Problem: Shopify API returning empty results for phone number queries Fix: Phone number formatting mismatch. Normalize both the incoming WhatsApp number and the Shopify stored number. Also check if the customer used a different phone number for their Shopify account than their WhatsApp number.

Problem: AI responses are too slow (>5 seconds) Fix: Use GPT-4o-mini instead of GPT-4o for simple queries. Set max_tokens to 150. Add a streaming indicator message ("Typing...") via WhatsApp API while the AI processes.

Problem: AI confidently provides wrong order status Fix: You should never be using AI for order status. Re-architect your workflow to use deterministic API calls for factual data. AI should only handle opinion-based and informational queries.

Results: What We Achieved for Our Client

For our D2C laundry services client, the WhatsApp + AI support system delivered:

  • 130+ hours per month of manual customer handling eliminated
  • Average response time dropped from 2-4 hours to under 30 seconds
  • Customer satisfaction scores improved by 22% (measured via post-interaction CSAT surveys)
  • Support cost reduced by approximately 65%
  • 24/7 availability — customers get instant responses at 2 AM on a Sunday

As a Shopify Partner and AI automation specialist, we have replicated variations of this system for multiple D2C brands. The architecture is the same — the customization is in the system prompts, escalation rules, and integration depth.

If you want to see how we built a similar system using n8n and GPT for a different use case, check out our guide on building an AI customer support agent with n8n and GPT.

Frequently Asked Questions

Written by

Photo of Rishabh Sethia
Rishabh Sethia

Founder & CEO

Rishabh Sethia is the founder and CEO of Innovatrix Infotech, a Kolkata-based digital engineering agency. He leads a team that delivers web development, mobile apps, Shopify stores, and AI automation for startups and SMBs across India and beyond.

Connect on LinkedIn
Get started

Ready to talk about your project?

Whether you have a clear brief or an idea on a napkin, we'd love to hear from you. Most projects start with a 30-minute call — no pressure, no sales pitch.

No upfront commitmentResponse within 24 hoursFixed-price quotes