Convert to a scheduled order

post

/ccstore/v1/orders/current/convertToScheduledOrder

This endpoint will allow the caller to take the current order for the shopper and from it create a scheduled order. The current order will be used to create the template order and it will be associated it with an appropriate schedule, the details of which will be passed to the endpoint in the request payload. The current order will be cleared in the same way as if the order had been submitted.

Request

Supported Media Types
Header Parameters
Body ()
Root Schema : convertToScheduledOrder_request
Type: object
Show Source
Example:
{
    "schedule":{
        "selectedDates":[
        ],
        "weeksInMonth":[
            1,
            2,
            3
        ],
        "monthsInYear":[
            1,
            2
        ],
        "daysOfWeek":[
            1,
            2,
            3
        ]
    },
    "scheduleType":"calendar",
    "endDate":"2017-10-01T00:00:00.000Z",
    "name":"testScheduleOrder",
    "startDate":"2015-10-01T00:00:00.000Z"
}
Nested Schema : schedule
Type: object
The schedule of the Scheduled order.
Show Source
Nested Schema : daysOfWeek
Type: array
The days of week of the Scheduled order.
Show Source
Nested Schema : monthsInYear
Type: array
The months in year of the Scheduled order.
Show Source
Nested Schema : selectedDates
Type: array
The selected dates in a month in year for the Scheduled order.
Show Source
Nested Schema : weeksInMonth
Type: array
The weeks in month of the Scheduled order.
Show Source
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : convertToScheduledOrder_response
Type: object
Show Source
Nested Schema : clonedOrders
Type: array
The list of cloned orders
Show Source
Nested Schema : executionStatusList
Type: array
The status list of executed scheduled orders
Show Source
Nested Schema : schedule
Type: object
The schedule of the Scheduled order.
Show Source
Nested Schema : templateOrder
Type: object
The templateOrder of the Scheduled order.
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : items
Type: object
Show Source
Nested Schema : daysOfWeek
Type: array
The days of week of the Scheduled order.
Show Source
Nested Schema : monthsInYear
Type: array
The months in year of the Scheduled order.
Show Source
Nested Schema : selectedDates
Type: array
The selected dates in a month in year for the Scheduled order.
Show Source
Nested Schema : weeksInMonth
Type: array
The weeks in month of the Scheduled order.
Show Source
Example Response (application/json)
{
    "endDate":"2022-10-01T00:00:00.000Z",
    "executionStatusList":[
    ],
    "type":"scheduledOrder",
    "schedule":{
        "daysInMonth":[
        ],
        "scheduleType":"calendar",
        "weeksInMonth":[
            1,
            2,
            3
        ],
        "monthsInYear":[
            1,
            2
        ],
        "daysOfWeek":[
            1,
            2,
            3
        ],
        "occurrenceInDay":1
    },
    "templateOrderId":"o240411",
    "clonedOrders":[
    ],
    "profileId":"se-570031",
    "templateOrder":{
        "repositoryId":"o240411",
        "state":"TEMPLATE"
    },
    "name":"testScheduleOrder",
    "nextScheduledRun":"2020-10-01T00:00:00.000Z",
    "links":[
        {
            "method":"PATCH",
            "rel":"/rels/patchCurrentOrder",
            "href":"http://localhost:8080/ccstore/v1/orders/current"
        },
        {
            "method":"POST",
            "rel":"/rels/priceCurrentOrder",
            "href":"http://localhost:8080/ccstore/v1/orders/current/price"
        },
        {
            "method":"POST",
            "rel":"/rels/convertToScheduledOrder",
            "href":"http://localhost:8080/ccstore/v1/orders/current/convertToScheduledOrder"
        },
        {
            "method":"POST",
            "rel":"/rels/switchCurrentOrder",
            "href":"http://localhost:8080/ccstore/v1/orders/current/switch"
        },
        {
            "method":"POST",
            "rel":"/rels/submitCurrentOrder",
            "href":"http://localhost:8080/ccstore/v1/orders/current/submit"
        }
    ],
    "state":"active",
    "id":"sco140001",
    "startDate":"2020-10-01T00:00:00.000Z",
    "createDate":"2020-09-21T08:47:10.889Z"
}

Default Response

In case of any failure in external tax or external shipping webhooks, the errors returned in the webhook response payload get added to the errors property in this endpoint???s error response. The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
Error CodeDescriptionPossible Fix
51165Creation of scheduled order failed.See error message for additional guidance.

The error response:
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top