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 🗂 Codex Compare Pricing About Contact Start Free Trial →
Technical Guide Step-by-Step ⏱ 15 min read

Connect SAP Business One to WhatsApp API — 3 Methods, Real Code

SAP B1 manages your inventory, orders, and financials. WA.Expert puts those events on WhatsApp — instantly. This guide covers every technical approach: DI API, SAP B1 Service Layer, B1if middleware, and Boyum IT's B1UP. With working code examples from SAP's own documentation.

Get WA.Expert API Key → Talk to a Developer

What this guide covers

SAP Business One is deeply embedded in Indian manufacturing, distribution, and wholesale businesses. But SAP B1's built-in notification system is email-only. This guide shows you exactly how to bridge SAP B1 events — new sales orders, invoice approvals, delivery notes, payment applications — to WhatsApp messages via WA.Expert API. We cover three integration methods so you can choose the right one for your infrastructure.

Integration approachComplexityBest for
SAP B1 Service Layer (REST API)⭐⭐ Medium — requires SAP HANA or 10.0+Best for modern SAP B1 deployments on HANA. Clean REST API, no SDK needed.
SAP B1 DI API (COM/SDK)⭐⭐⭐ Complex — requires Windows server, VB.NET or C#Legacy deployments on SQL Server. Full object model access.
B1if / SAP Integration Framework⭐⭐ Medium — requires B1if licenseEnterprise B1 setups. Visual workflow builder, no code for simple flows.
Boyum B1UP / Beas⭐ Easy — if Boyum IT is already installedIf your SAP B1 already has Boyum IT addons — quickest path.
Zapier/Make via Service Layer⭐ Easy — no server codeFor non-developers. Poll Service Layer via Zapier/Make → WA.Expert.

How to connect — all methods explained

Method 1 SAP B1 Service Layer → WA.Expert

1

Enable SAP B1 Service Layer

Service Layer is available on SAP B1 9.2+ with HANA or SQL Server. In SAP B1 Administration → System Initialization → General Settings → Services tab → Enable Service Layer. Default port: 50000 (HTTP) or 50001 (HTTPS).

2

Authenticate with Service Layer

POST to /b1s/v1/Login with your SAP B1 company database, username, and password. You receive a session cookie (B1SESSION) valid for 30 minutes. All subsequent API calls must include this cookie.

3

Set up a webhook trigger script

Create a scheduled SQL job or a SAP B1 Formatted Search (FMS) that fires when a document is added/updated. The script calls your middleware endpoint with the document details.

4

Call WA.Expert API from middleware

Your Node.js/Python middleware receives the SAP B1 event, fetches the customer's phone from Business Partner master data via Service Layer, then calls WA.Expert API to send the WhatsApp.

5

Alternative: Query Service Layer on schedule

If real-time webhook is complex, a scheduled script polls the Service Layer every 5 minutes for new documents (filter by CreateDate = today, DocStatus = Open) and processes the queue.

# SAP B1 Service Layer → WA.Expert # Step 1: Login to get session import requests, json SL_URL = "https://your-sap-server:50000/b1s/v1" session = requests.Session() login = session.post(f"{SL_URL}/Login", json={ "CompanyDB": "YOUR_COMPANY_DB", "UserName": "manager", "Password": "YOUR_PASSWORD" }) # Step 2: Fetch new Sales Orders orders = session.get( f"{SL_URL}/Orders?$filter=DocumentStatus eq 'O' and DocDate eq '{today}'" ) # Step 3: For each order, send WhatsApp for order in orders.json()['value']: phone = get_bp_phone(order['CardCode']) send_whatsapp(phone, "so_confirmation", { "name": order['CardName'], "doc_num": order['DocNum'], "amount": order['DocTotal'] })

Service Layer base URL format: https://[server]:[port]/b1s/v1. Default ports: 50000 (HTTP), 50001 (HTTPS). SSL certificate is self-signed by default — use verify=False in requests for internal networks.

