createProductAssignmentToCollections

post

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

Creates a request to assign product to multiple collections

Request

Supported Media Types
  • application/json
Path Parameters
id
Type: string
Required: true
Body Parameter
Root Schema : createProductAssignmentToCollections_request
Nested Schema : collections
Type: array
List of collections IDs to assign a product to.

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createProductAssignmentToCollections_response
Nested Schema : parentCategories
Type: array
Array having repository IDs of the collection.
Nested Schema : items
Type: object
Example 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
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:

{"collections": [
  "camera_1001",
  "camera_1002"
]}

Sample Response Payload returned by endpoint:

{
  "repositoryId": "camera_1",
  "links": [{
    "rel": "self",
    "href": "http://localhost:9080/ccadminui/v1/products/camera_1/addToCollections"
  }],
  "id": "camera_1",
  "parentCategories": [
    {"repositoryId": "cat40013"},
    {"repositoryId": "cat40017"}
  ]
}