createProductAssignmentToCollections

post

/ccadmin/v1/products/{id}/addToCollections

Creates a request to assign product to multiple collections

Request

Supported Media Types
Path Parameters
Body ()
Root Schema : createProductAssignmentToCollections_request
Type: object
Show Source
  • collections
    List of collections IDs to assign a product to. Note, it is not allowed to move products to catalog root categories. Instead if the catalog's default category for products is set then it will be used or if it is not set then the move for that root category will be ignored.
Example:
{
    "collections":[
        "camera_1001",
        "camera_1002"
    ]
}
Nested Schema : collections
Type: array
List of collections IDs to assign a product to. Note, it is not allowed to move products to catalog root categories. Instead if the catalog's default category for products is set then it will be used or if it is not set then the move for that root category will be ignored.
Show Source
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : createProductAssignmentToCollections_response
Type: object
Show Source
Nested Schema : parentCategories
Type: array
Array having repository IDs of the collection.
Show Source
Nested Schema : items
Type: object
Show Source
Example Response (application/json)
{
    "repositoryId":"camera_1",
    "links":[
        {
            "rel":"self",
            "href":"http://localhost:9080/ccadminui/v1/products/camera_1/addToCollections"
        }
    ],
    "id":"camera_1",
    "parentCategories":[
        {
            "repositoryId":"cat40013"
        },
        {
            "repositoryId":"cat40017"
        }
    ]
}

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| |------------------|------------------| |20007|Error assigning product to collection| |20008|Missing "collections" property| |20090|Collection Id passed is null or empty| |20091|Collection Id cat4d0013 is invalid or non-existent| |200226|CRUD operation on product is not allowed for the custom catalog|
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top