This removes one or more products (with default options) or bundles from the cart along with quantity, term, start date, and end date.


APISignature
removeMultiBundleswebService static Apttus_CPQApi.CPQ.RemoveMultiBundlesResponseDO removeMultiBundles(Apttus_CPQApi.CPQ.RemoveMultiBundlesRequestDO request)
Parameters
NameTypeDescription
requestApttus_CPQApi.CPQ.RemoveMultiBundlesRequestDOThe request data object.



Request Data Object - Apttus_CPQApi.CPQ.RemoveMultiBundlesRequestDO
FieldTypeDescription
CartIdIDThe Id of the cart.
LineNumberList<Decimal>The List of LineNumbers that need to be removed from the cart.



Response Data Object - Apttus_CPQApi.CPQ.RemoveMultiBundlesResponseDO
FieldTypeDescription
IsSuccessBooleanIndicates the success of the operation.


Code Sample

Use the sample below to remove one ore more products of the cart. When the user selects multiple products on the cart and clicks Delete or Remove, invoke this API. The multiple products are deleted from the cart. Based on the line number and the cartID the selected assets are removed from the cart. Update the new line items using the getLineItems function.
 

/**
 * The below method demonstrates how to remove multiple products from an existing cart (every quote has a cart)
 * Lets assume the Quote's Cart has a 3 products, 
 * Laptop is a bundle product (line number 1) and Monitor and Wifi Router are standalone products (line number 2 and 3 respectively)
 * The input of this method is Quote Number and the line numbers of the Laptop bundle product and Monitor and Wifi Router are standalone products
 */
public static void removeMultiBundles(String quoteNumber, List<Integer> lineNumbers) {
	
	List<Apttus_Config2__ProductConfiguration__c> cart = [SELECT Id FROM Apttus_Config2__ProductConfiguration__c WHERE Apttus_QPConfig__Proposald__r.Name = :quoteNumber LIMIT 1];
	
	if(!cart.isEmpty() && lineNumbers != null && !lineNumbers.isEmpty()) {
		
		// Create the request object
		Apttus_CPQApi.CPQ.RemoveMultiBundlesRequestDO request = new Apttus_CPQApi.CPQ.RemoveMultiBundlesRequestDO();
		request.CartId = cart.get(0).Id;
		request.LineNumbers = lineNumbers;
		
		// Execute the removeMultiBundles routine
		Apttus_CPQApi.CPQ.RemoveMultiBundlesResponseDO response = Apttus_CPQApi.CPQWebService.removeMultiBundles(request);
		
		System.debug('Remove bundle from cart response status = ' + response.IsSuccess);
	}    	
}
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.

Response/Request XML

Example Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cpq="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQWebService" xmlns:cpq1="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQ">
   <soapenv:Header>
      <cpq:SessionHeader>
         <cpq:sessionId>00D4P000000z7dE!AQQAQAHIR1W9.1as89Auz.CvNYxqyg56gLLWgUtP5VZxidvTsb1DpQZpmyDuqZOiF4VctBp3jhhJIxG9oRQ4A4F9h98N0inT</cpq:sessionId>
      </cpq:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <cpq:removeMultiBundles>
         <cpq:request>
            <cpq1:CartId>a1l4P00000Bg7D9QAJ</cpq1:CartId>
            <cpq1:LineNumbers>1</cpq1:LineNumbers>
			<cpq1:LineNumbers>3</cpq1:LineNumbers>
         </cpq:request>
      </cpq:removeMultiBundles>
   </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_CPQApi/CPQWebService" xmlns:RemoveMultiBundlesResponseDO="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQ">
   <soapenv:Body>
      <removeMultiBundlesResponse>
         <result>
            <RemoveMultiBundlesResponseDO:IsSuccess>true</RemoveMultiBundlesResponseDO:IsSuccess>
         </result>
      </removeMultiBundlesResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML