NetSuite is an ERP (Enterprise Resource Planning) Tool that helps businesses to run all the applications that help them to improve efficiency and grow.

Although NetSuite has various inbuilt functions available, few functions require API integration from third-party tools. Here the Restlet API comes into the picture.

Restlet Script is used to get data from Other System to NetSuite and send data from NetSuite to external applications securely. Restlet supports four HTTP methods get, post, put and delete.

Here is an example of a Restlet script:

/** 
 * @NApiVersion 2.x 
 * @NScriptType restlet 
*/ 
define([], function() { 
 return { 
  get : function() { 
   return "Hello World!" 
  } 
 } 
});

A step-by-step guide to setup and integrating Restlet API in Postman

Table of Contents

Stage 1 - Pre-requisites

Need to enable some features in NetSuite to set up Restlet APIs (Application Programming Interfaces).

Step 1 - First go to set up > company > enable features

setup

Step 2 - In the enable features page click on the “SuiteCloud” subtab.

suitecloud

Step 3 - Scroll down and enable the rest web service features under the “SuiteTalk (Web Services)” and outh 2.0 in the “manage authentication”.

manage authentication

Stage 2 - Setup NetSuite integration

In this stage, we will collect the Consumer/Client and Token ID and Secret that we will use in the later stages of the process.

Step 1 - To generate an integration record or Consumer/Client ID and Secret, go to Setup > Integration > Manage Integration > New

setup integration

Step 2 - In the integration page fill in the data like Name, Stage, Description, etc. Also, take care of the points below:

- If you do not need the “token-based authentication”, then uncheck that option.

- Give the “redirect URL” if you are using the local system.

Once you are done with the details, click on the “save” button.

fill details

Step 3 - Once you save the new integration, make sure you note down the “Consumer key/client ID and Secret” under the “Client Credentials” section.

client credential

Note: This credential will only appear when you create it for the first time.

Step 4 - To generate Token ID and Secret, go to Setup > Users/Roles > Access Tokens > New

user roles

Step 5 - In the access token page, fill in the data like application name, user, role, and token name. And click on the “save” button.

access token

Step 6 - Once you save the details, make sure you note down the “Token ID and Secret” under the “Token Id/Secret” section.

confirmation

Note: This credential will only appear when you create it for the first time.

Stage 3 - NetSuite and Postman Integration

Before we go further, we need to download the Postman environment template and collection archive from the Suite Cloud tools download.

Step 1 - Login to your NetSuite account.

Step 2 - Then we need to download Postman environment template and collection archive. To do this use the below mention URL with your NetSuite “Account ID” https://<accountID>.app.netsuite.com/app/external/integration/integrationDownloadPage.nl

Note – Change <accountID> with your NetSuite account id. For example: https:// TSTDRV0000001.app.netsuite.com/app/external/integration/integrationDownloadPage.nl

Step 3 - You will see this page. Download the NetSuiteRestApiSampleRequest.zip file. Unzip that file.

netsuite unzip file

Step 4 - Open the Postman and click on the “gear” symbol. Select the “Settings” option.

netsuite settings

Step 5 - This pop-up will come up.

netsuite setting

Step 6 - Go to the “data” subtab and click on the “choose file” button under Import Data.

netsuite choose files

Step 7 - Go to the “requests” folder form the download file (NetSuiteRestApiSampleRequest).

netsuite request

Step 8 - Select the file which is listed within the “requests” folder.

netsuite tutorial platform

Step 9 - Then select the “NetSuite REST Environment” in Postman by clicking the dropdown.

netsuite restapi environment template

Step 10 - Now click on the “environment quick look” icon next to the environment dropdown.

step3.10-netsuite-test-request.webp

Step 11 - To set the NetSuite credentials in the environment file, click the “Edit” option in the pop-up window.

netsuite edit

Step 12 - Need to set the credentials like Account ID, Consumer key, Consumer Secret, Token ID, Token Secret (refer Stage 2), Company URL, and Restlet Service URL (steps mentioned below) to process further.

netsuite company setup

Step 13 - To get the company URL and Restlet service URL, go to setup > company > company information, in NetSuite.

suite talk

Step 14 - In the company information page, go to the company URL subtab. Copy the URL of Suite talk and RestLet and paste the Suite talk URL in the company URL and restlet in the restlet service URL.

Stage 4 - Creating internal and external URL

To run the restlet API we need to upload the restlet script and deploy it in the release status.

Step 1 - As a first step, store the restlet file in the NetSuite Document folder. To begin the process, go to customization > scripting > scripts > new.

customizing scripts

Step 2 - Add your file in the “Script File” section and click on the “create script record” button.

create script record

Step 3 - Once you click on the “create” button, a script page will appear. In that enter your script name and script id for your identification.

released

Step 4 - For deployment, click on the “deployment” subtab. Enter the title and keep the status “released”. Then click on the “save” button.

NetSuite settings

Step 5 - Once you click the save button, the script deployment page will appear. Here you can see two URLs, one for internal use and the second for external use. Copy the external one.

script deployment

Step 6 - Paste the external URL in the postman and select the appropriate method. Then click on the “send” button.

test request

Step 7 - Response will appear in the response window. When the status is“200 OK” that means the response is correctly coming from RestLet API.

restlet in oblivion

This is how you can integrate Restlet API in NetSuite using Postman. We are a well-known software development company that can help you with software integration and maintenance. If you have any requirements related to NetSuite integration, contact our experts.

The One Technologies Logo
Certified By