AI and software solutions
AI

How to build a WhatsApp chatbot: the Business app, the API and AI

How to build a WhatsApp chatbot: automated messages in the Business app, the WhatsApp Business API, AI assistants and a step-by-step setup.

Muhammed Göktuğ Temiz · 8 min read
Contents (10)
  1. Three ways: automated messages, the Business API, AI
  2. Automated messages with the WhatsApp Business app
  3. What is the WhatsApp Business API and how do you get it?
  4. The 24-hour rule and template messages
  5. How does pricing work?
  6. When do you need an AI assistant?
  7. Step-by-step setup
  8. Personal data
  9. Where to start?
  10. Frequently asked questions

If your customers mostly contact you on WhatsApp, answering the same questions one by one all day takes up much of an employee's time: “How much is it?”, “Do you have availability tomorrow?”, “Where's my order?”. A WhatsApp chatbot is software that answers these questions for you and hands the conversation over to an employee when needed. How you build one depends on how smart you want it to be.

#Three ways: automated messages, the Business API, AI

OptionWhat it doesWho it's for
WhatsApp Business appGreeting and away messages, quick replies, product catalogue; doesn't hold a conversationBusinesses with few messages, working from a single phone
Business API + rule-based botWorks through menus and buttons; answers questions such as order status, appointments and prices from your systemsBusinesses that get many messages, with questions that fit set patterns
Business API + AI assistantUnderstands freely written questions, answers from your own information, hands over to a person when neededBusinesses with varied questions and a wide range of product or service information

#Automated messages with the WhatsApp Business app

The easiest place to start is the WhatsApp Business app on your phone. Under Settings → Business tools you'll find three features: a greeting message sent to customers who message you for the first time, an away message sent outside working hours, and quick replies, which let you send answers you type often with a shortcut. The app is free and setting it up takes minutes.

#What is the WhatsApp Business API and how do you get it?

The WhatsApp Business API (in Meta's terms, the WhatsApp Business Platform) is the official infrastructure in which messages are received and sent by software on a server instead of the app on a phone. Access is provided directly through Meta (Cloud API) or through Meta's partners. The general steps are:

  1. A Meta Business account is opened and a WhatsApp Business account is created.
  2. The phone number the bot will use is added. Plan from the start whether the number will be used in the app, on the API or on both; in some cases the number has to be moved to the API.
  3. The display name is approved; for higher messaging limits, business verification is completed.
  4. For cases where you send the first message, message templates are prepared and submitted to Meta for approval.
  5. A webhook URL is set up so that incoming messages reach your software; the bot runs at this address.

#The 24-hour rule and template messages

When a customer messages you, a 24-hour customer service window opens; within that time you can reply with any text you like. After the window closes, or if you are starting the conversation, only template messages approved by Meta can be sent. There are three types of template: marketing (campaigns, announcements), utility (order status, appointment reminders) and authentication (one-time codes).

#How does pricing work?

The cost of the API has three parts: Meta's messaging fees, the partner's service fee if you use one, and developing and hosting the bot. Meta charges for template messages by type and by the recipient's country; replies sent within the window to conversations started by the customer are not charged under the current pricing. Because the rates change from time to time, check Meta's current pricing page before setting up. You can think about the items that drive the cost of the software side using the same logic as in what determines website pricing: scope, integrations and maintenance.

#When do you need an AI assistant?

A rule-based bot works on a “press 1, press 2” basis; it gets stuck when the customer steps outside the menu. An AI assistant, on the other hand, understands freely written questions and finds the answer in your documents, your price list or your website. An assistant makes sense when:

  • Customers ask the same thing in different words and it doesn't fit into a menu.
  • Your product or service information is extensive, and the answers are already written down in a document or on your website.
  • You want replies outside working hours too, but want matters that need a decision left to an employee.

A good assistant doesn't make things up when it doesn't know; it says “I'm passing you to one of our team”. We explain how an assistant that works with your own data (RAG) is built, and the jobs it isn't suited to, in chatbots for small businesses.

#Step-by-step setup

  1. Collect the questions. From the last month or two of WhatsApp conversations, pick out the 15–20 most frequent questions and their correct answers.
  2. Map the flow. The greeting, the most common topics, a booking or ordering step and a “talk to a person” option.
  3. Prepare API access and the number. A Meta Business account, the number and, if needed, business verification.
  4. Connect the bot to your systems. Your booking calendar, order panel or customer records; the bot reads its answers from there.
  5. Test with real questions. Have a few people from your team write in as customers, and fix the places where the bot gets stuck.
  6. Launch and monitor. Read the questions the bot couldn't answer every week, and update the information and the flow accordingly.

#Personal data

WhatsApp conversations contain names, phone numbers and often information such as orders or health details. Customers should be given a privacy notice, it should be clear where and for how long conversations are stored, and if AI is used you should know which service the data is sent to. We cover this in detail in on-premises AI and data protection.

#Where to start?

If you get few messages, start today with the Business app's greeting and quick reply features. If you get dozens of messages a day and keep answering the same questions, a bot on the API or an AI assistant will give you your time back. We build web and WhatsApp assistants as part of our AI solutions; if you're thinking of a bot that books appointments, also see our booking and reservation systems page.

Thinking about an AI assistant for your business?

Let's work out which questions can be answered automatically and where the assistant should run.

The discovery call is free. Same-day reply on weekdays 09:00–18:00 (GMT+3), otherwise within 24 hours. · See the service

Frequently asked questions

Can I build a WhatsApp chatbot for free?

The greeting, away and quick reply features in the WhatsApp Business app are free, but they don't hold a conversation. A bot that understands questions and answers them needs the Business API; Meta charges for template messages, and there is also the cost of developing and hosting the bot.

How do I get the WhatsApp Business API?

You open a Meta Business account, add a WhatsApp Business account and a phone number, get the display name approved and, if needed, complete business verification. Access is provided directly through Meta's Cloud API or through a Meta partner.

What is the 24-hour rule on WhatsApp?

For 24 hours after a customer messages you, you can reply with any text you like. Outside that window, or if you are starting the conversation, only template messages approved by Meta can be sent.

Can I build a WhatsApp chatbot with tools like n8n?

Yes. Automation tools such as n8n can connect to the WhatsApp Cloud API and are quick for simple flows. As business rules get more complex, and when connections to your systems and security are needed, a custom service is easier to manage; in either case, maintenance is the responsibility of you or the team you work with.

Can the bot hand the conversation over to an employee?

Yes. A well-built bot passes the conversation to an employee on topics it doesn't know the answer to or that need a decision, and the earlier messages are shown to the employee.

  • whatsapp chatbot
  • how to build a whatsapp chatbot
  • create a whatsapp chatbot
  • whatsapp business api
  • whatsapp automated messages
  • whatsapp ai assistant
AuthorMuhammed Göktuğ Temiz

Founder, Averis Soft

About usLinkedInGitHub
Blog

AI and more articles

All articles

How to transcribe audio to text: 5 ways and when each one works

Ways to transcribe audio to text: typing it out by hand, voice typing and AI transcription. Free options, plus tips on accuracy and privacy.

How to write a meeting summary: a sample template and automatic summaries with AI

How to write a meeting summary: a sample template, what to include, summaries from Teams and Zoom recordings, and automatic meeting summaries with AI.

How to choose an AI development company: 10 questions to ask before getting a quote

How to choose an AI development company: live examples, data and privacy, model costs, pilot tests and 10 questions to ask before getting a quote.
Contact

Let's bring your next project to life.

Tell us briefly about your project or book a free online discovery call; we'll get back to you within 24 hours.

WhatsApp