Use Permanent Tokens
Never use temporary tokens in production. Generate a permanent token from a System User.
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).
| Feature | Description |
|---|---|
| Signing Requests | Send signature links directly via WhatsApp |
| Reminders | Automated reminders for pending signatures |
| Completion Notifications | Notify signers when document is complete |
| Template Messages | Pre-approved Meta templates for compliance |
| Encrypted Credentials | AES-256-GCM encryption for API tokens |
| Country Selector | 80+ countries with flag emojis |
Before you begin, youβll need:
Go to developers.facebook.com
Click βGet Startedβ or βLog Inβ with your Facebook account
Accept the Meta Platform Terms and Developer Policies
Verify your account (phone or email verification may be required)
You now have a Meta Developer Account
In developers.facebook.com/apps, click βCreate Appβ
Select use case: Choose βOtherβ and click βNextβ
Select app type: Choose βBusinessβ and click βNextβ
Enter app details:
Click βCreate Appβ and complete any security verification
In your App Dashboard, scroll down to βAdd products to your appβ
Find βWhatsAppβ and click βSet upβ
If prompted, select or create a Meta Business Account
Youβll be redirected to the WhatsApp API Setup page
Meta provides a test phone number you can use for development
Go to business.facebook.com
If you donβt have an account, click βCreate Accountβ
Enter your business details:
Go to Business Settings β WhatsApp Accounts
Verify your app is connected
In WhatsApp β βAPI Setupβ
Under βFromβ, youβll see a phone number with a test number provided by Meta
Copy the Phone number ID (a long numeric string like 123456789012345)
For production, click βAdd phone numberβ to use your own business number
There are two types of tokens:
Valid for 24 hours:
Never expires - Recommended:
Go to App Settings β βBasicβ
Note your App ID and App Secret
Click βAddβ to create a System User:
Click βAdd Assetsβ and assign your WhatsApp Business Account with full control
Click βGenerate New Tokenβ:
whatsapp_business_managementwhatsapp_business_messagingCopy and securely store this token
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 hoursFooter: βWPsigner - Secure Electronic Signaturesβ
Template Name: signing_reminder
Category: Utility
Language: English (en)
Header: Text - βReminder: Signature Pending β°β
Body:
Hello,
This is a friendly reminder that the document "{{1}}" is still awaiting your signature.
Please sign by {{2}} to avoid delays.
Sign now: {{3}}
Thank you!Variables:
{{1}} - Document title{{2}} - Due date{{3}} - Signing URLTemplate Name: signing_completed
Category: Utility
Language: English (en)
Header: Text - βDocument Signed Successfully β β
Body:
Great news!
The document "{{1}}" was successfully signed on {{2}}.
You will receive a copy via email shortly.
Thank you for choosing {{3}}.Variables:
{{1}} - Document title{{2}} - Completion date{{3}} - Brand nameIn WordPress admin, go to WPsigner β Integrations
Find WhatsApp Business and click βConfigureβ
Enter your credentials:
Click βTest Connectionβ to verify your credentials are correct
Enable the βWhatsApp Notificationsβ toggle
Click βSave Settingsβ
When creating a document:
Go to WPsigner β New Document
In Step 2 (Add Signers), youβll see a new WhatsApp field
Select the country code using the dropdown (with flags πΊπΈ π¬π§ π²π½)
Enter the phone number (digits only)
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 ββββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ| Event | Hook | WhatsApp Action |
|---|---|---|
| Signer added with phone | wps_signer_created | Signing request with link sent |
| Signer completes signing | wps_after_document_signed | Confirmation notification sent |
| All signers done | wps_document_completed | Final notification sent to remaining signers (skips those already notified) |
| Manual reminder | Triggered from admin | Reminder template sent with updated link |
WPsigner implements enterprise-grade security for WhatsApp integration:
| Feature | Implementation |
|---|---|
| Token Encryption | AES-256-GCM encryption at rest via WPS_Encryption |
| Rate Limiting | 5 test connection attempts/min, 10 saves/min per user |
| Input Validation | Numeric-only IDs, E.164 phone format validation before sending |
| Phone Validation | Numbers validated with validate_phone() before API calls |
| Audit Logging | All settings changes logged with user attribution |
| Nonce Verification | CSRF protection on all AJAX requests |
| Capability Checks | Only manage_options users can configure |
Error: βConnection failedβ when testing
Solutions:
Error: Messages not received
Solutions:
Error: Template not found
Solutions:
signing_request, signing_reminder, signing_completeden)Error: βTest Connectionβ or βSave Settingsβ buttons have no effect
Solutions:
Meta WhatsApp API has these limits:
| Tier | Messages/day | Requirements |
|---|---|---|
| Unverified | 250 | None |
| Verified Tier 1 | 1,000 | Business verification |
| Verified Tier 2 | 10,000 | Good quality rating |
| Verified Tier 3 | 100,000 | Excellent quality rating |
| Method | Description | Return |
|---|---|---|
WPS_WhatsApp::is_enabled() | Check if integration is enabled | bool |
WPS_WhatsApp::is_configured() | Check if credentials are set | bool |
WPS_WhatsApp::validate_phone($phone) | Validate E.164 phone number | bool |
WPS_WhatsApp::send_template_message($phone, $template, $params) | Send a template message | array|WP_Error |
WPS_WhatsApp::send_reminder($signer_id) | Send reminder to a signer | bool|WP_Error |
WPS_WhatsApp::send_completion($signer_id) | Send completion notification | bool|WP_Error |
WPS_WhatsApp::test_connection($phone_id, $token) | Test API connection | array|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 configuredif ( 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 flowadd_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 eventadd_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.
| Component | Version |
|---|---|
| Meta Graph API | v22.0 (supported until ~May 2027) |
| WPsigner integration | v2.0.0+ |
| Database | MySQL and SQLite (WP_SQLite_DB) compatible |