Accessing Subresources in REST Web Services
In NetSuite, the most important resource is a record. A record is a singular resource. However, there can be other resources in NetSuite as well.
A record usually references other resources -other records. For more information about resources, see Resource.
Sublists and subrecords are subresources. Subresources can also be accessed through REST web services. Consider the following usage notes when working with subresources through REST web services.
You cannot directly delete a subresource. However, it is deleted when the parent record is deleted. Additionally, depending on the record type, you can often set a subrecord's value to null.
You cannot create a subrecord by itself. A subrecord always has to be created in the context of a parent record.
When working with records, you can perform the following operations on subresources:
Get a referenced record that is represented by a select field through the parent record.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/employee/107/subsidiary
Get a parent record's subresource: sublist.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/1/item
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/1/item/1
Get a parent record's subresource: subrecord.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/1/billingaddress
Get a parent record's subresource: sublist of a subrecord.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/customer/107/addressBook/39/addressBookAddress
Get a parent record's subresource: sublist of a subrecord of a sublist.
GET https://demo123.suitetalk.api.netsuite.com/services/rest/record/v1/salesOrder/6/item/1/inventoryDetail/inventoryAssignment/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
- 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