> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/integration-guide/readme/accounting-and-erp/integrating-with-netsuite.md).

# Integrating with NetSuite

Connect NetSuite to Drivetrain with token-based authentication and a least-privilege role. Covers setup, saved searches, what syncs and troubleshooting.

You connect NetSuite yourself with token-based authentication (TBA): create an integration and an access token in NetSuite, then enter five values in Drivetrain. Saved searches are optional and need a small script in NetSuite.

## Before you start

* **In Drivetrain:** you need to be an admin.
* **In NetSuite:** a NetSuite administrator does the setup below. The connection itself should use a dedicated integration user with its own role. The Administrator role also works, but Oracle advises against it for web services integrations.
* **Features** to enable at **Setup** > **Company** > **Setup Tasks** > **Enable Features**:
  * **SuiteCloud** subtab: **REST Web Services** and **Token-based Authentication** (under **Manage Authentication**). For saved searches, also **SOAP Web Services**, **Client SuiteScript** and **Server SuiteScript**.
  * **Analytics** subtab: **SuiteAnalytics Workbook**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-0777872b84a05788323381985e17b2bf7ad35143%2FNetsuite-2.avif?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-9c30072bd5006c7812970333b4aba2a70e92a6dd%2FNetsuite-1.avif?alt=media)

* **Permissions** for the integration role (Drivetrain only reads data):

| Tab     | Permission                 | Level | Needed for                                         |
| ------- | -------------------------- | ----- | -------------------------------------------------- |
| Setup   | Log in using Access Tokens | Full  | All                                                |
| Setup   | REST Web Services          | Full  | All                                                |
| Reports | SuiteAnalytics Workbook    | Edit  | All                                                |
| Setup   | User Access Tokens         | Full  | Only if the integration user creates its own token |
| Setup   | SOAP Web Services          | Full  | Saved searches                                     |
| Lists   | Documents and Files        | Full  | Saved searches                                     |

The role also needs view access to every record Drivetrain syncs (see [What data comes in](#what-data-comes-in)), including each transaction type you plan with (for example journal entries, invoices and bills), consolidated exchange rates, accounting periods and deleted records. If you use subsidiaries or multiple accounting books, give the role **All** subsidiaries with **Allow Cross-Subsidiary Record Viewing**, and all accounting books. [Integrating with NetSuite (Role Based Access)](/integration-guide/readme/others/integrating-with-netsuite-role-based-access.md) has a complete role sheet you can copy; it grants more than this minimum, which also works.

{% hint style="warning" %}
NetSuite doesn't raise an error for records the role can't see. It leaves them out. If numbers in Drivetrain are lower than in NetSuite, check the role's transaction types and subsidiaries first.
{% endhint %}

## Step 1: Set up NetSuite

### 1. Create the integration user

* Create the role at **Setup** > **Users/Roles** > **Manage Roles** > **New**, with the permissions above.
* Go to **Lists** > **Employees** > **Employees** > **New**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-214bc67031c5cdc4f3bf9dcb6c0c1e8699a9881b%2FScreenshot%202025-04-16%20at%208.09.32%E2%80%AFPM.png?alt=media)

* Select the **Standard Employee Form**, enter the name "Drivetrain Integration" and a service-account email from your own domain (for example `drivetrain@mycompany.com`).

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-9b68bb076f16117a8be51a62d40caf9934a8b2e2%2FScreenshot%202025-04-16%20at%208.31.55%E2%80%AFPM.png?alt=media)

* On the **Access** subtab, check **Give Access**, set a password, add the role you created (the screenshot shows Administrator) and click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-275f36f72d271b532719e67923a4446981351ade%2FScreenshot%202025-04-16%20at%2010.11.00%E2%80%AFPM.png?alt=media)

### 2. Create an integration

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

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-c1e9599867cde55ff5b787773ac0c513a3b57c91%2FNetsuite-6.png?alt=media)

* Enter a **Name** (for example "Drivetrain Integration"). Under **Authentication**, check **TOKEN-BASED AUTHENTICATION** and uncheck **TBA: AUTHORIZATION FLOW**. In **OAuth 2.0**, uncheck **AUTHORIZATION CODE GRANT**. Click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-63c041d0f367fbc8f87e2690e318379fb4d87cda%2Fnetsuite-07.png?alt=media)

* Under **Client Credentials** at the bottom of the page, copy the **Consumer Key** and **Consumer Secret**. NetSuite shows them only once.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-19baabfc18a9bed176836b0d9166c261ac0437ea%2FScreenshot%202025-04-17%20at%2012.53.14%E2%80%AFPM.png?alt=media)

### 3. Create an access token

* Log in to NetSuite as the integration user and click the **Home** icon.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-f099d80780ac21aa914335453e647807a20f105b%2FScreenshot%202025-04-17%20at%201.02.57%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-7e5599f9641ff59293baaa11e59f528475a4096c%2FScreenshot%202025-04-17%20at%201.11.17%E2%80%AFPM.png?alt=media)

* At the bottom of the **Settings** list, click **Manage Access Tokens**, then **New My Access Token**. The link only appears if Token-based Authentication is enabled and the role has **User Access Tokens**. An administrator can instead create the token at **Setup** > **Users/Roles** > **Access Tokens** > **New**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-faf07d62ff5b32c8b4c298f0435952c13e2b8b5a%2FScreenshot%202025-04-17%20at%201.13.21%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-dcc0b524108b7d827eb585856e262c57d9d15a85%2FScreenshot%202025-04-17%20at%201.17.24%E2%80%AFPM.png?alt=media)

* In **APPLICATION NAME**, select the integration from step 2 and click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-67e876f92fd3e0a8aed6a13cddd1aa9622300082%2FScreenshot%202025-04-17%20at%201.19.33%E2%80%AFPM.png?alt=media)

* Copy the **Token ID** and **Token Secret**. NetSuite shows them only once.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-5d5fd520a9289498fa0329b58d235951d210f61f%2FScreenshot%202025-04-17%20at%201.21.49%E2%80%AFPM.png?alt=media)

### 4. Find your account ID

* Go to **Setup** > **Company** > **Company Information** and copy the **Account ID** (for example `1234567`, or `1234567_SB1` for a sandbox).

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-23c0f178661437cfe544b52ededb31410a494db8%2FScreenshot%202025-04-17%20at%201.25.27%E2%80%AFPM.png?alt=media)

### 5. Install the saved search script (only for saved searches)

1. Download the script from <https://highway-cdn.drivetrain.ai/scripts/DrivetrainSavedSearch.zip> and unzip it.
2. Go to **Customization** > **Scripting** > **Scripts** > **New**. The Upload Script File form opens.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-5785b8522e80a1eb86c33b18cb68f79f3f50c67f%2FScreenshot%202025-04-17%20at%201.46.36%E2%80%AFPM.png?alt=media)

3. Hover over the **Script File** field and click the **+** button that appears. Pick a folder if you don't want the default (SuiteScripts), click **Choose File**, select the unzipped file and click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-66f24ab9ad340897c9a2355c3678a12df1d086ef%2FScreenshot%202025-04-17%20at%201.48.37%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-0364a1362455a399b20eae8d29602e8dbbb98792%2FScreenshot%202025-04-17%20at%201.53.54%E2%80%AFPM.png?alt=media)

4. Click **Create Script Record**. Enter **Name** "Drivetrain Saved Search" and **ID** "drivetrainsavedsearch". On the **Deployments** tab, enter **Title** "DrivetrainSavedSearch" and set the status to **Released**. Click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-af96bd474f56a40ddd857f032fe566ef76c7139b%2FScreenshot%202025-04-17%20at%201.55.30%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-56b5dd5fe3f44c70e91eb8cebeefd02cd7eb9d6a%2FScreenshot%202025-04-17%20at%202.00.33%E2%80%AFPM.png?alt=media)

5. Click the deployment title to open the Script Deployment, and copy the **External URL**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-b8544297427a92de2a52de0aa659c46db05fbdb2%2FScreenshot%202025-04-17%20at%202.02.17%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-39d37ff9bea68d286757040245c263dab75c91fe%2FScreenshot%202025-04-17%20at%202.06.51%E2%80%AFPM.png?alt=media)

6. Edit the deployment, add the integration user's role to its audience (the screenshot shows Administrator) and click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-0cfac5ce27be589b93a502e3c3a25c8e78f6a292%2FScreenshot%202025-04-17%20at%202.18.43%E2%80%AFPM.png?alt=media)

7. Go to **Documents** > **Files** > **File Cabinet** > **New** and add a folder named **DrivetrainExports** at the root. The script writes each export there.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-1d2f55426c8cefd82e00419aa53eda9c3fa0c409%2FScreenshot%202025-04-17%20at%202.32.56%E2%80%AFPM.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-d70f8b5034565e3f09d78a15356ef1338acae40f%2FScreenshot%202025-04-17%20at%202.37.27%E2%80%AFPM.png?alt=media)

## Step 2: Connect NetSuite in Drivetrain

1. On the **Data** page, click the **+** icon at the top of the **Data** panel (or **Add data source** if nothing is connected yet).

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-b686fc3b0d4fbed523567f2a6c09e7140a5f251f%2FScreenshot%202025-04-17%20at%202.39.54%E2%80%AFPM.png?alt=media)

2. Select **NetSuite**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-26d4d370b6765418902cdc164931025ca085015c%2Fnetsuite-27.png?alt=media)

