NetSuite
Procedures and concepts for the NetSuite integration.
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)
Go to Books → All Books.
Search for the name of the book and click on it.
Click on Install or Add Connection to add the book to your agent.
If adding a connection, you'll be prompted for 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).
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.
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
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
answer
The parsed JSON response from the RESTlet.
any
Examples
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
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
answer
The parsed JSON response from the RESTlet.
any
Examples
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
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
answer
A dict with the script's id, name, string id, script file id, and the source of the SuiteScript file.
json
Examples
to retrieve a file's information from netsuite
Get a file's information from NetSuite's File Cabinet, using the SOAP API.
Input Concepts
file id
The ID of the file to retrieve information for
text
Yes
(no default)
Output Concepts
answer
The file's information
json
Examples
to retrieve a schema from netsuite
Get the JSON schema for an entity
Input Concepts
entity
The entity to get the schema for
text
Yes
(no default)
Output Concepts
answer
The schema for the entity
json
Examples
to retrieve an attachment from netsuite
Get an attachment from NetSuite's File Cabinet, using the SOAP API.
Input Concepts
attachment id
The ID of the attachment to retrieve
text
Yes
(no default)
Output Concepts
answer
The attachment
file
Examples
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
answer
A list of RESTlets, each with: script_id, deploy_id, name, script_string_id, deploy_string_id, status, and is_deployed.
json
Examples
Last updated
Was this helpful?

