เอกสารนี้นี้ได้รับการอัพเดตแล้ว
คำแปลเป็น ภาษาไทย ยังไม่เสร็จสมบูรณ์
ภาษาอังกฤษที่อัพเดต: 13 พ.ย.
ภาษาไทย ที่อัพเดต: 5 พ.ย.

Business phone numbers

This document describes WhatsApp business phone numbers, their requirements, management information, and unique features.

Registering business phone numbers

A valid business phone number must be registered before it can be used to send and receive messages via Cloud API. Registered numbers can still be used for everyday purposes, such as calling and text messages, but cannot be used with WhatsApp Messenger ("WhatsApp").

Numbers already in use with WhatsApp cannot be registered unless they are deleted first. If your number is banned on WhatsApp and you wish to register it, it must be unbanned via the appeal process first.

Note that when you complete the steps in our Get Started document, a test business phone number will be generated and registered for you automatically.

Eligibility requirements

Eligible phone numbers must be:

  • owned by you
  • have a country and area code (short codes are not supported)
  • able to receive voice calls or SMS
  • number should have scaled capabilities

If you are registering a 1-800 number, see Registering 1-800 and Toll Free Numbers for additional information.

Registration methods

Status

Business phone numbers have a status, which reflects their quality rating and current messaging limit. Business phone numbers must have a status of "connected" in order to send and receive messages via the API.

Viewing status via WhatsApp Manager

Your business phone number's current status appears in the Status column in the WhatsApp Manager > Account tools > Phone numbers panel.

See our About your WhatsApp Business phone number’s quality rating help center article to learn more about quality ratings and statuses as they appear in WhatsApp Manager.

Getting status via API

Request the status field on your WhatsApp Business Phone Number ID. See the GET /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID> reference for a list of returnable status values and their meanings.

Example request

curl 'https://graph.facebook.com/v24.0/106540352242922?fields=status' \
-H 'Authorization: Bearer EAAJB...'

Example response

{
  "status": "CONNECTED",
  "id": "106540352242922"
}

Display names

You must provide display name information when registering a business phone number. The display name appears in your business phone number's WhatsApp profile, and can also appear at the top of individual chat threads and the chat list if certain conditions are met. See our Display names document to learn how display names work.

Business profiles

A business profile provides additional information about your business, such as its address, website, description, etc. You can supply this information when registering your business phone number. See our Business profiles document to learn how business profiles work.

Official Business Account status

Business phone numbers can gain Official Business Account ("OBA") status. OBA numbers have a blue checkmark beside their name in the contacts view.

See our Official Business Account document to learn how to request OBA status for a business phone number.

Two-step verification

You must set a two-step verification PIN when registering a business phone number. Your PIN is required when changing your PIN or deleting your phone number from the platform.

Changing your PIN via WhatsApp Manager

You will need your current PIN to change your PIN via WhatsApp Manager. To change your PIN:

  1. Navigate to WhatsApp Manager > Account tools > Phone numbers.
  2. Select your business phone number.
  3. Click the Two-step verification tab.
  4. Click the Change PIN button and complete the flow.

If you don't have your PIN, you can change your PIN using the API.

Changing your PIN via API

Use the POST /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID> endpoint to set a new PIN.

Example request

curl 'https://graph.facebook.com/v24.0/106540352242922/' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "pin": "150954"
}'

Example response

Upon success:

{
  "success": true
}

Disabling two-step verification

To disable two-step verification using WhatsApp Manager, follow the steps for changing your PIN, but click the Turn off two-step verification button as the final step instead. An email with a link will be sent to the email address associated with your business portfolio. Use the link to disable two-step verification. Once disabled, you can re-enable it by setting a new PIN.

Note that you cannot disable two-step verification using the API.

1-800 and toll free numbers

