WhatsApp Inbound Lead Capture for ERPNext — Auto-create CRM Leads from WhatsApp messages

Hi Frappe community,

Sharing the next feature of my WhatsApp ↔ ERPNext integration — inbound lead capture is now live.

This came directly from a client requirement. They were already using the outbound feature (sending WhatsApp messages from ERPNext), but enquiries coming in on WhatsApp were still being missed or entered manually. They needed every inbound WhatsApp message to automatically land as a CRM Lead.

:movie_camera: Demo: WhatsApp → ERPNext CRM: Automatic Lead Capture Demo Video

What it does: When someone messages your WhatsApp Business number, ERPNext automatically creates a CRM Lead (or links to an existing one if the number is already in your system). Every message, text, audio, image, document, location, is logged in a “WhatsApp Inbound Log” doctype linked to that Lead.

How it works:

  • Meta WhatsApp Cloud API sends a webhook POST to ERPNext
  • The app normalizes the number to +E.164 format and searches existing Leads across three number variants (handles Indian 10-digit, bare E.164, +E.164)
  • New contact → Lead created with source = “WhatsApp”
  • Existing contact → message logged without creating a duplicate
  • Processing is enqueued via frappe.enqueue so the webhook returns 200 immediately

Setup requirements:

  • A Meta Business App with WhatsApp Cloud API access
  • Enable “Inbound Lead Capture” in WhatsApp Settings
  • Subscribe to the messages field in your Meta webhook

Tested on Frappe v16 / ERPNext v16.

If you’re an ERPNext user and want this set up for your business, feel free to reach out: mandula.abhilash@gmail.com

2 Likes