This API synchronize shopping cart line items with order line items. Before you synchronize your cart add products using addMultiProducts(), add bundles using addBundle(). The API will generally be invoked when the user clicks the Place Order action from the cart.

API Details

APISignature
synchronizeCartwebService static Conga_Config2.CPQStruct.SynchronizeCartResponseDO synchronizeCart(Apttus_Config2.CPQStruct.SynchronizeCartRequestDO request)


Parameters
NameTypeDescription
requestCPQStruct.SynchronizeCartRequestDOThe request data object.



Request Data Object - CPQStruct.SynchronizeCartRequestDO
NameTypeRequired?Description
CartIdIDYesThe Id of the cart (Product Configuration) you want to synchronize.


API Response

Response Data Object - CPQStruct.SynchronizeCartResponseDO
NameTypeDescription
IsSuccessBooleanIndicates whether synchronizing the cart items was successful.



Code Sample


The following code sample enables you to synchronize cart items with an order. When the customer has finalized the cart, you can synchronize the products in the cart with the order used to generate the cart. Invoke this API after the user has finalized the cart. 


public void synchronizeCart()
{
	if(String.isNotBlank(cartId))
	{
		// Create the request
		Apttus_Config2.CPQStruct.SynchronizeCartRequestDO request2 = new Apttus_Config2.CPQStruct.SynchronizeCartRequestDO();
		
		// Add request parameters
		request2.CartId = cartId;
	   
		// Synchronize cart
		Apttus_Config2.CPQStruct.SynchronizeCartResponseDO result2 = Apttus_Config2.OrderWebService.synchronizeCart(request2);
		 
	} else {
		ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'Invalid or blank cart Id.'));
	}   
}
CODE

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:synchronizeCart>
<ord:request>
<cpq:CartId>a1I7A000001IqcfUAC</cpq:CartId>
</ord:request>
</ord:synchronizeCart>
</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:SynchronizeCartResponseDO="http://soap.sforce.com/schemas/class/Apttus_Config2/CPQStruct">
   <soapenv:Body>
      <synchronizeCartResponse>
         <result>
            <SynchronizeCartResponseDO:IsSuccess>true</SynchronizeCartResponseDO:IsSuccess>
         </result>
      </synchronizeCartResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML