Creating an external connection to NetSuite requires some initial configuration in NetSuite. This article explains the necessary steps in order to connect Trelica to NetSuite.

You must be in a NetSuite Administrator role in order to configure NetSuite to allow Trelica to connect to it.

Enable Token Based Authentication in NetSuite

Log in to NetSuite.

Go to Setup > Company > Enable Features.

Under the SuiteCloud sub-tab:

  • In the SuiteTalk (Web Services) field group, ensure that REST Web Services is checked.
  • In the Manage Authentication field group, ensure that Token Based Authentication is checked.
  • If you want to return purchase order documents, ensure that Server SuiteScript is checked.

Click Save.

Create a role and account for the Trelica integration

Create a Trelica role

Go to Setup > Users/Roles > User Management > Manage Roles > New. (or search for new role in the global search).

Give the role a descriptive name, such as Trelica Integration Role.

Under the Authentication field group, make sure Web Services Only Role is unchecked, as this does not work with OAuth1a.

Now go to the Permissions sub-tab and select the following permissions:

Section Permissions
Transactions Audit Trail (View)
Bills (View)
Check (View)
Enter Vendor Credits (View)
Expense Report (View)
Find Transaction (View)
Purchase Order (View)
Make Journal Entry (View)

Account Detail (View)
Accounts Payable (View)
Amortization Reports (View)
Expenses (View)
SuiteAnalytics Workbook (View)
Transaction Detail (View)
Purchase Order Reports (View)


Accounts (View)
Amortization Schedules (View)
Items (View)
Currency (View)
Departments (View)
Employees (View)
Employee Record (View)
Expense Categories (View)
Subsidiaries (View)
Vendors (View)
Documents and Files (View) [optional - only required if reading purchase order documents]

Setup REST Web Services (Full)
User Access Tokens (Full)
Log in using Access Tokens (Full)
Access Token Management (Full)
View Login Audit Trail (Full)
Bulk Manage Roles (View)

Click Save.

NetSuite lets you restrict access to subsidiaries and accounts. Unless you have a specific reason to restrict the data you are requesting, please ensure that:

Subsidiary Restrictions > Accessible Subsidiaries - set to All Under Accounting Books,

Accounting Books > Selected Accounting Books - set to All

Create a Trelica employee record

You can associate the newly created Trelica role with an existing employee account, but our general recommendation is to use dedicated integrations account

Dedicated accounts are created by adding an Employee and then allowing them to log in to NetSuite which consumes a NetSuite seat.

If you already have some form of integration account we recommend reusing this, and associating the Trelica role with it. When it comes to connect you will log in with the integration account, but will grant the access to the Trelica specific role. This allows you to use a single paid integration account but with different role profiles for the different applications you connect to NetSuite.

Go to Lists > Employees > Employees > New (or search for page:employees in the global search).

Give the Employee a descriptive name and ID, (e.g. TrelicaAPI).

Under the Access sub-tab, assign the newly created Trelica role.

Click Save.

The Trelica integration user will count towards your available user licenses.

Create a new Integration Record

Go to Setup > Integration > Manage Integrations > New (or search for page:integrations in the global search)

Field Value
Name Trelica
Description Trelica Spend Data Integration
State Enabled
Concurrency Limit 10 (suggested, or a value under the Max Concurrency Limit)

Now go to the Authentication sub-tab,

Find the Token-based Authentication field group and fill in the following fields:

Field Value
Token-based Authentication Checked
TBA Authorization Flow Checked
Callback URL


If your data is hosted in our EU cloud then please make sure you are using and not in the Callback URL.

Make sure that nothing is checked or entered in the OAuth2.0 and User Credentials field groups.

Click Save. On the confirmation screen, copy the following that you will need to authenticate:

  • Consumer Key (or Client ID)
  • Consumer Secret (or Client Secret)
If you forget to copy these, you can always edit the Integration Record and regenerate new details.

Find your NetSuite Account ID

Go to Setup > Integration > Webservice Preferences

Copy your Account ID and keep a note of it as you will need to enter it into Trelica.

Connect Trelica to NetSuite

If you received an email asking you to set up the integration, then just click on the link, otherwise login to Trelica and go to Admin > Integrations to get started.

In the Search... box, just type in NetSuite.

Then click on the NetSuite logo to get started, and on the next screen click Connect:

Now enter the Account ID, Consumer Key and Consumer Secret that you generated in NetSuite.

For sandbox instances, please use a minus sign (-) rather than an underscore (_) for the Account ID, e.g. 1234567-SB1.

Click Connect.

You will then need to login to NetSuite.

Once logged in, you will be asked to confirm that Trelica is allowed to access your NetSuite account.

Click Continue.

You will be taken back to Trelica and Trelica will start to request data from NetSuite. This may take some time but happens in the background, so you can freely navigate away from the page and come back later to check on progress.

User data

As well as spend transaction data, Trelica returns data about NetSuite users.

This includes data from the audit log about when the user last logged in to NetSuite, what roles they have, and what license is assigned to them

When you connect you can also choose to return infromation about all employees too (i.e. those who do not have NetSuite access).

If you haven't granted Trelica the Bulk Manage Roles (View) permission then Trelica cannot accurately ascertain which roles are Employee Center (billed at reduced rate), Vendor Center (free), Partner Center (free), or Customer Center (free) roles. You will see a warning message to this effect as this may mean that some users are incorrectly classified as General Access users. We recommend adding this role to the custom Trelica user role you used when first connecting Trelica to NetSuite.

Purchase Order document support

Pre-requisite permissions and features

If you are enabling Purcase Order document support having previously configured the Trelica NetSuite connector, then you may need to enable additional features or permissions. This section describes what you need to check.

Check role permissions

  1. Go to Setup > Users/Roles > User Management > Manage Roles.
  2. Click through to the Trelica role.
  3. Go to the Permissions sub-tab. Under the 'Lists' section ensure that Documents and Files (View) is checked.
  4. Click Save.

Check Server SuiteScript is enabled

  1. Go to Setup > Company > Enable Features.
  2. Under the SuiteCloud sub-tab ensure that Server SuiteScript is checked.
  3. Click Save and confirm the Terms of Service.

Configuring Purchase Order document support

Upload and deploy the Restlet

  1. Download and save the Trelica restlet to your computer. You will upload it shortly.
  2. Go to Netsuite and navigate to Customization > Scripting > Scripts.
  3. Click New Script.
  4. Hover over the Script file and click the + icon that appears.
  5. Under the Select File field, click and upload the file you just downloaded to your computer.
  6. Do not alter the File Name field. The file must have a .js suffix.
  7. Click Save. You will be taken back to the Upload Script File.
  8. Click Create Script Record.
  9. In the Script record page, enter Trelica in the Name field.
  10. Click Save. This will create the script record.
  11. Click Deploy Script. You will be taken to the Script Deployment page.
  12. In the Audience tab, make sure the Trelica Integration Role is selected.
  13. Set the Status to Released.
  14. Click Save
  15. Copy the External URL to your clipboard.

Configuring in Trelica

  1. Go to the Netsuite connection in Trelica and click Settings.
  2. Select the Purchase Order documents feature:
  3. Scroll down and paste the URL into the Restlet URL field in Trelica.
  4. Re-enter your Consumer Secret.
  5. Click Reconnect.


What do I do if I've forgotten my NetSuite Consumer Key and Consumer Secret?

You can regenerate them by editing the integration record:

Was this article helpful?

0 out of 0 found this helpful



Please sign in to leave a comment.