Commerce Category
A commerce category record exposes a commerce category to REST web services.
This record:
-
is not a subrecord
-
has no subrecords
-
has only sublists
The REST API Browser includes information about the field names and field types of the commerce category record, and about the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser’s commerce category reference page.
For information about using the REST API Browser, see The REST API Browser.
Record ID
The record ID for a commerce category REST record is commercecategory.
Prerequisites
You must Enable Commerce Categories Feature for any interaction with the record. The account must also contain a Commerce Catalog record to reference.
Inaccessible Elements
The following sublists are not accessible through REST web services:
-
URL Fragment Aliases sublist is not exposed
-
"isCurrentlyEffective is internal only
Elements with Different Functionality
Updating the tags collection using REST does not delete removed tags, it only adds new tags and updates existing tags.
Additional Details
The "displayinSite" field values must be "T" or "F", not standard boolean.
The "sitemapPriority" field values must be a string with possible values between "0.0" and "1.0" incrementing by tenths. For example, ("0.1", "0.2", "0.3", etc.). This behavior is the same across all channels, not specific to REST web services.
Code Sample
Updating a Commerce Category Record
This example shows how to update a commerce category record.
HTTP Method: PATCH
URL: {NETSUITE_DOMAIN}/services/rest/record/v1/commercecategory/{id}
Request Parameters: {id} - Commerce Category ID to update
HTTP Request Headers: Content-Type: application/json
{ "name": "REST Category", "catalog": 1, "urlFragment": "rest-category", "isInactive": false, "addToHead": "string", "metaDescription": "string", "metaKeywords": "string", "pageTitle": "string", "pageHeading": "string", "externalId": "string", "description": "string", "startDate": "2023-07-13T16:37:57.000Z", "endDate": "2024-07-13T16:37:57.000Z", "sequenceNumber": 0, "displayInSite": "T", "sitemapPriority": "0.0", "thumbnail": 5034, "pageBanner": 5034, "subcategories": { "items": [ { "subcategory": "2", "pageHeadingOverride": "string", "addToHeadOverride": "string", "displayInSiteOverride": "F", "sequenceNumber": 0, "nameOverride": "Child REST Category", "urlFragmentOverride": "child-rest-category", "pageTitleOverride": "string", "metaDescriptionOverride": "string", "metaKeywordsOverride": "string", "sitemapPriorityOverride": "1.0", "descriptionOverride": "string", "pageBannerOverride": 3323, "thumbnailOverride": 3323 }, { "subcategory": "3", "sequenceNumber": 1, "nameOverride": "Another Child REST Category", "urlFragmentOverride": "another-child-rest-category" } ] }, "items": { "items": [ { "primaryCategory": true, "sequenceNumber": 0, "item": 206 }, { "primaryCategory": true, "sequenceNumber": 1, "item": 227 } ] }, "translations": { "items": [ { "metaDescription": "string", "name": "string", "description": "string", "pageTitle": "string", "pageHeading": "string", "locale": "fr_CA", "addToHead": "string", "metaKeywords": "string", "thumbnail": 3323, "pageBanner": 3323 }, { "metaDescription": "string", "name": "string", "pageTitle": "string", "pageHeading": "string", "locale": "es_ES", "metaKeywords": "string" } ] }, "tags": { "items": [ { "name": "tag1", "id": 1 }, { "name": "tag2", "id": 2 } ] }
}