The website send a message notification to the WhatsApp of owners personal number when a new order is placed. To make this workflow functional , You have to get a token from Facebook and setup the WhatsApp configurations. This is the most tedious ****part of the process as it might have some confusions but this the one time process to get a WhatsApp token to connect your website with WhatsApp Business API. Before Getting started we need to understand a few things
- WhatsApp token
- This is a permanent secret token obtained from facebook’s business profile at Users > System Users > Generate Token dashboard after completing some steps on Facebook business profile
- WhatsApp Test Number or Sender Number
- This is a WhatsApp number that sends the message to other users. This number acts as a bot. You can add your own custom phone but this number has not to be on the WhatsApp. In our case only the owner will receive the messages from this bot so we can proceed with the WhatsApp Test number provided on the Facebook Dashboard.
- Recipient Number
- This can be the personal number of the owner who can grant the permission to the Test Number or Sender Number to receive messages. In this case the Test Number will only send the messages to the owner so we can set our personal Whatsapp number in this configuration.
- Message Template
- WhatsApp API or Bot need a message template to send message to Recipient Number. We will define this template in facebook developer’s dashboard
- Facebook Business Profile
- Facebook needs a an approved Business profile so they provide you a permanent WhatsApp token on behalf of this business profile for using WhatsApp Business API
- Facebook Developer App
- This is the central dashboard where the user can perform the following actions
- Create an App to access Facebook API’s including WhatsApp Business
- Create WhatsApp Manager
- Create Test Number
- Create WhatsApp Templates
- Add Recipient Number
Step 1 - Create a Facebook Business Profile
Follow This guide to create a Facebook Business Account https://www.facebook.com/business/help/1710077379203657?id=180505742745347
The business profile should be approved by facebook in order to proceed the below steps.
<aside>
💡 While filing the business details, enter the website address of your current website that you have deployed or use any other website if you already have for your business. The website should be accessible in order to get your business profile approved
</aside>
Go to Step 2 and create Facebook Developer App first and then come back to this guide as Developer App might be asked while creating the token
How to create a system user
This step is to create system user with Admin access and generate a token. The token generated here will be used in cloudflare environment variable to receive messages on WhatsApp