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: string
ID of collection.
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 : updateCollection_request
Type:
Show Source
object
-
catalogId(optional):
string
ID of the catalog.
-
categoryImages(optional):
array categoryImages
List of category images to assign to the product.
-
moves(optional):
array moves
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(optional):
string
Operation to perform if updating childProducts property. Can be one of: reorder, remove, move.
-
parentCategoryId(optional):
string
ID of the parent category for the new collection.
-
parentCategoryIds(optional):
array parentCategoryIds
ID of multiple parent categories for the new collection.
-
productMap(optional):
array productMap
Map of product IDs to corresponding order index when performing a reorder operation on childProducts property.
-
products(optional):
array products
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(optional):
object properties
List of properties of the collection.
-
repositoryId(optional):
string
Repository id of the collection.
-
type(optional):
string
The type of update operation, appendProducts or updateProducts
Example:
{
"catalogId":"cloudLakeCatalog",
"categoryImages":{
"metadata":{
"altText":"Gift Shop-New",
"titleText":"Gift Shop-New"
}
},
"repositoryId":"cat90016",
"properties":{
"displayName":"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"
}
}
}
Nested Schema : categoryImages
Type:
array
List of category images to assign to the product.
Show Source
Nested Schema : moves
Type:
array
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.
Show Source
Nested Schema : parentCategoryIds
Type:
array
ID of multiple parent categories for the new collection.
Show Source
Nested Schema : productMap
Type:
array
Map of product IDs to corresponding order index when performing a reorder operation on childProducts property.
Show Source
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.
Show Source
Nested Schema : properties
Type:
object
List of properties of the collection.
Show Source
-
active(optional):
boolean
Whether or not the collection is active. Can be set to null to inherit value 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.
-
seoMetaInfo(optional):
object seoMetaInfo
Seo meta info for category.
Nested Schema : items
Type:
Show Source
object
-
metadata(optional):
object metadata
Seo meta info for category.
-
name(optional):
string
Image filename without path.
-
path(optional):
string
Virtual path to image, including filename.
-
repositoryId(optional):
string
RepositoryId of image if it already exists.
Nested Schema : metadata
Type:
object
Seo meta info for category.
Show Source
-
altText(optional):
string
Alt text for category image.
-
titleText(optional):
string
Title text for category image.
Nested Schema : items
Type:
Show Source
object
-
fromEnd:
integer
Ending index for selecting products to move.
-
fromStart:
integer
Starting index for selecting products to move.
-
to:
integer
Destination index for moved products.
Nested Schema : seoMetaInfo
Type:
object
Seo meta info for category.
Show Source
-
repositoryId(optional):
string
Repository id of seo metadata.
-
seoDescription(optional):
string
Description of category.
-
seoKeywords(optional):
string
Keywords of category.
-
seoTitle(optional):
string
Title of category.
-
seoUrlSlug(optional):
string
Url Slug of category.
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : updateCollection_response
Type:
Show Source
object
-
ancestorCategories(optional):
array ancestorCategories
Array of category objects.
-
categoryIdPaths(optional):
array categoryIdPaths
An array of category ids forming a category Path
-
categoryImages(optional):
array categoryImages
Array of image objects.
-
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 category.
-
displayName(optional):
string
Display Name of the category.
-
fixedChildCategories(optional):
array fixedChildCategories
Array of category objects.
-
fixedParentCategories(optional):
array fixedParentCategories
Array of category objects.
-
id(optional):
string
Category ID.
-
keywords(optional):
array keywords
Array of keywords.
-
longDescription(optional):
string
Long description of the category.
-
name(optional):
string
Legacy property.
-
parentCategory(optional):
object parentCategory
Default parent category of the category.
-
repositoryId(optional):
string
Repository ID.
-
route(optional):
string
Route of the category.
-
seoDescriptionDerived(optional):
string
Derived from display name and description of the category
-
seoKeywordsDerived(optional):
string
Derived from display name and ancestor category name's of the category
-
seoMetaInfo(optional):
object seoMetaInfo
Seo meta info for category.
-
seoTitleDerived(optional):
string
Derived from display name of the category
-
seoUrlSlugDerived(optional):
string
Derived from seoUrlSlug of the category if available, else derived from display name of the category
Nested Schema : categoryIdPaths
Type:
array
An array of category ids forming a category Path
Show Source
Nested Schema : parentCategory
Type:
object
Default parent category of the category.
Show Source
-
repositoryId(optional):
string
Repository id of the default parent category of the category.
Nested Schema : seoMetaInfo
Type:
object
Seo meta info for category.
Show Source
-
repositoryId(optional):
string
Repository id of seo metadata.
-
seoDescription(optional):
string
Description of category.
-
seoKeywords(optional):
string
Keywords of category.
-
seoTitle(optional):
string
Title of category.
-
seoUrlSlug(optional):
string
Url Slug of category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of ancestor child category.
Nested Schema : items
Type:
Show Source
object
-
metadata(optional):
object metadata
Seo meta info for category.
-
repositoryId(optional):
string
Repository id of image.
Nested Schema : metadata
Type:
object
Seo meta info for category.
Show Source
-
altText(optional):
string
Alt text for category image.
-
titleText(optional):
string
Title text for category image.
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 fixed child category.
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository id of parent category.
Example Response (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,
"childProductsCount":0,
"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"
}
],
"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":null,
"parentCategory":{
"repositoryId":"rootCategory"
},
"ancestorCategories":[
{
"repositoryId":"rootCategory"
}
],
"id":"cat50056"
}
412 Response
ETag mismatch. Asset has been updated by another user.
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|
|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|
|20131|Must provide new property values.|
|200225|Operation on collection is not allowed for the custom 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