How to integrate the WhatsApp Business API, step by step

Set up the WhatsApp Cloud API: accounts, number, templates, webhooks and opt-in, plus how Meta's per-message pricing works as of October 2026.

By Sohail Hussain21 November 20266 min read

To integrate the WhatsApp Business API, you set up a Meta business portfolio and WhatsApp account, register a phone number on Meta's Cloud API, get your message templates approved, connect a webhook to receive replies and delivery updates, and build your sending logic around the 24-hour customer service window. You can do this directly with Meta or through a Business Solution Provider. The Cloud API, hosted by Meta, is now the only route: Meta's On-Premises API sunset notice set October 23, 2025 as the date it stopped sending messages.

WhatsApp integrations are a regular part of our APIs and integrations work, mostly order updates, appointment reminders and enquiries routed into a CRM. Everything below reflects Meta's developer documentation as of October 2026, which changed significantly on October 1, 2026.

Do you need the API, or is the WhatsApp Business app enough?

The free WhatsApp Business app runs on a phone and a few linked devices. It handles one-to-one chats, quick replies, labels and a catalogue. For a small team replying by hand, it is enough, and an API project would be money spent on nothing.

You need the API when messages must be sent automatically from your systems (order shipped, appointment tomorrow, payment received), when several agents share one number through a proper inbox, when chats need to land in your CRM, or when a chatbot or AI agent answers first. Our guide to WhatsApp AI chatbots covers that last case.

You do not always have to choose. Meta supports coexistence: a business onboarded through a solution partner can keep using the app on the same number while also sending through the Cloud API. The trade-offs are a fixed throughput of 20 messages per second, no group chat sync and broadcast lists switched off.

How does WhatsApp pricing work as of October 2026?

Meta has charged per delivered message since July 1, 2025. The rate depends on the message category and the recipient's country, and Meta publishes a rate card per market, with India priced as its own market. The table below reflects Meta's WhatsApp pricing page as of October 2026.

Message typeWhen you use itCharged?
Marketing templateOffers, announcements, re-engagementYes, every delivered message
Utility templateOrder, delivery, account and appointment updatesYes. Inside an open service window they were free from July 1, 2025 to September 30, 2026, and are charged from October 1, 2026
Authentication templateOne-time passcodesYes
Service messageFree-form replies while the customer service window is openFrom October 1, 2026, the first 1,000 a month per business phone number are free; after that, charged at published rates
Any message in a free entry point windowAfter a user contacts you from a click-to-WhatsApp ad, for up to 7 daysFree, including utility templates; only Meta Business Agent messages are charged

Two changes on October 1, 2026 matter for budgets. Service replies were previously free without limit; now only the first 1,000 a month per business phone number are, and unused free messages do not roll over. And utility templates sent inside an open service window, free from July 1, 2025 to September 30, 2026, are now charged. Eligible government and non-profit organisations keep free service messages beyond the 1,000 through December 31, 2027. Utility and authentication messages get lower rates as monthly volume rises, through volume tiers that reset each month. If you go through a Business Solution Provider, expect their fee on top.

Step 1: Set up the business portfolio, WhatsApp account and phone number

You need a Meta business portfolio, a WhatsApp account inside it, a developer app, and a phone number. Verify the business early. It is one of the ways to raise your messaging limit, and it takes time.

Decide on the route. Going direct means a developer connects your systems to Meta's Cloud API and you pay Meta. Going through a Business Solution Provider gives you their inbox and template tools, for a fee.

The phone number can be real or virtual, but it must receive a verification SMS or call. A number already active on personal WhatsApp has to be moved off it first; one on the Business app can use coexistence. The display name customers see must relate to your business and is reviewed by Meta. For production, generate a long-lived system user token rather than the temporary token shown in the developer dashboard.

Step 2: Write and submit your message templates

Any message your business starts, and any message sent after the 24-hour window has closed, must use a pre-approved template. Each template has a category (marketing, utility or authentication), a language, a body with variables, and optional header, footer and buttons. Review is automatic and, per Meta's template documentation, can take up to 24 hours.

Keep utility templates strictly transactional. "Your order A-1023 has shipped" is utility; adding "and here is 10 percent off your next order" makes it marketing, at a higher price. Templates that collect poor feedback can be paused or disabled, so write them for the recipient, not the campaign.

