How to build a WhatsApp AI agent for e-commerce
Learn how to build a WhatsApp AI agent for e-commerce — order tracking, product discovery, returns, Shopify integration, and abandoned cart recovery.
E-commerce is one of the highest-value use cases for WhatsApp AI agents. Your customers are already on WhatsApp. They're already asking questions about orders, products, and returns. The question isn't whether to be there — it's how to make the experience good enough that it converts and retains customers. Here's how to build a WhatsApp AI agent for e-commerce that handles the full customer journey.
TL;DR
- Order tracking is the highest-volume use case — "where's my order?" is the most common e-commerce support message, and it's trivially automatable with a Shopify integration.
- Product discovery is where AI agents genuinely outperform chatbots — a customer describing what they need can be matched to the right product in natural language.
- Inbound abandoned cart recovery works — when a customer who abandoned a cart messages you, the bot can surface their cart and offer to help them complete the order.
Why WhatsApp is a natural fit for e-commerce
Email is the traditional e-commerce communication channel. Order confirmations, shipping updates, promotional messages — all sent via email. But email open rates hover around 20%, and response rates are even lower.
WhatsApp open rates sit at around 98%. When a customer messages you on WhatsApp, they're in a conversational mindset — they expect a reply, and they're ready to engage. That's a fundamentally different dynamic than an email that gets buried in an inbox.
For e-commerce businesses, this creates opportunities at every stage of the customer journey: discovery, purchase, fulfilment, and re-engagement.
Use case 1: order tracking
"Where's my order?" is the most common customer service query in e-commerce. In many businesses, it accounts for 30–50% of all support contacts. It's also the most automatable — the answer is in your order management system, and retrieving it requires a simple lookup.
The flow:
- Customer sends "where's my order?" (or any variation: "order status", "tracking", "has my parcel shipped?")
- Bot asks for the order number or the email address used at checkout
- Bot queries your order management system (Shopify, WooCommerce, or whatever you use)
- Bot returns the current status: "Your order #12345 was dispatched on 14 July and is estimated to arrive tomorrow. Your tracking number is GB123456789."
- If the customer wants to track it live, the bot sends the carrier tracking link
This flow, fully automated, handles hundreds of "where's my order?" queries a day without any human involvement.
Use case 2: product discovery and recommendations
A customer who knows exactly what they want can find it on your website. But a customer who knows what they need — without knowing what it's called or whether you stock it — is harder to serve via a product catalogue.
In WhatsApp, natural language description works. A customer can say "I'm looking for a gift for my mum, she's really into cooking, budget around £50" and an AI agent can engage with that description, ask a clarifying question or two, and surface the right products from your catalogue.
This is the use case where AI agents genuinely outperform traditional chatbots. A menu-based bot can't handle open-ended product discovery. An AI agent can hold a consultative conversation, much like a good in-store sales assistant.
With Shopify connected via Composio, the bot can search your product catalogue in real time and send links to specific products, including prices and availability.
Use case 3: returns and refunds
Returns are a pain point for customers and for support teams. The customer has to find the returns policy, complete a form, wait for a label, and then often follow up because they're not sure the return was received.
A WhatsApp returns flow simplifies this:
- Customer messages "I want to return an order"
- Bot asks for the order number and reason for return
- Bot checks your returns policy (is it within the return window? Is the item eligible?)
- Bot confirms the return, generates a returns label link, and sends it in chat
- Bot confirms receipt when the warehouse processes the return
This flow saves significant support time and, importantly, makes customers feel cared for. A fast, easy return experience often converts a potentially negative situation into a loyalty moment.
Use case 4: size and fit guidance
For fashion and apparel businesses, size and fit queries are high volume and high stakes. A customer who orders the wrong size returns the item. A customer who got helpful guidance before ordering — and ordered the right thing first time — has a better experience and a lower return rate.
In WhatsApp, the bot can ask relevant questions ("what's your usual size in other brands?", "are you between sizes?", "is this for a relaxed or fitted look?") and guide the customer to the right choice. It can also handle fabric questions, care instructions, and anything else a customer might need before committing to a purchase.
Use case 5: inbound abandoned cart recovery
Outbound abandoned cart messages — blasting everyone who left something in their cart — are restricted by WhatsApp's messaging policies (you need an opt-in template and appropriate business tier). But inbound recovery works differently and is completely unrestricted.
When a customer who has an abandoned cart messages your WhatsApp number — for any reason — the bot can check whether they have an active cart. If they do, it can surface it: "By the way, you have some items in your basket — do you want to pick up where you left off?" This is contextual, welcome, and converts well because the customer is already in conversation with you.
This requires connecting your e-commerce platform to the bot so it can look up cart status by phone number. With Shopify and Composio, this is a standard integration.
Use case 6: loyalty and re-engagement
For customers who've ordered before, the bot can be proactive in a compliant way: when an existing customer messages in, acknowledge their history. "Welcome back, Sarah. Your last order of the lavender candle set was on 12 March — is there anything I can help you find today?"
This kind of personalisation, which feels natural in a one-to-one conversation, is much harder to replicate in email or on a website. It's a genuine advantage of the WhatsApp channel — and it's available to any business that stores basic order history.
Building the Shopify integration
Shopify is the most common e-commerce platform for businesses building WhatsApp agents, and Composio provides a direct integration.
With CodeWords, you describe the flow to Cody, the AI automation assistant, and specify that you want to connect to Shopify. Cody builds the integration — the API calls, the data mapping, the conditional logic — without you needing to write code.
For order tracking, you tell Cody: "When a customer asks where their order is, ask for their order number, look it up in Shopify, and reply with the current status and tracking number."
For product discovery, you tell Cody: "When a customer describes what they're looking for, search my Shopify product catalogue and suggest the three most relevant products with links."
What good e-commerce agents do well
The best e-commerce WhatsApp agents share a few characteristics:
They stay focused. They're great at e-commerce tasks and don't try to be everything. When a customer asks something outside scope, they acknowledge it and redirect.
They personalise. They use the customer's name, reference their order history, and make the experience feel one-to-one rather than automated.
They escalate well. For complaints, refund disputes, and genuinely complex situations, they hand over to a human quickly and gracefully — with the full conversation context included.
They close the loop. Order confirmed, payment received, return processed — they always send the final confirmation message so the customer isn't left wondering.
Start building your e-commerce WhatsApp agent at CodeWords. Describe your use case to Cody and have a working prototype ready to test in minutes.
Related reading