You may want to register a 1-800 or other toll free number on the platform. These numbers are usually behind an Interactive Voice Response (IVR) system, however, which a WhatsApp registration call cannot navigate. Phone numbers behind an IVR system can be registered, but must be able to accept calls from international numbers and be able to redirect our SMS message or voice call to a real person.

To register a phone number that is behind an IVR system:

  1. WhatsApp shares with you 1 or 2 phone numbers that the registration call will come from.
  2. Create an allow list for these numbers. If you are unable to create an allow list for these numbers, add the phone number to your WABA and open a Direct Support ticket asking for the registration call phone numbers and include the phone number you are trying to register in the ticket.
  3. Redirect the registration call to an employee or a mailbox to capture the registration code.

Phone numbers behind an IVR system that are unable to receive registration calls are not supported.

Registered number cap

New business portfolios are initially capped at 2 registered business phone numbers.

If your business becomes verified, or if you have reached a messaging limit of 2,000, we will automatically increase your cap to 20. Upon increase, a Meta Business Suite notification will be sent, informing you of your new cap, and a business_capability_update webhook will be triggered with max_phone_numbers_per_business set to your new cap.

Verify phone numbers

You need to verify the phone number you want to use to send messages to your customers. Phone numbers must be verified using a code sent via an SMS/voice call. The verification process can be done via Graph API calls specified below.

To verify a phone number using Graph API, make a POST request to PHONE_NUMBER_ID/request_code. In your call, include your chosen verification method and language.

EndpointAuthentication

/PHONE_NUMBER_ID/request_code

Authenticate yourself with a system user access token.

If you are requesting the code on behalf of another business, the access token needs to have Advanced Access to the whatsapp_business_management permission.

Parameters

Name Description

code_method

string

Required.

Chosen method for verification. Supported options:

  • SMS
  • VOICE

language

string

Required.

The language's two-character language code code. For example: "en".

Example request

curl -X POST 'https://graph.facebook.com/v24.0/106540352242922/request_code?code_method=SMS&language=en_US' \
-H 'Authorization: Bearer EAAJB...'

After the API call, you will receive your verification code via the method you selected. To finish the verification process, include your code in a POST request to PHONE_NUMBER_ID/verify_code.

Endpoint Authentication

/PHONE_NUMBER_ID/verify_code

Authenticate yourself with a system user access token.

If you are requesting the code on behalf of another business, the access token needs to have Advanced Access to the whatsapp_business_management permission.

Parameters

NameDescription

code

numeric string

Required.

The code you received after calling FROM_PHONE_NUMBER_ID/request_code.

Example

Sample request:

curl -X POST \
  'https://graph.facebook.com/v24.0/FROM_PHONE_NUMBER_ID/verify_code' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -F 'code=000000'

A successful response looks like this:

{
  "success": true
}

WhatsApp user phone number formats

Plus signs (+), hyphens (-), parenthesis ((,)), and spaces are supported in send message requests.

We highly recommend that you include both the plus sign and country calling code when sending a message to a customer. If the plus sign is omitted, your business phone number's country calling code is prepended to the customer's phone number. This can result in undelivered or misdelivered messages.

For example, if your business is in India (country calling code 91) and you send a message to the following customer phone number in various formats:

Number In Send Message RequestNumber Message Delivered ToOutcome

+16315551234

+16315551234

Correct number

+1 (631) 555-1234

+16315551234

Correct number

(631) 555-1234

+916315551234

Potentially wrong number

1 (631) 555-1234

+9116315551234

Potentially wrong number

Note: For Brazil and Mexico, the extra added prefix of the phone number may be modified by the Cloud API. This is a standard behavior of the system and is not considered a bug.

Identity Change Check

You may want us to verify a customer's identity before we deliver your message to them. You can have us do this by enabling the identity change check setting on your business phone number.

If a customer performs an action in WhatsApp that we consider to be an identity change, we generate a new identity hash for the user. You can get this hash anytime you message the customer by enabling the identity change check setting on your business phone number. Once enabled, anytime the customer messages you, or you message the customer without an identity hash, we will include their hash in any incoming messages webhooks or status messages webhooks. You can then capture and store this hash for future use.

