Skip to main content

WhatsApp Business API Integration Guide

This guide covers WhatsApp Business API setup via Gupshup for Juniro's transactional messaging needs.


Why Gupshup (Not Twilio)

FactorGupshupTwilio
CostLower (closer to Meta rates)Higher markup (+25-50%)
India supportExcellent (HQ in India)Good
US supportFull coverageFull coverage
India numbersEasy to acquireMay need extra docs
Meta partnershipPartner of the Year 2023 & 2024Standard partner
Scale120B+ messages/yearLarge scale

Bottom line: Same capabilities, lower cost, better India support.


When to Implement

StageWhatsApp Approach
Pre-launch (now)Manual WhatsApp from personal phone — free, personal, effective
Post-launchGupshup WhatsApp API — automated confirmations, reminders
At scale (1000+ bookings/mo)Essential for automation

Recommendation: Start the approval process 4-6 weeks before you need it. Verification can take 2-3 weeks.


Use Cases for Juniro

Phase 1: Post-Launch (Priority)

Use CaseTriggerMessage Type
Booking confirmationParent books classUtility
Class reminder24 hours before classUtility
Provider notificationNew booking receivedUtility
Cancellation noticeClass cancelledUtility

Phase 2: Growth

Use CaseTriggerMessage Type
Welcome messageNew signup (opted-in)Marketing
Review request24 hours after classUtility
Waitlist notificationSpot availableUtility
Payment reminderPayment due/failedUtility

Phase 3: Engagement

Use CaseTriggerMessage Type
New class alertProvider adds class in saved categoryMarketing
Referral programFriend signs upMarketing
Re-engagementInactive for 30 daysMarketing

Message Categories & Pricing

Meta charges based on message category and destination country.

Categories

CategoryDescriptionExample
UtilityTransactional, expected by userBooking confirmation, reminders
AuthenticationOTPs, verificationLogin codes
MarketingPromotional, optionalNew class alerts, offers

Pricing (via Gupshup, approximate)

DestinationUtilityMarketingAuthentication
India~$0.005~$0.012~$0.004
US~$0.015~$0.025~$0.014

Prices are Meta's rate + small Gupshup markup. Check Gupshup pricing for current rates.

Free Messages

Messages within a 24-hour customer service window (after user messages you first) are free.


Phone Number Strategy

Use separate numbers for each market so users see a familiar local number:

MarketNumberWhy
India+91 numberIndian users trust local numbers
US+1 numberUS users expect US numbers
Meta Business Verification (one time)

WhatsApp Business Account (WABA)

┌───────────────────────────────────┐
│ +91 XXXXX XXXXX (India users) │
│ +1 XXX XXX XXXX (US users) │
└───────────────────────────────────┘

Why Two Numbers?

FactorOne NumberTwo Numbers
User trustForeign number looks suspiciousLocal number feels familiar
Response ratesLowerHigher
Cost~$1-2/mo~$3-4/mo
Setup complexitySimplerSlightly more work
Meta approvalOneOne (same WABA)

How It Works

  • One Meta Business Verification — you don't need separate approvals
  • One WhatsApp Business Account (WABA) — both numbers under same account
  • Two phone numbers — each registered as WhatsApp sender
  • Same templates — approved once, work on both numbers

Routing Logic

function getWhatsAppNumber(userCountry) {
if (userCountry === 'IN') {
return process.env.TWILIO_WHATSAPP_NUMBER_INDIA; // +91...
}
return process.env.TWILIO_WHATSAPP_NUMBER_US; // +1...
}

Alternative: One Number (Simpler)

If you prefer simplicity, one US number works globally:

One WhatsApp Business Number (+1)

Message users in any country
├── India (+91) ✓
├── US (+1) ✓
└── Any country ✓

This works but Indian users may be less likely to engage with a foreign number.


Setup Process Overview

┌─────────────────────────────────────────────────────────────────┐
│ SETUP TIMELINE (4-6 weeks) │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Week 1 Week 2 Week 3 Week 4 │
│ ─────── ─────── ─────── ─────── │
│ Gupshup Meta Phone Templates │
│ Account Business Numbers Approved │
│ Setup Verification Verified Ready! │
│ (5-20 days) │
│ │
└─────────────────────────────────────────────────────────────────┘

