Skip to content

How to Build a WhatsApp Chatbot for Business, Step by Step

Most shop chats repeat the same five questions. Here is how to build a WhatsApp chatbot that answers them in your customers' languages, uses AI carefully, and hands real problems to a person.

Small emerald robot sorting blank chat bubbles, a symbol of a WhatsApp chatbot for business that answers customers

It is 11 pm in Casablanca. Salma sells skincare on Instagram and WhatsApp, and her phone shows 63 unread chats. Most ask the same five things: the price of the vitamin C serum, delivery to Agadir, cash on delivery, whether the cream suits oily skin, and when the parcel will arrive. She types the same answers in French, in Darija and sometimes in Arabic until 1 am.

A WhatsApp chatbot for business takes those repeat questions off her hands. It does not replace Salma. It answers the easy questions in seconds, at any hour, and passes the real conversations to her. This guide shows how to build one the way we build them: from your real chats, keyword rules first, AI second, and a person always within reach.

What a chatbot can and cannot do

A good bot does three jobs well. It answers known questions instantly. It collects the details you need, such as city, size and phone number. And it routes the customer to the right person. It does all three in the language the customer uses.

It does badly at anything that needs judgment: a damaged parcel, a refund dispute, an upset customer. Those need a human, fast.

You can run a bot on the official WhatsApp Business Platform or on a QR-connected tool. We compare both in WhatsApp Business API vs WhatsApp Web tools. The method below works with either.

Start with your real questions, not a flowchart

Most bots fail because someone designs a menu before reading the inbox. Scroll through your last 200 conversations and write down every first question. Group them. In most shops, five to eight topics cover 70 to 80% of first messages.

An example fashion shop in Rabat, over two weeks:

TopicShare of first messagesTypical wording
Price31%"Chhal taman?", "Prix svp", "Combien?"
Delivery city and time22%"Livraison l Tanger?", "Kayn tawsil?"
Cash on delivery14%"Paiement à la livraison?"
Sizes and stock12%"Kayna taille L?", "Disponible?"
Order status9%"Fin wslat commande dyali?"
Everything else12%Complaints, wholesale, partnerships

That last row matters. It is the part the bot should hand to a person, or to a carefully limited AI reply.

Build the keyword layer first

Keyword rules are predictable: the same message always gets the same answer, so they are easy to test. Most tools offer four match types:

  • Exact keyword: the whole message must equal the keyword. Good for menu choices like "1", "2" or "menu".
  • Contains a keyword: fires when the message includes one specific word, such as "livraison".
  • Contains any keyword: fires on any word from a list. This is the workhorse for multilingual shops.
  • Fallback: the reply when nothing else matches.

Cover every way people write the same word

Customers in Morocco write Darija in Latin letters, in Arabic letters, with numbers for some sounds (3, 7, 9), and with typos. One "contains any" rule for price might list: prix, combien, chhal, ch7al, taman, thaman, سعر, بشحال, price, how much. Add the misspellings you see in your inbox.

Keep each reply short and end with a question

Salam 👋 Le sérum vitamine C est à 189 DH. Livraison 35 DH partout au Maroc, paiement à la livraison. Vous êtes dans quelle ville ?

The question at the end moves the conversation forward. When the customer answers "Agadir", a delivery rule can reply with the delivery time for that city. For more ready-to-use wording, see these WhatsApp auto reply message examples.

Write a fallback that helps

Merci pour votre message. Tapez 1 pour les prix, 2 pour la livraison, 3 pour suivre une commande, ou écrivez "conseiller" pour parler à quelqu'un de l'équipe.

"Sorry, I did not understand" ends conversations. Choices keep them going.

Add AI replies for the questions keywords miss

Keywords cannot cover "can you deliver to my cousin in Oujda if I pay?". An AI reply can, if you keep it on a short leash:

  1. Write the instruction. Say who the assistant speaks for, what you sell, which languages to answer in, and what it must never do: promise dates you cannot keep, give medical advice, invent discounts.
  2. Give it approved knowledge only. Prices, delivery zones and times, return rules, product facts. If the answer is not in that knowledge, it should say it will pass the question to the team.
  3. Set a fixed reply for when AI is unavailable. For example: "Merci, un conseiller vous répond dans la journée."
  4. Limit replies per contact. A cap stops loops with other bots.
  5. Exclude numbers. Suppliers, couriers, family and your own staff should never get bot replies.

