Platform
Chatbot Builder Bulk Messaging Team Inbox Mini CRM API & Webhooks AI Integration WhatsApp Flows
Industries
E-commerce & D2C Real Estate Education Healthcare Finance & BFSI Logistics Hospitality Retail
Integrations
Learn
Learning Hub Help & Docs Connect Guides Automation Codex Blog Message Templates
Pricing Start Free Trial →
HomeConnect › Connect ERPNext to WhatsApp
ERPNext Integration Guide · Accounting / ERP / India

Connect ERPNext to WhatsApp

ERPNext is open-source, self-hostable ERP built on the Frappe Framework. Unlike Tally, it has a proper REST API and built-in outgoing webhooks, so connecting it to WhatsApp is straightforward: submit an invoice, the customer gets a WhatsApp. No bridge required.

Published 23 June 2026  ·  7 min read  ·  Accounting / ERP
No bridge needed: ERPNext is cloud-reachable

Unlike Tally (which needs a tunnel to expose a local port), ERPNext runs on a reachable URL, either yoursite.erpnext.com (cloud hosted) or your own domain. WA.Expert can call its REST API directly, and ERPNext can POST webhooks to WA.Expert without any extra setup.

Auth is lowercase 'token', not 'Bearer'

ERPNext's Authorization header uses the word token in lowercase: Authorization: token api_key:api_secret. Using Bearer or capitalising Token causes a 401. The token is your API key and API secret joined by a colon.

Step 1: Generate API credentials

1
In ERPNext, go to User list, open the user you want to use for the integration (ideally a dedicated API user, not Administrator).
2
Click the Settings tab, expand API Access, and click Generate Keys.
3
A popup shows the API Secret. Copy it immediately. It is shown only once. The API Key is visible on the page.
4
Your token: API_KEY:API_SECRET (key first, colon, then secret).
Token format and Authorization header
Token:  YOUR_API_KEY:YOUR_API_SECRET

Header: Authorization: token YOUR_API_KEY:YOUR_API_SECRET
        (lowercase 'token', space, then the colon-joined pair)

Example:
Authorization: token 8d3a1f2c4e6b:7a9f1d2e3b4c5a6d7e8f
Official docs

ERPNext REST API: docs.frappe.io

Direction A: ERPNext webhook fires a WhatsApp

The cleanest integration: configure a webhook in ERPNext for a DocType event, and WA.Expert receives the payload and sends the WhatsApp automatically.

Set up the webhook in ERPNext