To use the hash, include it in a send message request. We will compare the hash in the request to the customer's current hash. If the hashes match, the message will be delivered. If there is a mismatch, it means the customer has changed their identity since you last messaged them and we will not deliver the message. Instead, we will send you a status messages webhook with error code 137000, notifying you of the failure and mismatch.

When you receive a mismatched hash webhook, assume the customer's phone number can no longer be trusted. To reestablish trust, verify the customer's identity again using other, non-WhatsApp channels. Once you have reestablished trust, resend the failed message to the new identity (if any), without a hash. Then store the customer's new hash included in the message status delivery webhook.

Request Syntax

Send a POST request to the WhatsApp Business Phone Number > Settings endpoint to enable or disable the identity change check setting.

POST /<WHATSAPP_BUSINESS_PHONE_NUMBER>/settings

Post Body

{
  "user_identity_change" : {
    "enable_identity_key_check": <ENABLE_IDENTITY_KEY_CHECK>
}

Set <ENABLE_IDENTITY_KEY_CHECK> to true to enable identity check, or false to disable it.

Example Enable Request

curl 'https://graph.facebook.com/v24.0/106850078877666/settings' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "user_identity_change": {
    "enable_identity_key_check": true
  }
}'

Example Enable Response

{
  "success": true
}

Example Send Message With Check

This example message would only be delivered if the recipient_identity_key_hash hash value matches the customer's current hash.

curl 'https://graph.facebook.com/v24.0/106850078877666/messages' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer EAAJB...' \
-d '
{
  "messaging_product": "whatsapp",
  "recipient_type": "individual",
  "to": "+16505551234",
  "recipient_identity_key_hash": "DF2lS5v2W6x=",
  "type": "text",
  "text": {
    "preview_url": false,
    "body": "Your latest statement is attached. See... "
  }
}'

Webhooks

In incoming messages webhooks with a contacts object, such as the text messages webhook, the customer's hash is assigned to the identity_key_hash property.

In outgoing messages webhooks (status messages webhooks), the customer's hash is assigned to the recipient_identity_key_hash property in the statuses object.

Getting Throughput Level

Use the WhatsApp Business Phone Number endpoint to get a phone number's current throughput level:

GET /<WHATSAPP_BUSINESS_PHONE_NUMBER_ID>?fields=throughput

Get All Phone Numbers

To get a list of all phone numbers associated with a WhatsApp Business Account, send a GET request to the WhatsApp Business Account > Phone Numbers endpoint.

In addition, phone numbers can be sorted in either ascending or descending order by last_onboarded_time, which is based on when the user completed onboarding for Embedded Signup. If not specified, the default order is descending.

Request syntax

curl -X GET "https://graph.facebook.com/<API_VERSION>/<WABA_ID>/phone_numbers?access_token=<ACCESS_TOKEN>"  

On success, a JSON object is returned with a list of all the business names, phone numbers, phone number IDs, and quality ratings associated with a business. Results are sorted by embedded signup completion date in descending order, with the most recently onboarded listed first.

Example response

{
  "data": [
    {
      "verified_name": "Jasper's Market",
      "display_phone_number": "+1 631-555-5555",
      "id": "1906385232743451",
      "quality_rating": "GREEN"
      
    },
    {
      "verified_name": "Jasper's Ice Cream",
      "display_phone_number": "+1 631-555-5556",
      "id": "1913623884432103",
      "quality_rating": "NA"
    }
  ]
}

Request syntax

curl -X GET "https://graph.facebook.com/<API_VERSION>/<WABA_ID>/phone_numbers?access_token=&lt;SYSTEM_USER_ACCESS_TOKEN>]&amp;sort=['last_onboarded_time_ascending']"

Example response

