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 : billingAddress
Type: object
Billing address for the order
Nested Schema : orders
Type: array
Orders to be resubmitted. Related Endpoint operations - resendOrdersForFulfillment
Nested Schema : payments
Type: object
List of payments
Nested Schema : schedule
Type: object
The details of the schedule order. Related Endpoint operations - createOrder
Nested Schema : shippingAddress
Type: object
Shipping address. Related Endpoint operations - createOrder, priceOrder, submitOrder, preAuthorizeOrder
Nested Schema : shippingGroups
Type: array
Shipping Groups. Related Endpoint operations - createOrder, priceOrder, submitOrder
Nested Schema : shippingMethod
Type: object
shipping method. Related Endpoint operations - createOrder, priceOrder, submitOrder, preAuthorizeOrder
Nested Schema : shoppingCart
Type: object
Shopping cart information. Related Endpoint operations - createOrder, priceOrder, submitOrder, preAuthorizeOrder
Nested Schema : schedule
Type: object
The schedule of the scheduled order
Nested Schema : daysInMonth
Type: array
Days in a month this scheduled order has to be placed
Nested Schema : daysOfWeek
Type: array
Days in a week this scheduled order has to be placed
Nested Schema : monthsInYear
Type: array
Months in a year this scheduled order has to be placed
Nested Schema : weeksInMonth
Type: array
Weeks in a month this scheduled order has to be placed
Nested Schema : items
Type: object
Nested Schema : items
Type: array
Items in the cart.
Nested Schema : shippingAddress
Type: object
Shipping address.
Nested Schema : shippingMethod
Type: object
shipping method
Nested Schema : items
Type: object
Nested Schema : coupons
Type: array
The array of coupons applied to the order.
Nested Schema : items
Type: array
Items in the cart.
Nested Schema : items
Type: object
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 : 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 : items
Type: object
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
Nested Schema : values
Type: object
The array of values associated with an externalData item.

Response

Supported Media Types
  • application/json
200 Response
Following model is returned when operation succeeds.
Body
Root Schema : createOrder_response
Nested Schema : billingMethod
Type: object
Billing method information of the order. Related Endpoint operation - submitOrder.
Nested Schema : discountInfo
Type: object
Discount information. Related Endpoint operation - createOrder, priceOrder, submitOrder, preAuthorizeOrder.
Nested Schema : dynamicProperties
Type: array
Read-only list of dynamic properties for the order along with meta-data. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : giftWithPurchaseInfo
Type: array
Gift Selection Information. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : giftWithPurchaseOrderMarkers
Type: array
Gift With Purchase order markers information. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : notSubmittedOrders
Type: array
Orders not submitted for fulfillment. Related Endpoint operations - resendOrdersForFulfillment
Nested Schema : orderComments
Type: array
The list of all logged comments for the order.
Nested Schema : paymentGroup
Type: object
Payment Group for the order. Related Endpoint operation - submitOrder.
Nested Schema : paymentGroups
Type: array
List of payment Groups for the order. Related Endpoint operations - submitOrder
Nested Schema : priceInfo
Type: object
Price information. Related Endpoint operation - createOrder, priceOrder, submitOrder, preAuthorizeOrder.
Nested Schema : pricingMessages
Type: object
The Pricing messages information. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : profile
Type: object
Profile Information for the order. Related Endpoint operations - submitOrder
Nested Schema : returnRequests
Type: array
The list of the requests raised for the order. Related Endpoint operations - submitOrder
Nested Schema : shippingAddress
Type: object
Shipping address. Related Endpoint operations - submitOrder
Nested Schema : shippingGroups
Type: array
Shipping Groups. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : shippingMethod
Type: object
Shipping method information. Related Endpoint operation - priceOrder, submitOrder, preAuthorizeOrder.
Nested Schema : shoppingCart
Type: object
Shopping cart information. Related Endpoint operation - createOrder, priceOrder, submitOrder, preAuthorizeOrder.
Nested Schema : submittedOrders
Type: array
Orders submitted for fulfillment. Related Endpoint operations - resendOrdersForFulfillment
Nested Schema : taxPriceInfo
Type: object
The tax pricing details for the order. Related Endpoint operation - createOrder, priceOrder, submitOrder.
Nested Schema : claimedCouponMultiPromotions
Type: object
The coupons that were claimed
Nested Schema : orderCouponsMap
Type: array
Map of coupons.
Nested Schema : orderImplicitDiscountList
Type: array
List of discounts.
Nested Schema : unclaimedCouponMultiPromotions
Type: object
The coupons that were not claimed
Nested Schema : unclaimedCouponsMap
Type: array
Map of unclaimed coupons.
Nested Schema : couponCode
Type: array
Coupon Code, corresponding to which promotions were applied
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : items
Type: object
Nested Schema : couponCode
Type: array
Coupon Code, corresponding to which some promotions were not applied
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 : 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 : GiftWithPurchaseMessages
Type: array
The GWP 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 : 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 : childItems
Type: array
Child items of the commerce item
Nested Schema : discountInfo
Type: object
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 : imageInfo
Type: object
Shipping method 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 : 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: 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 : 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 : giftWithPurchaseCommerceItemMarkers
Type: array
The array of giftWithPurchaseCommerceItemMarkers.
Nested Schema : priceOverrideReason
Type: object
Price override reason map
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 : gwpSelections
Type: array
The gift information.
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 : 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 : values
Type: object
The array of values associated with an externalData item.
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": []
}