# Integrating the Official WhatsApp Business Cloud API in Indonesia

> How I wire up message templates, webhooks, the 24-hour window, and per-message pricing with the official WhatsApp Cloud API for Indonesian apps.

URL: https://www.matthewswong.com/en/blog/whatsapp-business-api-integration-indonesia/

- Author: Matthews Wong (https://www.matthewswong.com/en/about/)
- Published: 2026-07-14
- Updated: 2026-10-17
- Category: Backend

> **Key takeaway:** For Indonesian customer notifications, use Meta's official WhatsApp Business Cloud API, not unofficial libraries. Register pre-approved message templates, reply free-form inside the 24-hour customer service window that opens when a customer messages you, receive inbound messages via webhooks, and budget for per-message template pricing that varies by category (marketing, utility, authentication), while non-template replies inside the window stay free.

In Indonesia, WhatsApp is not just a chat app — it is the default channel for everything from order confirmations to payment reminders. On a recent project for an Indonesian client, I needed the backend to fire reliable notifications the moment an order shipped or an invoice fell due. The temptation is always to grab a scraper library that automates WhatsApp Web. I strongly advise against it, and this article walks through the official path I took instead.

The official option is the WhatsApp Business Platform Cloud API, hosted by Meta. There is no server to run for WhatsApp itself — you call one HTTP endpoint, and Meta handles delivery, encryption, and account health. That single decision removes an entire class of production incidents that unofficial tools create.

## Why the official Cloud API beats unofficial libraries

Popular Node and Python libraries that drive WhatsApp Web through a headless browser look convenient because they are free and skip the approval process. But they are reverse-engineered clients, and WhatsApp's Terms of Service forbid reverse engineering the service or using it through automated means in unauthorized ways. They can break whenever WhatsApp updates its web client, and the same Terms let WhatsApp disable or suspend an account that violates them. For a business notification pipeline, a disabled number means silent, total outage. Here is how the two approaches compare.

| Aspect | Official Cloud API | Unofficial library |
| --- | --- | --- |
| Reliability | Meta-hosted, stable versioned endpoints | Reverse-engineered WhatsApp Web, breaks on updates |
| Account safety | Sanctioned by Meta; enforcement starts with warnings and appealable limits | Account can be disabled for breaking WhatsApp's Terms |
| Compliance | Template review and opt-in enforced | No guardrails, real legal exposure |
| Scale | Published tiers from 250 to unlimited recipients per 24 hours | Fragile single session, easily flagged |
| Support | Meta docs plus BSP support | Community only, no recourse when it breaks |

> If WhatsApp disables a number for breaking its Terms, your entire notification flow goes down with it, and you cannot simply register a replacement, because the Terms bar creating another account without permission. No amount of saved cost from an unofficial library is worth that operational risk on a production system.

## Message templates and getting them approved

Any message you send outside an open customer service window must use a pre-approved template. You create the template once through the Message Templates API or WhatsApp Manager, supplying an example value for each placeholder, and Meta reviews it; an approval decision can take up to 24 hours. Only an approved template can be sent. Templates support placeholder variables that you fill at send time, so one approved template covers thousands of personalised messages. Pick the right category — utility for transactional updates, marketing for promotions, authentication for one-time codes — because the category drives both approval rules and billing.

> Write templates in Bahasa Indonesia from the start, using the language code id. Meta does not translate template text, and each language version is a separate template that goes through review and counts against your template limit, so keep English and Indonesian in separate versions instead of mixing both in one body.

## The 24-hour customer service window

The moment a customer sends you a message, a 24-hour customer service window opens. While it is open you can reply with free-form messages — no template required — and each fresh customer message resets the timer to another 24 hours. Once the window closes, the only way to reach that customer again is a template message. This distinction is the heart of the platform: templates for business-initiated contact, free-form service messages for conversations the customer started.

- Window open: send text, images, buttons, or lists freely — ideal for a support or chatbot reply.
- Window closed: only an approved template message can re-engage the customer.
- Every inbound customer message resets the 24-hour timer, so an active chat stays free-form.

## Sending a template message from the backend

All outbound messages hit a single endpoint. You need your phone number ID from the Meta dashboard, a long-lived System User access token, and the recipient's number with the plus sign and country code — for Indonesia that means +62 with the leading zero dropped, so a number starting with 0812 becomes +62812. Meta highly recommends keeping the plus sign: without it, your business number's own country code is prepended, which can misdeliver the message. The body parameters fill the template's placeholders in order.

## Receiving inbound messages with webhooks

To react to customer replies — and to know that a service window just opened — you subscribe to webhooks. Meta first calls your endpoint with a GET request to verify it against a token you set, then delivers every inbound message and delivery-status update as a POST signed with an X-Hub-Signature-256 header, which you should check against your app secret. Respond with HTTP 200 quickly: on any other response Meta retries for up to 7 days, and retries can arrive as duplicates, so deduplicate by message ID. Do the heavy processing on a queue, not inline in the webhook handler.

## Template categories and per-message pricing

Since 1 July 2025, Meta has charged per message instead of per conversation: you pay each time a template message is delivered, and the rate depends on the template category and the recipient's country calling code. Non-template messages, which you can only send inside an open customer service window, are free, and utility templates delivered inside an open window are free too. Indonesia (+62) has its own rates on Meta's rate card, which is also published in rupiah, and higher monthly volumes unlock lower utility and authentication rates. If you reply within 24 hours to a customer who reached you through a Click to WhatsApp ad or a Facebook Page button on the mobile app, a 72-hour free entry point window opens in which every message is free. Check the current rate card before you budget, since Meta updates it periodically.

| Category | Typical use | Billed? |
| --- | --- | --- |
| Marketing | Promos, newsletters, cart reminders | Charged per delivered message |
| Utility | Order updates, receipts, invoice reminders | Free inside an open 24h window, otherwise charged |
| Authentication | OTP and login verification codes | Charged; businesses based outside Indonesia may pay the authentication-international rate |
| Service | Your replies to a customer inside the 24h window | Free |

> Design flows so transactional updates land while a window is open. If a customer just placed an order in-chat, sending the shipping update as a utility message inside that window costs nothing — real savings at Indonesian volumes.

## Opt-in rules and compliance

Meta requires opt-in before you message anyone. The customer must agree to receive messages from your business, and the request must clearly name your business. Since Meta's November 2024 policy update the opt-in no longer has to mention WhatsApp specifically, as long as it complies with local law, and in Indonesia that law includes UU PDP. A phone number tied to a named customer is personal data under it, processing it needs a lawful basis such as explicit consent (Article 20), consent must be written or recorded (Article 22), and you must be able to show proof of it (Article 24). Store the consent trail; you will want it if a customer disputes a message.

- Capture opt-in on a channel the customer already uses — your web checkout, app, or a physical form.
- State clearly that they are opting in to messages from your business and name the business; saying the messages will arrive on WhatsApp is no longer required by Meta, but it avoids surprises.
- Honour opt-outs immediately and keep a stop-list so you never message a number that unsubscribed.
- Keep quality high: blocks, reports and mutes lower your quality rating, and sustained low quality gets your sending rate-limited.

Put together, this is a pipeline I trust in production: approved templates for outbound alerts, a webhook that flips customers into a free service window, category-aware sending to control cost, and a consent record that keeps you compliant. It takes more setup than a scraper library, but it is the only version that survives contact with real Indonesian traffic.

## Sources

- Pricing on the WhatsApp Business Platform — Meta for Developers
- WhatsApp Cloud API Get Started — Meta for Developers
- Message template fundamentals — Meta for Developers

## Source links

- https://developers.facebook.com/documentation/business-messaging/whatsapp/pricing
- https://developers.facebook.com/documentation/business-messaging/whatsapp/get-started
- https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview

## FAQ

### Do I need a Business Solution Provider (BSP) to use the WhatsApp Cloud API?

No. The Cloud API is hosted by Meta, and a business integrating for itself can work directly through the Meta App Dashboard with a System User access token. A Business Solution Provider can take over onboarding, invoicing and support, but it is optional.

### Can I send a WhatsApp message to a customer who has not messaged me first?

Only with a pre-approved message template, and only if the customer has opted in to messages from your business. Free-form messages are allowed only inside the 24-hour customer service window that opens when the customer messages or calls you. Outside that window, a template is the only way to start contact.

### How much does the WhatsApp Business API cost for Indonesian numbers?

Since 1 July 2025 Meta charges per delivered template message, with rates set by template category and the recipient's country code; Indonesia has its own rates on Meta's rate card, which is also published in rupiah. Non-template messages inside an open customer service window are free, and so are utility templates delivered inside one. Marketing and authentication templates are charged, and higher monthly volumes unlock lower utility and authentication rates, so check the current rate card before budgeting.

### Why not just use a free WhatsApp library that automates WhatsApp Web?

Those libraries are reverse-engineered clients, and WhatsApp's Terms of Service forbid reverse engineering the service or using it through unauthorized automated means. The Terms let WhatsApp disable or suspend an account that breaks them, and you agree not to create another account without permission, so one enforcement action can take your whole notification flow offline. For a production system the official Cloud API is the reliable choice.

### Do I need to handle opt-in for WhatsApp notifications in Indonesia?

Yes. Meta requires opt-in that clearly names your business, and since its November 2024 policy update the opt-in may be general rather than WhatsApp-specific, as long as it complies with local law. Under Indonesia's UU PDP, consent must be written or recorded and you must be able to show proof of it, so record when and how each customer agreed and honour opt-outs immediately.

---

- HTML version: https://www.matthewswong.com/en/blog/whatsapp-business-api-integration-indonesia/
- Bahasa Indonesia: https://www.matthewswong.com/id/blog/whatsapp-business-api-integration-indonesia/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
