# NetSuite

## Overview

[Oracle NetSuite](https://www.netsuite.com) is a cloud-based ERP solution that helps businesses manage finance, CRM, e-commerce, and supply chain operations, providing real-time insights and streamlined processes.

### Org-Level vs User-Level

> **Org-Level**: Uses Token-based authentication for organization-wide access. Best for company-wide ERP and billing management.
>
> **User-Level**: Not typically supported for billing integrations.

## Create Integration (Org-Level)

### Prerequisites

Before you start, make sure you have:

- **Administrator access** in NetSuite, required to enable features and manage tokens.
- Your **NetSuite Account ID**, found in your browser URL (for example, `1234567_SB1` for a sandbox or `1234567` for production).

### Step 1: Enable SuiteCloud Communication

Suger communicates with NetSuite using modern protocols that you must turn on manually.

1. Navigate to **Setup > Company > Enable Features**.
2. Click the **SuiteCloud** tab.
3. **Enable Web Services**: Scroll to the **SuiteTalk (Web Services)** section and check both **SOAP Web Services** and **REST Web Services**.
4. **Enable Authentication**: In the **Manage Authentication** section, ensure **Token-Based Authentication** is checked.
5. Click **Save**.

### Step 2: Create the Suger Integration Record

This step generates the "Client" credentials that identify Suger to your specific NetSuite instance.

1. Go to **Setup > Integration > Manage Integrations > New**.
2. **Name the integration**: `Suger Connector`.
3. **Authentication**: Select **Token-Based Authentication**.
4. **Security Settings**: Ensure **TBA: IssueToken Endpoint** and **TBA: Authorization Flow** are both **Disabled**.
5. Click **Save**. NetSuite then displays your **Consumer Key (Client ID)** and **Consumer Secret (Client Secret)**.

:::warning
These keys are displayed **only once**. Copy them immediately into a secure password manager. If lost, you must create a new integration record and start over.
:::

### Step 3: Generate Access Tokens

While the integration record identifies *Suger*, the access token is the specific "key" that lets Suger perform actions on behalf of your user.

1. From your NetSuite Home page, go to the **Settings** portlet and click **Manage Access Tokens**.
2. Click **New Token**.
3. **Select Application**: Choose the `Suger Connector` you created in Step 2.
4. **Select User/Role**: Choose the appropriate user and role for this connection.
5. Click **Save**. NetSuite displays the **Token ID** and **Token Secret**. Copy these immediately.

### Step 4: Finalize in the Suger Console

Bring all the keys together to open the data pipe.

1. Open the **Suger Console** and navigate to **Settings > Integrations**.
2. Locate the **Oracle NetSuite** card and click **Connect**.
3. **Input credentials**: Paste your **Account ID**, **Client ID**, **Client Secret**, **Token ID**, and **Token Secret**.
4. Click **Create**. A status of **Verified** confirms that Suger is successfully communicating with your NetSuite ledger.

## Edit Integration

Editing is not supported. If you rotate your tokens or secrets for security compliance, delete the existing integration in the Suger Console and reconnect using the fresh keys.

## Delete Integration

To immediately terminate the connection, click the **Trash** icon next to the integration in the Suger Console.

:::warning
This does not affect your data in NetSuite. To be thorough, also revoke the access token or the integration record directly within NetSuite.
:::
