createOrder

post

/ccagent/v1/orders

Create Order. It can createOrder/priceOrder/preAuthorizeOrder/submitOrder/resendOrdersForFulfillment order for a customer based on operations. Operations can be any of createOrder, priceOrder, preAuthorizeOrder, submitOrder. Dynamic Properties of order 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. Storefront also has an endopint with same id ('createOrder'), but the behaviour is different. For more informaiton refer Storefront API. This takes additonal header paramater x-ccsite to create the order in specific site. If the header information is not provided order is created on default site. 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
x-ccsite
Type: string
the site id on which the orders needs to be placed
Body Parameter
Root Schema : createOrder_request
Nested Schema : appliedPromotions
Type: array
The array of applied promotions
Nested Schema : billingAddress
Type: object
The billing address details.
Nested Schema : payments
Type: array
Payment details for the order.
Nested Schema : schedule
Type: object
Details of the schedule order to be created
Nested Schema : shippingAddress
Type: object
The shipping address details.
Nested Schema : shippingGroups
Type: array
The shipping groups for the order.
Nested Schema : shippingMethod
Type: object
The shipping method details for the order.
Nested Schema : shoppingCart
Type: object
The shopping cart contents of the current order.
Nested Schema : items
Type: object
Nested Schema : customProperties
Type: object
Custom object with dynamic properties. This will be passed to the webhook request
Nested Schema : schedule
Type: object
schedule details for the schedule.
Nested Schema : daysOfWeek
Type: array
mention which days of week schedule should run. values can be 1 to 7.
Nested Schema : monthsInYear
Type: array
The months in year of the Scheduled order. Values can be 0 to 11.
Nested Schema : weeksInMonth
Type: array
The weeks in month of the Scheduled order.Values can be 1 to 5
Nested Schema : items
Type: object
Nested Schema : items
Type: array
The array of products in the shipping group.
Nested Schema : recurringChargePriceInfo
Type: object
Recurring charge price information.
Nested Schema : shippingAddress
Type: object
The shipping address details.
Nested Schema : shippingMethod
Type: object
The shipping method details for the order.
Nested Schema : items
Type: object
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : frequencyAmountTotals
Type: array
The total for each recurring charge frequency
Nested Schema : frequencyTaxTotals
Type: array
The tax for each recurring charge frequency
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : coupons
Type: array
The array of coupons applied to the order.
Nested Schema : items
Type: array
The array of products in the shopping cart.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : childItems
Type: array
The array of child items in the item, if the item is a configurable item. A child item can itself contain child item array if it is a configurable product in itself.
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : giftWithPurchaseSelections
Type: array
The array of gift with purchase selections to be made.
Nested Schema : items
Type: object
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
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 : values
Type: object
The array of values associated with an externalData item.
Nested Schema : items
Type: object

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createOrder_response
Nested Schema : approvalSystemMessages
Type: array
An array of approval messages when order going in pending approval state
Nested Schema : billingAddress
Type: object
The billing address details.
Nested Schema : discountInfo
Type: object
The 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
The gift information.
Nested Schema : giftWithPurchaseOrderMarkers
Type: array
gift with purchase order marker information
Nested Schema : payments
Type: array
Payment details for the order, including additional properties specific to the payment type.
Nested Schema : priceInfo
Type: object
The price information.
Nested Schema : priceListGroup
Type: object
The price list group object.
Nested Schema : pricingMessages
Type: object
The Pricing messages information.
Nested Schema : quoteInfo
Type: object
the quote information of the order
Nested Schema : recurringChargePriceInfo
Type: object
Recurring charge price information.
Nested Schema : scheduledOrder:
Type: object
the schedule information of order
Nested Schema : shippingAddress
Type: object
The shipping address details.
Nested Schema : shippingGroups
Type: array
The shipping groups for the order.
Nested Schema : shippingMethod
Type: object
The shipping method details for the order.
Nested Schema : shoppingCart
Type: object
The shopping cart contents of the current order.
Nested Schema : trackingInfo
Type: array
Tracking Information for the Order.
Nested Schema : orderDiscountDescList
Type: array
The list of all the order discounts.
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 : giftWithPurchaseMessages
Type: array
The gift with purchase messages information.
Nested Schema : items
Type: object
Nested Schema : params
Type: array
The list of all message parameters.
Nested Schema : items
Type: object
Nested Schema : errorInfo
Type: array
the array of errors, if any
Nested Schema : notes
Type: array
the notes (history) for the order
Nested Schema : items
Type: object
Nested Schema : frequencyAmountTotals
Type: array
The total for each recurring charge frequency
Nested Schema : frequencyTaxTotals
Type: array
The tax for each recurring charge frequency
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : clonedOrders
Type: array
Array of order ids created from scheduled order.
Nested Schema : executionStatusList
Type: array
list of orders with status that are placed with this schedule.
Nested Schema : lastError
Type: object
last error of this scheduled order.
Nested Schema : schedule
Type: object
The schedule of the Scheduled order.
Nested Schema : items
Type: object
Nested Schema : errorMessages
Type: array
The error messages list.
Nested Schema : errorMessages
Type: array
An array of error messages
Nested Schema : daysInMonth
Type: array
The selected dates in a month in year for the Scheduled order.
Nested Schema : daysOfWeek
Type: array
The days of week of the Scheduled order.
Nested Schema : monthsInYear
Type: array
The months in year of the Scheduled order.
Nested Schema : weeksInMonth
Type: array
The weeks in month of the Scheduled order.
Nested Schema : items
Type: object
Nested Schema : discountInfo
Type: object
The shipping group price information.
Nested Schema : items
Type: array
The array of products in the shipping group.
Nested Schema : priceInfo
Type: object
The shipping group price information.
Nested Schema : recurringChargePriceInfo
Type: object
Recurring charge price information.
Nested Schema : shippingAddress
Type: object
The shipping address details.
Nested Schema : shippingMethod
Type: object
The shipping method details.
Nested Schema : taxPriceInfo
Type: object
The shipping tax price info details.
Nested Schema : trackingInfo
Type: array
Tracking Information for the Order.
Nested Schema : discountDescList
Type: array
The list of all the order discounts.
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : detailedItemPriceInfo
Type: object
Detailed Item Price Information.
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : dynamicProperties
Type: array
Array of custom properties at order line item level.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : skuProperties
Type: array
Sku properties Information
Nested Schema : variant
Type: array
List of variants for the product.
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 : frequencyAmountTotals
Type: array
The total for each recurring charge frequency
Nested Schema : frequencyTaxTotals
Type: array
The tax for each recurring charge frequency
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: array
The array of products in the shopping cart.
Nested Schema : items
Type: object
Nested Schema : childItems
Type: array
The array of child items in the item, if the item is a configurable item. A child item can itself contain child item array if it is a configurable product in itself.
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : discountInfo
Type: array
The discount information.
Nested Schema : dynamicProperties
Type: array
Array of custom properties at order line item level.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
Nested Schema : skuProperties
Type: array
Sku properties Information
Nested Schema : variant
Type: array
List of variants for the product.
Nested Schema : items
Type: object
Nested Schema : detailedRecurringChargeInfo
Type: object
Detailed Item Price Information.
Nested Schema : externalData
Type: array
External data to be associated with a commerce item, provided by a configurator system.
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 : giftWithPurchaseDiscountInfo
Type: array
The gift information.
Nested Schema : items
Type: object
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

