addList
In SOAP web services, the addList operation is used to add one or more new instances of a record to 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 add a customer and a contact within a single request using this operation. However, each record entered must have a unique signature.
SOAP Request
In the following example, two customer records are added.
<soap:Body>
<platformMsgs:addList>
<platformMsgs:record xsi:type="listRel:Customer">
<listRel:entityId>Shutter Fly</listRel:entityId>
<listRel:companyName>Shutter Fly, Inc</listRel:companyName>
<listRel:unsubscribe>false</listRel:unsubscribe>
</platformMsgs:record>
<platformMsgs:record xsi:type="listRel:Customer">
<listRel:entityId>GNC</listRel:entityId>
<listRel:companyName>GNC Corp</listRel:companyName>
<listRel:unsubscribe>false</listRel:unsubscribe>
</platformMsgs:record>
</platformMsgs:addList>
</soap:Body>
SOAP Response
In the response, notice that the internal ID for each record added is returned.
<soapenv:Body>
<addListResponse 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>
</addListResponse>
</soapenv:Body>
In REST web services, you can use batch operations to add 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 adding 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 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