> For the complete documentation index, see [llms.txt](https://docs.kognitos.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kognitos.com/legacy/legacy-experience/books/reference/netsuite.md).

# NetSuite

{% hint style="info" %}
The following documentation is for **NetSuite v2.2.1** *(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 call a GET restlet in *netsuite*

Invoke a RESTlet in NetSuite with an HTTP GET request.

**Before calling a RESTlet, first describe it** (using its `script_id`) to retrieve the SuiteScript source code. Analyze the source to determine the expected query-string parameters, then supply them via `parameters`. The request is signed with the book's existing Token Based Authentication, so no OAuth signature needs to be computed by the caller. Inputs are sent as query string parameters. Note: although GET is conventionally read-only, a RESTlet is arbitrary SuiteScript and may have side effects regardless of the HTTP method.

**Input Concepts**

| Concept      | Description                                                                             | Type   | Required | Default Value |
| ------------ | --------------------------------------------------------------------------------------- | ------ | -------- | ------------- |
| `script id`  | The numeric internal id of the RESTlet script (the `script` URL parameter).             | `text` | Yes      | (no default)  |
| `deploy id`  | The numeric deployment id of the RESTlet (the `deploy` URL parameter). Defaults to "1". | `text` | No       | 1             |
| `parameters` | Optional query string parameters to send to the RESTlet.                                | `json` | No       | (no default)  |

**Output Concepts**

| Concept  | Description                                | Type  |
| -------- | ------------------------------------------ | ----- |
| `answer` | The parsed JSON response from the RESTlet. | `any` |

**Examples**

```generic
call a GET restlet in netsuite
the script id is "4965"
the deploy id is "1"
```

### to call a POST restlet in *netsuite*

Invoke a RESTlet in NetSuite with an HTTP POST or PUT request.

**Before calling a RESTlet, first describe it** (using its `script_id`) to retrieve the SuiteScript source code. Analyze the source to determine the expected JSON body shape and required fields, then supply them via `body`. The request is signed with the book's existing Token Based Authentication, so no OAuth signature needs to be computed by the caller. The body is sent as a JSON payload. Both POST and PUT send the body the same way; choose the method the RESTlet implements.

**Input Concepts**

| Concept     | Description                                                                             | Type   | Required | Default Value |
| ----------- | --------------------------------------------------------------------------------------- | ------ | -------- | ------------- |
| `script id` | The numeric internal id of the RESTlet script (the `script` URL parameter).             | `text` | Yes      | (no default)  |
| `body`      | The JSON body to send to the RESTlet.                                                   | `json` | Yes      | (no default)  |
| `deploy id` | The numeric deployment id of the RESTlet (the `deploy` URL parameter). Defaults to "1". | `text` | No       | 1             |
| `method`    | The HTTP method to use, either "POST" (default) or "PUT".                               | `text` | No       | POST          |

**Output Concepts**

| Concept  | Description                                | Type  |
| -------- | ------------------------------------------ | ----- |
| `answer` | The parsed JSON response from the RESTlet. | `any` |

**Examples**

```generic
call a POST restlet in netsuite
the script id is "4965"
the deploy id is "1"
the body is the payload
```

### to describe a restlet from *netsuite*

Describe a RESTlet by returning the source of its SuiteScript file.

NetSuite does not publish an input/output schema for RESTlets, so the only authoritative description of what a RESTlet expects and returns is its SuiteScript source. This procedure looks up the script file backing the RESTlet and returns its source so the contract can be inspected. **This is the prerequisite step before calling any RESTlet.** The caller should read the returned `source` to determine the expected input parameters (for GET) or JSON body shape (for POST/PUT), and then use that knowledge when calling the RESTlet via the appropriate invoke procedure.

**Input Concepts**

| Concept     | Description                                                                                                    | Type   | Required | Default Value |
| ----------- | -------------------------------------------------------------------------------------------------------------- | ------ | -------- | ------------- |
| `script id` | The numeric internal id of the RESTlet script (the `script_id` returned by retrieving the available restlets). | `text` | Yes      | (no default)  |

**Output Concepts**

| Concept  | Description                                                                                             | Type   |
| -------- | ------------------------------------------------------------------------------------------------------- | ------ |
| `answer` | A dict with the script's id, name, string id, script file id, and the `source` of the SuiteScript file. | `json` |

**Examples**

```generic
describe a restlet from netsuite
the script id is "4965"
```

### 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"
```

### to retrieve the available restlets from *netsuite*

List the RESTlet scripts and their deployments in this NetSuite account.

Returns one row per RESTlet deployment. The `script_id` and `deploy_id` values are the numeric identifiers used to invoke a RESTlet (they map to the `script` and `deploy` URL parameters). Only deployments with `status` of `RELEASED` and `is_deployed` of `T` are callable.

**Output Concepts**

| Concept  | Description                                                                                                                    | Type   |
| -------- | ------------------------------------------------------------------------------------------------------------------------------ | ------ |
| `answer` | A list of RESTlets, each with: script\_id, deploy\_id, name, script\_string\_id, deploy\_string\_id, status, and is\_deployed. | `json` |

**Examples**

```generic
retrieve the available restlets from netsuite
```


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kognitos.com/legacy/legacy-experience/books/reference/netsuite.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
