createCollection
post
/ccadmin/v1/collections
Create Collection. Create a collection based on request paramenters. **Requires the x-ccasset-language header so translated content can be set for a specific language.**
Request
Supported Media Types
- application/json
Query Parameters
-
showCategoryPaths(optional): boolean
If set to false then category path related properties, namely, categoryPaths, categoryIdPaths, multiCatalogCategoryPaths and multiCatalogCategoryIdPaths, are not returned. If set to true then categoryPaths and categoryIdPaths are returned. For multiCatalogCategoryPaths and multiCatalogCategoryIdPaths use multipleCategoryPaths parameter. Default value of the parameter is true.
Header Parameters
-
X-CCAsset-Language: string
The asset language of the request
Root Schema : createCollection_request
Type:
Show Source
object
-
catalogId(optional):
string
ID of the catalog. If this field is not provided the request will default to using the product catalog.
-
orphaned(optional):
boolean
Set to true to ensure this product is created unassigned with no parents. This field cannot be used if catalogId, parentCategoryId or parentCategoryIds fields are used.
-
parentCategoryId(optional):
string
ID of the parent category for the new collection. If parentCategoryIds, orphaned and this field are not provided then the request will put the collection under the root navigation category of the catalog.
-
parentCategoryIds(optional):
array parentCategoryIds
ID of multiple parent categories for the new collection. If parentCategoryId, orphaned and this field are not provided then the request will put the collection under the root navigation category of the catalog.
-
properties:
object properties
List of properties of the collection.
Example:
{
"catalogId":"cloudLakeCatalog",
"properties":{
"displayName":"Electronics"
}
}
Nested Schema : parentCategoryIds
Type:
array
ID of multiple parent categories for the new collection. If parentCategoryId, orphaned and this field are not provided then the request will put the collection under the root navigation category of the catalog.
Show Source
Nested Schema : properties
Type:
object
List of properties of the collection.
Show Source
-
active(optional):
boolean
Whether or not the category is active. Can be set to null to inherit from parents.
-
description(optional):
string
Description of the category.
-
displayName:
string
Display name of the collection.
-
id(optional):
string
Category ID.
-
longDescription(optional):
string
Long description of the category.
-
name(optional):
string
Legacy Property.
-
parentCategory(optional):
string
Repository id of the default parent category
-
parentCategoryScope(optional):
string
Scope of update for parent category, one of: base, catalogSpecific, global or revertToBase. If this field is not provided then existing scope is used, i.e. if a catalog specific parent category is already set then it will be updated otherwise the base will be updated.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : createCollection_response
Type:
Show Source
object
-
active(optional):
boolean
Whether or not the collection is active. Value is inherited from parents if not set.
-
categoryImages(optional):
array categoryImages
Array of category images.
-
categoryPaths(optional):
array categoryPaths
An array of category paths.
-
childCategories(optional):
string
Array of category objects.
-
childProducts(optional):
array childProducts
Array of child products.
-
childProductsCount(optional):
integer
Count of the child products.
-
description(optional):
string
Description of the category.
-
displayName(optional):
string
Display Name of the category.
-
fixedParentCategories(optional):
array fixedParentCategories
Array of category objects.
-
id(optional):
string
Category ID.
-
longDescription(optional):
string
Long description of the category.
-
repositoryId(optional):
string
Repository ID.
-
route(optional):
string
Route of the category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of child product.
Nested Schema : items
Type:
Show Source
object
-
active(optional):
boolean
Whether or not the collection is active. Value is inherited from parents if not set.
-
categoryImages(optional):
array categoryImages
Array of category images.
-
categoryPaths(optional):
array categoryPaths
An array of category paths.
-
childCategories(optional):
array childCategories
Array of category objects.
-
childProducts(optional):
array childProducts
Array of child products.
-
childProductsCount(optional):
integer
Count of the child products.
-
description(optional):
string
Description of the category.
-
displayName(optional):
string
Display Name of the category.
-
id(optional):
string
id of parent category.
-
longDescription(optional):
string
Long description of the category.
-
repositoryId(optional):
string
Repository id of parent category.
-
route(optional):
string
Route of the category.
Nested Schema : items
Type:
Show Source
object
-
categoryImages(optional):
array categoryImages
Array of category images.
-
categoryPaths(optional):
array categoryPaths
An array of category paths.
-
childCategories(optional):
array childCategories
Array of category objects.
-
childProducts(optional):
array childProducts
Array of child products.
-
childProductsCount(optional):
integer
Count of the child products.
-
displayName(optional):
string
Display Name of the category.
-
fixedParentCategories(optional):
array fixedParentCategories
Array of category objects.
-
id(optional):
string
id of child category.
-
repositoryId(optional):
string
Repository id of child category.
-
route(optional):
string
Route of the category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of child category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of child product.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of parent category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of child product.
Example Response (application/json)
{
"longDescription":null,
"childProducts":null,
"route":"/electronics/category/cat90020",
"childProductsCount":0,
"categoryPaths":[
"/Commerce Root/Electronics"
],
"displayName":"Electronics",
"repositoryId":"cat90020",
"active":true,
"childCategories":null,
"id":"cat90020",
"fixedParentCategories":[
{
"longDescription":"ATG Store commerce root",
"childProducts":null,
"route":"/commerce-root/category/rootCategory",
"childProductsCount":0,
"categoryPaths":[
"/Commerce Root"
],
"displayName":"Commerce Root",
"repositoryId":"rootCategory",
"active":true,
"childCategories":[
{
"longDescription":null,
"childProducts":null,
"route":"/electronics/category/cat90020",
"childProductsCount":0,
"categoryPaths":[
"/Commerce Root/Electronics"
],
"displayName":"Electronics",
"repositoryId":"cat90020",
"active":true,
"childCategories":null,
"id":"cat90020",
"fixedParentCategories":[
{
"repositoryId":"rootCategory"
}
]
}
],
"id":"rootCategory",
"fixedParentCategories":[
]
}
]
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|20066|Collection ID of a collection must be unique. {0} is already in use.|
|20065|Invalid collection ID {0}. Collection ID may only contain alphanumeric characters.|
|20064|Collection name passed is already in Use|
|20060|Create Category Type Internal Error|
|84001|The following input fields conflict with each other.|
|200225|Operation on collection is not allowed for the custom catalog|
|200240|parentCategoryScope is not revertToBase but parentCategory is not in the request|
|200241|parentCategory is not a parent of the collection|
|200243|parentCategoryScope invalid/unknown value|
|200244|catalogSpecific parentCategoryScope but parentCategory is not in the specified catalog|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code