Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetSuite REST API Bulk/Batch Operations

I'm writing a C# library/project that will integrate the NetSuite ERP with our software. Basically the premise is that I want to be able to import and export data from NetSuite in and out of our system in bulk, since we could potentially be dealing with thousands of records. When I query the customer endpoint, for example, it provides a list of links to each individual customer. Is there a way to hydrate those records? The hydration can work via SuiteQL, with a crude solution being something like select * from customer, however I feel like I'm missing a first-class solution here.

This also is a problem in the export direction (ie. POST to NetSuite). Is REST Web Services just unsuitable for this usage? Is a RESTlet more or less my only option here? It feels like there is a first-class solution that I am overlooking in the documentation.

Thanks in advance!

like image 554
MoonMist Avatar asked Jul 01 '26 23:07

MoonMist


1 Answers

Restlets are probably your best bet. Another avenue is SOAP web services, which has bulk list operations. But that will be deprecated with update 2026.1

As far as what you call hydration, suite analytics connect and the relevant connect drivers are the way I would go. Same SuiteQL syntax, but better for large volumes of data.


Edit:

I found this information about bulk edits using the REST API. NetSuite SOAP addList in REST Example. Link contents are copied below.

REST Request The following example shows how to create records with batch requests using the POST operation. You can create new records using the POST and PUT operations.

In the request, you can specify any field that can be used to create a single record.

URL: POST https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder

HEADERS:
Authorization: /*Auth token goes here*/
Prefer: respond-async
Content-type: application/vnd.oracle.resource+json; type=collection

BODY:
{
  "items": [
    {
      "name": "item 1",
     "field1" : {"id" : "1"}
    },
    {
      "name": "item 2"
    }
  ]
} 

REST Response Asynchronous batch requests return a response with a link to the newly created asynchronous task. The following is an example of a response. Then you can send a request using the job ID in the response header to retrieve the list of tasks.

Response:
HTTP CODE: HTTP 202

BODY: 

HEADERS:
Preference-Applied: respond-async
location: https://demo123.suitetalk.api.netsuite.com/services/rest/async/v1/job/1 
like image 171
Minimistro Avatar answered Jul 06 '26 04:07

Minimistro



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!