NetSuite Component
Manage NetSuite records
Component key: netsuite
Description
Oracle NetSuite is a unified business management suite, encompassing ERP/Financials, CRM and ecommerce.
For more details refer to NetSuite's API documentation.
Connections
NetSuite OAuth Auth Code
Tokens retrieved using Netsuite's OAuth 2.0 Auth Code flow expire after 7 days, and are not able to be refreshed. This requires a user to re-authenticate every 7 days, which is not a good user experience. We recommend using the OAuth 2.0 Client Credentials flow (described below) instead.
To make API requests to NetSuite on behalf of your customers, your customer will need to create an OAuth 2.0 app. NetSuite's OAuth 2.0 documentation details the steps that need to be taken.
As an administrator, your customer will need to:
-
Enable SuiteTalk
- Click Setup -> Company -> Enable Features
- Under the Suite Cloud tab, ensure REST WEB SERVICES and OAUTH 2.0 are both checked
-
Create an OAuth 2.0 app
- Click Setup -> Integration -> Manage Integrations -> New
- Give your integration a name and description
- Un-check TOKEN-BASED AUTHENTICATION and TBA: AUTHORIZATION FLOW under Token-based Authentication
- Ensure AUTHORIZATION CODE GRANT" and REST WEB SERVICES are checked under OAuth 2.0
- Enable REST WEB SERVICES under SCOPE
- Enter
https://oauth2.prismatic.io/callback
as your REDIRECT URI - Take note of your CONSUMER KEY and CONSUMER SECRET
-
Create OAuth 2.0 Roles
- Ensure that any user who wishes to log in via OAuth has been assigned a proper role.
As an integration developer, you will need to mark Consumer Key, Consumer Secret, and Token URL organization- and customer-visible, as your end user will need to edit them with their own values.
Input | Default | Notes | Example |
---|---|---|---|
Authorize URL string / Required Hidden Field authorizeUrl | https://system.netsuite.com/app/login/oauth2/authorize.nl | The OAuth 2.0 Authorization URL for NetSuite. | |
Consumer Key (Client ID) string / Required clientId | Generate a consumer key when you create your OAuth 2.0 app in NetSuite | example0000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
Consumer Secret (Client Secret) password / Required clientSecret | Generate a consumer secret when you create your OAuth 2.0 app in NetSuite | example0000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
Scopes string / Required Hidden Field scopes | rest_webservices | A space-delimited set of one or more scopes. This will always be rest_webservices | |
Token URL string / Required tokenUrl | https://<ACCOUNT_ID>.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token | The OAuth 2.0 Token URL for NetSuite. Replace <ACCOUNT_ID> with your account ID, which can be found in your browser's URL bar when you log in to NetSuite - https://<ACCOUNT_ID>.app.netsuite.com/ |
Netsuite OAuth Client Credentials
Connecting to NetSuite using Client Credentials (JWT) To make API requests to NetSuite on behalf of your customers, your customer will need to configure an OAuth 2.0 app with JWT option. NetSuite's OAuth 2.0 documentation provides detailed steps for setting this up. OAuth Client Credentials Setup documentation details the steps that need to be taken.
As an administrator, your customer will need to:
-
Enable SuiteTalk
- Navigate to Setup > Company > Enable Features
- Under the Suite Cloud tab, ensure that both REST WEB SERVICES and OAUTH 2.0 are checked.
-
To Create an OAuth 2.0 app with JWT Option
- Go to Setup > Integration > Manage Integrations > New
- Give your integration a name and a description.
- Un-check TOKEN-BASED AUTHENTICATION and TBA: AUTHORIZATION FLOW under Token-based Authentication
- Ensure the following are checked under OAuth 2.0
- REST WEB SERVICES
- CLIENT CREDENTIALS (MACHINE TO MACHINE) GRANT
- Enable REST WEB SERVICES under SCOPE
- Take note of and save your CONSUMER KEY and CONSUMER SECRET as it will not be shown again in Netsuite after this step
-
Generating the Certificate ID and Private Key for JWT
-
A private key is required for JWT-based authentication. Follow the steps below or refer to the NetSuite Documentation for generating or importing a private key.
-
On your machine create a valid certificate abiding by the Netsuite requirements using OpenSSL in a terminal. This will generate .pem files on your local machine containing key used as the Private Key for JWT information and the certificate for the next step
openssl req -x509 -newkey rsa:4096 -sha256 -keyout auth-key.pem -out auth-cert.pem -nodes -days 730
-
In Netsuite, navigate to Setup > Integration > OAUTH 2.0 CLIENT (M2M) SETUP and select Create New
-
Choose the proper Entity, Role, and select the Application created in the previous section.
-
For Certificate choose the the public key you create - that is the
auth-cert.pem
file that was generated in the aboveopenssl
steps. -
Once saved, a Certificate ID is generated. Save this for the Prismatic integration.
-
-
In your Prismatic Integration Connection configuration Select the Netsuite OAuth 2.0 Client Credentials connection Type and enter the following:
- Certificate ID from OAUTH 2.0 CLIENT (M2M) SETUP
- Private Key from the
auth-key.pem
file you created above. Copy the entire text including the-----BEGIN PRIVATE KEY-----
and-----END PRIVATE KEY-----
text - Consumer Key (Client ID) from the Netsuite integration
- Consumer Secret (Client Secret) from the Netsuite integration
-
Create OAuth 2.0 Roles
Ensure that any user who wishes to log in via OAuth has been assigned a proper role. As an integration developer, you will need to mark Consumer Key, Consumer Secret, Token URL, and Certificate ID as organization- and customer-visible, as your end user will need to edit them with their own values.
Input | Default | Notes | Example |
---|---|---|---|
Consumer Key (Client ID) string / Required clientId | Generate a consumer key when you create your OAuth 2.0 app in NetSuite | example0000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
Consumer Secret (Client Secret) password / Required clientSecret | Generate a consumer secret when you create your OAuth 2.0 app in NetSuite | example0000000000000000000000000aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
Certificate ID (Key ID) string / Required keyId | The key ID used for signing the JWT token. | zzP3z13fkaZsCcwCbmMpd5GvvPs9DTPIquAI83MnNx4 | |
Private Key for JWT text / Required privateKey | The private key used for signing the JWT token. | ||
Scopes string / Required Hidden Field scopes | rest_webservices | A space-delimited set of one or more scopes. This will always be rest_webservices | |
Token URL string / Required tokenUrl | https://<ACCOUNT_ID>.suitetalk.api.netsuite.com/services/rest/auth/oauth2/v1/token | The OAuth 2.0 Token URL for NetSuite. Replace <ACCOUNT_ID> with your account ID, which can be found in your browser's URL bar when you log in to NetSuite - https://<ACCOUNT_ID>.app.netsuite.com/ |
Data Sources
Select Record
Select a record from a list of records | key: selectRecord | type: picklist
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Pagination Limit string / Required limit | 1000 | Fetch only this many records at a time. | 10 |
Pagination Offset string offset | Fetch records offset by this value. | 20 | |
Query string query | Query to filter records by. See https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1545222128.html for details. | email START_WITH barbara | |
Record Field string recordField | Record Field to use as the label for the picklist. If unspecified, the record ID is used. | ||
Record Type string / Required recordType | Record type to perform the action against. |
Select SuiteQL
Execute a SuiteQL Query to create a picklist | key: selectSuiteQl | type: picklist
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Key Field string / Required key | Items returned field to use as the key for the picklist. | count | |
Label Field string / Required label | Items returned field to use as the label for the picklist. | ||
Pagination Limit string / Required limit | 1000 | Fetch only this many records at a time. | 10 |
Pagination Offset string offset | Fetch records offset by this value. | 20 | |
SuiteQL Payload code / Required query | Data payload to send in the action request. See https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157909186990.html for details. |
Actions
Create Record
Create record of specified type | key: createRecord
Input | Default | Notes |
---|---|---|
Connection connection / Required connection | ||
Debug boolean debugInput | Enable for additional logging information. | |
Payload code / Required payload | Data payload to send in the action request. See https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html for details. | |
Record Type string / Required recordType | Record type to perform the action against. |
Delete Record
Delete record of the specified type | key: deleteRecord
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug boolean debugInput | Enable for additional logging information. | ||
Record ID string / Required id | The ID of the record you want. | 100 | |
Record Type string / Required recordType | Record type to perform the action against. |
Get Record
Get record of specified type | key: getRecord
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug boolean debugInput | Enable for additional logging information. | ||
Expand Sub-Resources boolean expandSubResources | false | Enable to automatically expand all sublists, sublist lines, and subrecords on this record. | |
Fields to Return string Value List fields | Specific fields and sublists to return in the request. If unspecified, the full record is returned. | ||
Record ID string / Required id | The ID of the record you want. | 100 | |
Record Type string / Required recordType | Record type to perform the action against. | ||
Simple Enum Format boolean simpleEnumFormat | false | Enable to return enumeration values in a format that only shows the internal ID value. |
List Records
List records of specified type | key: listRecord
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug boolean debugInput | Enable for additional logging information. | ||
Pagination Limit string / Required limit | 1000 | Fetch only this many records at a time. | 10 |
Pagination Offset string offset | Fetch records offset by this value. | 20 | |
Query string query | Query to filter records by. See https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1545222128.html for details. | email START_WITH barbara | |
Record Type string / Required recordType | Record type to perform the action against. |
Raw Request
Send raw HTTP request to NetSuite | key: rawRequest
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Data string data | The HTTP body payload to send to the URL. | {"exampleKey": "Example Data"} | |
Debug Request boolean debugRequest | false | Enabling this flag will log out the current request. | |
File Data string Key Value List fileData | File Data to be sent as a multipart form upload. | [{key: "example.txt", value: "My File Contents"}] | |
Form Data string Key Value List formData | The Form Data to be sent as a multipart form upload. | [{"key": "Example Key", "value": new Buffer("Hello World")}] | |
Header string Key Value List headers | A list of headers to send with the request. | User-Agent: curl/7.64.1 | |
Max Retry Count string maxRetries | 0 | The maximum number of retries to attempt. | |
Method string / Required method | The HTTP method to use. | ||
Query Parameter string Key Value List queryParams | A list of query parameters to send with the request. This is the portion at the end of the URL similar to ?key1=value1&key2=value2. | ||
Response Type string / Required responseType | json | The type of data you expect in the response. You can request json, text, or binary data. | |
Retry On All Errors boolean retryAllErrors | false | If true, retries on all erroneous responses regardless of type. | |
Retry Delay (ms) string retryDelayMS | 0 | The delay in milliseconds between retries. | |
Service Type string / Required serviceType | record | The type of service to use. | record |
Timeout string timeout | The maximum time that a client will await a response to its request | 2000 | |
URL string / Required url | Input the path only (/contact), The base URL is already included (https://${accountId}.suitetalk.api.netsuite.com/services/rest/record/v1). For example, to connect to https://${accountId}.suitetalk.api.netsuite.com/services/rest/record/v1/contact, only /contact is entered in this field. | /contact | |
Use Exponential Backoff boolean useExponentialBackoff | false | Specifies whether to use a pre-defined exponential backoff strategy for retries. |
SuiteQL Query
Execute a SuiteQL Query through Netsuite's REST Web Service | key: suiteQLQuery
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug boolean debugInput | Enable for additional logging information. | ||
Pagination Limit string / Required limitInput | 1000 | Fetch only this many records at a time. | 10 |
Pagination Offset string offsetInput | Fetch records offset by this value. | 20 | |
SuiteQL Payload code / Required suiteQLInput | Data payload to send in the action request. See https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157909186990.html for details. |
Update Record
Update record of the specified type | key: updateRecord
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug boolean debugInput | Enable for additional logging information. | ||
Record ID string / Required id | The ID of the record you want. | 100 | |
Payload code / Required payload | Data payload to send in the action request. See https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2022.1/index.html for details. | ||
Record Type string / Required recordType | Record type to perform the action against. | ||
Replace string Value List replace | Names of sublists on this record. All specified sublists will be replaced instead of added to. | ||
Replace Selected Fields boolean replaceSelectedFields | false | If enabled, delete all fields, including body fields, specified in the Replace input. |