Understanding Netsuite API
Netsuite provides a robust SuiteTalk API that allows developers to interact with Netsuite functionalities programmatically. To create a Sales Order record, you’ll need to make a POST request to the appropriate endpoint with the necessary data in the request body. This is where Postman comes into play.
Setting Up Postman
- Postman: https://www.postman.com/
- Create a NetSuite Integration: Before making API requests, you need to set up an integration in NetSuite to obtain the required credentials. Go to Setup > Integrations > Manage Integrations in your NetSuite account and create a new integration.
- Obtain API Credentials: Once the integration is created, note down the Account ID, Consumer Key, Consumer Secret, Token ID, and Token Secret. These credentials will be used to authenticate your requests.
- Content Type: Add Content-type as Json/application if needed
Creating a Netsuite Sales Order Record
Creating Sales Order record using Postman.
Step 1: Authentication
In Postman, create a new request and set the request type to POST.
Enter the following URL from NetSuite Script Deployment and replace Account ID with your NetSuite account ID
Under the Authorization tab, select OAuth 1.0 as the type, and enter the Consumer Key, Consumer Secret, Token ID, and Token Secret obtained from the NetSuite integration
Step 2: Request Body
In the Body tab, select raw and choose JSON. Construct a JSON payload representing the Sales Order details. For example:
{
"recordType": "salesOrder",
"fields": {
"entity": {
"type": "customer",
"id": 123
},
"itemList": [
{
"item": {
"type": "inventoryItem",
"id": 456
},
"quantity": 2
}
]
}
}
Adjust the values according to your specific Sales Order.
Step 3: Send the Request
Click the Send button in Postman to make the API request. If everything is set up correctly, Netsuite will create a Sales Order record, and the response will contain details about the newly created record.
Conclusion
Using Postman to interact with Netsuite’s SuiteTalk API streamlines the process of creating Sales Order records. This automation not only saves time but also reduces the chances of errors associated with manual data entry. As you become familiar with the process, you can explore additional functionalities provided by the Netsuite API and further enhance your automation capabilities.