> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/workflow-builder/apps/netsuite.md).

# NetSuite

## Connecting NetSuite to Stack AI (Token-Based Authentication)

This guide walks through setting up a **NetSuite Token-Based Authentication (TBA)** connection so StackAI can read and/or write data in your NetSuite account.

Note: Our most popular NetSuite action is **Custom SuiteQL**, shown below:

<figure><img src="/files/zQBpTrk7Go47FuPMufPD" alt=""><figcaption></figcaption></figure>

By the end of this guide you'll have collected **five values** to paste into Stack AI to establish the connection:

<figure><img src="/files/BzpWiSgxgGKNwfdVSEg9" alt=""><figcaption></figcaption></figure>

### Step 1: Enable the required features

Go to Setup -> Company -> Enable Features:

<figure><img src="/files/ohQydft9GjuGPasyAX6D" alt=""><figcaption></figcaption></figure>

Make sure you have SuiteAnalytics Workbook, Token-Based Authentication, and REST Web Services all enabled for your account:

<figure><img src="/files/NKW0Lpi5yL6OMfHNc3fA" alt=""><figcaption></figcaption></figure>

### Step 2: Find your Account ID

Go to Setup -> Company -> Company Information:

<figure><img src="/files/LemEe2FOhggrOQBgmC3Z" alt=""><figcaption></figcaption></figure>

Jot down your Account ID shown here:

<figure><img src="/files/aGQALpnSeAQPIYayxA3V" alt=""><figcaption></figcaption></figure>

### Step 3: Register StackAI as an Integration Record

Go to Set up -> Integration -> Manage Integrations -> New

<figure><img src="/files/U1OzmMymWDcYzfHtak8q" alt=""><figcaption></figcaption></figure>

Give it a name, and check "TOKEN-BASED AUTHENTICATION". Uncheck anything in the OAuth 2.0 section - this integration used TBA only.

<figure><img src="/files/yyxK14o75mMcyWBcezqD" alt=""><figcaption></figcaption></figure>

Hit Save -> Then jot down the consumer key and consumer secret (it is only shown once):

<figure><img src="/files/TsyXs46kvXlKSU56qaML" alt=""><figcaption></figcaption></figure>

### Step 4: Create a role with the right permissions

Go to Setup -> Users/Roles -> Manage Roles -> New

<figure><img src="/files/2V7hCbhpWiI0QpDy8RpR" alt=""><figcaption></figcaption></figure>

Create a new role:&#x20;

* Enter a name
* Select "All" for Accessible subsidaries
* Select "WEB SERVICES ONLY ROLE" in the Authentication section. (You can put anything for center type since this is a web services only role)

<figure><img src="/files/tVGqx9AU8DAldiKb2w6O" alt=""><figcaption></figcaption></figure>

Set the following permissions for the integration to work:

* SuiteAnalytics Workbook (Reports sub-tab)
* Log in using Access Tokens (Setup sub-tab)
* REST Web Services (Setup sub-tab)

<figure><img src="/files/V3PwtAWaxcYHxzw20WsQ" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/5nz7LbQuM4pCGoN2lNSQ" alt=""><figcaption></figcaption></figure>

### Step 5: Assign the role to a user

Go to Lists -> Employees -> Employees -> Search

<figure><img src="/files/viuU7lqoEGSZnuxqxq74" alt=""><figcaption></figcaption></figure>

Search for the user you want to assign the role to:

<figure><img src="/files/UajZFNJkI51iKFnbqOmT" alt=""><figcaption></figcaption></figure>

Click Edit:

<figure><img src="/files/fuaSsOcIXRpFeFwDj3pe" alt=""><figcaption></figcaption></figure>

* Check "Give Access"
* Add the role you created in Step 4
* Hit Save

<figure><img src="/files/2Jy8UupO3QeosUre08cH" alt=""><figcaption></figcaption></figure>

Important Note! You need to make sure the user who is logged into netsuite UI has "Access Token Management" permission for the next step. This can be assigned to the user as a global permission, or it can be added to the administrator role and the user could be assigned the administrator role in the screenshot above.

### Step 6: Generate an Access Token

Go to Setup -> Users/Roles -> Access Tokens -> New

<figure><img src="/files/mBfRvkFS2xCiQGvRTcql" alt=""><figcaption></figcaption></figure>

Fill in the Application name from Step 3, User from Step 5, and Role from Step 4. Choose a name for the token and hit Save.

<figure><img src="/files/GkutheukkI1d4NiwJ5Bc" alt=""><figcaption></figcaption></figure>

Jot down the Token ID and Token Secret (they are only shown once)

<figure><img src="/files/b7a2RycKXGaZm7jJGqsk" alt=""><figcaption></figcaption></figure>

### Step 7: Create the connection in StackAI

Enter all fields collected in the StackAI UI:

<figure><img src="/files/NAMhmfg6ojbovxL7lpcP" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stackai.com/workflow-builder/apps/netsuite.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
