> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# NetSuite Query authentication guide

export const maia = "Maia";

This is a step-by-step guide to acquiring NetSuite credentials and authorizing the [NetSuite Query](/docs/components/netsuite-query) component.

***

## Prerequisites

To authorize the NetSuite Query component, you *must* create a new integration. You cannot edit an existing integration. This process is described in the [Acquire NetSuite credentials](#acquire-netsuite-credentials) section below.

Before you can create an OAuth connection to NetSuite, you need to enable token-based authentication in your NetSuite account. To do this, follow the instructions in the NetSuite [Enable the Token-based Authentication Feature](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/bridgehead_4253254429.html) guide.

***

## Acquire NetSuite credentials

To acquire the credentials needed for a NetSuite OAuth connection, you need to create an integration. Follow the instructions below to create an integration. During this process, copy each credential and paste it somewhere so you can use it later to create an OAuth connection in {maia}.

1. Log in to the [NetSuite portal](https://www.netsuite.com/).

2. Copy your **Account ID** from the page URL. For example, if the URL is `https://1234567.app.netsuite.com`, your account ID is `1234567`. For more information, read the NetSuite [Finding your NetSuite Account ID](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1498754928.html) guide.

3. Follow the instructions in the NetSuite [Create Integration Records for Applications to Use TBA](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/bridgehead_4249032125.html#procedure_4253065190) guide until you see a confirmation page.

   <Note>
     Clear the **User credentials** checkbox when creating your integration.
   </Note>

4. On the confirmation page, copy your NetSuite **Consumer key** and **Consumer secret**.

   <Warning>
     * Make sure to copy the **Consumer key** and **Consumer secret** immediately as they will only appear once.
     * When copying these values, some browsers may add a space to the end of the string. Watch out for this as it will cause the credentials to fail.
   </Warning>

5. Follow the instructions in the NetSuite [Access Token Management - Create and Assign a TBA Token](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/bridgehead_4254081947.html#procedure_4253065595) guide until you see a confirmation page.

6. On the confirmation page, copy your NetSuite **Token ID** and **Token secret**.

   <Warning>
     * Make sure to copy the **Token ID** and **Token secret** immediately, as they will only appear once.
     * When copying these values, some browsers may add a space to the end of the string. Watch out for this, as it will cause the credentials to fail.
   </Warning>

***

## Create an OAuth connection

1. Follow the instructions in [OAuth](/docs/guides/oauth), and select NetSuite in the **Provider** field.
2. In the **Authentication Type** field, select **Composite Token**.
3. In **Client ID**, enter your NetSuite **Consumer ID**.
4. In **Client secret**, enter your NetSuite **Consumer secret**.
5. In **Account ID**, enter your NetSuite **Account ID**.
6. In **Access token**, enter your NetSuite **Token ID**.
7. In **Access token secret**, enter your NetSuite **Token secret**.
8. Click **Authorize**.
9. A new browser tab will open, connecting you to the third party. Select your account, and complete the connection. Upon success, this browser tab will close.

The **OAuth connections** menu will now display your new OAuth connection, which is ready for use with the NetSuite Query component.
