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
Nested Schema : categoryImages
Type: array
List of category images to assign to the product.
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.
Nested Schema : productMap
Type: array
Map of product IDs to corresponding order index when performing a reorder operation on childProducts property.
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.
Nested Schema : properties
Type: object
List of properties of the collection.
Nested Schema : items
Type: object
Nested Schema : metadata
Type: object
Seo meta info for category.
Nested Schema : items
Type: object
Nested Schema : seoMetaInfo
Type: object
Seo meta info for category.

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateCollection_response
Nested Schema : ancestorCategories
Type: array
Array of category objects.
Nested Schema : categoryImages
Type: array
Array of image objects.
Nested Schema : categoryPaths
Type: array
An array of category paths.
Nested Schema : childCategories
Type: array
Array of category objects.
Nested Schema : childProducts
Type: array
Array of child products.
Nested Schema : fixedChildCategories
Type: array
Array of category objects.
Nested Schema : fixedChildProducts
Type: array
Array of fixed child products.
Nested Schema : fixedParentCategories
Type: array
Array of category objects.
Nested Schema : keywords
Type: array
Array of keywords.
Nested Schema : seoMetaInfo
Type: object
Seo meta info for category.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : metadata
Type: object
Seo meta info for category.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
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
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

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"
}