1
In ERPNext, go to Setup → Integrations → Webhook (search "Webhook" in the global search if you cannot find it).
2
Click New. Set DocType to the document type you want to trigger on (e.g. Sales Invoice).
3
Set Doc Event to the event: on_submit, on_update, or after_insert.
4
Set Request URL to your WA.Expert webhook URL (from the WA.Expert automation's Inbound Webhook trigger).
5
Optionally add a Webhook Secret header so WA.Expert can verify requests are genuinely from your ERPNext instance.
6
Save. Use the Test Webhook button to send a test payload.
DocTypeDoc EventWhatsApp trigger
Sales Invoiceon_submitInvoice sent to customer: invoice number, total, due date.
Payment Entryon_submitPayment received confirmation to customer or internal team.
Sales Orderafter_insertOrder confirmation to customer: order number and summary.
Delivery Noteon_submitDispatch notification with tracking details.
Purchase Orderon_submitPO alert to internal procurement or to the supplier.

Any ERPNext DocType can be a webhook trigger. Use on_submit for approval-gated documents and after_insert for immediate notifications.

ERPNext webhook payload — Sales Invoice (on_submit)
{
  "doctype":        "Sales Invoice",
  "name":           "SINV-2026-00142",
  "customer":       "Priya Textiles",
  "customer_mobile": "9820012345",
  "grand_total":    48500.00,
  "due_date":       "2026-07-07",
  "status":         "Submitted",
  "posting_date":   "2026-06-23"
}

Map to WA.Expert variables:
  customer         -> party_name
  "+91" + customer_mobile -> wa_phone   <- PREPEND +91 if needed
  name             -> invoice_number
  grand_total      -> invoice_amount
  due_date         -> payment_due
Always check whether the mobile field is in the payload

The customer_mobile field is present in Sales Invoice if it was set on the Customer master. If it is missing from the payload, do a secondary GET to /api/resource/Contact?filters=[[Contact,link_name,=,CUSTOMER_NAME]]&fields=[mobile_no] to look up the number from the Contact record. Prepend +91 to bare 10-digit Indian numbers.

Direction B: WA.Expert calls the ERPNext REST API

Use WA.Expert's External API Request step to read data from ERPNext (payment outstanding, order status) or to create records (new Lead from WhatsApp enquiry).

GET — fetch outstanding Sales Invoices for a customer
GET https://yoursite.erpnext.com/api/resource/Sales%20Invoice
    ?filters=[["Sales Invoice","customer","=","Priya Textiles"],
               ["Sales Invoice","outstanding_amount",">",0]]
    &fields=["name","grand_total","outstanding_amount","due_date"]
Authorization: token YOUR_API_KEY:YOUR_API_SECRET

Response:
{
  "data": [
    {"name":"SINV-2026-00142","grand_total":48500,"outstanding_amount":48500,"due_date":"2026-07-07"},
    {"name":"SINV-2026-00138","grand_total":22000,"outstanding_amount":22000,"due_date":"2026-06-30"}
  ]
}
POST — create a Lead in ERPNext from a WhatsApp enquiry
POST https://yoursite.erpnext.com/api/resource/Lead
Authorization: token YOUR_API_KEY:YOUR_API_SECRET
Content-Type: application/json

Body:
{
  "lead_name":  "{{customer_name}}",
  "mobile_no":  "{{customer_phone}}",
  "source":     "WhatsApp",
  "status":     "New",
  "notes":      "{{customer_message}}"
}

Response:
{
  "data": {
    "name":      "CRM-LEAD-2026-00241",
    "lead_name": "Priya Sharma",
    "status":    "New"
  }
}

Worked example: invoice alert on WhatsApp

Full flow — ERPNext Sales Invoice submit to customer WhatsApp
1. Accountant submits Sales Invoice SINV-2026-00142 in ERPNext.

2. ERPNext fires the on_submit webhook to WA.Expert:
   {"name":"SINV-2026-00142","customer":"Priya Textiles",
    "customer_mobile":"9820012345","grand_total":48500,"due_date":"2026-07-07"}

3. WA.Expert automation:
   wa_phone = "+91" + "9820012345" = "+919820012345"

4. WA.Expert sends the customer WhatsApp:
   'Hi Priya Textiles! Invoice SINV-2026-00142 for Rs. 48,500
    has been raised. Payment due: 7 July 2026.
    Reply to this message for any queries.'

Troubleshooting

SymptomLikely causeFix
401 on API callsWrong auth header formatUse lowercase 'token': Authorization: token api_key:api_secret. Not 'Bearer', not 'Token' (capitalised).
API Secret lostSecret shown only once at generationDelete the existing keys and Generate Keys again. The new secret will appear in the popup. Update all integrations that used the old key.
Webhook not firingDocType event not matching or webhook disabledCheck the webhook record in ERPNext: ensure Enabled is checked, the Doc Event matches what you expect (on_submit vs after_insert), and the DocType name is exact.
Mobile number missing from payloadNot set on Customer masterOpen the Customer record and enter the mobile number. Alternatively, fetch from the Contact DocType with a secondary GET.
Filter returning no resultsField name or operator wrongERPNext filters use the format [[DocType,field,operator,value]]. The DocType in the filter must match the resource DocType exactly. Test the URL in a browser while logged in to see the raw response.
POST creating duplicate recordsSubmitting the same payload twiceERPNext auto-names most DocTypes. Sending POST twice creates two records. Check for the record first with a GET if you want to avoid duplicates.

Common questions

What is the ERPNext token format?
+
Colon-joined: api_key:api_secret. Header: Authorization: token api_key:api_secret (lowercase 'token'). API Secret shown only once — copy at generation.
How do I trigger WhatsApp on invoice submit?
+
Setup > Integrations > Webhook > New. DocType: Sales Invoice. Doc Event: on_submit. Request URL: your WA.Expert webhook URL. Save and test.
Which DocTypes work for WhatsApp automation?
+
Sales Invoice (on_submit), Payment Entry (on_submit), Sales Order (after_insert), Delivery Note (on_submit), Purchase Order (on_submit).
How do I look up a customer's phone number?
+
GET /api/resource/Contact?filters=[[Contact,link_name,=,CUSTOMER_NAME]]&fields=[mobile_no]. Prepend +91 to bare 10-digit Indian numbers.
Can I create ERPNext records from WhatsApp?
+
Yes. POST /api/resource/DocTypeName with the token header and JSON body. Create a Lead from a WhatsApp enquiry, for example.
Does this incur extra WA.Expert charges?
+
Each WhatsApp uses a message credit: Rs. 0.14 on Starter (utility). ERPNext REST API and webhooks are free.

Connect Tally to WhatsApp

Tally's XML-over-HTTP gateway: the complete bridge and payment-reminder guide.

Read guide

Connect Zoho Books to WhatsApp

Zoho Books: cloud accounting with OAuth and invoice webhooks.

Read guide

External API Request Step

Master every field in WA.Expert's HTTP action step.

Read guide

Connect ERPNext to WhatsApp today

Free trial, no credit card. If you get stuck, we answer live on WhatsApp.

Start Free Trial → Book a Demo
1