Netsuite API
NetSuite API Connection
The NetSuite connector in OnLink uses Token-based Authentication (TBA) to connect to NetSuite. This guide walks through preparing your NetSuite account, creating an integration record (consumer key and secret), creating an access token (token ID and secret), and adding all four values to OnLink.
- 1 At a glance
- 2 Before you begin
- 3 Step 1: Prepare NetSuite for token-based authentication
- 4 Step 2: Create an integration record (Consumer Key and Secret)
- 5 Step 3: Create an access token (Token ID and Token Secret)
- 6 Step 4: Add the connection in OnLink
- 7 Step 5: Verify the connection
- 8 Troubleshooting
- 9 NetSuite documentation
At a glance
Connection field | Value | Where to get it |
|---|---|---|
Consumer Key | Generated string | NetSuite integration record confirmation page (step 2) |
Consumer Secret | Generated string | NetSuite integration record confirmation page (step 2) |
Token ID | Generated string | NetSuite access token confirmation page (step 3) |
Token Secret | Generated string | NetSuite access token confirmation page (step 3) |
Authentication | TOKEN-BASED AUTHENTICATION (TBA) | Handled by OnLink |
Before you begin
You need a NetSuite Administrator (or a user with the Integration Application permission) to create the integration record.
To create a token for another user, you need a role with the Access Token Management permission. Administrators can create tokens for themselves, but not for other Administrators.
Decide which NetSuite user and role OnLink will connect as. OnLink can only read the records that role can see.
Confirm you have access to OnLink to create the connection.
Sandbox and Release Preview: Tokens created in your production account aren't copied to Release Preview or sandbox accounts. To connect OnLink to a sandbox, create new tokens in that account — and create them again every time the sandbox is refreshed.
Oracle deprecation notice: Oracle states that as of NetSuite 2027.1, no new TBA integrations can be created for SOAP web services, REST web services, or RESTlets. Existing integrations continue to work.
Step 1: Prepare NetSuite for token-based authentication
Enable the Token-based Authentication feature: go to Setup > Company > Enable Features, open the SuiteCloud subtab, check Token-based Authentication under Manage Authentication, accept the terms and click Save. See Enable the Token-based Authentication Feature.
Create (or update) a role that allows token-based login: go to Setup > Users/Roles > User Management > Manage Roles, select the role, and on Permissions > Setup add Log in using Access Tokens (or User Access Tokens). See Set Up Token-based Authentication Roles.
Assign the integration user to that role: open the user's record (e.g. Lists > Employees > Employees), click Edit, open the Access subtab, add the TBA role and click Save. See Assign Users to Token-based Authentication Roles.
Step 2: Create an integration record (Consumer Key and Secret)
Go to Setup > Integration > Manage Integrations > New.
Enter a Name that identifies the app, e.g.
OnLink, and leave State as Enabled.On the Authentication subtab, make sure Token-based Authentication is checked.
Click Save.
Copy the Consumer Key and Consumer Secret from the confirmation page and store them securely.
For details, see Create Integration Records for Applications to Use TBA and Creating an Integration Record.
Copy the consumer key and secret now. NetSuite only displays them the first time you save the integration record. If you don't have the credentials, generate new ones for apps created in your NetSuite account (Manage Integrations → open the record → Edit → Reset Credentials). If the record was bundled, the credentials are included, and only the app owner can regenerate them. See Regenerating a Consumer Key and Secret.
Step 3: Create an access token (Token ID and Token Secret)
Users assigned a customized role that has the Access Token Management permission can create, assign, and manage a token for other users (except tokens for an Administrator role). For example, they can assign a token to users whose role has only the Log in using Access Tokens permission. TBA tokens do not expire; however, it is good practice to revoke a token after some time and create a new one.
Log in as a user with the Access Token Management permission.
Go to Setup > Users/Roles > Access Tokens.
On the Access Tokens page, click New Access Token.
Select the Application Name — the integration record from step 2.
Select the User from step 1.
Select the Role from step 1.
Keep the default Token Name (a concatenation of Application Name, User, and Role) or enter your own.
Click Save. The confirmation page displays the Token ID and Token Secret.
Copy the Token ID and Token Secret and store them securely. You'll paste them into OnLink in step 4.
For details, see Access Token Management – Create and Assign a TBA Token.
Copy the token now. For security reasons, the Token ID and Token Secret are only displayed on the confirmation page. After you leave it, they cannot be retrieved. If you lose them, create a new token and update OnLink.
Security: Treat the consumer key/secret and token ID/secret as you would a password. Never share them with unauthorized individuals, never send them by email, and don't include them in screenshots, tickets, or chat.
Step 4: Add the connection in OnLink
In OnLink, create a new connection and select NetSuite.
Enter the Consumer Key and Consumer Secret from step 2.
Enter the Token ID and Token Secret from step 3.
Save the connection.
Step 5: Verify the connection
Run a test sync (or Get Data) using the new NetSuite connection.
Confirm that records (e.g. employees) are returned and that the fields you need are populated.
If anything fails, check the OnLink Job logs and the troubleshooting section below.
Done: The connection is saved, OnLink can authenticate to NetSuite with TBA, and data is returned.
Troubleshooting
Symptom | Likely cause and fix |
|---|---|
Authentication fails with a previously working connection | The token was revoked, or the consumer key and secret were reset (resetting invalidates the old values). Create a new token or copy the new consumer credentials and update OnLink. |
Requests blocked | The integration record's State is Blocked or Waiting for Approval. Set it to Enabled in Setup > Integration > Manage Integrations. |
Sandbox connection fails | Production tokens aren't copied to sandbox or Release Preview accounts, and a sandbox refresh removes tokens. Create new tokens in the sandbox. |
Lost consumer secret or token secret | They are shown only once. Reset the consumer credentials (step 2) or create a new token (step 3). |
Records or fields missing | The token's role can't see them. Use a role with access to the required records. |
NetSuite documentation
Enable the Token-based Authentication Feature — turn on TBA in Enable Features
Set Up Token-based Authentication Roles — TBA permissions and how to add them to a role
Assign Users to Token-based Authentication Roles — give the integration user the TBA role
Creating an Integration Record — overview of integration records
Create Integration Records for Applications to Use TBA — integration record fields for TBA
Regenerating a Consumer Key and Secret — reset lost consumer credentials
Access Token Management – Create and Assign a TBA Token — create tokens for an integration user
Viewing, Editing, Creating, and Revoking TBA Tokens — manage and revoke tokens