assignProducts
post
/ccadmin/v1/collections/assignProducts
Assign Products. Move, link or unlink one or more products to one or more collections.
Request
Supported Media Types
- application/json
Root Schema : assignProducts_request
Type:
Show Source
object
-
collections:
array collections
Collections to link/move/unlink the products to. Note, it is not allowed to move/link 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/link for that root category will be ignored.
-
fromParent(optional):
string
Parent collection for move operation. If specified then all products must belong to this collection. If not specified then products are moved out of all their existing parent collections.
-
operation(optional):
string
Operation to perform. Can be one of: move, link or unlink. If unspecified, default value is move
-
products:
array products
Products to link/move/unlink.
Example:
{
"fromParent":"cat40010",
"collections":[
"giftCards",
"topLeaf"
],
"operation":"move",
"products":[
"Product_13C",
"Product_1Cii"
]
}
Nested Schema : collections
Type:
array
Collections to link/move/unlink the products to. Note, it is not allowed to move/link 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/link for that root category will be ignored.
Show Source
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : assignProducts_response
Type:
Show Source
object
-
success(optional):
boolean
true if the move operation was successful
Example Response (application/json)
{
"success":true
}
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|
|------------------|------------------|
|20089|Organize Child Internal Error|
|20085|Collection does not have parent collection|
|20084|Invalid index provided. Index should be -1 or greater|
|20083|Child collection cannot be assigned to parent collection because it would create a circular collection structure|
|20071|Collection Id is invalid or non-existent|
|20070|Collection Id passed is null or empty|
|20081|Cannot find child collection|
|20080|Child collection passed is null|
|20079|It is not allowed to move a root category|
|20082|Attempt to move child to its current location|
|20086|Parent collection to link is null|
|20087|Parent collection to update is null|
|20088|Invalid operation|
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