On success, a JSON object is returned with a list of all the business names, phone numbers, phone number IDs, and quality ratings associated with a business. It is sorted based on when the user has completed embedded signup in ascending order, with the most recently onboarded listed last.

{
  "data": [
   {
      "verified_name": "Jasper's Ice Cream",
      "display_phone_number": "+1 631-555-5556",
      "id": "1913623884432103",
      "quality_rating": "NA"
    },
    {
      "verified_name": "Jasper's Market",
      "display_phone_number": "+1 631-555-5555",
      "id": "1906385232743451",
      "quality_rating": "GREEN"     
    }   
  ]
}

Filter phone numbers

You can query phone numbers and filter them based on their account_mode. This filtering option is currently being tested in beta mode. Not all developers have access to it.

Parameters

NameDescription

field

Value: account_mode

operator

Value: EQUAL

value

Values: SANDBOX, LIVE

Request syntax

curl -i -X GET "https://graph.facebook.com/<API_VERSION>/<WABA_ID>/phone_numbers?filtering=[{"field":"account_mode","operator":"EQUAL","value":"SANDBOX"}]&access_token=<ACCESS_TOKEN>

Example response

{
  "data": [
    {
      "id": "1972385232742141",    
      "display_phone_number": "+1 631-555-1111",
      "verified_name": "John’s Cake Shop",
      "quality_rating": "UNKNOWN",
    }
  ],
  "paging": {
	"cursors": {
		"before": "abcdefghij",
		"after": "klmnopqr"
	}
   }
}

Get a single phone number

To get information about a phone number, send a GET request to the WhatsApp Business Phone Number endpoint:

Request Syntax

GET https://graph.facebook.com/<API_VERSION>/<PHONE_NUMBER_ID>

Sample Request

curl \
'https://graph.facebook.com/v15.0/105954558954427/' \
-H 'Authorization: Bearer EAAFl...'

On success, a JSON object is returned with the business name, phone number, phone number ID, and quality rating for the phone number queried.

{
  "code_verification_status" : "VERIFIED",
  "display_phone_number" : "15555555555",
  "id" : "105954558954427",
  "quality_rating" : "GREEN",
  "verified_name" : "Support Number"
}

Get Display Name Status (Beta)

Include fields=name_status as a query string parameter to get the status of a display name associated with a specific phone number. This field is currently in beta and not available to all developers.

Sample Request

curl \
'https://graph.facebook.com/v15.0/105954558954427?fields=name_status' \
-H 'Authorization: Bearer EAAFl...'

Sample Response

{
  "id" : "105954558954427",
  "name_status" : "AVAILABLE_WITHOUT_REVIEW"
}

The name_status value can be one of the following:

  • APPROVED: The name has been approved. You can download your certificate now.
  • AVAILABLE_WITHOUT_REVIEW: The certificate for the phone is available and display name is ready to use without review.
  • DECLINED: The name has not been approved. You cannot download your certificate.
  • EXPIRED: Your certificate has expired and can no longer be downloaded.
  • PENDING_REVIEW: Your name request is under review. You cannot download your certificate.
  • NONE: No certificate is available.

Note that certificates are valid for 7 days.

Deleting business phone numbers

Only business portfolio admins can delete business phone numbers, and numbers can't be deleted if they have been used to send paid messages within the last 30 days.

Deleting business phone numbers via WhatsApp Manager

If your business phone number has a Connected status, you will need your two-step verification PIN to delete your number.

  1. Load your business portfolio in the WhatsApp Manager.
  2. If it doesn't automatically load the Phone numbers panel, navigate to Account tools (the toolbox icon) > Phone numbers.
  3. Click the phone number's trash can icon and complete the flow.

If the number has been used to send paid messages within the last 30 days, you will be redirected to the Insights panel, showing the date of the last paid message. You can delete the number 30 days from this date.

Deleting business phone numbers via API

You cannot delete a business phone number via API.

Conversational components

You can enable helpful message UI components to make it easier for WhatsApp users to interact with your business. See Conversational components.