Method 2 SAP B1 DI API (C# / VB.NET)

1

Install SAP B1 SDK on integration server

Download SAP B1 SDK from SAP Support Portal (SAP Note 886895). Install on a Windows server that has network access to the SAP B1 application server. The DI API is a COM component — requires 32-bit .NET application.

2

Reference SAP B1 COM objects

In Visual Studio: Add Reference → COM → SAPbobsCOM. This gives you access to the Company object, Document objects (oOrders, oInvoices, oDeliveryNotes) and Business Partner objects.

3

Connect and authenticate

Create a Company object, set ServerName, CompanyDB, UserName, Password, DbServerType, and call Connect(). Check return value — 0 means success.

4

Listen for document events

Use the BusinessObjectsXML event or set up a scheduled Windows service that queries new documents since last run. Store the last processed DocEntry to avoid duplicates.

5

Extract phone and call WA.Expert

For each new document, use BusinessPartners.GetByKey(CardCode) to get the BP master. Access CardForeignName or the U_WhatsApp user-defined field if you've added one. Call WA.Expert REST API via HttpClient.

// SAP B1 DI API — C# example // Connect to SAP B1 Company SAPbobsCOM.Company oCompany = new SAPbobsCOM.Company(); oCompany.Server = "YOUR_SAP_SERVER"; oCompany.CompanyDB = "YOUR_DB"; oCompany.UserName = "manager"; oCompany.Password = "YOUR_PASSWORD"; oCompany.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2019; int retCode = oCompany.Connect(); // Get new Sales Orders SAPbobsCOM.Documents oOrder = oCompany.GetBusinessObject( SAPbobsCOM.BoObjectTypes.oOrders); oOrder.GetByKey(docEntry); string cardCode = oOrder.CardCode; string docNum = oOrder.DocNum.ToString(); // Get BP phone SAPbobsCOM.BusinessPartners oBP = oCompany.GetBusinessObject( SAPbobsCOM.BoObjectTypes.oBusinessPartners); oBP.GetByKey(cardCode); string phone = oBP.Phone1; // or UDF U_Mobile // Call WA.Expert API SendWhatsApp(phone, "so_confirmation", docNum);

The SAP B1 DI API is a 32-bit COM object — your integration application must run as 32-bit (x86) on Windows. Add a custom User-Defined Field U_Mobile (Character, 15 chars) to Business Partner master for clean phone storage.

Common questions

Does SAP Business One have a native WhatsApp integration?
SAP B1 does not have a native WhatsApp integration. The three standard approaches are: (1) SAP B1 Service Layer REST API (modern B1 on HANA), (2) SAP B1 DI API via SDK (legacy SQL Server deployments), and (3) third-party middleware like Boyum IT's B1UP or B1if. WA.Expert provides the WhatsApp delivery layer in all three scenarios.
Which SAP B1 version is needed for the Service Layer approach?
SAP Business One Service Layer is available from version 9.2 onwards on HANA, and from version 10.0 onwards on SQL Server (Microsoft SQL). Older versions (8.8x, 9.0, 9.1) must use the DI API approach. Check your SAP B1 version in Help → About SAP Business One.
Where are phone numbers stored in SAP B1 Business Partner master?
Phone1 and Phone2 fields in the Business Partner master data (BP Catalog tab) store the primary phone numbers. For WhatsApp specifically, the best practice is to add a User-Defined Field (UDF) named U_Mobile or U_WhatsApp in Business Partners (Administration → Setup → General → User-Defined Fields). This keeps the WhatsApp number separate from the main contact phone.
Can I trigger WhatsApp from SAP B1 approval workflows?
Yes — when a document (Purchase Order, Credit Note) requires manager approval in SAP B1, the approval workflow change can trigger a WhatsApp notification to the approver via the integration. The trigger is the document status change in the underlying database or a DI API event listener.
How do I handle multiple contacts per Business Partner in SAP B1?
SAP B1 Business Partners have a Contact Persons tab with multiple contacts, each having their own phone number. Your integration script should iterate through Contact Persons to find the primary contact or the one flagged as the WhatsApp recipient. Use the ContactEmployees.Phone1 field for each contact person.
Can SAP B1 integration send WhatsApp to vendors, not just customers?
Yes — the same integration works for vendors (Purchase Orders, Goods Receipt POs). Vendor Business Partners have the same Phone1/UDF phone fields. The WhatsApp template content differs — vendors receive PO acknowledgements, delivery schedule confirmations, and payment advice notifications.

More connection guides

Ready to connect SAP Business One to WhatsApp?

WA.Expert provides the API key, template management, and WhatsApp delivery. Your team handles the SAP B1 trigger logic using this guide.

Start Free Trial → Talk to a Developer