# NetSuite

{% hint style="info" %}
The following documentation is for **NetSuite v2.1.4** *(BDK)*.
{% endhint %}

## Overview

NetSuite is a comprehensive cloud-based enterprise resource planning (ERP) platform that integrates financial management, CRM, e-commerce, and business intelligence. This integration enables automated financial data synchronization, customer record management, order processing, and business reporting workflows. Streamline enterprise operations and enhance business process automation across your NetSuite environment.

## Prerequisites

### 1. Required Books

The following Book(s) need to be added to your agent so it can learn and understand the automation procedures defined within them:

* **NetSuite**

#### How to Add the Book(s)

1. Go to **Books** → **All Books**.
2. Search for the name of the book and click on it.
3. Click on <kbd>**Install**</kbd> or <kbd>**Add Connection**</kbd> to add the book to your agent.
4. If adding a connection, you'll be prompted for [**connectivity**](#connectivity) details.

## Connectivity

This section outlines the available methods for connecting to the Book, along with the required configuration details for each.

### Connect using Consumer key, Consumer secret, Token ID, Token secret and Account ID

Connects to Netsuite using token based authentication (TBA).

| Label           | Description                                  | Type        |
| --------------- | -------------------------------------------- | ----------- |
| Consumer key    | The consumer key for the Netsuite account    | `sensitive` |
| Consumer secret | The consumer secret for the Netsuite account | `sensitive` |
| Token ID        | The token ID for the Netsuite account        | `sensitive` |
| Token secret    | The token secret for the Netsuite account    | `sensitive` |
| Account ID      | The account ID for the Netsuite account      | `text`      |

### Configuration

The following table details all the available configuration options for this book.

| Concept                | Description                                                    | Type     | Default Value |
| ---------------------- | -------------------------------------------------------------- | -------- | ------------- |
| `attachment folder id` | Get the ID of the FileCabinet folder to upload attachments to. | `text`   | (no default)  |
| `netsuite timeout`     | Get the timeout value for API calls in seconds.                | `number` | (no default)  |

Configuration can be set or retrieved as shown in the following examples:

## Procedures

### to retrieve a file's information from *netsuite*

Get a file's information from NetSuite's File Cabinet, using the SOAP API.

**Input Concepts**

| Concept   | Description                                    | Type   | Required | Default Value |
| --------- | ---------------------------------------------- | ------ | -------- | ------------- |
| `file id` | The ID of the file to retrieve information for | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description            | Type   |
| -------- | ---------------------- | ------ |
| `answer` | The file's information | `json` |

**Examples**

```generic
retrieve a file's information from netsuite
the file id is "3000662"
```

### to retrieve a schema from *netsuite*

Get the JSON schema for an entity

**Input Concepts**

| Concept  | Description                      | Type   | Required | Default Value |
| -------- | -------------------------------- | ------ | -------- | ------------- |
| `entity` | The entity to get the schema for | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description               | Type   |
| -------- | ------------------------- | ------ |
| `answer` | The schema for the entity | `json` |

**Examples**

```generic
retrieve a schema from netsuite
the entity is "supportCase"
```

### to retrieve an attachment from *netsuite*

Get an attachment from NetSuite's File Cabinet, using the SOAP API.

**Input Concepts**

| Concept         | Description                          | Type   | Required | Default Value |
| --------------- | ------------------------------------ | ------ | -------- | ------------- |
| `attachment id` | The ID of the attachment to retrieve | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description    | Type   |
| -------- | -------------- | ------ |
| `answer` | The attachment | `file` |

**Examples**

```generic
retrieve an attachment from netsuite
the attachment id is "3000662"
```
