Skip to main content

How to Connect WhatsApp Bot

Dan. A avatar
Written by Dan. A
Updated over 3 weeks ago

Overview

The WhatsApp Bot integration allows you to send automated messages to your customers through WhatsApp, leveraging the world's most popular messaging platform for customer engagement. Once connected, you can send promotional messages, notifications, and updates directly to your customers' WhatsApp accounts.

What you can do with WhatsApp Bot:

  • Send automated promotional campaigns

  • Deliver transaction notifications and receipts

  • Share special offers and announcements

  • Communicate updates about loyalty programs

  • Reach customers on their preferred messaging platform

  • Increase message open rates compared to email

Important limitation: WhatsApp Bot integration is only available for loyalty cards.

Time to complete: 30-45 minutes for first-time setup


Before You Begin

Required Accounts and Access

You'll need:

  • Facebook Business account (create one at business.facebook.com if you don't have one)

  • Admin access to your Facebook Business Manager

  • Perkstar account with access to mailing settings

  • Phone number to use as your WhatsApp sender (must support WhatsApp Business)

Information You'll Need to Save

During this process, you'll generate several pieces of information. Have a document ready to record:

  • Phone number ID

  • WhatsApp Business Account ID

  • Permanent access token

  • App ID (Facebook app)

Technical Requirements

  • Stable internet connection

  • Access to Facebook Developers portal

  • Permission to create apps in your Facebook Business account

  • Ability to receive test messages on WhatsApp


Part 1: Create Facebook App

Step 1: Access Facebook Developers

  1. Log in with your Facebook Business account credentials

  2. Navigate to My Apps in the top menu

  3. Click Create App

Step 2: Select App Type

  1. Choose Other as your app type

  2. Click Next

  3. On the next screen, select Business

  4. Click Next

Step 3: Configure App Details

  1. App Name: Enter a descriptive name (e.g., "YourBusiness WhatsApp Bot")

  2. App Contact Email: Enter your business email

  3. Business Manager: Select your existing Business Manager or create a new one

  4. Click Create App

You'll be taken to your new app's dashboard.


Part 2: Set Up WhatsApp API

Step 4: Add WhatsApp Product

  1. In your app dashboard, scroll down to find WhatsApp in the products list

  2. Click Set up next to WhatsApp

  3. Select your Business Profile from the dropdown

  4. Click Start Using the API

Step 5: Configure Phone Number

  1. You'll see a section to Add a phone number

  2. Enter the phone number you want to use for sending WhatsApp messages

  3. Follow the verification process to confirm the number

Important: This phone number will appear as the sender for all WhatsApp messages to your customers.

Step 6: Test Message Sending (Optional)

  1. In the API setup page, you'll see a Send Test Message section

  2. Enter a test phone number (your own WhatsApp number)

  3. Click Send Message to verify the connection works

  4. Check your WhatsApp to confirm message received

Step 7: Save Critical Information

On this page, you'll see three important pieces of information. Copy and save these now:

  • Phone Number ID: (found under your added phone number)

  • WhatsApp Business Account ID: (displayed in the account section)

  • App ID: (found in the top-left of the page)

You'll need these later to connect to Perkstar.


Part 3: Configure Webhooks

Webhooks allow Perkstar to receive delivery status and responses from WhatsApp.

Step 8: Set Up Callback URL

  1. On the WhatsApp API page, find the Webhooks section

  2. Click Callback URL - Edit

  3. Enter the following information exactly:

    • Callback URL: https://mailing.digitalwallet.cards/whatsapp/webhook/inbound

    • Verify Token: whatsapp_bot_webhook_verify_token

  4. Click Verify and Save

Important: These values must be entered exactly as shown. Any variation will prevent the webhook from working.

Step 9: Enable Message Webhooks

  1. Click Webhooks - Manage

  2. In the list of webhook fields, find Messages

  3. Enable the Messages toggle

  4. Click Done

This allows Perkstar to receive message delivery updates and customer replies.


Part 4: Generate Permanent Access Token

The permanent access token allows Perkstar to send messages through your WhatsApp account without the token expiring.

Step 10: Access Business Manager Settings

  1. Select the Business Manager you specified in your app settings earlier

  2. In the left menu, navigate to Users → System Users

Step 11: Create System User

  1. Click Add to create a new system user

  2. Name: Enter a descriptive name (e.g., "Perkstar WhatsApp Integration")

  3. Role: Select Admin

  4. Click Create System User

Step 12: Generate Token

  1. Find your newly created system user in the list

  2. Click Generate New Token

  3. Configure token settings:

    • App: Select the WhatsApp app you created earlier

    • Token Expiration: Select Never (critical—token must not expire)

  4. Enable the following permissions by checking each box:

    • business_management

    • catalog_management

    • whatsapp_business_management

    • whatsapp_business_messaging

  5. Click Generate Token

  6. Immediately copy and save the token—you won't be able to see it again

Security note: Treat this token like a password. Never share it publicly or commit it to code repositories.

Step 13: Assign App Permissions

  1. While still viewing your system user, click Assign Assets

  2. Select the Apps tab

  3. Find your WhatsApp app in the list

  4. Enable Manage App permission

  5. Click Save Changes


Part 5: Enable Live Mode and Connect to Perkstar

Step 14: Enable Live Mode

  1. Return to your app dashboard at https://developers.facebook.com

  2. Navigate to your WhatsApp app

  3. Find the Live Mode toggle in the top-right corner

  4. Switch it to ON

Your app is now ready to send real messages (not just test messages).

Step 15: Connect WhatsApp Bot in Perkstar

  1. Log in to your Perkstar account

  2. Go to Mailings → Settings

  3. Click Connect WhatsApp Bot

  4. Enter the information you saved during setup:

    • Access Token: The permanent token from Step 12

    • Sender's Phone Number: The phone number you configured in Step 5

    • Phone Number ID: From Step 7

    • WhatsApp Business Account ID: From Step 7

  5. Click Connect or Save

  6. Test the connection: Send a test message to verify everything works correctly

Success! Your WhatsApp Bot is now connected and ready to send messages to your customers.


Best Practices

Security and Maintenance

Token management:

  • Store your access token securely (password manager or secure documentation)

  • Never share tokens in emails, chat messages, or public spaces

  • If you suspect a token is compromised, generate a new one immediately

  • Document who has access to tokens in your organization

Regular monitoring:

  • Check webhook delivery status periodically

  • Monitor message delivery rates

  • Watch for Facebook/Meta platform updates that may affect API access

Compliance and Messaging

WhatsApp Business Policy compliance:

  • Only message customers who have opted in to receive communications

  • Provide clear opt-out instructions in your messages

  • Respect customer preferences and unsubscribe requests

  • Follow WhatsApp's messaging guidelines and rate limits

Message quality:

  • Keep messages concise and valuable

  • Personalize content when possible

  • Include clear calls-to-action

  • Test message formatting before sending to all customers

Operational Considerations

Phone number selection:

  • Use a dedicated business phone number (not personal)

  • Ensure the number can receive messages for two-way communication

  • Consider using a number with your local area code for better trust

Business Profile setup:

  • Complete your WhatsApp Business Profile with accurate information

  • Add your business logo and description

  • Include business hours and location if applicable


Troubleshooting

"Webhook verification failed"

  • Check: Did you enter the Callback URL and Verify Token exactly as specified?

  • Solution: Re-enter the values, ensuring no extra spaces or characters

  • Callback URL: https://mailing.digitalwallet.cards/whatsapp/webhook/inbound

  • Verify Token: whatsapp_bot_webhook_verify_token

"Token is invalid or expired"

  • Check: Did you set token expiration to "Never"?

  • Check: Did you copy the entire token without truncating it?

  • Solution: Generate a new token with "Never" expiration and ensure complete copy/paste

"Cannot find app in system user assets"

  • Check: Did you assign the app to your system user in Step 13?

  • Solution: Go back to Business Manager → System Users → Assign Assets → Apps → Enable "Manage App"

"Phone number verification failed"

  • Check: Is the phone number already connected to another WhatsApp Business account?

  • Check: Can the number receive SMS or voice calls for verification?

  • Solution: Use a different number or disconnect from previous WhatsApp Business account

"Messages not sending from Perkstar"

  • Check: Is Live Mode enabled on your Facebook app?

  • Check: Are all four credentials entered correctly in Perkstar?

  • Check: Did you enable the Messages webhook field?

  • Solution: Verify each piece of information and re-save in Perkstar

"Permission denied" errors

  • Check: Did you select all four required permissions when generating the token?

  • Solution: Generate a new token with all permissions enabled

Cannot connect WhatsApp Bot in Perkstar

  • Check: Are you using a loyalty card account (not a sub-account)?

  • Limitation: WhatsApp Bot is only available for loyalty cards

  • Solution: If you need WhatsApp messaging for sub-accounts, contact Perkstar support for alternatives


Frequently Asked Questions

How long does the setup process take? First-time setup typically takes 30-45 minutes. Subsequent setups (if you need to reconfigure) are faster once you're familiar with the process.

Can I use my personal WhatsApp number? It's not recommended. Use a dedicated business phone number that can be associated with WhatsApp Business API. Personal numbers may not work correctly.

Does the token ever expire? Only if you set an expiration date. If you selected "Never" during token generation, it will remain valid indefinitely unless you manually revoke it.

Can I connect multiple WhatsApp numbers? You would need to create separate Facebook apps for each phone number and connect them individually to different Perkstar accounts.

What happens if I change my phone number later? You'll need to update the phone number in Facebook Developers, verify it, and then update the sender's phone number in Perkstar settings.

How many messages can I send per day? This depends on your WhatsApp Business API tier, which is determined by Facebook/Meta based on your sending patterns and compliance. Start with smaller volumes and scale up.

Can customers reply to my WhatsApp messages? Yes, if you've enabled two-way messaging. However, you'll need to configure how replies are handled in your Perkstar account.

What if my Facebook Business account gets disabled? Your WhatsApp Bot will stop working. Resolve any Facebook Business account issues immediately and ensure compliance with all platform policies.

Do I need a WhatsApp Business app on my phone? No, the API operates independently. However, having the WhatsApp Business app can be helpful for understanding the customer experience.

Can I test before sending to real customers? Yes, use the test message feature in Step 6, and send test campaigns to your own number before launching to customers.

What's the difference between this and the WhatsApp Business app? The WhatsApp Business app is for manual, small-scale messaging. The API (what you're setting up) allows automated, large-scale messaging from your Perkstar platform.


Additional Resources

Official documentation:

Need help? If you encounter issues not covered in this guide:

  1. Verify each step was completed exactly as described

  2. Check Facebook Developer status page for platform issues

  3. Contact Perkstar support with:

    • Screenshots of any error messages

    • Confirmation of which step you're stuck on

    • Your app ID (but never share your access token)


Pro tip: Take screenshots at each step during your first setup. This creates a visual reference guide specific to your account, making future troubleshooting or reconfiguration much easier.

Did this answer your question?