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 Oracle NetSuite to WhatsApp API — SuiteScript 2.0 + RESTlets

Oracle NetSuite is the ERP backbone for many Indian enterprises and global subsidiaries. WA.Expert connects NetSuite events — sales orders, invoice creation, payment application, fulfilment — to WhatsApp messages via SuiteScript 2.0 RESTlets and workflow actions. Full working code included.

Get WA.Expert API Key → Talk to a Developer

What this guide covers

NetSuite provides several integration paths, each suited to different technical skill levels. SuiteScript 2.0 User Event scripts fire on record create/edit and can call external HTTP endpoints directly. Workflow Actions provide a no-code alternative within NetSuite's workflow builder. SuiteTalk REST API allows external systems to trigger WhatsApp by reading NetSuite data.

Integration approachComplexityBest for
SuiteScript 2.0 User Event Script⭐⭐ Medium — SuiteScript knowledge neededMost direct. Script fires on record save and calls WA.Expert immediately.
NetSuite Workflow Action⭐ Easy — NetSuite admin, no codeWorkflow builder → Send HTTP Request action → WA.Expert. No scripting.
SuiteTalk REST API + external polling⭐⭐ Medium — external server neededExternal script polls NetSuite REST API for new records → triggers WhatsApp.
RESTlet endpoint⭐⭐ Medium — SuiteScript knowledgeBuild a custom RESTlet that other systems call to trigger WhatsApp via NetSuite data.

How to connect — all methods explained

Method 1 SuiteScript 2.0 User Event — Direct Method

1

Create a new SuiteScript 2.0 file

In NetSuite: Customization → Scripting → Scripts → New. Script Type: User Event. Upload a new .js file with @NScriptType UserEventScript. This script fires afterSubmit on the record type you choose.

2

Write the afterSubmit function

The afterSubmit function receives a context object with context.newRecord. Extract customer phone (use entity record lookup), order number (context.newRecord.getValue("tranid")), and amount (context.newRecord.getValue("total")).

3

Look up customer phone via N/record

Use require(["N/record"]) to load the customer record by internalId. Access the field custentity_whatsapp_number (custom field) or phone field from the entity record.

4

Call WA.Expert API via N/https

Use NetSuite's N/https module for external HTTP calls. Create a https.post() call to WA.Expert API with the phone, template name, and variables. N/https handles SSL automatically.

5

Deploy the script

In Script record: Deployments tab → New Deployment. Set Record Type (Sales Order, Invoice, etc.). Set Execute As: specify a service account user. Status: Released. Save and test by creating a Sales Order.

/** * @NScriptType UserEventScript * @NApiVersion 2.1 * NetSuite → WA.Expert WhatsApp on Sales Order save */ define(['N/https', 'N/record', 'N/log'], (https, record, log) => { const afterSubmit = (context) => { if (context.type !== context.UserEventType.CREATE) return; const so = context.newRecord; const entityId = so.getValue('entity'); // Load customer record for phone const customer = record.load({ type: record.Type.CUSTOMER, id: entityId }); const phone = customer.getValue('custentity_whatsapp') || customer.getValue('phone'); if (!phone) return; https.post({ url: 'https://api.wa.expert/v1/send', headers: {Authorization: 'Bearer YOUR_API_KEY'}, body: JSON.stringify({ to: phone, template: 'netsuite_so_confirm', variables: { name: customer.getValue('companyname'), order: so.getValue('tranid'), amount: so.getValue('total') } }) }); }; return {afterSubmit}; });

N/https module governance units: 10 per call. Each script execution has 5,000 governance units (standard) or 10,000 (scheduled). For bulk operations, use a Scheduled Script (Map/Reduce) instead of User Event to avoid governance limit hits.

Method 2 NetSuite Workflow Action — No-Code

1

Create a workflow on the target record type

Customization → Workflow → Workflows → New. Record Type: Sales Order (or Invoice, Customer). Trigger On: After Record Submit. Set condition: Record was just created.

2

Add a Send HTTP Request action

Add Action → Send HTTP Request (available in NetSuite 2021.1+). Method: POST. URL: https://api.wa.expert/v1/send. Headers: Content-Type: application/json, Authorization: Bearer YOUR_KEY.

3

Build the JSON body with field tokens

NetSuite workflow uses {field_id} tokens for dynamic content. Body example: {"to":"{custentity_whatsapp}","template":"so_confirm","variables":{"name":"{altname}","order":"{tranid}"}}

4

Activate the workflow

Set Status to Released. Test with a new Sales Order. Check Workflow Execution Log (Customization → Workflow → Workflow Execution Log) to debug any errors.

// NetSuite Workflow — Send HTTP Request action body // Field tokens replaced dynamically by NetSuite { "to": "{custentity_whatsapp}", "template": "netsuite_invoice_ready", "variables": { "name": "{altname}", "invoice_num": "{tranid}", "amount": "{total}", "due_date": "{duedate}" } } // Workflow condition: Type = Invoice, Status = Open // Action fires: After Record Submit, if custentity_whatsapp is not empty

The Send HTTP Request workflow action requires NetSuite 2021.1 or later. For older NetSuite versions, use a SuiteScript User Event script instead. Both achieve the same result — the workflow approach just requires no scripting knowledge.

Common questions

What SuiteScript version should I use — 1.0 or 2.0?
Use SuiteScript 2.1 (the latest version of SS2). It supports modern JavaScript (async/await, arrow functions, let/const) and has better module support. SuiteScript 1.0 is deprecated. All new development should use SS 2.0 or 2.1. The N/https module is only available in SS 2.0+, which is required for calling WA.Expert API.
Where do I store WhatsApp phone numbers in NetSuite?
Best practice: create a custom entity field on Customer record — Field ID: custentity_whatsapp, Label: "WhatsApp Number", Type: Free-Form Text, Length: 20. Apply to: Customer, Contact. This dedicated field keeps WhatsApp number separate from main phone and fax. Make it visible on the Communication tab of the Customer form.
How many governance units does a WA.Expert API call consume?
N/https.post() consumes 10 governance units per call. A standard User Event script gets 5,000 units. This means you can make up to 500 HTTP calls per script execution — more than enough for single-record notification. For bulk operations (script processing 1,000+ records), use a Map/Reduce script which has much higher governance limits.
Can I trigger WhatsApp from NetSuite payment application?
Yes — create a User Event script on the Customer Payment record type. The afterSubmit fires when a payment is applied. Extract the customer, amount, and invoice number. Send a payment receipt WhatsApp. This is one of the highest-value NetSuite + WhatsApp automations as payment acknowledgements significantly reduce accounts receivable queries.
Does NetSuite's SuiteTalk REST API support webhooks/push notifications?
NetSuite does not have true push webhooks in SuiteTalk REST. Instead: (1) Use SuiteScript User Events (push from NetSuite side), or (2) Poll SuiteTalk REST API from an external service every few minutes (pull from outside). The SuiteScript approach is always preferred for real-time WhatsApp delivery.
Can NetSuite workflow actions call WA.Expert API directly in India?
Yes — NetSuite's workflow HTTP request action can call any HTTPS endpoint globally, including WA.Expert's Indian-region API servers. Ensure your WA.Expert API key is stored as a Script Parameter (not hardcoded) in the workflow for security.

More connection guides

Ready to connect Oracle NetSuite to WhatsApp?

SuiteScript 2.0 User Event or no-code Workflow Actions — choose your path. WA.Expert handles the WhatsApp API side.

Start Free Trial → Talk to a Developer