Step-by-Step Setup

Step 1: Create Gupshup Account

  1. Go to gupshup.io
  2. Click "Start for Free" or "Sign Up"
  3. Create an account with business email
  4. Complete business profile
  5. Add payment method (pay-as-you-go)

Time: 15 minutes


Step 2: Create Meta Business Portfolio

  1. Go to business.facebook.com
  2. Create a Meta Business Portfolio (if you don't have one)
  3. Add business details:
    • Legal business name: Juniro (or your registered name)
    • Business address
    • Business website: juniro.com
    • Business email
  4. Get administrator access with full permissions

Time: 30 minutes


Step 3: Start Meta Business Verification

  1. In Meta Business Settings → Security Center
  2. Click Start Verification
  3. Provide required documents:
Document TypeExamples
Business registrationCertificate of incorporation, LLC filing
Tax documentEIN letter, GST registration (India)
Utility billRecent bill with business name & address
Bank statementStatement showing business name
  1. Submit and wait for review

Time: 5-20 business days (varies by region)

Tips for faster approval:

  • Ensure business name matches exactly across all documents
  • Use high-quality scans (not photos)
  • Business website should be live with matching info

Step 4: Register WhatsApp Sender (Gupshup)

  1. Go to Gupshup Dashboard → WhatsApp → Get Started
  2. Click Create WhatsApp Business Account
  3. Connect your Meta Business Portfolio
  4. Follow the setup flow:
    • Select your Meta Business Portfolio
    • Create or select WhatsApp Business Account (WABA)
    • Choose display name (appears to recipients)

Display Name Guidelines:

  • ✓ "Juniro"
  • ✓ "Juniro Kids Activities"
  • ✗ "Best Kids Activities" (too generic)
  • ✗ All caps "JUNIRO"

Time: 30 minutes (after Meta verification complete)


Step 5: Acquire and Verify Phone Numbers

Get Two Phone Numbers via Gupshup

NumberStepsCost
US (+1)Gupshup Dashboard → Numbers → Add US Number~$1-2/mo
India (+91)Gupshup Dashboard → Numbers → Add India Number~$1-2/mo

Requirements:

  • Numbers must be able to receive SMS/voice (for OTP verification)
  • India numbers are easier to acquire via Gupshup than other providers

Adding US Number:

  1. Gupshup Dashboard → Phone Numbers
  2. Select: United States
  3. Choose a number or use your own
  4. Verify via OTP

Adding India Number:

  1. Gupshup Dashboard → Phone Numbers
  2. Select: India
  3. Choose a number or use your own
  4. May require: Business PAN or GST (Gupshup makes this easier)

Alternative: Use Your Own Numbers

  1. Register existing numbers with Gupshup
  2. Verify ownership via SMS/voice OTP

Verification Process (for each number):

  1. In WhatsApp Sender setup, add phone number
  2. Meta sends OTP via SMS or voice call
  3. Enter OTP to verify ownership
  4. Number is now WhatsApp-enabled
  5. Repeat for second number

Time: 30 minutes (both numbers)


Step 6: Create Message Templates

Templates are required for outbound messages (business-initiated).

Submit via: Gupshup Dashboard → WhatsApp → Templates → Create Template

Template Structure:

Template Name: booking_confirmation
Category: Utility
Language: English

Header (optional): Booking Confirmed! ✅

Body:
Hi {{1}},

{{2}} is enrolled in {{3}}!

📅 {{4}}
⏰ {{5}}
📍 {{6}}

See you there!

Footer (optional): Reply HELP for assistance

Placeholders:

  • {{1}} = Parent name
  • {{2}} = Child name
  • {{3}} = Class name
  • {{4}} = Date
  • {{5}} = Time
  • {{6}} = Location

Approval Time: Usually minutes (automated review), up to 24 hours


Step 7: Test in Sandbox (Optional)

Before going live, test with Gupshup's Sandbox:

  1. Gupshup Dashboard → WhatsApp → Sandbox
  2. Connect your WhatsApp to the sandbox number
  3. Test sending/receiving messages
  4. No approval needed for sandbox testing

Message Templates for Juniro

Utility Templates (High Priority)

1. Booking Confirmation

Name: booking_confirmation
Category: Utility

Hi {{1}}! ✅

{{2}} is booked for {{3}}.

📅 {{4}}
⏰ {{5}}
📍 {{6}}

Questions? Reply to this message.

— Juniro

2. Class Reminder (24h)

Name: class_reminder_24h
Category: Utility

Hi {{1}}! 👋

Reminder: {{2}} has {{3}} tomorrow.

📅 {{4}}
⏰ {{5}}
📍 {{6}}

See you there!

— Juniro

3. Provider New Booking

Name: provider_new_booking
Category: Utility

New booking! 🎉

{{1}} enrolled {{2}} in your {{3}} class.

📅 {{4}}
⏰ {{5}}

View details in your Juniro dashboard.

4. Cancellation Notice

Name: class_cancelled
Category: Utility

Hi {{1}},

{{2}} on {{3}} has been cancelled.

Reason: {{4}}

You'll receive a full refund within 5-7 days.

Questions? Reply here.

— Juniro

Marketing Templates (Lower Priority)

5. Welcome Message

Name: welcome_parent
Category: Marketing

Hey {{1}}! 👋

Welcome to Juniro — your new way to find kids' activities.

🔍 Browse 100+ activities
📅 Book instantly
⭐ Read real parent reviews

Start exploring: juniro.com

Reply STOP to opt out.

Template Approval Tips

Do's

  • Be specific about what placeholders contain
  • Make it clear the user requested/expects this message
  • Include opt-out instructions for marketing messages
  • Use proper grammar and formatting

Don'ts

  • Don't start or end with a placeholder
  • Don't use generic placeholders like "Important: {{1}}"
  • Don't duplicate existing templates
  • Don't include promotional content in Utility templates

Common Rejection Reasons

ReasonFix
Placeholder at start/endMove placeholder to middle of sentence
Too genericAdd specific context about the message purpose
Policy violationRemove prohibited content (gambling, adult, etc.)
Wrong categoryMarketing content in Utility → recategorize
DuplicateCheck existing templates, modify if similar

Opt-in Requirements

WhatsApp requires explicit user consent before sending messages.

Where to Collect Opt-in

TouchpointImplementation
Signup formCheckbox: "Send booking updates via WhatsApp"
Booking flow"Get class reminders on WhatsApp?"
Account settingsWhatsApp notification preferences
Post-booking"Want WhatsApp reminders for future classes?"

Opt-in Language Example

☑️ Send me booking confirmations and class reminders via WhatsApp

By checking this box, you agree to receive transactional messages
from Juniro on WhatsApp. You can opt out anytime by replying STOP.

Track in your database:

user: {
phone: "+919876543210",
whatsappOptIn: true,
whatsappOptInDate: "2025-02-14",
whatsappOptInSource: "booking_flow"
}

Technical Integration

Sending a Message (Node.js)

// Gupshup WhatsApp API
const GUPSHUP_API_URL = 'https://api.gupshup.io/wa/api/v1/template/msg';

// Get the right WhatsApp number based on user's country
function getWhatsAppFromNumber(userPhone) {
if (userPhone.startsWith('+91')) {
return process.env.GUPSHUP_WHATSAPP_NUMBER_INDIA;
}
return process.env.GUPSHUP_WHATSAPP_NUMBER_US;
}

// Send template message via Gupshup
async function sendBookingConfirmation(to, data) {
const fromNumber = getWhatsAppFromNumber(to);

const response = await fetch(GUPSHUP_API_URL, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'apikey': process.env.GUPSHUP_API_KEY,
},
body: new URLSearchParams({
source: fromNumber,
destination: to.replace('+', ''), // Gupshup expects without +
template: JSON.stringify({
id: 'booking_confirmation', // Your template ID
params: [
data.parentName,
data.childName,
data.className,
data.date,
data.time,
data.location,
],
}),
}),
});

