updateItems
post
/ccstore/v1/purchaseLists/{id}/updateItems
Update Purchase List Items. This operation is used to update the purchase list items.
Basic operations include add, delete, update. add operation is considered as default if nothing is specified in the input payload.
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
stringRequired:trueThe ID of the Purchase list.
Body Parameter
Root Schema : updateItems_request
{
"items":[
{
"op":"update",
"productId":"Product_18Cxi",
"quantityDesired":25,
"catRefId":"Sku_18Dxi"
},
{
"op":"delete",
"productId":"Product_5Cx",
"quantityDesired":30,
"catRefId":"Sku_5Cxy"
},
{
"op":"add",
"productId":"Product_5Cx",
"quantityDesired":10,
"catRefId":"Sku_5Cxy"
}
]
}
- items
-
Type:
arrayitemsAdditional Properties Allowed:list of purchase list items
Nested Schema : items
Nested Schema : items
Type:
object- catRefId
-
Type:
stringRequired:truecatalog ref id - op
-
Type:
stringRequired:trueopertaion to be performed on purchase list item.This can be one of add/update/delete - productId
-
Type:
stringRequired:trueThe product id - quantityDesired
-
Type:
integerRequired:trueQuantity desired for the item
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateItems_response
- messsage
-
Type:
stringSuccess message - success
-
Type:
booleanBoolean success value either true or false
Example application/json
{
"success":true,
"messsage":"Purchase List Item(s) updated successfully."
}
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|
|------------------|------------------|
|64107|Error while adding an item to purchase list|
|64100|Invalid profile or user logged out|
|64106|Error while removing an item from purchase list|
|64109|Error while updating an item of purchase list
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:
{"items": [
{
"op": "update",
"productId": "Product_18Cxi",
"quantityDesired": 25,
"catRefId": "Sku_18Dxi"
},
{
"op": "delete",
"productId": "Product_5Cx",
"quantityDesired": 30,
"catRefId": "Sku_5Cxy"
},
{
"op": "add",
"productId": "Product_5Cx",
"quantityDesired": 10,
"catRefId": "Sku_5Cxy"
}
]}
Sample Response Payload returned by endpoint:
{
"success": true,
"messsage": "Purchase List Item(s) updated successfully."
}