copyOrder

post

/ccagent/v1/orders/copyOrder

Copy Order. Duplicates given order. 1. The cloned order will always be in INCOMPLETE state 2. PaymentGroups and coupons/promotions if any would not be copied 3. If there is an already existing incomplete order it would be merged with newly created clone order. Optionally takes X-CCOrganization header which is a JSON field with organization ID as value. If this header is not provided, then the endPoint will consider first active organization as the current organization for a B2B user.

Request

Supported Media Types
  • application/json
Header Parameters
X-CCOrganization
Type: string
the organization Id in which order should be created
Body Parameter
Root Schema : copyOrder_request
Nested Schema : exclude
Type: object
Properties to exclude at the time of copy order. Key is item descriptor name. Value is the aray of properties which we want to exclude
Nested Schema : commerceItems
Type: array
Item descriptor name
Nested Schema : order
Type: array
Item descriptor name

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : copyOrder_response
Nested Schema : approvalSystemMessages
Type: array
The array of messages which are stored during order processing
Nested Schema : billingMethod
Type: object
billing Method information of the order.
Nested Schema : discountInfo
Type: object
Discount information.
Nested Schema : dynamicProperties
Type: array
Read-only list of dynamic properties for the order along with meta-data.
Nested Schema : giftWithPurchaseInfo
Type: array
Gift Selection Information
Nested Schema : giftWithPurchaseOrderMarkers
Type: array
Gift With Purchase order markers information
Nested Schema : orderComments
Type: array
The list of all logged comments for the order.
Nested Schema : paymentGroup
Type: object
Payment Group for the order.
Nested Schema : paymentGroups
Type: array
List of payment Groups for the order.
Nested Schema : priceInfo
Type: object
Price information of the order.
Nested Schema : priceListGroup
Type: object
PriceList group of the order.
Nested Schema : profile
Type: object
Profile Information for the order.
Nested Schema : returnRequests
Type: array
The list of the requests raised for the order.
Nested Schema : shippingAddress
Type: object
shipping address for the order.
Nested Schema : shippingGroups
Type: array
Shipping Group infomration
Nested Schema : shippingMethod
Type: object
Shipping method information.
Nested Schema : shoppingCart
Type: object
Shopping cart information.
Nested Schema : taxPriceInfo
Type: object
The tax pricing details for the order.
Nested Schema : orderCouponsMap
Type: array
Map of coupons.
Nested Schema : orderImplicitDiscountList
Type: array
List of discounts.
Nested Schema : unclaimedCouponsMap
Type: array
Map of unclaimed coupons.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : couponInfo
Type: array
The coupon Info.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : billingAddress
Type: object
Billing address for the order.
Nested Schema : items
Type: object
Nested Schema : billingAddress
Type: object
Billing address for the order.
Nested Schema : currency
Type: object
Currency of the PriceList group.
Nested Schema : organization
Type: object
The Organization associated with the B2B customer profile.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: array
Items in the cart.
Nested Schema : shippingAddress
Type: object
shipping address for the order.
Nested Schema : shippingMethod
Type: object
Shipping method information.
Nested Schema : trackingInfo
Type: array
Tracking Information for the Order.
Nested Schema : items
Type: object
Nested Schema : skuProperties
Type: array
Sku properties Information
Nested Schema : variant
Type: array
Product Variant Information.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: array
Items in the cart.
Nested Schema : items
Type: object
Nested Schema : childItems
Type: array
Child items of the commerce item
Nested Schema : discountInfo
Type: object
Discount information.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : giftWithPurchaseCommerceItemMarkers
Type: array
The array of giftWithPurchaseCommerceItemMarkers.
Nested Schema : imageInfo
Type: object
Shipping method information.
Nested Schema : skuProperties
Type: array
Sku properties Information
Nested Schema : variant
Type: array
Product Variant Information.
Nested Schema : items
Type: object
Nested Schema : childItems
Type: array
Child items of the commerce item
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : selectedOptions
Type: array
The array of variants of the child item.
Nested Schema : items
Type: object
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : selectedOptions
Type: array
The array of variants of the child item.
Nested Schema : items
Type: object
Nested Schema : values
Type: object
The array of values associated with an externalData item.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : values
Type: object
The array of values associated with an externalData item.
Nested Schema : items
Type: object
Nested Schema : orderCouponsMap
Type: array
Map of coupons.
Nested Schema : orderImplicitDiscountList
Type: array
List of discounts.
Nested Schema : unclaimedCouponsMap
Type: array
Map of unclaimed coupons.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : couponInfo
Type: array
The coupon Info.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : values
Type: object
The array of values associated with an externalData item.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Example application/json

{
    "creationTime":1.478264292E12,
    "orderComments":[
    ],
    "sourceSystem":"Cloud Commerce",
    "dynamicProperties":[
    ],
    "stateString":"INCOMPLETE",
    "submittedDate":"2016-11-04T12:58:13.000Z",
    "paymentGroups":[
    ],
    "priceInfo":{
        "amount":249.95,
        "total":309.88,
        "shipping":35,
        "shippingSurchargeValue":0,
        "tax":24.93,
        "subTotal":249.95,
        "currencyCode":"USD",
        "totalWithoutTax":284.95
    },
    "pricingMessages":{
    },
    "shoppingCart":{
        "items":[
            {
                "deactivationDate":"2018-06-27T12:59:59Z",
                "rawTotalPrice":249.95,
                "returnedQuantity":0,
                "displayName":"Dora the Explorer - Season 1",
                "shippingSurchargeValue":0,
                "externalData":[
                ],
                "discountAmount":0,
                "billingAccountId":"billingAcc-123",
                "imageInfo":{
                    "primaryThumbImageURL":"/ccstore/v1/images/?source=/file/v5541415982230769347/products/doratheexplorer_season1_LARGE.jpg&height=100&width=100"
                },
                "assetId":"asset10001",
                "price":249.95,
                "variant":[
                ],
                "onSale":false,
                "actionCode":"Add",
                "serviceId":"service-123",
                "stateDetailsAsUser":"Added to order",
                "unitPrice":49.99,
                "serviceAccountId":"serviceAcc-123",
                "quantity":5,
                "productId":"Product_21Cxi",
                "salePrice":0,
                "detailedItemPriceInfo":[
                    {
                        "discounted":false,
                        "amount":249.95,
                        "quantity":5,
                        "tax":21.86,
                        "orderDiscountShare":0,
                        "detailedUnitPrice":49.99,
                        "currencyCode":"USD"
                    }
                ],
                "giftWithPurchaseCommerceItemMarkers":[
                ],
                "tax":21.86,
                "catRefId":"Sku_21Dxy",
                "customerAccountId":"customerAcc-123",
                "discountInfo":[
                ],
                "stateDescription":"INITIAL",
                "activationDate":"2017-06-27T15:30:00Z",
                "listPrice":49.99,
                "status":0
            }
        ]
    },
    "links":[
        {
            "rel":"self",
            "href":"http://localhost:9080/ccagentui/v1/orders/copyOrder"
        }
    ],
    "id":"o50415",
    "state":0,
    "stateDetailsAsUser":"Incomplete",
    "taxPriceInfo":{
        "cityTax":0.71,
        "amount":24.93,
        "valueAddedTax":0,
        "countyTax":0.71,
        "isTaxIncluded":false,
        "miscTax":6.41,
        "districtTax":0,
        "stateTax":17.1,
        "countryTax":0
    },
    "shippingGroups":[
        {
            "taxPriceInfo":{
                "cityTax":0.71,
                "amount":24.93,
                "valueAddedTax":0,
                "countyTax":0.71,
                "isTaxIncluded":false,
                "miscTax":6.41,
                "districtTax":0,
                "stateTax":17.1,
                "countryTax":0
            },
            "shippingMethod":{
                "shippingTax":3.07,
                "cost":35,
                "displayName":"Standard",
                "value":"standardShippingMethod",
                "shippingMethodDescription":"Standard"
            },
            "shippingGroupId":"sg60415",
            "submittedDate":null,
            "priceInfo":{
                "amount":249.95,
                "total":309.88,
                "shipping":35,
                "shippingSurchargeValue":0,
                "tax":24.93,
                "subTotal":249.95,
                "currencyCode":"USD",
                "totalWithoutTax":284.95
            },
            "discountInfo":{
                "orderDiscount":0,
                "shippingDiscount":0,
                "discountDescList":[
                ]
            },
            "shipOnDate":null,
            "trackingInfo":[
            ],
            "actualShipDate":null,
            "shippingAddress":{
                "lastName":"Blooming",
                "country":"US",
                "address3":null,
                "address2":"Santa Clara County",
                "city":"San Jose",
                "prefix":null,
                "address1":"7 W Jackson Blvd",
                "postalCode":"95111",
                "companyName":"US Motor Works, Inc.",
                "jobTitle":null,
                "county":null,
                "suffix":null,
                "selectedCountry":"US",
                "firstName":"Ron",
                "phoneNumber":"408-752-3500",
                "stateName":"California",
                "faxNumber":null,
                "alias":null,
                "middleName":null,
                "state":"CA",
                "countryName":"United States",
                "email":"ron@example.com",
                "selectedState":"NY",
                "state_ISOCode":"US-NY"
            },
            "items":[
                {
                    "primaryThumbImageURL":"/ccstore/v1/images/?source=/file/v5541415982230769347/products/doratheexplorer_season1_LARGE.jpg&height=100&width=100",
                    "deactivationDate":"2018-06-27T12:59:59Z",
                    "rawTotalPrice":249.95000000000002,
                    "returnedQuantity":0,
                    "displayName":"Dora the Explorer - Season 1",
                    "shippingSurchargeValue":0,
                    "externalData":[
                    ],
                    "discountAmount":0,
                    "billingAccountId":"billingAcc-123",
                    "assetId":"asset10001",
                    "price":249.95,
                    "variant":[
                    ],
                    "onSale":false,
                    "primaryImageAltText":"Dora the Explorer - Season 1",
                    "actionCode":"Add",
                    "serviceId":"service-123",
                    "stateDetailsAsUser":"The item has been initialized within the shipping group",
                    "serviceAccountId":"serviceAcc-123",
                    "unitPrice":49.99,
                    "primaryImageTitle":"Dora the Explorer - Season 1",
                    "quantity":5,
                    "productId":"Product_21Cxi",
                    "salePrice":0,
                    "detailedItemPriceInfo":[
                        {
                            "discounted":false,
                            "amount":249.95,
                            "quantity":5,
                            "tax":21.86,
                            "orderDiscountShare":0,
                            "detailedUnitPrice":49.99,
                            "currencyCode":"USD"
                        }
                    ],
                    "active":true,
                    "catRefId":"Sku_21Dxy",
                    "skuProperties":[
                        {
                            "propertyType":"sku-base",
                            "name":"Name",
                            "id":"displayName",
                            "value":null
                        },
                        {
                            "propertyType":"sku-base",
                            "name":"Active",
                            "id":"active",
                            "value":true
                        },
                        {
                            "propertyType":"sku-base",
                            "name":"Id",
                            "id":"id",
                            "value":"Sku_21Dxy"
                        }
                    ],
                    "customerAccountId":"customerAcc-123",
                    "discountInfo":[
                    ],
                    "route":"/dora-the-explorer-season-1/product/Product_21Cxi",
                    "activationDate":"2017-06-27T15:30:00Z",
                    "listPrice":49.99,
                    "status":"INITIAL"
                }
            ],
            "trackingNumber":null,
            "status":"PENDING_MERCHANT_ACTION"
        }
    ],
    "approvalSystemMessages":[
        "Order is pending approval because total is greater than the approved order limit."
    ],
    "shippingMethod":{
        "shippingTax":3.07,
        "cost":35,
        "displayName":"Standard",
        "value":"standardShippingMethod",
        "shippingMethodDescription":"Standard"
    },
    "profile":{
        "firstName":"Ron",
        "lastName":"Blooming",
        "organization":{
            "approvalRequired":true,
            "name":"US Motor Works, Inc.",
            "id":"or-100002"
        },
        "middleName":null,
        "email":"ron@example.com"
    },
    "priceListGroup":{
        "repositoryId":"defaultPriceGroup"
    },
    "returnRequests":[
    ],
    "creationDate":"2016-11-04T12:58:12.000Z",
    "discountInfo":{
        "unclaimedCouponMultiPromotions":{
        },
        "orderCouponsMap":{
        },
        "orderDiscount":0,
        "shippingDiscount":0,
        "orderImplicitDiscountList":[
        ],
        "unclaimedCouponsMap":{
        },
        "claimedCouponMultiPromotions":{
        }
    },
    "profileId":"bb-110023",
    "exchangeRequests":[
    ],
    "giftWithPurchaseInfo":[
    ],
    "shippingAddress":{
        "lastName":"Blooming",
        "country":"US",
        "address3":null,
        "address2":"Santa Clara County",
        "city":"San Jose",
        "prefix":null,
        "address1":"7 W Jackson Blvd",
        "postalCode":"95111",
        "companyName":"US Motor Works, Inc.",
        "jobTitle":null,
        "county":null,
        "suffix":null,
        "selectedCountry":"US",
        "firstName":"Ron",
        "phoneNumber":"408-752-3500",
        "stateName":"California",
        "faxNumber":null,
        "alias":null,
        "middleName":null,
        "state":"CA",
        "countryName":"United States",
        "email":"ron@example.com",
        "selectedState":"NY",
        "state_ISOCode":"US-NY"
    },
    "giftWithPurchaseOrderMarkers":[
    ]
}
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| |------------------|------------------| |28320|Order duplication failed.| |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| |28321|No Order id specified| |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
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Nested Schema : items
Type: object