3. Enter **Account ID**, **Consumer key**, **Consumer secret**, **Token key** (NetSuite's **Token ID**) and **Token secret**, and click **Connect**. **Connect** stays disabled until every field is filled.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-a8b944ab0f6a1fb4eb0e7526605758951374b70e%2FScreenshot%202025-04-17%20at%202.41.52%E2%80%AFPM.png?alt=media)

4. Drivetrain tests the credentials, opens the new NetSuite data source and starts the first sync.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-10b8b0ef076e1f88d9605a3f11bfbc83649e82d1%2FScreenshot%202025-04-17%20at%207.43.05%E2%80%AFPM.png?alt=media)

### Add a saved search (optional)

Add saved searches after the first sync finishes. Each saved search must be visible to the integration role (for example **Public**), and you need the External URL from Step 1.5.

1. On the NetSuite data source, click **Add data** (it may read **Add saved search**).

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-27fa2e7743996cc112198a76a097915911ed78ef%2FScreenshot%202025-04-17%20at%205.07.28%E2%80%AFPM.png?alt=media)

2. Enter the **External URL** (if it isn't already filled in), paste the full **Saved search URL** and enter a **Display name**. For example, paste <https://123456.app.netsuite.com/app/common/search/searchresults.nl?searchid=884&whence=>, not just the ID 884.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-9ab4686271fb73b120dd36e450bbcfb368bd139d%2FScreenshot%202025-04-17%20at%205.17.52%E2%80%AFPM.png?alt=media)

3. Click **Create**. The saved search appears as a dataset once it syncs.

## What data comes in

* Accounts, accounting periods, consolidated exchange rates, currencies, customers, departments, classes, locations, subsidiaries, vendors, items, transactions, transaction lines, transaction accounting lines and deleted records. Drivetrain builds standard NetSuite datasets from them, such as General Ledger and Trial Balance.
* The first sync pulls all transactions. Later syncs pull only records changed since the last sync.
* Each saved search is exported in full on every sync.
* Data syncs daily by default. Use **Sync** in the data source's menu to sync now, or **Sync schedule** to change the schedule.

## Update credentials or disconnect

* NetSuite tokens don't expire, but they stop working if they're revoked or the user, role or integration changes. To enter a new token, open the data source's menu, choose **Edit credentials**, enter the values and click **Update credentials**. A full sync starts. You can't edit while a sync is running, or switch to a different NetSuite account.
* To disconnect, choose **Remove** and confirm. To also cut access on the NetSuite side, revoke the token at **Setup** > **Users/Roles** > **Access Tokens**.
* Your Drivetrain team may ask for read-only access to the NetSuite UI during onboarding to check numbers. This isn't needed for the connection.

## Troubleshooting

<details>

<summary>"Invalid login credentials. Please check for any errors or confirm that they are still valid"</summary>

Drivetrain's test query to NetSuite failed. Check the five values and that the token belongs to this integration and account. Check that **REST Web Services**, **Token-based Authentication** and **SuiteAnalytics Workbook** are enabled, and that the role has **Log in using Access Tokens**, **REST Web Services** and **SuiteAnalytics Workbook**.

</details>

<details>

<summary>"… must be alphanumeric" or "Account ID must be start with a number"</summary>

Copy the value again without spaces or line breaks. The account ID starts with digits, for example `1234567` or `1234567_SB1`.

</details>

<details>

<summary>Syncs fail and Drivetrain says the credentials are invalid or have been revoked</summary>

NetSuite rejected the login ("Invalid login attempt"): the token was revoked, or the user, role or integration changed. Check NetSuite's login audit trail at **Setup** > **Users/Roles** > **User Management** > **View Login Audit Trail**, create a new token and use **Edit credentials**.

</details>

<details>

<summary>The sync fails because a record type is "nonexistent" or returns an "invalid search query"</summary>

The role can't see that record type, or the feature is off in NetSuite. Give the role View access to it (see Before you start), or enable the feature.

</details>

<details>

<summary>Saved search: "NetSuite could not find this saved search…"</summary>

Check the saved search URL, and make the search public or visible to the integration role.

</details>

<details>

<summary>Saved search: "The NetSuite role connected to Drivetrain cannot export saved searches…"</summary>

Give the role **Documents and Files** at **Full**, and check that the **DrivetrainExports** folder exists at the root of the File Cabinet.

</details>

<details>

<summary>Saved search: "Drivetrain could not reach the saved search script in NetSuite…"</summary>

Check that the script deployment is **Released**, that the integration role is in its audience, and that the External URL is the deployment's. **Client SuiteScript** and **Server SuiteScript** must be enabled.

</details>

<details>

<summary>Saved search: "Invalid URL"</summary>

Paste full URLs. The External URL must contain `script=` and `deploy=`, and the saved search URL must contain `searchid=`.

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.drivetrain.ai/integration-guide/readme/accounting-and-erp/integrating-with-netsuite.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
