createProductAssignmentToCollections
post
/ccadmin/v1/products/{id}/addToCollections
Creates a request to assign product to multiple collections
Request
Supported Media Types
- application/json
Path Parameters
Root Schema : createProductAssignmentToCollections_request
Type:
Show Source
object
-
collections:
array 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
-
Array of:
string
List of collection ids
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : createProductAssignmentToCollections_response
Type:
Show Source
object
-
id(optional):
string
Repository ID of the product.
-
parentCategories(optional):
array parentCategories
Array having repository IDs of the collection.
-
repositoryId(optional):
string
Repository ID of the product.
Nested Schema : parentCategories
Type:
array
Array having repository IDs of the collection.
Show Source
Nested Schema : items
Type:
Show Source
object
-
repositoryId(optional):
string
Repository ID of a collection.
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 CX Commerce:
|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|Operation on product 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