NetSuite RESTlet Installation
Prerequisites
Before starting the configuration, ensure the following:
- Full
Administrator
access is required for the target organization in NetSuite. - Administrator access is needed in xpna for the workspace.
- The NetSuite RESTlet can be downloaded from xpna by navigating to
Connections > Add New DataSource > Netsuite > Download RESTlet
.
Six (6) key pieces of information are required to establish a connection with NetSuite:
- Realm (Account ID)
- Consumer Key
- Consumer Secret
- Access Token Key
- Access Token Secret
- Script Deployment External URL
Integration
Enable Integration Features
To enable the xpna integration with NetSuite, certain features must be activated:
- Go to
Setup > Company > Enable Features
. - Under the SuiteCloud tab, ensure the following feature is enabled:
- Token-Based Authentication
Get Account ID
To retrieve the account ID from NetSuite:
- Navigate to
Setup > Company > Company Information
. - Copy the
Account ID
and save it for use in the connection as theRealm
.
Create an Integration
Create a new integration in NetSuite:
- Navigate to
Setup > Integration > Manage Integrations > New
. - Enter a name, e.g.,
xpnaConnect
. - Set the
State
toEnabled
. - Ensure
Token-Based Authentication
is checked. - Uncheck
TBA: Authorization Flow
. - Uncheck
Authorization Code Grant
in the OAuth 2.0 section. - Click
Save
.
Upon saving, the consumer/client credentials (i.e., Consumer Key
and Consumer Secret
) will be displayed. These credentials are necessary for the connection.
Note:
These credentials are displayed only once. Navigating away from the page will result in their loss.
User
Create a Role
To create a role for the xpna integration:
- Navigate to
Setup > Users/Roles > Manage Roles > New
. - Assign a name, e.g.,
xpnaConnect
. - Set
Accessible Subsidiaries
toAll
. - Set
Two-Factor Authentication Required
toNot Required
. - In the
Transactions
tab, set permissions toView
. - In the
Permissions
tab, set the following toFull
:- Access Token Management
- Login using Access Tokens
- User Access Token
Create a User
To create a user and assign the role created above:
- Go to
Lists > Employees > Employees > New
. - Enter a name, e.g.,
xpnaConnect
, and complete the required fields. - Click the
Access
tab. - Check the
Give Access
box. - Assign the role created earlier.
Create Credentials
- Navigate to
Setup > User/Roles > Access Tokens > New
. - Select the application for the integration created earlier.
- Select the user and role created previously.
- Enter a name, e.g.,
xpnaConnect
.
The access token credentials (Access Token Key
and Access Token Secret
) will be displayed. These credentials are required for the connection.
Note:
These credentials are displayed only once. Navigating away from the page will result in their loss.
RESTlet Deployment
Upload the xpna RESTlet
To upload the RESTlet script:
- Navigate to
Customization > Scripting > New
. - Click the
+
icon next toScript File
.- Set
Attach From
toComputer
. - Set
File Name
toxpnaConnect.js
. - Set
Folder
toSuiteScripts
. - Choose the file downloaded from xpna.
- Click
Save
.
- Set
- Ensure the file is selected in the
Script File
dropdown. - Click
Create Script Record
. - Set the name to
xpnaConnect.js
. - Set the script ID to
xpnaConnect
. - Click
Save
.
Deploy the xpna RESTlet
To deploy the RESTlet:
- In the
Scripts
tab:- Enable only
POST FUNCTION
.
- Enable only
- Click
Deploy Script
. - Set
Status
toReleased
. - Set
Log Level
toError
orDebug
. - In the
Audience
tab:- Select
ROLES
and choose the role created earlier.
- Select
- Click
Save
.
Copy the External URL
, as it is used in the connection as the Endpoint URL
.
Note:
If the script is re-deployed, the external URL will have an updated
deploy=<#>
value that must be updated in the connection.