This document describes the steps Solution Partners must perform to onboard new business customers who have completed the Embedded Signup flow.
If you are a Solution Partner, any business customer who completes your implementation of the Embedded Signup flow will not be able to use your app to access their WhatsApp assets or send and receive messages until you complete these steps.
Also, if you wish to test messaging capabilities using the customer's business phone number, you will need a WhatsApp phone number that can already send and receive messages from other WhatsApp numbers.
Perform all of the requests described below using server-to-server requests. Do not use client-side requests.
Use the GET /oauth/access_token endpoint to exchange the token code returned by Embedded Signup for a business integration system user access token ("business token").
curl --get 'https://graph.facebook.com/v21.0/oauth/access_token' \ -d 'client_id=<APP_ID>' \ -d 'client_secret=<APP_SECRET>' \ -d 'code=<CODE>'
Placeholder | Description | Example value |
---|---|---|
| Required. Your app ID. This is displayed at the top of the App Dashboard. |
|
| Required. Your app secret. You can get this from the App Dashboard > App Secret > Basic panel. |
|
| Required. The code returned by Embedded Signup when the customer successfully completed the flow. |
|
Upon success:
<BUSINESS_TOKEN>
Placeholder | Description | Example value |
---|---|---|
| The business customer's business integration system user access token ("business token"). |
|
Use the POST /<WABA_ID>/subscribed_apps endpoint to subscribe your app to webhooks on the business customer's WABA. Note that you have multiple webhook override options if you want the customer's webhooks to be sent to a different callback URL.
curl -X POST 'https://graph.facebook.com/v21.0/<WABA_ID>/subscribed_apps' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>'
Placeholder | Description | Example value |
---|---|---|
| Required. Your system user access token ("system token"). |
|
| Required. The customer's WABA ID. |
|
Upon success:
{ "success": true }
We are currently testing new steps for sharing your credit line with onboarded business customers. These steps will eventually replace this step, so if you wish to implement these steps now, see Alternate method for sharing your credit line.
Use the POST /<EXTENDED_CREDIT_LINE_ID>/whatsapp_credit_sharing_and_attach endpoint to share your credit line with an onboarded business customer.
curl -X POST 'https://graph.facebook.com/<API_VERSION>/<EXTENDED_CREDIT_LINE_ID>/whatsapp_credit_sharing_and_attach?waba_currency=<CUSTOMER_BUSINESS_CURRENCY>&waba_id=<CUSTOMER_WABA_ID>' \ -H 'Authorization: Bearer <SYSTEM_TOKEN>'
Placeholder | Description | Example value |
---|---|---|
| Required. The business's currency, as a three-letter currency code. Support values are:
This currency is used for invoicing and corresponds to pricing rates. |
|
| Required. The customer's WABA ID. |
|
| Required. Your extended credit line ID. |
|
| Required. Your system token. |
|
Upon success:
{ "allocation_config_id": "<ALLOCATION_CONFIGURATION_ID>", "waba_id": "<CUSTOMER_WABA_ID>" }
Placeholder | Description | Example value |
---|---|---|
| The extended credit line's allocation configuration ID. Save this ID if you want to verify that your credit line has been shared with the customer. |
|
| The customer's WABA ID. |
|
Use the POST /<BUSINESS_PHONE_NUMBER_ID>/register endpoint to register the customer's business phone number for use with Cloud API.
curl 'https://graph.facebook.com/v21.0/<BUSINESS_PHONE_NUMBER_ID>/register' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "pin": "<DESIRED_PIN>" }'
Placeholder | Description | Example value |
---|---|---|
| Required. The customer's business phone number ID returned. |
|
| Required. The customer's business token. |
|
| Required. Set this value to a 6-digit number. This will be the business phone number's two-step verification PIN. |
|
Upon success:
{ "success": true }
This step is optional.
If you wish to test the messaging capabilities of your business customer's business phone number, send a message to the customer's number from your own WhatsApp number (this will open a customer service window, allowing you to respond with any type of message).
Next, use the POST /<BUSINESS_PHONE_NUMBER_ID>/messages endpoint to send a text message in response.
curl 'https://graph.facebook.com/v21.0/<BUSINESS_PHONE_NUMBER_ID>/messages' \ -H 'Content-Type: application/json' \ -H 'Authorization: Bearer <BUSINESS_TOKEN>' \ -d ' { "messaging_product": "whatsapp", "recipient_type": "individual", "to": "<WHATSAPP_USER_NUMBER>", "type": "text", "text": { "body": "<BODY_TEXT>" } }'
Placeholder | Description | Example value |
---|---|---|
| Required. Message body text. Supports URLs. Maximum 4096 characters. |
|
| Required. The customer's business phone number ID. |
|
| Reqiured. The customer's business token. |
|
| Required. Your WhatsApp phone number that can send and receive messages from other WhatsApp numbers. Note that this cannot be a business phone number already registered for use with Cloud API or On-Premises API. |
|
Upon success:
{ "messaging_product": "whatsapp", "contacts": [ { "input": "<WHATSAPP_USER_NUMBER>", "wa_id": "<WHATSAPP_USER_ID>" } ], "messages": [ { "id": "<WHATSAPP_MESSAGE_ID>" } ] }
Placeholder | Description | Example value |
---|---|---|
| WhatsApp message ID. |
|
| Your WhatsApp user ID. |
|
| Your WhatsApp phone number that the message was sent to. |
|
If you were able to successfully send and receive messages using the customer's business phone number, and if messages webhooks were triggered describing the initial message that you sent, as well as the delivery statuses of the message you sent in response, the customer's business phone number is working properly.