Enbbox Docs

WhatsApp Business

Learn how to use the WhatsApp Business Cloud API to send notifications through Enbbox

Overview

WhatsApp Business enables businesses to send notifications, alerts, and transactional messages to customers through WhatsApp. Enbbox integrates with the Meta Cloud API for WhatsApp Business.

[!IMPORTANT] WhatsApp Business requires a Meta Business account, a verified phone number, and approval for message templates before you can send notifications. Setup takes 15-30 minutes.

Prerequisites

Step 1: Create a Meta App

  1. Go to developers.facebook.com/apps
  2. Click Create App → choose Business type
  3. Enter an app name (e.g., "Enbbox Notifications")
  4. Select your Meta Business account
  5. Click Create App

Step 2: Set Up WhatsApp

  1. In your new app's dashboard, find WhatsApp in the product list and click Set Up
  2. Select your Meta Business account when prompted
  3. You'll be given a test phone number and a temporary access token

Step 3: Register Your Business Phone Number

  1. Navigate to WhatsAppAPI Setup in the app dashboard
  2. Click Add phone number
  3. Enter your business phone number
  4. Verify via SMS or voice call
  5. Set a display name for your business profile

[!WARNING] The phone number you register cannot have an existing WhatsApp account. If it does, you must delete that account first.

Step 4: Generate a Permanent Access Token

The temporary token expires in 24 hours. For production:

  1. Go to Business SettingsSystem Users
  2. Create a new system user with Admin role
  3. Click Generate Token → select your WhatsApp app
  4. Grant the whatsapp_business_messaging and whatsapp_business_management permissions
  5. Copy the permanent access token

Step 5: Create Message Templates

WhatsApp requires pre-approved templates for outbound (business-initiated) messages:

  1. Navigate to WhatsAppMessage Templates
  2. Click Create Template
  3. Choose a category: Marketing, Utility, or Authentication
  4. Write your template with optional variables: Hello {{1}}, your order {{2}} has shipped!
  5. Submit for review — approval usually takes minutes to a few hours

Step 6: Connect to Enbbox

  1. Navigate to Integrations in the Enbbox dashboard
  2. Click Add Provider → select ChatWhatsApp Business
  3. Enter your:
    • Access Token (permanent token from Step 4)
    • Phone Number ID (found in WhatsApp → API Setup)
    • Business Account ID (found in Business Settings)
  4. Click Test Connection to verify
  5. Activate the integration

Step 7: Subscriber Phone Number

Enbbox automatically uses the subscriber's phone field for WhatsApp delivery — no extra credentials needed in most cases:

import { SubscribersApi, Configuration } from "@enbbox/api";

const config = new Configuration({ accessToken: "your-api-key" });
const subscribersApi = new SubscribersApi(config);

// Just set the phone when creating or updating the subscriber
await subscribersApi.createSubscriber({
  subscriberId: "subscriber-123",
  phone: "+1234567890", // E.164 format — used for WhatsApp and SMS
});

[!TIP] If a subscriber's WhatsApp number differs from their primary phone, you can override it with provider-specific credentials:

import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);

await credentialsApi.setCredentials("subscriber-123", "whatsapp-business", {
  credentials: { phone_number: "+0987654321" },
});

Priority: credentials.phone_numbersubscriber.phone

Messaging Rules

Message TypeRequirementWindow
Business-initiatedMust use an approved templateAnytime
User-initiated replyFree-form text allowed24-hour window
AuthenticationOTP templates with one-tap buttonAnytime

[!NOTE] WhatsApp charges per conversation, not per message. Pricing varies by country. Check Meta's pricing page for details.

Troubleshooting

IssueSolution
Template not approvedReview Meta's template guidelines
Token expiredGenerate a permanent token via System Users (Step 4)
Number not verifiedComplete phone verification via SMS or voice call
Message not deliveredEnsure recipient has WhatsApp installed and number is in E.164 format
Rate limitedWhatsApp has throughput limits based on quality rating

On this page