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
{
"collections":[
"camera_1001",
"camera_1002"
]
}
- collections
-
Type:
array
collectionsRequired:true
Additional Properties Allowed:List of collections IDs to assign a product to.
Nested Schema : collections
Type:
array
List of collections IDs to assign a product to.
-
Type:
string
List 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:
string
Repository ID of the product. - parentCategories
-
Type:
array
parentCategoriesAdditional Properties Allowed:Array having repository IDs of the collection. - repositoryId
-
Type:
string
Repository ID of the product.
Nested Schema : parentCategories
Nested Schema : items
Type:
object
- repositoryId
-
Type:
string
Repository 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:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - errors
-
Type:
array
errorsAdditional Properties Allowed:An optional list of errors if multiple errors were encountered - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The HTTP status code - type
-
Type:
string
The URI to the HTTP state code definition
Nested Schema : errors
Nested Schema : items
Type:
object
- devMessage
-
Type:
string
An optional non-localized message containing technical information for developers - errorCode
-
Type:
string
The numerical code identifying the error - message
-
Type:
string
The localized message describing the error - moreInfo
-
Type:
string
An optional non-localized message with more information - o:errorPath
-
Type:
string
An optional machine readable description of where the error occurred - status
-
Type:
string
The 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"} ] }