SynchronizeCart()

Sync 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


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