const result = await response.json();
return result.messageId;
}

// Example: India user sees message from +91 number
sendBookingConfirmation('+919876543210', {
parentName: 'Priya',
childName: 'Aarav',
className: 'Swimming Basics',
date: 'Saturday, Feb 15',
time: '10:00 AM',
location: 'AquaKids, Jubilee Hills',
});

// Example: US user sees message from +1 number
sendBookingConfirmation('+14045551234', {
parentName: 'Sarah',
childName: 'Emma',
className: 'Soccer Camp',
date: 'Saturday, Feb 15',
time: '9:00 AM',
location: 'Piedmont Park, Atlanta',
});

Webhook for Incoming Messages

// pages/api/webhooks/gupshup-whatsapp.ts
import { NextRequest, NextResponse } from 'next/server';

export async function POST(request: NextRequest) {
const body = await request.json();

// Gupshup webhook payload structure
const { type, payload } = body;

if (type === 'message') {
const { source, payload: messagePayload } = payload;
const from = source; // 919876543210
const message = messagePayload?.text; // User's message

console.log(`WhatsApp from +${from}: ${message}`);

// Handle STOP/HELP keywords
if (message?.toUpperCase() === 'STOP') {
await updateWhatsAppOptOut(`+${from}`);
}
}

// Acknowledge receipt
return NextResponse.json({ status: 'ok' });
}

