updatePurchaseList
put
/ccagent/v1/purchaseLists/{id}
Update Purchase List. This operation is used to update properties of a purchase list.
Dynamic Properties of purchase list can be added in the the request using the key value pair structure ("dynamicPropertyKey":"dynamicPropertyValue"). These property values can take the types of boolean, date, float, string, timestamp, enumerated, big string.
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
stringRequired:trueThe ID of the Purchase List to be updated.
Body Parameter
Root Schema : updatePurchaseList_request
{
"accountId":"or-100001",
"name":"Purchase List 1",
"description":"Purchase List",
"siteId":"siteUS",
"items":[
{
"productId":"Product_18Cxi",
"quantityDesired":25,
"catRefId":"Sku_18Dxi"
},
{
"productId":"Product_5Cx",
"quantityDesired":30,
"catRefId":"Sku_5Cxy"
}
]
}
- accountId
-
Type:
stringThe id of the Organization. - description
-
Type:
stringDescription for the purchase list. - items
-
Type:
arrayitemsAdditional Properties Allowed:list of purchase list items - name
-
Type:
stringRequired:trueThe name of the purchase list. - siteId
-
Type:
stringThe Id of the site.
Nested Schema : items
Nested Schema : items
Type:
object- catRefId
-
Type:
stringRequired:truecatalog ref id - 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 : updatePurchaseList_response
- accountId
-
Type:
stringThe id of the Organization. - creationDate
-
Type:
stringThe date when purchase list is created. - description
-
Type:
stringDescription for the purchase list. - id
-
Type:
stringThe Id of the purchase list. - items
-
Type:
arrayitemsAdditional Properties Allowed:list of purchase list items - lastModifiedDate
-
Type:
stringThe last modified date for the purchase list. - name
-
Type:
stringThe name of the purchase list. - owner
-
Type:
objectownerAdditional Properties Allowed:The user who created this purchase list. - repositoryId
-
Type:
stringRepository Id of the purchase list. - siteId
-
Type:
stringThe Id of the site.
Nested Schema : items
Nested Schema : owner
Type:
objectThe user who created this purchase list.
- firstName
-
Type:
stringThe first name of the user - lastName
-
Type:
stringThe last name of the user - repositoryId
-
Type:
stringrespository Id of the user
Nested Schema : items
Type:
object- catRefId
-
Type:
stringcatalog ref id - id
-
Type:
stringId of the purchase list item - productId
-
Type:
stringThe product id - quantityDesired
-
Type:
integerQuantity desired for the item - repositoryId
-
Type:
booleanrepository id of purchase list item
Example application/json
{
"owner":{
"lastName":"Anderson",
"firstName":"Kim",
"repositoryId":"se-570031",
"id":"se-570031"
},
"accountId":null,
"lastModifiedDate":"2017-09-27T09:48:22.000Z",
"repositoryId":"gl30074",
"name":"Purchase List 2",
"description":"Purchase List update",
"siteId":null,
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccagentui/v1/purchaseLists/gl30074"
}
],
"id":"gl30074",
"creationDate":"2017-09-27T09:48:22.000Z",
"items":[
{
"productId":"Product_5Cx",
"quantityDesired":30,
"repositoryId":"gi10001",
"id":"gi10001",
"catRefId":"Sku_5Cxy"
}
]
}
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|
|------------------|------------------|
|64104|Error while updating the purchase list.|
|64100|Invlaid profile id|
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:
{
"accountId": "or-100001",
"name": "Purchase List 1",
"description": "Purchase List",
"siteId": "siteUS",
"items": [
{
"productId": "Product_18Cxi",
"quantityDesired": 25,
"catRefId": "Sku_18Dxi"
},
{
"productId": "Product_5Cx",
"quantityDesired": 30,
"catRefId": "Sku_5Cxy"
}
]
}
Sample Response Payload returned by endpoint:
{
"owner": {
"lastName": "Anderson",
"firstName": "Kim",
"repositoryId": "se-570031",
"id": "se-570031"
},
"accountId": null,
"lastModifiedDate": "2017-09-27T09:48:22.000Z",
"repositoryId": "gl30074",
"name": "Purchase List 2",
"description": "Purchase List update",
"siteId": null,
"links": [{
"rel": "self",
"href": "http://localhost:9080/ccagentui/v1/purchaseLists/gl30074"
}],
"id": "gl30074",
"creationDate": "2017-09-27T09:48:22.000Z",
"items": [{
"productId": "Product_5Cx",
"quantityDesired": 30,
"repositoryId": "gi10001",
"id": "gi10001",
"catRefId": "Sku_5Cxy"
}]
}