This API creates an order for a specific Account and Price List.

API Details


APISignature
createOrderwebService static Apttus_Config2.CPQStruct.CreateOrderResponseDO createOrder(Apttus_Config2.CPQStruct.CreateOrderRequestDO)



Parameters
NameTypeDescription
requestCPQStruct.CreateOrderRequestDOThe request data object.



Request Data Object - CPQStruct.CreateOrderRequestDO
FieldTypeRequired?Description
AccountIdIDYesThe Id of the Account to be associated with the order.
PriceListIdIDYesThe Id of the PriceList to be associated with the order. Only the products associated with the Price List appear on the cart.
PricingDateDatetimeNoDate and time associated with the order and represent the date when the order will be priced.


API Response

Response Data Object - CPQStruct.CreateOrderResponseDO
FieldTypeDescription
orderIdIDThe Id of the newly created order object

Code Sample

The following code sample enables you to create an order for a valid account with an Account Id and a Price List with a valid Price List Id. Using the sample, you can search for a valid account using an account number. If an account exists with the account number entered, you can create an order using the createOrder() API. You can invoke this API in use cases when you want to create an order based on the account and price list. 
 

public void createOrder()
{
	// Create the request
	Apttus_Config2.CPQStruct.CreateOrderRequestDO request = new Apttus_Config2.CPQStruct.CreateOrderRequestDO();
	
	// Add request parameters
	request.AccountId = accountId;
	request.PriceListId = priceListId;
	request.PricingDate = Datetime.now();
	
	// Create a new order
	Apttus_Config2.CPQStruct.CreateOrderResponseDO result = Apttus_Config2.OrderWebService.createOrder(request);
	
	// Assign orderId to local variable
	orderId = result.OrderSO.Id;
}
CODE

Integration Details

Use the following information in your integrations with Apttus CPQ Web Services API. Refer to Integrating Apttus with External Systems for information on how to get started.

API Prerequisites

None.

Request and Response XML

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ord="http://soap.sforce.com/schemas/class/Apttus_Config2/OrderWebService" xmlns:cpq="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct">
   <soapenv:Header>
          <ord:SessionHeader>
         <ord:sessionId>00D7A0000009QII!ARUAQFmpeBOmsYS2JcADxYc4PxWoOkAHJP1JiNo5vtvnDBCEvfnWWWmO7pqbEXY7WadiCmm_Vib6MjhmgUbR8321tIO1NQRg</ord:sessionId>
      </ord:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <ord:createOrder>
         <ord:request>
             <cpq:AccountId>0017A00000WW0pZQAT</cpq:AccountId>
                  </ord:request>
      </ord:createOrder>
   </soapenv:Body>
</soapenv:Envelope>
XML

Example Response

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://soap.sforce.com/schemas/class/Apttus_Config2/OrderWebService" xmlns:CreateOrderResponseDO="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <createOrderResponse>
         <result>
            <CreateOrderResponseDO:OrderSO xsi:type="Apttus_Config2__Order__c">
               <Id>a2n7A0000002tviQAA</Id>
               <Apttus_Config2__AutoActivateOrder__c>false</Apttus_Config2__AutoActivateOrder__c>
               <Apttus_Config2__BillToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__BillToAccountId__c>
               <Apttus_Config2__BillingPreferenceId__c>a2d2f0000000h0YAAQ</Apttus_Config2__BillingPreferenceId__c>
               <Apttus_Config2__OrderDate__c>2020-07-06T06:33:53.000Z</Apttus_Config2__OrderDate__c>
               <Apttus_Config2__PricingDate__c>2020-07-06T06:33:53.000Z</Apttus_Config2__PricingDate__c>
               <Apttus_Config2__ShipToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__ShipToAccountId__c>
               <Apttus_Config2__SoldToAccountId__c>0017A00000WW0pZQAT</Apttus_Config2__SoldToAccountId__c>
               <Apttus_Config2__SoldToAccountId__r xsi:type="Account">
                  <Id>0017A00000WW0pZQAT</Id>
                  <Name>OM_Account</Name>
               </Apttus_Config2__SoldToAccountId__r>
               <Apttus_Config2__Source__c>Account</Apttus_Config2__Source__c>
               <Apttus_Config2__Status__c>Draft</Apttus_Config2__Status__c>
               <Apttus_Config2__Type__c>New</Apttus_Config2__Type__c>
               <Name>O-00005958</Name>
               <OwnerId>0052f000000j6YUAAY</OwnerId>
            </CreateOrderResponseDO:OrderSO>
         </result>
      </createOrderResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML