NetSuite RESTlet Installation
Prerequisites
Before starting the configuration, ensure the following:
- Full
Administratoraccess 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 IDand 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
StatetoEnabled. - Ensure
Token-Based Authenticationis checked. - Uncheck
TBA: Authorization Flow. - Uncheck
Authorization Code Grantin 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 SubsidiariestoAll. - Set
Two-Factor Authentication RequiredtoNot Required. - In the
Transactionstab, set permissions toViewfor all types. - In the
Liststab, set the following permissions toView:- Accounts
- Classes
- Departments
- Locations
- Subsidiaries
- In the
Setuptab, set the following permissions:- Access Token Management :
Full - Company Information :
Full - Login using Access Tokens :
Full - Manage Accounting Periods :
View - Set Up Company (if available) :
View - User Access Token :
Full
- Access Token Management :
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
Accesstab. - Check the
Give Accessbox. - 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 FromtoComputer. - Set
File NametoxpnaConnect.js. - Set
FoldertoSuiteScripts. - Choose the file downloaded from xpna.
- Click
Save.
- Set
- Ensure the file is selected in the
Script Filedropdown. - 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
Scriptstab:- Enable only
POST FUNCTION.
- Enable only
- Click
Deploy Script. - Set
StatustoReleased. - Set
Log LeveltoErrororDebug. - In the
Audiencetab:- Select
ROLESand 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.