{
    "taxPriceInfo":{
        "cityTax":0,
        "amount":4,
        "valueAddedTax":0,
        "countyTax":2,
        "isTaxIncluded":false,
        "miscTax":0,
        "districtTax":0,
        "stateTax":2,
        "countryTax":0
    },
    "priceInfo":{
        "amount":9.99,
        "total":38.5,
        "shipping":25,
        "tax":3.51,
        "subTotal":9.99,
        "currencyCode":"USD"
    },
    "discountInfo":{
        "unclaimedCouponMultiPromotions":{
        },
        "orderCouponsMap":{
        },
        "orderDiscount":0,
        "shippingDiscount":0,
        "orderImplicitDiscountList":[
        ],
        "unclaimedCouponsMap":{
        },
        "claimedCouponMultiPromotions":{
        }
    },
    "orderId":"o10415",
    "dynamicProperties":[
        {
            "id":"dynamicPropertyShippingInstructions",
            "value":"Test Instructions"
        }
    ],
    "isItemPriceOverrideAllowed":true,
    "shoppingCart":{
        "numberOfItems":1,
        "items":[
            {
                "unitPrice":9.99,
                "quantity":1,
                "productId":"Product_18Cyii",
                "priceOverridenBy":"",
                "giftWithPurchaseCommerceItemMarkers":[
                ],
                "preOrderQuantity":0,
                "childItems":[
                    {
                        "quantity":1,
                        "route":"/intel-pentium-dual-core/product/prod40001",
                        "productId":"prod40001",
                        "displayName":"Intel Pentium Dual Core",
                        "selectedOptions":[
                        ],
                        "catRefId":"sku40001"
                    },
                    {
                        "quantity":1,
                        "route":"/8-gb-kingston-sodimm-ddr3-1600mhz/product/prod40007",
                        "productId":"prod40007",
                        "displayName":"8 GB Kingston Sodimm DDR3 1600MHz",
                        "selectedOptions":[
                        ],
                        "catRefId":"sku40007"
                    }
                ],
                "catRefId":"Sku_18Dxy",
                "configuratorId":"36379716",
                "overriddenPrice":"",
                "commerceItemId":"ci1000785",
                "discountInfo":[
                ],
                "price":9.99,
                "isPriceOverridden":false,
                "onSale":true,
                "backOrderQuantity":0,
                "priceOverrideReason":{
                }
            }
        ]
    },
    "giftWithPurchaseInfo":[
    ],
    "links":[
        {
            "method":"POST",
            "rel":"self",
            "href":"/ccagentui/v1/orders"
        }
    ],
    "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| |------------------|------------------| |40001|Please check the shipping address and try again.| |200124|Internal error occurred.| |28155|{0} cannot be purchased directly and is only available as part of a customizable product, please remove this item from your cart in order to proceed| |1002020|The user does not have permission to place an order.| |100094|Organization passed in the header is currently inactive| |100098|Current operation is being performed in an organization context and the shopper profile is not associated to any organization| |28107|Specified order does not exist| |28129|Product/sku {0} not found| |22001|An internal error occurred while processing input request.| |22002|No profile found with profile id {0}| |28326|Code not currently active./ Code not found. / Code expired.| |28088|Please check the selected shipping method before placing your order. The previously selected shipping method is no longer available.| |28086|No shipping data specified| |30015|SiteId passed in x-ccsite header is currently inactive| |28087|No shipping method specified| |30014|SiteId passed in x-ccsite header is invalid or the site was deleted| |28103|Quantity cannot exceed order limit| |28301|Order submission failed| |28104|Quantity cannot exceed stock limit (inventory check)| |28102|Product/sku {0} not found| |28300|Internal error while creating the order| |28080|Empty shopping cart data| |28081|No items found in cart data| |100101|The shopper profile does not belong to organization passed in the header| |100102|Organization passed in the header is invalid or does not exist| |100103|The order or return request does not belong to the organization passed in the header| |28084|No quantity specified on item| |28085|Invalid quantity {0} specified on item| |28082|No product id specified on item| |28083|No catalog reference id specified on item| |28105|Order submission failed| |28111|Your order has not been placed due to a payment error, and you have not been charged. Please try again|
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:

{
  "op": "createOrder",
  "profileId": "se-570032",
  "shippingMethod": {"value": "standardShippingMethod"},
  "shoppingCart": {
    "coupons": [{
      "code": "SAVE5PERCENTON100",
      "level": "order",
      "description": "Order Discount - SAVE5%ON100 - Coupon",
      "id": "explicitOrderDiscount5on100",
      "status": "unclaimed"
    }],
    "items": [{
      "serviceAccountId": "serviceAcc-123",
      "deactivationDate": "2018-06-27T12:59:59Z",
      "quantity": 1,
      "productId": "Product_18Cyii",
      "currentPrice": 0,
      "billingAccountId": "billingAcc-123",
      "childItems": [{
        "serviceAccountId": "serviceAcc-123",
        "deactivationDate": "2018-06-27T12:59:59Z",
        "quantity": "1",
        "productId": "prod40001",
        "displayName": "Laptop Parts 1",
        "externalData": [],
        "currentPrice": 0,
        "billingAccountId": "billingAcc-123",
        "childItems": [{
          "serviceAccountId": "serviceAcc-123",
          "deactivationDate": "2018-06-27T12:59:59Z",
          "quantity": "1",
          "productId": "prod40001",
          "displayName": "Laptop Parts 1",
          "externalData": [],
          "currentPrice": 0,
          "billingAccountId": "billingAcc-123",
          "catRefId": "sku40009",
          "priceListGroupId": "defaultPriceGroup",
          "customerAccountId": "customerAcc-123",
          "assetId": "asset10001",
          "invalid": false,
          "stockStatus": true,
          "actionCode": "Add",
          "activationDate": "2017-06-27T15:30:00Z",
          "serviceId": "service-123"
        }],
        "catRefId": "sku40001",
        "priceListGroupId": "defaultPriceGroup",
        "customerAccountId": "customerAcc-123",
        "assetId": "asset10001",
        "invalid": false,
        "stockStatus": true,
        "actionCode": "Add",
        "activationDate": "2017-06-27T15:30:00Z",
        "serviceId": "service-123"
      }],
      "externalPriceQuantity": -1,
      "catRefId": "Sku_18Dxy",
      "configuratorId": "12343455",
      "externalPrice": "722.0",
      "customerAccountId": "customerAcc-123",
      "assetId": "asset10001",
      "stockStatus": true,
      "onSale": true,
      "actionCode": "Add",
      "activationDate": "2017-06-27T15:30:00Z",
      "serviceId": "service-123"
    }]
  },
  "shippingAddress": {
    "lastName": "Spencers",
    "country": "US",
    "address3": "",
    "address2": "",
    "city": "Montgomery",
    "prefix": "",
    "address1": "600 Dexter Avenue",
    "postalCode": "36130",
    "jobTitle": "",
    "companyName": "",
    "county": "",
    "suffix": "",
    "DEFAULT_POSTAL_CODE_PATTERN": "^[0-9a-zA-Z]{1,}([ -][0-9a-zA-Z]{1,})?$",
    "selectedCountry": "US",
    "firstName": "Mark",
    "phoneNumber": "973-974-1234",
    "faxNumber": "",
    "middleName": "",
    "state": "AL",
    "email": "",
    "selectedState": "AL",
    "state_ISOCode": "US-AL"
  },
  "requestChannel": "agent",
  "dynamicPropertyShippingInstructions": "Test Instructions"
}

Sample Response Payload returned by endpoint:

{
  "taxPriceInfo": {
    "cityTax": 0,
    "amount": 4,
    "valueAddedTax": 0,
    "countyTax": 2,
    "isTaxIncluded": false,
    "miscTax": 0,
    "districtTax": 0,
    "stateTax": 2,
    "countryTax": 0
  },
  "priceInfo": {
    "amount": 9.99,
    "total": 38.5,
    "shipping": 25,
    "tax": 3.51,
    "subTotal": 9.99,
    "currencyCode": "USD"
  },
  "discountInfo": {
    "unclaimedCouponMultiPromotions": {},
    "orderCouponsMap": {},
    "orderDiscount": 0,
    "shippingDiscount": 0,
    "orderImplicitDiscountList": [],
    "unclaimedCouponsMap": {},
    "claimedCouponMultiPromotions": {}
  },
  "orderId": "o10415",
  "dynamicProperties": [{
    "id": "dynamicPropertyShippingInstructions",
    "value": "Test Instructions"
  }],
  "isItemPriceOverrideAllowed": true,
  "shoppingCart": {
    "numberOfItems": 1,
    "items": [{
      "unitPrice": 9.99,
      "quantity": 1,
      "productId": "Product_18Cyii",
      "priceOverridenBy": "",
      "giftWithPurchaseCommerceItemMarkers": [],
      "preOrderQuantity": 0,
      "childItems": [
        {
          "quantity": 1,
          "route": "/intel-pentium-dual-core/product/prod40001",
          "productId": "prod40001",
          "displayName": "Intel Pentium Dual Core",
          "selectedOptions": [],
          "catRefId": "sku40001"
        },
        {
          "quantity": 1,
          "route": "/8-gb-kingston-sodimm-ddr3-1600mhz/product/prod40007",
          "productId": "prod40007",
          "displayName": "8 GB Kingston Sodimm DDR3 1600MHz",
          "selectedOptions": [],
          "catRefId": "sku40007"
        }
      ],
      "catRefId": "Sku_18Dxy",
      "configuratorId": "36379716",
      "overriddenPrice": "",
      "commerceItemId": "ci1000785",
      "discountInfo": [],
      "price": 9.99,
      "isPriceOverridden": false,
      "onSale": true,
      "backOrderQuantity": 0,
      "priceOverrideReason": {}
    }]
  },
  "giftWithPurchaseInfo": [],
  "links": [{
    "method": "POST",
    "rel": "self",
    "href": "/ccagentui/v1/orders"
  }],
  "giftWithPurchaseOrderMarkers": []
}