Sending an approved template through the Cloud API looks like this, with the placeholders replaced by your values:

bash
curl -X POST "https://graph.facebook.com/<API_VERSION>/<PHONE_NUMBER_ID>/messages" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{
    "messaging_product": "whatsapp",
    "recipient_type": "individual",
    "to": "919876543210",
    "type": "template",
    "template": {
      "name": "order_shipped",
      "language": { "code": "en" },
      "components": [
        {
          "type": "body",
          "parameters": [
            { "type": "text", "text": "A-1023" },
            { "type": "text", "text": "https://example.com/track/A-1023" }
          ]
        }
      ]
    }
  }'

Step 3: Connect a webhook for replies and delivery updates

Sending is half the integration. Everything that comes back arrives through a webhook: incoming messages and button replies, delivery statuses (sent, delivered, read, failed) and template status changes. You expose an HTTPS endpoint, Meta verifies it with a one-time challenge request, and you subscribe to message events.

Reply with a 200 quickly and process the event in the background. Store message IDs so a repeated delivery does not trigger a second action. Check the signature header Meta sends before trusting a payload. Webhooks explained covers the general pattern, and our webhook payload formatter includes WhatsApp samples, so you can see the structure before writing a parser.

Step 4: Build your sending logic around the 24-hour window

When a customer messages or calls you, a customer service window opens for 24 hours, and each new message from them resets it. While it is open, you can send any message type: text, images, documents, buttons, lists, locations. Once it closes, only templates are allowed. Meta's guide to sending messages lists the types.

So your system must record when each contact last wrote in, and pick between a free-form reply and a template accordingly. This bites in human handover: an agent who picks up a conversation on Monday morning from a Friday evening enquiry has to reopen it with a template. Build that into the inbox from the start, not after the first complaint.

Step 5: Collect opt-in, then scale up gradually

Meta requires opt-in before you message anyone. It must say clearly that the person is agreeing to WhatsApp messages, and from which business. A checkbox on your website checkout or enquiry form works, and so do SMS, a phone menu or paper forms. Honour opt-outs promptly.

New business portfolios can send templates to 250 unique people outside the service window in a rolling 24 hours. Business verification, or sending 2,000 high-quality template messages to unique people within 30 days, qualifies you for 2,000, after a quality review by Meta. Above that, Meta raises the limit automatically, through 10,000 and 100,000 to unlimited, when quality stays high and you have used at least half your limit over the past seven days. The rules are in Meta's messaging limits page. Throughput is 80 messages per second per number by default, which only matters for large sends.

The integration usually pays off fastest on transactional messages, so it is worth listing every update your team sends by hand today. For store owners, WhatsApp order notifications walks through that case, and the bigger question of which systems to connect at all starts with custom software vs off-the-shelf.

Was this guide useful?

Questions

Frequently asked.

Can we keep our existing WhatsApp number?

Usually. If the number runs on the WhatsApp Business app, Meta's coexistence onboarding through a solution partner lets you keep using the app for one-to-one chats while adding the API. Coexistence has limits: a fixed throughput of 20 messages per second, no group chat sync and broadcast lists switched off. Otherwise, use any number that can receive a verification code.

Do we need a Business Solution Provider?

No. You can use the Cloud API directly through a Meta developer app and pay Meta per message. A Business Solution Provider adds a ready-made shared inbox, template tools and support, usually for a monthly fee or a markup per message. Going direct suits integrations into your own systems; a provider suits teams that mainly want an inbox.

Can we send bulk marketing messages?

Only as approved marketing templates, to people who opted in, within your messaging limit, and each delivered message is charged. Recipients can block or report you, which lowers your quality rating and can get templates paused. Treat it like email marketing to a permission list, not a broadcast to cold numbers.

Sohail Hussain

Founder, MSH Technologies

Sohail has designed and built websites, web apps and AI products for over 12 years, for clients from Singapore-based industrial groups to early-stage SaaS startups. He writes about what actually worked.

Keep reading

Related guides.

All posts

Your next move

Like what you see? Tell us about it.

A process that takes too long, a website that undersells you, or an idea ready to take shape. Tell us where you are and we will suggest a useful next step.

India · Working with clients worldwide

Sohail, Founder, replies within 1 working day (Mon–Sat, IST). Free and no obligation.