Environment Variables

# .env.local
GUPSHUP_API_KEY=your-gupshup-api-key
GUPSHUP_APP_NAME=juniro

# WhatsApp Numbers (two numbers for local experience)
GUPSHUP_WHATSAPP_NUMBER_US=14155238886
GUPSHUP_WHATSAPP_NUMBER_INDIA=919876543210

Cost Estimation

Scenario: 500 bookings/month

Message TypeCountRate (India)Cost
Booking confirmation500$0.004$2.00
24h reminder500$0.004$2.00
Provider notification500$0.004$2.00
Total1,500~$6/month

Scenario: 2,000 bookings/month

Message TypeCountRate (mixed)Cost
Booking confirmation2,000$0.008 avg$16.00
24h reminder2,000$0.008 avg$16.00
Provider notification2,000$0.008 avg$16.00
Review request1,000$0.008 avg$8.00
Total7,000~$56/month

Plus Gupshup phone numbers: ~$2-4/month for both


Checklist: WhatsApp Setup

Prerequisites

  • Gupshup account created
  • Payment method added to Gupshup
  • Meta Business Portfolio created
  • Administrator access to Meta Business Portfolio

Meta Verification (5-20 days)

  • Business registration document uploaded
  • Tax document uploaded
  • Verification submitted
  • Verification approved ✓

Gupshup Setup

  • WhatsApp Business Account created in Gupshup
  • US phone number (+1) added
  • India phone number (+91) added
  • US number verified with OTP
  • India number verified with OTP
  • Display name approved

Templates

  • booking_confirmation template submitted
  • class_reminder_24h template submitted
  • provider_new_booking template submitted
  • All templates approved ✓

Integration

  • Gupshup API integration complete
  • Environment variables configured
  • Test message sent successfully
  • Webhook endpoint for incoming messages

Compliance

  • Opt-in checkbox added to signup/booking flow
  • Opt-in consent stored in database
  • STOP/HELP keyword handling implemented

Troubleshooting

IssueCauseSolution
Template rejectedPlaceholder at start/endRestructure message
Template rejectedWrong categoryRecategorize (Utility vs Marketing)
Verification delayedDocument mismatchEnsure exact name match
Message not deliveredUser not on WhatsAppFallback to SMS
Rate limitedToo many messagesImplement queuing

Resources


Summary

ItemDetails
ProviderGupshup (Meta Partner of the Year)
When to start4-6 weeks before needed
Total setup time2-4 weeks (mostly waiting for verification)
Cost to startPay-as-you-go + ~$2-4/mo for 2 numbers
Ongoing cost~$0.005-0.025 per message
Numbers needed2 (US +1 and India +91 for local trust)
Meta approvals1 (covers both numbers)
Priority use casesBooking confirmations, reminders