Netsuite-Client
(Node + NetSuite)
This package contains functionality for connecting to NetSuite Web Services from Node, handling token authorization and SOAP XML parsing, and allows fetching records and uploading files.
Install
npm install @twec/netsuite-client
Use in your node app
Import
const NetSuiteClient = require('netsuite-client');
Instantiate
When instatiating your netsuite object, you'll need to provide a config object with connection details. See
netsuite-config-template.json.
const netSuiteConfig = {
};
const netsuiteClient = new NetSuiteClient(netsuiteConfig);
Get a record
const record = await netsuiteClient.get({
type: '',
internalId: '',
externalId: ''
});
Upload a file
const fileRef = await netsuiteClient.upload(
'./some/local/dir/my-file.csv',
'uploads/my-file.csv',
);
Other
Checkout other methods: look at the netsuite object console.log(netsuiteClient);
and read netsuite-client.js.
Limitations
Currently you can only fetch records (get
operation), upload a file (upsert
operation), and fetch folders.
Testing
- Create a
netsuite-config.json
file; see netsuite-config-template.json
for an example in the Functional test folder. - Run
yarn run test
to execute the test scripts.