Order matters too. Keyword rules should run first, and AI only when no rule matches. That way your tested answers always win, and the customer never gets two replies to one message.

Hand off to a person at the right moment

Decide in advance which messages go straight to a human. Common triggers:

  • Words like "conseiller", "agent", "humain", "réclamation", "problème" or "مشكل".
  • Any message about a damaged, late or wrong order.
  • A third message in a row that the bot could not match.

When the handoff happens, tell the customer what to expect: "Une personne de l'équipe vous répond avant 18h." A shared team inbox means the message reaches whoever is on shift, not only the owner's phone. Our guide to WhatsApp customer service best practices covers response times and tone.

Use the bot to confirm cash on delivery orders

For cash on delivery shops, the biggest win is often confirming orders. Many refused parcels come from impulse orders or wrong addresses, and a short chat before shipping catches a good share of them.

Bonjour Youssef, merci pour votre commande : 1 sac cuir noir, 349 DH, livraison à Fès. Répondez OUI pour confirmer ou NON pour annuler.

A rule on "oui", "wah", "ok" and "نعم" can thank the customer and mark the order as confirmed. A rule on "non" or "annuler" can pass it to the team. The full method, with timing and more samples, is in WhatsApp order confirmation for cash on delivery.

Keep your number safe

A bot that only replies to people who wrote first carries far less risk than one that starts conversations. If your tool connects through the WhatsApp Web protocol, it is unofficial, and WhatsApp can restrict or ban numbers that send spam or messages people did not ask for. No tool can promise that a number will never be banned.

  • Let customers write first, or message only people who opted in. See how to grow a WhatsApp contact list with opt-in.
  • Set opt-out keywords such as STOP, "arrêter" and "وقف", and honour them at once.
  • Respect privacy law where your customers live: GDPR in the EU, UK GDPR, and law 09-08 in Morocco, overseen by the CNDP. Store only what you need.

Test, measure and improve every week

Before going live, test from a second phone: each keyword in each language, a typo, a voice note, a photo. Then run it for a week and read the log.

Track three numbers: first messages a rule answered, messages that hit the fallback, and chats sent to a person. If more than a quarter hit the fallback, read them and add keywords. Moving from about 40% matched in week one to 70% by week four is a realistic target.

IGNIPOST Chat runs this setup on a QR-connected number: keyword chatbot rules with all four match types, an AI Smart Reply that answers only from the knowledge you approve and runs after the rules, a live chat inbox for the team, and an activity log. Plans are on the pricing page.

Frequently asked questions

How long does it take to build a WhatsApp chatbot for business?

A first useful version takes an afternoon. Spend an hour reading your last 200 chats and listing the top questions, an hour writing keyword rules and replies in your customers' languages, and an hour testing from a second phone. After that, plan 20 minutes a week to read the fallback messages and add the keywords and answers that were missing.

Can a WhatsApp chatbot answer in Darija and Arabic?

Yes, if you build for it. Keyword rules need every common spelling: Darija in Latin letters, Darija with numbers like 3 and 7, Arabic script, plus French and English. An AI reply can answer in the customer's language if your instruction asks it to. Test each language from a second phone before going live, because a missed spelling sends customers straight to the fallback.

Will a chatbot get my WhatsApp number banned?

A bot that replies to people who wrote first is low risk, but no tool can guarantee a number will not be restricted. Unofficial tools use the WhatsApp Web protocol, and WhatsApp acts against spam and unwanted messages. Message only people who wrote to you or opted in, keep replies personal, honour opt-out keywords at once, and never send to bought lists.

When should the bot hand a conversation to a person?

Hand off on complaints, damaged or late orders, refund requests, wholesale enquiries, and after two or three messages the bot could not match. Also hand off whenever a customer asks for a person. Tell them when someone will answer, for example before 6 pm, and make sure the message lands in a shared inbox that the person on shift actually watches.

Share this guide

More in WhatsApp Automation, or browse all guides.

Answer every WhatsApp message, even at rush hour.

Connect your number in two minutes, set the replies you type ten times a day, and keep your team on the conversations that need a person.