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:
stringRequired:true
Body Parameter
Root Schema : createProductAssignmentToCollections_request
{
"collections":[
"camera_1001",
"camera_1002"
]
}
- collections
-
Type:
arraycollectionsRequired:trueAdditional Properties Allowed:List of collections IDs to assign a product to.
Nested Schema : collections
Type:
arrayList of collections IDs to assign a product to.
-
Type:
stringList of collection ids
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createProductAssignmentToCollections_response
- id
-
Type:
stringRepository ID of the product. - parentCategories
-
Type:
arrayparentCategoriesAdditional Properties Allowed:Array having repository IDs of the collection. - repositoryId
-
Type:
stringRepository ID of the product.
Nested Schema : parentCategories
Nested Schema : items
Type:
object- repositoryId
-
Type:
stringRepository ID of a collection.
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- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - errors
-
Type:
arrayerrorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code - type
-
Type:
stringThe URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object- devMessage
-
Type:
stringAn optional non-localized message containing technical information for developers - errorCode
-
Type:
stringThe numerical code identifying the error - message
-
Type:
stringThe localized message describing the error - moreInfo
-
Type:
stringAn optional non-localized message with more information - o:errorPath
-
Type:
stringAn optional machine readable description of where the error occurred - status
-
Type:
stringThe HTTP status code
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"}
]
}