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

# NetSuite

> How to configure the NetSuite integration for Stuut.

This guide explains how to configure Stuut’s standard NetSuite integration using OAuth 2.0 Client Credentials (M2M). Once finished, Stuut imports historical data and performs hourly incremental syncs.

## NetSuite M2M OAuth setup for Stuut

This is the complete setup for the standard Stuut NetSuite integration.

### 1. Enable NetSuite features

As a NetSuite Administrator, go to **Setup → Company → Enable Features**.

Enable:

* **OAuth 2.0** under SuiteCloud
* **REST Web Services** under SuiteCloud / SuiteTalk (Web Services)
* **SuiteAnalytics Workbook** under Analytics, because it is listed in the Stuut reference permissions

Do not enable **RESTlets** for the standard Stuut flow.\
Enable **SuiteAnalytics Connect** only if Stuut confirms that this tenant uses a separate Connect/ODBC/JDBC connection.

### 2. Create or update the Stuut integration role

Go to **Setup → Users/Roles → Manage Roles → New**.

Name it something like `Stuut Integration`.

Add the following permissions from the supplied Stuut reference sheet.

**Transactions**

| Permission       | Level |
| ---------------- | ----- |
| Credit Memo      | View  |
| Customer Payment | View  |
| Find Transaction | View  |
| Invoice          | View  |

**Reports**

| Permission              | Level |
| ----------------------- | ----- |
| SuiteAnalytics Workbook | Edit  |

**Lists**

| Permission             | Level  |
| ---------------------- | ------ |
| Address List in Search | Full   |
| Contacts               | View   |
| Customers              | Full   |
| Documents and Files    | Create |
| Employee Record        | View   |
| Employees              | View   |
| Perform Search         | Full   |

**Setup**

| Permission                           | Level                                         |
| ------------------------------------ | --------------------------------------------- |
| Log in using Access Tokens           | Full                                          |
| Log in using OAuth 2.0 Access Tokens | Full                                          |
| REST Web Services                    | Full                                          |
| SuiteAnalytics Connect               | Full — only if Stuut confirms Connect is used |

The key permission for M2M OAuth is **Log in using OAuth 2.0 Access Tokens**. The other permissions determine which NetSuite records Stuut can read.

### 3. Assign the role to a dedicated service account

Create or identify a dedicated NetSuite employee/service-account user for Stuut.

Assign the `Stuut Integration` role to that employee. Avoid using an individual administrator’s everyday NetSuite account.

### 4. Generate the certificate key pair

<Tip>
  You can use any key-generation method, as long as the public certificate and private key are provided in `.pem` format.
</Tip>

Here is one way to generate the keys on macOS, Linux, or another Unix-like system with OpenSSL:

```bash theme={null}
umask 077
mkdir -p stuut-netsuite-m2m
cd stuut-netsuite-m2m

openssl genpkey \
  -algorithm RSA \
  -pkeyopt rsa_keygen_bits:4096 \
  -out stuut_private.pem

openssl req \
  -new \
  -x509 \
  -key stuut_private.pem \
  -out stuut_public.pem \
  -days 730 \
  -subj "/CN=Stuut NetSuite Integration"

chmod 600 stuut_private.pem
chmod 644 stuut_public.pem
```

* Upload `stuut_public.pem` to NetSuite.
* Keep `stuut_private.pem` confidential; share it with Stuut only via the approved secure-secret channel.

### 5. Create the NetSuite Integration Record

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

Set:

* **Name:** `Stuut Collections - Production`
* **State:** Enabled

Under **Authentication**:

* Enable **Client Credentials (Machine to Machine) Grant**
* Enable **REST Web Services**
* Leave **RESTlets** unchecked
* Enable **SuiteAnalytics Connect**

Save the record. Securely record the values shown on the confirmation page:

* Client ID
* Client Secret
* Application ID, if displayed

### 6. Create the M2M certificate mapping

Go to:

**Setup → Integration → Manage Authentication → OAuth 2.0 Client Credentials (M2M) Setup**

Click **Create New** and select:

* **Entity:** the dedicated Stuut service-account employee
* **Role:** `Stuut Integration`
* **Application:** `Stuut Collections - Production`
* **Certificate:** upload `stuut_public.pem`

Click **Save**.

Record the resulting **Certificate ID / mapping ID**.

### 7. Connect NetSuite to Stuut

Log in to Stuut and navigate to **Organization Settings → Connectors → All Connectors**. Choose **NetSuite** from the list.

Click **Add** and follow the instructions in the window. You will enter the credentials from the previous steps.

<Frame caption="Configure NetSuite connection in Stuut">
  <img src="https://mintcdn.com/stuut-support/nmJ4ksVxL4E4tSwJ/images/netsuite/configure-connection.png?fit=max&auto=format&n=nmJ4ksVxL4E4tSwJ&q=85&s=b454c93950dfc23fe2b044beef3fc398" alt="Stuut Configure NetSuite Connection window showing Account ID and OAuth 2.0 authentication method fields" width="1044" height="1550" data-path="images/netsuite/configure-connection.png" />
</Frame>

### 8. Validate the connection

Click the **Check Health** button in the top right. If everything was set up correctly, a success message will pop up. The integration is now set up and ready.

### 9. Optional: cash-application write-back

Only do this if Stuut will create payments in NetSuite.

Update the integration role:

| Permission                      | Level  |
| ------------------------------- | ------ |
| Transactions → Customer Payment | Create |

Use **Full** only if Stuut needs to reverse or void payments.
