Netsuite API

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.

At a glance

Connection field

Value

Where to get it

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

  1. 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.

  2. 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.

  3. 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)

  1. Go to Setup > Integration > Manage Integrations > New.

  2. Enter a Name that identifies the app, e.g. OnLink, and leave State as Enabled.

  3. On the Authentication subtab, make sure Token-based Authentication is checked.

  4. Click Save.

  5. 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.

  1. Log in as a user with the Access Token Management permission.

  2. Go to Setup > Users/Roles > Access Tokens.

  3. On the Access Tokens page, click New Access Token.

  4. Select the Application Name — the integration record from step 2.

  5. Select the User from step 1.

  6. Select the Role from step 1.

  7. Keep the default Token Name (a concatenation of Application Name, User, and Role) or enter your own.

  8. Click Save. The confirmation page displays the Token ID and Token Secret.

image-20251216-143811.png
  1. 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

  1. In OnLink, create a new connection and select NetSuite.

  2. Enter the Consumer Key and Consumer Secret from step 2.

  3. Enter the Token ID and Token Secret from step 3.

  4. Save the connection.

Step 5: Verify the connection

  1. Run a test sync (or Get Data) using the new NetSuite connection.

  2. Confirm that records (e.g. employees) are returned and that the fields you need are populated.

  3. 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

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