Skip to content

WhatsApp Business Integration

Since v2.0.0

Send document signing requests and notifications directly to your signers via WhatsApp. This integration uses the official WhatsApp Business API from Meta (Graph API v22.0).


FeatureDescription
Signing RequestsSend signature links directly via WhatsApp
RemindersAutomated reminders for pending signatures
Completion NotificationsNotify signers when document is complete
Template MessagesPre-approved Meta templates for compliance
Encrypted CredentialsAES-256-GCM encryption for API tokens
Country Selector80+ countries with flag emojis

Before you begin, you’ll need:

  • ✅ A Meta Business Account (free to create)
  • ✅ A Facebook App with WhatsApp product added
  • ✅ A verified phone number for WhatsApp Business
  • Approved message templates (required by Meta)

  1. Go to developers.facebook.com

  2. Click “Get Started” or “Log In” with your Facebook account

  3. Accept the Meta Platform Terms and Developer Policies

  4. Verify your account (phone or email verification may be required)

  5. You now have a Meta Developer Account


  1. In developers.facebook.com/apps, click “Create App”

  2. Select use case: Choose “Other” and click “Next”

  3. Select app type: Choose “Business” and click “Next”

  4. Enter app details:

    • App name: e.g., “MyCompany Signing Notifications”
    • Contact email: Your business email
    • Business Account: Select existing or choose “No Business Manager account selected” (you can add one later)
  5. Click “Create App” and complete any security verification


  1. In your App Dashboard, scroll down to “Add products to your app”

  2. Find “WhatsApp” and click “Set up”

  3. If prompted, select or create a Meta Business Account

  4. You’ll be redirected to the WhatsApp API Setup page

  5. Meta provides a test phone number you can use for development


  1. Go to business.facebook.com

  2. If you don’t have an account, click “Create Account”

  3. Enter your business details:

    • Legal business name
    • Your name
    • Business email
  4. Go to Business SettingsWhatsApp Accounts

  5. Verify your app is connected


  1. In WhatsApp → “API Setup”

  2. Under “From”, you’ll see a phone number with a test number provided by Meta

  3. Copy the Phone number ID (a long numeric string like 123456789012345)

  4. For production, click “Add phone number” to use your own business number

There are two types of tokens:

Valid for 24 hours:

  1. Go to WhatsApp → “API Setup”
  2. Click “Copy” next to the temporary token
  3. Use this for testing only
  1. Go to business.facebook.com/settings
  2. Your Business Account ID is in the URL or under “Business Info”

Meta requires pre-approved templates for business-initiated messages.

Create these three templates in WhatsApp Manager:

Template Name: signing_request
Category: Utility
Language: English (en)

Header: Text - “Document Ready for Signature 📝”

Body:

Hello {{1}},
You have a new document "{{2}}" ready for your signature.
Click here to sign: {{3}}
This link expires in {{4}} hours.
Thank you for using WPsigner.

Variables:

  • {{1}} - Signer name
  • {{2}} - Document title
  • {{3}} - Signing URL
  • {{4}} - Expiration hours

Footer: “WPsigner - Secure Electronic Signatures”


  1. In WordPress admin, go to WPsignerIntegrations

  2. Find WhatsApp Business and click “Configure”

  3. Enter your credentials:

    • Phone Number ID: From Step 5
    • Permanent Access Token: Your permanent token
    • Business Account ID: Optional
  4. Click “Test Connection” to verify your credentials are correct

  5. Enable the “WhatsApp Notifications” toggle

  6. Click “Save Settings”


When creating a document:

  1. Go to WPsignerNew Document

  2. In Step 2 (Add Signers), you’ll see a new WhatsApp field

  3. Select the country code using the dropdown (with flags 🇺🇸 🇬🇧 🇲🇽)

  4. Enter the phone number (digits only)

  5. The full E.164 number is automatically formatted (e.g., +15551234567)


┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Create Document │────▶│ Signer Added │────▶│ WhatsApp Sent │
│ with Phone # │ │ (wps_signer_ │ │ with Sign Link │
│ │ │ created hook) │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Completion │◀────│ Document │◀────│ Signer Signs │
│ WhatsApp Sent │ │ Completed │ │ Document │
└─────────────────┘ └─────────────────┘ └─────────────────┘
EventHookWhatsApp Action
Signer added with phonewps_signer_createdSigning request with link sent
Signer completes signingwps_after_document_signedConfirmation notification sent
All signers donewps_document_completedFinal notification sent to remaining signers (skips those already notified)
Manual reminderTriggered from adminReminder template sent with updated link

