updateList

In SOAP web services, the updateList operation is used to update one or more instances of a record type in NetSuite.

If there are multiple records, they can either be of the same record type or different record types. For example, it's possible to update a customer and a contact within a single request using this operation.

SOAP Request

In the following example, two customer records are updated. The first has the single field companyName updated, whereas the second updates two fields: entityID and companyName. The internalID for each record must be provided and the type of record (Customer) to be updated.

            <soap:Body>
<platformMsgs:updateList>
   <platformMsgs:record internalId="980" xsi:type="listRel:Customer">
      <listRel:companyName>Shutter Fly Corporation</listRel:companyName>
   </platformMsgs:record>
   <platformMsgs:record internalId="981" xsi:type="listRel:Customer">
      <listRel:entityId>GNCC</listRel:entityId>
      <listRel:companyName>GNCC Corp</listRel:companyName>
   </platformMsgs:record>
</platformMsgs:updateList>
</soap:Body> 

          

SOAP Response

The following example shows the response to the previous request.

            <soapenv:Body>
<updateListResponse xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
<writeResponseList xmlns="urn:messages_2025_1.platform.webservices.netsuite.com">
   <writeResponse>
      <ns1:status isSuccess="true" xmlns:ns1="urn:core_2025_1.platform.webservices.netsuite.com"/>
      <baseRef internalId="980" type="customer" xsi:type="ns2:RecordRef"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ns2="urn:core_2025_1.platform.webservices.netsuite.com"/>
   </writeResponse>
   <writeResponse>
      <ns3:status isSuccess="true" xmlns:ns3="urn:core_2025_1.platform.webservices.netsuite.com"/>
      <baseRef internalId="981" type="customer" xsi:type="ns4:RecordRef"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:ns4="urn:core_2025_1.platform.webservices.netsuite.com"/>
   </writeResponse>
</writeResponseList>
</updateListResponse>
</soapenv:Body> 

          

In REST web services, you can use batch operations to update multiple instances of the same record type in a single REST request.

Batch operations in REST web services are executed asynchronously and in parallel. You can currently work with a maximum of 100 records in one batch request.

When you use batch operations for updating records, you must specify the following REST request headers:

  • prefer: respond-async

  • content-type: application/vnd.oracle.resource+json; type=collection

Additionally, you can specify the X-NetSuite-idempotency-key header with a unique idempotency key value. For an example, see Sending an Asynchronous Request Using an Idempotency Key.

REST Request

The following example shows how to update records with batch requests. You can update existing records using the PUT and PATCH operations.

PATCH and PUT requests have an internal or external ID specified in each item.

You can specify both internal and external IDs in the request, but only one is used to match it to a record. The internal ID takes precedence over the external ID.

            URL:
PATCH 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": [
    {
      "id" : 5,
      "name": "item 1",
     "field1" : {"id" : "1"}
    },
    {
      "externalId" : "item 2 eid",
      "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 

          

Related Topics

General Notices