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:
string
Required:true
ID of collection.
Header Parameters
- X-CCAsset-Language
-
Type:
string
Required:true
The 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:
string
ID of the catalog. - categoryImages
-
Type:
array
categoryImagesAdditional Properties Allowed:List of category images to assign to the product. - moves
-
Type:
array
movesAdditional 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:
string
Operation to perform if updating childProducts property. Can be one of: reorder, remove, move. - parentCategoryId
-
Type:
string
ID of the parent category for the new collection. - productMap
-
Type:
array
productMapAdditional Properties Allowed:Map of product IDs to corresponding order index when performing a reorder operation on childProducts property. - products
-
Type:
array
productsAdditional 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:
object
propertiesAdditional Properties Allowed:List of properties of the collection. - repositoryId
-
Type:
string
Repository id of the collection. - type
-
Type:
string
The type of update operation, appendProducts or updateProducts
Nested Schema : categoryImages
Nested Schema : moves
Nested Schema : productMap
Type:
array
Map of product IDs to corresponding order index when performing a reorder operation on childProducts property.
-
Type:
string
Nested Schema : products
Type:
array
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.
-
Type:
string
Nested Schema : properties
Type:
object
List of properties of the collection.
- active
-
Type:
boolean
Whether 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:
string
Description of the category. - displayName
-
Type:
string
Required:true
Display name of the collection. - id
-
Type:
string
Category ID. - longDescription
-
Type:
string
Long description of the category. - name
-
Type:
string
Required:true
Name of the collection. - seoMetaInfo
-
Type:
object
seoMetaInfoAdditional Properties Allowed:Seo meta info for category.
Nested Schema : items
Type:
object
- metadata
-
Type:
object
metadataAdditional Properties Allowed:Seo meta info for category. - name
-
Type:
string
Image filename without path. - path
-
Type:
string
Virtual path to image, including filename. - repositoryId
-
Type:
string
RepositoryId of image if it already exists.
Nested Schema : metadata
Type:
object
Seo meta info for category.
- altText
-
Type:
string
Alt text for category image. - titleText
-
Type:
string
Title text for category image.
Nested Schema : items
Type:
object
- fromEnd
-
Type:
integer
Required:true
Ending index for selecting products to move. - fromStart
-
Type:
integer
Required:true
Starting index for selecting products to move. - to
-
Type:
integer
Required:true
Destination index for moved products.
Nested Schema : seoMetaInfo
Type:
object
Seo meta info for category.
- repositoryId
-
Type:
string
Repository id of seo metadata. - seoDescription
-
Type:
string
Description of category. - seoKeywords
-
Type:
string
Keywords of category. - seoTitle
-
Type:
string
Title of category. - seoUrlSlug
-
Type:
string
Url 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:
array
ancestorCategoriesAdditional Properties Allowed:Array of category objects. - categoryImages
-
Type:
array
categoryImagesAdditional Properties Allowed:Array of image objects. - categoryPaths
-
Type:
array
categoryPathsAdditional Properties Allowed:An array of category paths. - childCategories
-
Type:
array
childCategoriesAdditional Properties Allowed:Array of category objects. - childProducts
-
Type:
array
childProductsAdditional Properties Allowed:Array of child products. - description
-
Type:
string
Description of category. - displayName
-
Type:
string
Display Name of the category. - fixedChildCategories
-
Type:
array
fixedChildCategoriesAdditional Properties Allowed:Array of category objects. - fixedChildProducts
-
Type:
array
fixedChildProductsAdditional Properties Allowed:Array of fixed child products. - fixedParentCategories
-
Type:
array
fixedParentCategoriesAdditional Properties Allowed:Array of category objects. - id
-
Type:
string
Category ID. - keywords
-
Type:
array
keywordsAdditional Properties Allowed:Array of keywords. - longDescription
-
Type:
string
Long description of the category. - name
-
Type:
string
Name of the category. - repositoryId
-
Type:
string
Repository ID. - route
-
Type:
string
Route of the category. - seoDescriptionDerived
-
Type:
string
Derived from display name and description of the category - seoKeywordsDerived
-
Type:
string
Derived from display name and ancestor category name's of the category - seoMetaInfo
-
Type:
object
seoMetaInfoAdditional Properties Allowed:Seo meta info for category. - seoTitleDerived
-
Type:
string
Derived from display name of the category - seoUrlSlugDerived
-
Type:
string
Derived 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:
object
Seo meta info for category.
- repositoryId
-
Type:
string
Repository id of seo metadata. - seoDescription
-
Type:
string
Description of category. - seoKeywords
-
Type:
string
Keywords of category. - seoTitle
-
Type:
string
Title of category. - seoUrlSlug
-
Type:
string
Url Slug of category.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository id of ancestor child category.
Nested Schema : items
Type:
object
- metadata
-
Type:
object
metadataAdditional Properties Allowed:Seo meta info for category. - repositoryId
-
Type:
string
Repository id of image.
Nested Schema : metadata
Type:
object
Seo meta info for category.
- altText
-
Type:
string
Alt text for category image. - titleText
-
Type:
string
Title text for category image.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository id of child category.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository id of child product.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository id of fixed child category.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository id of fixed child product.
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository 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:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The 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" }