Feature docs

WhatsApp automation app on Vareons: install, connect, templates, and order confirmation

The WhatsApp automation app is the id whatsapp marketplace card opening /dashboard/whatsapp: it connects a WhatsApp Business number through Meta login, sends order confirmations with approved templates, receives customer replies through a webhook, and exposes connect, disconnect, resync, and details buttons.

Last verified: 2026-09-19

The app installs from the /dashboard/apps marketplace with an Install button on the "WhatsApp automation" card marked Featured, after which an Open button leads to /dashboard/whatsapp. The card itself shows the localized name, the Vareons developer name, the description about connecting WhatsApp Business with order confirmations and automatic messages, and a Free price badge.

Inside the app, the page starts with the "Smart WhatsApp" heading plus a terms-and-privacy checkbox, then the "Connect WhatsApp" button, which stays disabled until terms are accepted and the NEXT_PUBLIC_FACEBOOK_APP_ID and NEXT_PUBLIC_WHATSAPP_CONFIG_ID variables exist over HTTPS. Pressing it redirects the whole page to the OAuth dialog on facebook.com using the current graph version with the config_id parameter and state kept in sessionStorage, then returns with a code that is posted with the redirect_uri to POST /api/whatsapp/callback.

After connecting, each account card shows its status (Active or Disconnected) and connection date plus a "View details" button that fetches GET /api/whatsapp/account-details?phoneNumberId= and opens a dialog with three panels: number overview, webhook health, and templates with a "Redeploy templates now" button calling POST /api/whatsapp/redeploy-templates. The "Resync webhooks" button calls POST /api/whatsapp/subscribe-webhooks to repair the subscription and callback URL, and the red "Disconnect" button asks for browser confirmation before POST /api/whatsapp/disconnect with the phone number id.

Order-confirmation settings appear only when an account is connected: a dialog with an enable-confirmation switch and an Arabic-or-English language choice, saved through POST /api/whatsapp/order-confirmation-settings. When an order is created, the matching template (order_confirmation_ar or en) is sent, and customer replies (confirm, cancel, or edit) arrive through the webhook to update WhatsAppOrderConfirmation records and the order status.

Data is stored in the WhatsAppAccount (keyed by merchant plus phone number id), WhatsAppTemplate, WhatsAppChat, WhatsAppMessage, and WhatsAppOrderConfirmation models, while the logic lives in twenty-four files under lib/whatsapp covering the service, access token, account details, template parameters, webhook processing, signature, callback-URL building, and diagnostics.

Setup steps in Vareons

  1. Install the app from the marketplace

    Open /dashboard/apps, press Install on the WhatsApp automation card, then press Open to reach /dashboard/whatsapp.

  2. Accept the terms and connect the number

    Tick the terms and privacy checkbox, then press Connect WhatsApp to complete Meta login and return the code to POST /api/whatsapp/callback.

  3. Review details and templates

    Press View details to open the overview, webhook health, and templates panels, and use Redeploy templates now when needed.

  4. Enable order confirmation

    From order-confirmation settings, flip the enable switch, pick Arabic or English, then save so the template goes out with each new order.

  5. Watch replies and resync

    Customer replies arrive through the webhook to update the order; use Resync webhooks when receiving stops and Disconnect when changing numbers.

Frequently asked questions

Is the WhatsApp app free?

Yes, the marketplace card carries a Free badge with free billing type, and installation requires no purchase.

Why is the Connect WhatsApp button disabled?

It stays disabled until you accept the terms and the Facebook app and WhatsApp config variables exist with the site served over HTTPS.

How do I fix stopped incoming replies?

Press Resync webhooks on the account card; it re-subscribes and repairs the callback URL. Also check the webhook health panel in View details.

Can I change the confirmation message language?

Yes, from order-confirmation settings pick Arabic or English and save; the matching template goes out with new orders.

What happens on disconnect?

After browser confirmation it sends POST /api/whatsapp/disconnect with the phone number id, automatic messages stop, and another number can be connected.

Where is WhatsApp data stored?

In the account, template, chat, message, and order-confirmation models, with diagnostic logs for failures and delivery-status tracking.

Troubleshooting

1) Connect disabled: accept the terms and confirm the Facebook variables and HTTPS. 2) Callback failure after Meta: refresh and reconnect to resend the code. 3) Replies not arriving: use Resync webhooks and check the health panel. 4) Stale templates: use Redeploy templates now from the details dialog. 5) An unavailable-in-plan message means the catalog mode is disabled for your plan.

Important limitations

• Requires a WhatsApp Business account and a Meta app with correct permissions. • Business-initiated messages depend on approved Meta templates and the 24-hour window. • One account per phone number; switching needs a disconnect then a fresh connect. • Message delivery depends on Meta and is not guaranteed by Vareons alone.

Related links

تواصل معنا على واتساب