Examples

Sample Request:

{
  "orderId": "o30411",
  "exclude": {
    "commerceItem": [
      "priceInfo",
      "externalPriceDetails"
    ],
    "order": [
      "approverMessages",
      "quoteInfo",
      "approverIds",
      "submittedDate",
      "originOfOrder",
      "createdByOrderId",
      "priceInfo",
      "externalOrderPriceDetails",
      "cancelReason",
      "shippingGroups",
      "relationships",
      "paymentGroups"
    ]
  }
}

Sample Response Payload returned by endpoint:

{
  "creationTime": 1478264292000,
  "orderComments": [],
  "sourceSystem": "Cloud Commerce",
  "dynamicProperties": [],
  "stateString": "INCOMPLETE",
  "submittedDate": "2016-11-04T12:58:13.000Z",
  "paymentGroups": [],
  "priceInfo": {
    "amount": 249.95,
    "total": 309.88,
    "shipping": 35,
    "shippingSurchargeValue": 0,
    "tax": 24.93,
    "subTotal": 249.95,
    "currencyCode": "USD",
    "totalWithoutTax": 284.95
  },
  "pricingMessages": {},
  "shoppingCart": {"items": [{
    "deactivationDate": "2018-06-27T12:59:59Z",
    "rawTotalPrice": 249.95,
    "returnedQuantity": 0,
    "displayName": "Dora the Explorer - Season 1",
    "shippingSurchargeValue": 0,
    "externalData": [],
    "discountAmount": 0,
    "billingAccountId": "billingAcc-123",
    "imageInfo": {"primaryThumbImageURL": "/ccstore/v1/images/?source=/file/v5541415982230769347/products/doratheexplorer_season1_LARGE.jpg&height=100&width=100"},
    "assetId": "asset10001",
    "price": 249.95,
    "variant": [],
    "onSale": false,
    "actionCode": "Add",
    "serviceId": "service-123",
    "stateDetailsAsUser": "Added to order",
    "unitPrice": 49.99,
    "serviceAccountId": "serviceAcc-123",
    "quantity": 5,
    "productId": "Product_21Cxi",
    "salePrice": 0,
    "detailedItemPriceInfo": [{
      "discounted": false,
      "amount": 249.95,
      "quantity": 5,
      "tax": 21.86,
      "orderDiscountShare": 0,
      "detailedUnitPrice": 49.99,
      "currencyCode": "USD"
    }],
    "giftWithPurchaseCommerceItemMarkers": [],
    "tax": 21.86,
    "catRefId": "Sku_21Dxy",
    "customerAccountId": "customerAcc-123",
    "discountInfo": [],
    "stateDescription": "INITIAL",
    "activationDate": "2017-06-27T15:30:00Z",
    "listPrice": 49.99,
    "status": 0
  }]},
  "links": [{
    "rel": "self",
    "href": "http://localhost:9080/ccagentui/v1/orders/copyOrder"
  }],
  "id": "o50415",
  "state": 0,
  "stateDetailsAsUser": "Incomplete",
  "taxPriceInfo": {
    "cityTax": 0.71,
    "amount": 24.93,
    "valueAddedTax": 0,
    "countyTax": 0.71,
    "isTaxIncluded": false,
    "miscTax": 6.41,
    "districtTax": 0,
    "stateTax": 17.1,
    "countryTax": 0
  },
  "shippingGroups": [{
    "taxPriceInfo": {
      "cityTax": 0.71,
      "amount": 24.93,
      "valueAddedTax": 0,
      "countyTax": 0.71,
      "isTaxIncluded": false,
      "miscTax": 6.41,
      "districtTax": 0,
      "stateTax": 17.1,
      "countryTax": 0
    },
    "shippingMethod": {
      "shippingTax": 3.07,
      "cost": 35,
      "displayName": "Standard",
      "value": "standardShippingMethod",
      "shippingMethodDescription": "Standard"
    },
    "shippingGroupId": "sg60415",
    "submittedDate": null,
    "priceInfo": {
      "amount": 249.95,
      "total": 309.88,
      "shipping": 35,
      "shippingSurchargeValue": 0,
      "tax": 24.93,
      "subTotal": 249.95,
      "currencyCode": "USD",
      "totalWithoutTax": 284.95
    },
    "discountInfo": {
      "orderDiscount": 0,
      "shippingDiscount": 0,
      "discountDescList": []
    },
    "shipOnDate": null,
    "trackingInfo": [],
    "actualShipDate": null,
    "shippingAddress": {
      "lastName": "Blooming",
      "country": "US",
      "address3": null,
      "address2": "Santa Clara County",
      "city": "San Jose",
      "prefix": null,
      "address1": "7 W Jackson Blvd",
      "postalCode": "95111",
      "companyName": "US Motor Works, Inc.",
      "jobTitle": null,
      "county": null,
      "suffix": null,
      "selectedCountry": "US",
      "firstName": "Ron",
      "phoneNumber": "408-752-3500",
      "stateName": "California",
      "faxNumber": null,
      "alias": null,
      "middleName": null,
      "state": "CA",
      "countryName": "United States",
      "email": "ron@example.com",
      "selectedState": "NY",
      "state_ISOCode": "US-NY"
    },
    "items": [{
      "primaryThumbImageURL": "/ccstore/v1/images/?source=/file/v5541415982230769347/products/doratheexplorer_season1_LARGE.jpg&height=100&width=100",
      "deactivationDate": "2018-06-27T12:59:59Z",
      "rawTotalPrice": 249.95000000000002,
      "returnedQuantity": 0,
      "displayName": "Dora the Explorer - Season 1",
      "shippingSurchargeValue": 0,
      "externalData": [],
      "discountAmount": 0,
      "billingAccountId": "billingAcc-123",
      "assetId": "asset10001",
      "price": 249.95,
      "variant": [],
      "onSale": false,
      "primaryImageAltText": "Dora the Explorer - Season 1",
      "actionCode": "Add",
      "serviceId": "service-123",
      "stateDetailsAsUser": "The item has been initialized within the shipping group",
      "serviceAccountId": "serviceAcc-123",
      "unitPrice": 49.99,
      "primaryImageTitle": "Dora the Explorer - Season 1",
      "quantity": 5,
      "productId": "Product_21Cxi",
      "salePrice": 0,
      "detailedItemPriceInfo": [{
        "discounted": false,
        "amount": 249.95,
        "quantity": 5,
        "tax": 21.86,
        "orderDiscountShare": 0,
        "detailedUnitPrice": 49.99,
        "currencyCode": "USD"
      }],
      "active": true,
      "catRefId": "Sku_21Dxy",
      "skuProperties": [
        {
          "propertyType": "sku-base",
          "name": "Name",
          "id": "displayName",
          "value": null
        },
        {
          "propertyType": "sku-base",
          "name": "Active",
          "id": "active",
          "value": true
        },
        {
          "propertyType": "sku-base",
          "name": "Id",
          "id": "id",
          "value": "Sku_21Dxy"
        }
      ],
      "customerAccountId": "customerAcc-123",
      "discountInfo": [],
      "route": "/dora-the-explorer-season-1/product/Product_21Cxi",
      "activationDate": "2017-06-27T15:30:00Z",
      "listPrice": 49.99,
      "status": "INITIAL"
    }],
    "trackingNumber": null,
    "status": "PENDING_MERCHANT_ACTION"
  }],
  "approvalSystemMessages": ["Order is pending approval because total is greater than the approved order limit."],
  "shippingMethod": {
    "shippingTax": 3.07,
    "cost": 35,
    "displayName": "Standard",
    "value": "standardShippingMethod",
    "shippingMethodDescription": "Standard"
  },
  "profile": {
    "firstName": "Ron",
    "lastName": "Blooming",
    "organization": {
      "approvalRequired": true,
      "name": "US Motor Works, Inc.",
      "id": "or-100002"
    },
    "middleName": null,
    "email": "ron@example.com"
  },
  "priceListGroup": {"repositoryId": "defaultPriceGroup"},
  "returnRequests": [],
  "creationDate": "2016-11-04T12:58:12.000Z",
  "discountInfo": {
    "unclaimedCouponMultiPromotions": {},
    "orderCouponsMap": {},
    "orderDiscount": 0,
    "shippingDiscount": 0,
    "orderImplicitDiscountList": [],
    "unclaimedCouponsMap": {},
    "claimedCouponMultiPromotions": {}
  },
  "profileId": "bb-110023",
  "exchangeRequests": [],
  "giftWithPurchaseInfo": [],
  "shippingAddress": {
    "lastName": "Blooming",
    "country": "US",
    "address3": null,
    "address2": "Santa Clara County",
    "city": "San Jose",
    "prefix": null,
    "address1": "7 W Jackson Blvd",
    "postalCode": "95111",
    "companyName": "US Motor Works, Inc.",
    "jobTitle": null,
    "county": null,
    "suffix": null,
    "selectedCountry": "US",
    "firstName": "Ron",
    "phoneNumber": "408-752-3500",
    "stateName": "California",
    "faxNumber": null,
    "alias": null,
    "middleName": null,
    "state": "CA",
    "countryName": "United States",
    "email": "ron@example.com",
    "selectedState": "NY",
    "state_ISOCode": "US-NY"
  },
  "giftWithPurchaseOrderMarkers": []
}