Transforming Records

In REST web services, you can transform a record from one type into an another, using data from an existing records. For example, you can create an invoice record from an existing sales order record, using data from the sales order.

All record transformations available in SuiteScript are available in REST web services, too. Transformations are also supported in metadata. For information about the supported transformation types, see record.transform(options).

Record transformation is generally available for supported records. For a list of fully supported records, you can also see REST Web Services Supported Records.

In REST web services, you use the POST method to send a record transformation request. The record transformation is executed in a single request. In the request URL, the following details must be specified:

In the following example, a sales order record is transformed into an invoice. If the transformation is performed successfully, an HTTP 204 – No Content response is returned.

          POST http://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/3/!transform/invoice 

        

In the request body, you can also specify data for additional fields of the record, as shown in the following example.

          {
   "memo": "REST, end date and bills date added",
   "enddate": "2020-01-14",
   "billdate": "2020-01-14",
   "item": {
      "items": [
         { 
            "item": { "id": "3456" },
            "amount": 1 
         }
      ]
   }
} 

        

Related Topics

The REST API Browser
NetSuite Record Structure
Using CRUD Operations on Custom Records, Custom Lists, and Custom Transactions v1
Creating a Record Instance
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
Working with the Pricing Sublist on Item Records
Using the REST Web Services SuiteScript Execution Context

General Notices