WPsigner implements enterprise-grade security for WhatsApp integration:

FeatureImplementation
Token EncryptionAES-256-GCM encryption at rest via WPS_Encryption
Rate Limiting5 test connection attempts/min, 10 saves/min per user
Input ValidationNumeric-only IDs, E.164 phone format validation before sending
Phone ValidationNumbers validated with validate_phone() before API calls
Audit LoggingAll settings changes logged with user attribution
Nonce VerificationCSRF protection on all AJAX requests
Capability ChecksOnly manage_options users can configure

Error: “Connection failed” when testing

Solutions:

  1. Verify Phone Number ID is numeric only
  2. Check token hasn’t expired (use permanent token)
  3. Ensure WhatsApp product is added to your app
  4. Verify system user has correct permissions
  5. Make sure you entered credentials in the form before clicking Test Connection

Meta WhatsApp API has these limits:

TierMessages/dayRequirements
Unverified250None
Verified Tier 11,000Business verification
Verified Tier 210,000Good quality rating
Verified Tier 3100,000Excellent quality rating

MethodDescriptionReturn
WPS_WhatsApp::is_enabled()Check if integration is enabledbool
WPS_WhatsApp::is_configured()Check if credentials are setbool
WPS_WhatsApp::validate_phone($phone)Validate E.164 phone numberbool
WPS_WhatsApp::send_template_message($phone, $template, $params)Send a template messagearray|WP_Error
WPS_WhatsApp::send_reminder($signer_id)Send reminder to a signerbool|WP_Error
WPS_WhatsApp::send_completion($signer_id)Send completion notificationbool|WP_Error
WPS_WhatsApp::test_connection($phone_id, $token)Test API connectionarray|WP_Error
// Send a signing request via WhatsApp
$result = WPS_WhatsApp::send_template_message(
'+15551234567', // Phone in E.164 format
'signing_request', // Template name
[
'John Doe', // {{1}} Signer name
'NDA Contract', // {{2}} Document title
'https://...', // {{3}} Signing URL
'48', // {{4}} Hours to expire
]
);
if ( is_wp_error( $result ) ) {
error_log( 'WhatsApp send failed: ' . $result->get_error_message() );
}
// Check if WhatsApp is enabled and configured
if ( WPS_WhatsApp::is_enabled() && WPS_WhatsApp::is_configured() ) {
// WhatsApp is ready to send messages
}
// Validate phone before storing
$phone = '+15551234567';
if ( WPS_WhatsApp::validate_phone( $phone ) ) {
// Valid E.164 format
}
// Send reminder for a specific signer
$result = WPS_WhatsApp::send_reminder( $signer_id );
if ( is_wp_error( $result ) ) {
// Handle error
}
// Test with specific credentials (useful for validation before saving)
$result = WPS_WhatsApp::test_connection( '123456789012345', 'your_token' );
if ( ! is_wp_error( $result ) ) {
echo 'Connected: ' . $result['verified_name'];
}

You can extend the WhatsApp integration using these hooks:

// Hook into the signing request flow
add_action( 'wps_signer_created', function( $signer_id, $document_id ) {
// Called when a signer is added to a document
// WhatsApp message is sent automatically if phone is set
}, 10, 2 );
// Hook into document signed event
add_action( 'wps_after_document_signed', function( $document_id, $signer_id ) {
// Called when a signer completes signing
}, 10, 2 );
// Hook into document completed (all signers done)
add_action( 'wps_document_completed', function( $document_id ) {
// Called when all signers have completed
}, 10, 1 );

Use Permanent Tokens

Never use temporary tokens in production. Generate a permanent token from a System User.

Verify Your Business

Complete Meta Business Verification for higher message limits and trust.

Monitor Quality Rating

Keep your quality rating high by avoiding spam and honoring opt-outs.

Test Before Production

Use Meta’s test phone number during development before going live.


Q: Is WhatsApp Business API free?
A: Meta offers 1,000 free conversations per month. Additional messages are charged per conversation (typically $0.01-0.05 based on region).

Q: Can I use my personal WhatsApp number?
A: No, you must use a dedicated business number registered with WhatsApp Business API.

Q: How long does template approval take?
A: Usually 24-48 hours. Some templates may be rejected if they violate Meta’s policies.

Q: What happens if WhatsApp fails?
A: Email notifications are always sent as a fallback. WhatsApp is an additional channel.


ComponentVersion
Meta Graph APIv22.0 (supported until ~May 2027)
WPsigner integrationv2.0.0+
DatabaseMySQL and SQLite (WP_SQLite_DB) compatible