Creating a Record Instance
In REST web services, you can create a new record using the POST HTTP method. The POST method expects a request body (a JSON object) that conforms to the record's metadata schema and contains values for at least each mandatory field of the given record type.
REST web services do not support the update of subrecords, and do not support the bulk creation of records.
Not all record fields can be set using the POST method. For example, the id field is read-only.
Any omitted fields are considered empty or to have default values. The following example shows how to create a new customer record instance.
POST https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer
{ "entityid": "New Customer", "companyname": "My Company", "subsidiary": { "id": "1" } }
The following is an excerpt from the response headers of a successful operation, with no body content returned (HTTP Code 204). The URL of the newly created record is given in the Location header of the response.
Date Fri, 04 Jan 2019 08:50:20 GMT
Location https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/647
Content-Type application/json
Related Topics
- The REST API Browser
- NetSuite Record Structure
- Using CRUD Operations on Custom Records, Custom Lists, and Custom Transactions v1
- Getting a Record Instance
- Updating a Record Instance
- Using the Upsert Operation
- Deleting a Record Instance
- Accessing Subresources in REST Web Services
- Using External IDs
- Using Datetime Fields
- Executing Record Actions
- Transforming Records
- Working with the Pricing Sublist on Item Records
- Using the REST Web Services SuiteScript Execution Context