updateScheduledOrder
put
/ccagent/v1/scheduledOrders/{id}
Update Scheduled Order. Updates the scheduled order. Optionally takes X-CCOrganization header which is a JSON field with organization ID as value.
Request
Supported Media Types
- application/json
Path Parameters
- id
-
Type:
stringRequired:trueID of the scheduled order to be updated.
Header Parameters
- X-CCOrganization
-
Type:
stringThe organization Id to which the order belongs
Body Parameter
Root Schema : updateScheduledOrder_request
{
"schedule":{
"daysInMonth":[
1
],
"weeksInMonth":[
],
"monthsInYear":[
1,
3,
5,
7,
9,
11
],
"daysOfWeek":[
],
"occurrenceInDay":1
},
"scheduleType":"calendar",
"endDate":"2016-12-08",
"name":"Monthly Order",
"state":"active",
"startDate":"2016-12-01"
}
- endDate
-
Type:
stringScheduled order end date. - name
-
Type:
stringName of the Scheduled Order. - schedule
-
Type:
objectscheduleRequired:trueThe schedule of the scheduled order - startDate
-
Type:
stringRequired:trueScheduled Order start date. - state
-
Type:
stringThe state of the scheduled order.
Nested Schema : schedule
Type:
objectThe schedule of the scheduled order
- daysInMonth
-
Type:
arraydaysInMonthDays in a month this scheduled order has to be placed - daysOfWeek
-
Type:
arraydaysOfWeekDays in a week this scheduled order has to be placed - monthsInYear
-
Type:
arraymonthsInYearMonths in a year this scheduled order has to be placed - occurrenceInDay
-
Type:
integerThe number of times this scheduled order is placed in a day - weeksInMonth
-
Type:
arrayweeksInMonthWeeks in a month this scheduled order has to be placed
Nested Schema : daysInMonth
Nested Schema : daysOfWeek
Nested Schema : monthsInYear
Nested Schema : weeksInMonth
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : updateScheduledOrder_response
- createDate
-
Type:
stringScheduled Order creation date. - endDate
-
Type:
stringScheduled order end date. - executionStatusList
-
Type:
arrayexecutionStatusListThe list of executions from this scheduled order. - id
-
Type:
stringID of the scheduled order. - lastScheduledRun
-
Type:
stringLast scheduled run date of the scheduled order. - name
-
Type:
stringName of the Scheduled Order. - nextScheduledRun
-
Type:
stringNext scheduled run date of the scheduled order. - profileId
-
Type:
stringProfile ID of the shopper associated with the scheduled order. - repositoryId
-
Type:
stringRepository ID of the scheduled order. - schedule
-
Type:
objectscheduleSchedule of this scheduled order - startDate
-
Type:
stringScheduled Order start date. - state
-
Type:
stringThe state of the scheduled order. - templateOrderId
-
Type:
stringThe template order id.
Nested Schema : executionStatusList
Nested Schema : schedule
Type:
objectSchedule of this scheduled order
- daysInMonth
-
Type:
arraydaysInMonthDays in a month this scheduled order has to be placed - daysOfWeek
-
Type:
arraydaysOfWeekDays in a week this scheduled order has to be placed - monthsInYear
-
Type:
arraymonthsInYearMonths in a year this scheduled order has to be placed - occurrenceInDay
-
Type:
integerThe number of times this scheduled order is placed in a day - weeksInMonth
-
Type:
arrayweeksInMonthWeeks in a month this scheduled order has to be placed
Nested Schema : items
Type:
object- errorMessages
-
Type:
arrayerrorMessagesThe list of error messages for this execution. - executionDate
-
Type:
stringThe execution date. - id
-
Type:
stringID of the execution status. - orderId
-
Type:
stringOrder ID of the order submitted in that particular execution. - orderSubmitted
-
Type:
booleanThe boolean indicating whether the order has been submitted successfully during the execution. - orderTotal
-
Type:
numberOrder total. - repositoryId
-
Type:
stringThe repository id of the execution status.
Nested Schema : errorMessages
Nested Schema : daysInMonth
Nested Schema : daysOfWeek
Nested Schema : monthsInYear
Nested Schema : weeksInMonth
Example application/json
{
"lastError":null,
"endDate":"2016-12-08T00:00:00.000Z",
"executionStatusList":[
{
"errorMessages":[
"Exception While cloning an order."
],
"orderId":null,
"repositoryId":"600005",
"executionDate":"2016-11-23T00:00:00.000Z",
"id":"600005",
"orderSubmitted":false,
"orderTotal":null
}
],
"type":"scheduledOrder",
"version":25,
"lastScheduledRun":"2016-11-23T00:00:00.000Z",
"schedule":{
"daysInMonth":[
],
"weeksInMonth":[
],
"monthsInYear":[
1,
3,
5,
7,
9,
11
],
"daysOfWeek":[
],
"occurrenceInDay":1
},
"templateOrderId":"o30414",
"clonedOrders":[
],
"profileId":"120939",
"repositoryId":"sco10002",
"name":"Monthly Order",
"siteId":"siteUS",
"nextScheduledRun":"1969-12-31T23:59:59.999Z",
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccagentui/v1/scheduledOrders/sco10002"
}
],
"state":"active",
"id":"sco10002",
"startDate":"2016-12-01T00:00:00.000Z",
"createDate":"2016-11-21T11:15:15.000Z"
}
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|
|------------------|------------------|
|100094|Organization passed in the header is currently inactive|
|100095|The order or return request does not belong to the current organization of the shopper profile|
|100096|The organization associated to the order or return request was deleted / does not exist|
|100097|The organization associated to the order or return request is currently inactive|
|100098|Current operation is being performed in an organization context and the shopper profile is not associated to any organization|
|100099|Current operation is being performed in an organization context and the order or return request does not belong to any organization|
|100101|The shopper profile does not belong to organization passed in the header|
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:
arrayerrorsAn 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:
{
"schedule": {
"daysInMonth": [1],
"weeksInMonth": [],
"monthsInYear": [
1,
3,
5,
7,
9,
11
],
"daysOfWeek": [],
"occurrenceInDay": 1
},
"scheduleType": "calendar",
"endDate": "2016-12-08",
"name": "Monthly Order",
"state": "active",
"startDate": "2016-12-01"
}
Sample Response Payload returned by endpoint:
{
"lastError": null,
"endDate": "2016-12-08T00:00:00.000Z",
"executionStatusList": [{
"errorMessages": ["Exception While cloning an order."],
"orderId": null,
"repositoryId": "600005",
"executionDate": "2016-11-23T00:00:00.000Z",
"id": "600005",
"orderSubmitted": false,
"orderTotal": null
}],
"type": "scheduledOrder",
"version": 25,
"lastScheduledRun": "2016-11-23T00:00:00.000Z",
"schedule": {
"daysInMonth": [],
"weeksInMonth": [],
"monthsInYear": [
1,
3,
5,
7,
9,
11
],
"daysOfWeek": [],
"occurrenceInDay": 1
},
"templateOrderId": "o30414",
"clonedOrders": [],
"profileId": "120939",
"repositoryId": "sco10002",
"name": "Monthly Order",
"siteId": "siteUS",
"nextScheduledRun": "1969-12-31T23:59:59.999Z",
"links": [{
"rel": "self",
"href": "http://localhost:9080/ccagentui/v1/scheduledOrders/sco10002"
}],
"state": "active",
"id": "sco10002",
"startDate": "2016-12-01T00:00:00.000Z",
"createDate": "2016-11-21T11:15:15.000Z"
}