UNPKG

netsuite

Version:

A wrapper library for NetSuite's SuiteTalk SOAP API using NodeJS

44 lines (29 loc) 1.15 kB
### Getting Started Install the package using npm. ```$ npm i netsuite --save``` Create a new instance of the client. Initializing the client is an asynchronous operation. ``` javascript 'use strict'; const netsuite = require('netsuite'); const netsuiteClient = new netsuite({ accountId : YOUR_ACCOUNT_ID, appId : YOUR_APPLICATION_ID, baseUrl : YOUR_BASE_URL, // defaults to production NS - https://webservices.netsuite.com/services/NetSuitePort_2016_1 password : YOUR_PASSWORD, roleId : YOUR_ROLE_ID, username : YOUR_USERNAME, wsdlPath : YOUR_WSDL_PATH // defaults to wsdl (v2016) inside of npm directory }); netsuiteClient.init((err) => { // handle error if needed // netsuiteClient methods will now work }); ``` ### Methods ###### Get Record Retrieve a NetSuite Record of any allowed type using an internalId. Handle call asynchronously using a callback. ```netsuiteClient.getRecord(type, internalId, callback);``` __Arguments__ * type (String): Type of Record (i.e. 'salesOrder', 'customer') * internalId (String|Number): Internal Id of Record * callback (Function): ```(err, resp)```