Cost Category

A cost category record exposes a cost category to REST web services. This record is not a subrecord. This record does not have any subrecords.

For help working with this record in the UI, see Creating Cost Categories.

The REST API Browser includes information about the field names and field types of the cost category record, and about the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser’s costCategory reference page.

For information about using the REST API Browser, see The REST API Browser.

Record ID

The record ID for a cost category REST record is CostCategory.

Prerequisites

You must enable either the Standard Costing or Landed Cost feature before you can use this record through REST web services.

Code Samples

The following samples show common use cases for cost categories. The example ID is 4.

Creating a Cost Category Using a POST Request

This sample shows how to create a cost category when you are using the Standard Costing feature only.

              POST https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory
{ "itemCostType": { "id": "MATERIAL" }, "name": "Test Name"
} 

            

This sample shows how to create a cost category when you are using the Landed Cost feature only.

              POST https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory
{ "itemCostType": { "id": "LANDED" }, "name": "Air Freight Charges", "account": { "id": 69 }
} 

            

Retrieving a Cost Category Using a GET Request

              GET https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory/4 

            

Updating a Cost Category Using a PATCH Request

This sample shows how to update a cost category when you are using the Standard Costing feature only.

You can update the name only. You cannot change the cost type after you create the cost category.

              PATCH https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory/4
{ "name": "New Name",
} 

            

This sample shows how to update a cost category when you are using the Landed Cost feature only.

You can update the name and expense account ID only. You cannot change the cost type after you create the cost category.

              PATCH https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory/4
{ "name": "FedEx Charges", "account": { "id": 65 }
} 

            

Deleting a Cost Category Using a DELETE Request

              DELETE https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/costCategory/4 

            

Related Topics

REST Web Services Supported Records
SuiteTalk REST Web Services Overview and Setup
Working with Records
NetSuite Record Structure
The REST API Browser

General Notices