updateCollection
put
/ccadmin/v1/collections/{id}
Update Collection. Update a collection by ID. **Requires the x-ccasset-language header so translated content can be set for a specific language.**
Update childProducts property:
Set the type property to either appendProducts or updateProducts to update the child products of a collection.
EXAMPLE INPUT:
Remove prod1, prod2 and prod3
{'op': 'remove', 'products': ['prod1', 'prod2', 'prod3]}
Move the group of products at indices 5-10 (inclusive) to appear starting at index 2
(shorthand for 'move product 5 to index 2, product 6 to index 3, etc.')
{'op': 'move', 'fromStart': 5, 'fromEnd': 10, 'to' : 2}
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
stringRequired:trueID of collection.
Header Parameters
- X-CCAsset-Language
-
Type:
stringRequired:trueThe asset language of the request
Body Parameter
Root Schema : updateCollection_request
{
"catalogId":"cloudLakeCatalog",
"categoryImages":{
"metadata":{
"altText":"Gift Shop-New",
"titleText":"Gift Shop-New"
}
},
"repositoryId":"cat90016",
"properties":{
"displayName":"Electronics",
"name":"Electronics",
"seoMetaInfo":{
"seoDescription":"Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"seoTitle":"Gift Shop-New",
"seoKeywords":"Gift Shop-New",
"seoUrlSlug":"gift-shop-new"
}
}
}
- catalogId
-
Type:
stringID of the catalog. - categoryImages
-
Type:
arraycategoryImagesAdditional Properties Allowed:List of category images to assign to the product. - moves
-
Type:
arraymovesAdditional Properties Allowed:If type is updateProducts, and op is move, then this value is an array of objects specifying details for re-ordring whole groups of child products. - op
-
Type:
stringOperation to perform if updating childProducts property. Can be one of: reorder, remove, move. - parentCategoryId
-
Type:
stringID of the parent category for the new collection. - productMap
-
Type:
arrayproductMapAdditional Properties Allowed:Map of product IDs to corresponding order index when performing a reorder operation on childProducts property. - products
-
Type:
arrayproductsAdditional Properties Allowed:If type is appendProducts, or type is updateProducts and op is remove, then this value is equal to the list of IDs for child products that will be appened or removed. - properties
-
Type:
objectpropertiesAdditional Properties Allowed:List of properties of the collection. - repositoryId
-
Type:
stringRepository id of the collection. - type
-
Type:
stringThe type of update operation, appendProducts or updateProducts
Nested Schema : categoryImages
Nested Schema : moves
Nested Schema : productMap
Type:
arrayMap of product IDs to corresponding order index when performing a reorder operation on childProducts property.
-
Type:
string
Nested Schema : products
Type:
arrayIf type is appendProducts, or type is updateProducts and op is remove, then this value is equal to the list of IDs for child products that will be appened or removed.
-
Type:
string
Nested Schema : properties
Type:
objectList of properties of the collection.
- active
-
Type:
booleanWhether or not the collection is active. Can be set to null to inherit value from parents. This cannot be changed the rootCategory or nonNavigableCategory. - description
-
Type:
stringDescription of the category. - displayName
-
Type:
stringRequired:trueDisplay name of the collection. - id
-
Type:
stringCategory ID. - longDescription
-
Type:
stringLong description of the category. - name
-
Type:
stringRequired:trueName of the collection. - seoMetaInfo
-
Type:
objectseoMetaInfoAdditional Properties Allowed:Seo meta info for category.
Nested Schema : items
Type:
object- metadata
-
Type:
objectmetadataAdditional Properties Allowed:Seo meta info for category. - name
-
Type:
stringImage filename without path. - path
-
Type:
stringVirtual path to image, including filename. - repositoryId
-
Type:
stringRepositoryId of image if it already exists.
Nested Schema : metadata
Type:
objectSeo meta info for category.
- altText
-
Type:
stringAlt text for category image. - titleText
-
Type:
stringTitle text for category image.
Nested Schema : items
Type:
object- fromEnd
-
Type:
integerRequired:trueEnding index for selecting products to move. - fromStart
-
Type:
integerRequired:trueStarting index for selecting products to move. - to
-
Type:
integerRequired:trueDestination index for moved products.
Nested Schema : seoMetaInfo
Type:
objectSeo meta info for category.
- repositoryId
-
Type:
stringRepository id of seo metadata. - seoDescription
-
Type:
stringDescription of category. - seoKeywords
-
Type:
stringKeywords of category. - seoTitle
-
Type:
stringTitle of category. - seoUrlSlug
-
Type:
stringUrl Slug of category.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateCollection_response
- ancestorCategories
-
Type:
arrayancestorCategoriesAdditional Properties Allowed:Array of category objects. - categoryImages
-
Type:
arraycategoryImagesAdditional Properties Allowed:Array of image objects. - categoryPaths
-
Type:
arraycategoryPathsAdditional Properties Allowed:An array of category paths. - childCategories
-
Type:
arraychildCategoriesAdditional Properties Allowed:Array of category objects. - childProducts
-
Type:
arraychildProductsAdditional Properties Allowed:Array of child products. - description
-
Type:
stringDescription of category. - displayName
-
Type:
stringDisplay Name of the category. - fixedChildCategories
-
Type:
arrayfixedChildCategoriesAdditional Properties Allowed:Array of category objects. - fixedChildProducts
-
Type:
arrayfixedChildProductsAdditional Properties Allowed:Array of fixed child products. - fixedParentCategories
-
Type:
arrayfixedParentCategoriesAdditional Properties Allowed:Array of category objects. - id
-
Type:
stringCategory ID. - keywords
-
Type:
arraykeywordsAdditional Properties Allowed:Array of keywords. - longDescription
-
Type:
stringLong description of the category. - name
-
Type:
stringName of the category. - repositoryId
-
Type:
stringRepository ID. - route
-
Type:
stringRoute of the category. - seoDescriptionDerived
-
Type:
stringDerived from display name and description of the category - seoKeywordsDerived
-
Type:
stringDerived from display name and ancestor category name's of the category - seoMetaInfo
-
Type:
objectseoMetaInfoAdditional Properties Allowed:Seo meta info for category. - seoTitleDerived
-
Type:
stringDerived from display name of the category - seoUrlSlugDerived
-
Type:
stringDerived from seoUrlSlug of the category if available, else derived from display name of the category
Nested Schema : ancestorCategories
Nested Schema : categoryImages
Nested Schema : categoryPaths
Nested Schema : childCategories
Nested Schema : childProducts
Nested Schema : fixedChildCategories
Nested Schema : fixedChildProducts
Nested Schema : fixedParentCategories
Nested Schema : keywords
Nested Schema : seoMetaInfo
Type:
objectSeo meta info for category.
- repositoryId
-
Type:
stringRepository id of seo metadata. - seoDescription
-
Type:
stringDescription of category. - seoKeywords
-
Type:
stringKeywords of category. - seoTitle
-
Type:
stringTitle of category. - seoUrlSlug
-
Type:
stringUrl Slug of category.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of ancestor child category.
Nested Schema : items
Type:
object- metadata
-
Type:
objectmetadataAdditional Properties Allowed:Seo meta info for category. - repositoryId
-
Type:
stringRepository id of image.
Nested Schema : metadata
Type:
objectSeo meta info for category.
- altText
-
Type:
stringAlt text for category image. - titleText
-
Type:
stringTitle text for category image.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of child category.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of child product.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of fixed child category.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of fixed child product.
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository id of parent category.
Example application/json
{
"longDescription":"Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"childProducts":null,
"keywords":[
"gift",
"ideas",
"gifts",
"ideas",
"gift ideas",
"present",
"presents",
"special occasion",
"special occasions",
"birthday",
"christmas",
"anniversary",
"romantic",
"valentines",
"wedding",
"him",
"her",
"ATG Store.com"
],
"categoryImages":[
{
"metadata":{
"altText":"Gift Shop-New",
"titleText":"Gift Shop-New"
},
"repositoryId":"m10002"
}
],
"categoryPaths":[
"/Commerce Root/Gift Shop-New"
],
"displayName":"Gift Shop-New",
"seoKeywordsDerived":"Gift Shop-New",
"fixedChildCategories":[
{
"repositoryId":"cat50067"
},
{
"repositoryId":"cat60001"
}
],
"seoUrlSlugDerived":"gift-shop-new",
"seoDescriptionDerived":"Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"active":true,
"description":null,
"childCategories":[
{
"repositoryId":"cat50067"
},
{
"repositoryId":"cat60001"
}
],
"fixedChildProducts":[
],
"seoTitleDerived":"Gift Shop-New",
"fixedParentCategories":[
{
"repositoryId":"rootCategory"
}
],
"seoMetaInfo":{
"seoDescription":"Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"repositoryId":"100003",
"seoTitle":"Gift Shop-New",
"seoKeywords":"Gift Shop-New",
"seoUrlSlug":"gift-shop-new"
},
"route":"/gift-shop-new/category/cat50056",
"repositoryId":"cat50056",
"name":"cat50056",
"ancestorCategories":[
{
"repositoryId":"rootCategory"
}
],
"id":"cat50056"
}
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|
|------------------|------------------|
|20130|category Internal Error|
|26115|Could not update item image list|
|26114|Missing item images list|
|26116|Update images internal error (invalid item type)|
|20999|Internal Error|
|26110|The image path was invalid. It cannot contain a backslash.|
|26113|Could not get item for update|
|26112|Update Category Images Internal Error|
|20094|Cannot find the product for the given product id|
|20093|All products are already in the parent collection|
|20092|No products provided.|
|20091|Collection Id is invalid or non-existent|
|20090|Collection Id passed is null or empty|
|20202|Invalid Operation|
|20089|Organize child Internal Error|
|20141|Collection Id passed is null or empty|
|25015|setPropertyRepositoryItem Internal Error|
|26104|Could not locate parent folder of media items.|
|25014|Convert Input Property Internal Error|
|26106|The image name was empty.|
|20109|Internal Error|
|25016|Internal Error|
|26105|No collection image list was provided.|
|26108|The image path was invalid. It must start with a "/".|
|26107|The image path was empty.|
|20502|There was an error while retrieving seo metadata from repository.|
|26109|The image path was invalid. It must end with ".gif", ".jpg" or ".png".|
|26100|Update Product Images Internal Error|
|26102|The image could not be added to the item's image list.|
|20085|Collection does not have parent collection |
|20140|Collection Id is invalid or non-existent|
|37202|Invalid move products range|
|20084|Invalid index provided. Index should be -1 or greater|
|37203|Internal Error|
|20083|Cannot be assigned to parent collection because it would create a circular collection structure|
|20060|Create Category Type Internal Error|
|20081|Cannot find child collection|
|20080|Child Collection passed is null|
Body
Root Schema : errorModel
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
Examples
Sample Request:
{
"catalogId": "cloudLakeCatalog",
"categoryImages": {"metadata": {
"altText": "Gift Shop-New",
"titleText": "Gift Shop-New"
}},
"repositoryId": "cat90016",
"properties": {
"displayName": "Electronics",
"name": "Electronics",
"seoMetaInfo": {
"seoDescription": "Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"seoTitle": "Gift Shop-New",
"seoKeywords": "Gift Shop-New",
"seoUrlSlug": "gift-shop-new"
}
}
}
Sample Response Payload returned by endpoint:
{
"longDescription": "Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"childProducts": null,
"keywords": [
"gift",
"ideas",
"gifts",
"ideas",
"gift ideas",
"present",
"presents",
"special occasion",
"special occasions",
"birthday",
"christmas",
"anniversary",
"romantic",
"valentines",
"wedding",
"him",
"her",
"ATG Store.com"
],
"categoryImages": [{
"metadata": {
"altText": "Gift Shop-New",
"titleText": "Gift Shop-New"
},
"repositoryId": "m10002"
}],
"categoryPaths": ["/Commerce Root/Gift Shop-New"],
"displayName": "Gift Shop-New",
"seoKeywordsDerived": "Gift Shop-New",
"fixedChildCategories": [
{"repositoryId": "cat50067"},
{"repositoryId": "cat60001"}
],
"seoUrlSlugDerived": "gift-shop-new",
"seoDescriptionDerived": "Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"active": true,
"description": null,
"childCategories": [
{"repositoryId": "cat50067"},
{"repositoryId": "cat60001"}
],
"fixedChildProducts": [],
"seoTitleDerived": "Gift Shop-New",
"fixedParentCategories": [{"repositoryId": "rootCategory"}],
"seoMetaInfo": {
"seoDescription": "Gift Shop-New, Looking for an inspired quality gift? ATG Store gift shop has a wide choice of gifts for both men and women suitable for every occassion. Shopping for gifts is simple and convenient at ATG Store.com.",
"repositoryId": "100003",
"seoTitle": "Gift Shop-New",
"seoKeywords": "Gift Shop-New",
"seoUrlSlug": "gift-shop-new"
},
"route": "/gift-shop-new/category/cat50056",
"repositoryId": "cat50056",
"name": "cat50056",
"ancestorCategories": [{"repositoryId": "rootCategory"}],
"id": "cat50056"
}