This removes a product bundle and related line items and options from the cart.

API
Signature
removeBundlewebService static Apttus_CPQApi.CPQ.RemoveBundleResponseDO removeBundle(Apttus_CPQApi.CPQ.RemoveBundleRequestDO request)



Parameters
Name
Type
Description
requestApttus_CPQApi.CPQ.RemoveBundleRequestDOThe request data object.



Request Data Object - Apttus_CPQApi.CPQ.RemoveBundleRequestDO
Field
Type
Description
CartIdIDThe Id of the cart.
LineNumberDecimalThe bundle line number.



Response Data Object - Apttus_CPQApi.CPQ.RemoveBundleResponseDO
Field
Type
Description
IsSuccessBooleanIndicates the success of the operation.


Code Sample

The sample below enables you remove a selected bundle from the cart using the line number and a cart id. Invoke the API, when the user selects a bundle from the cart and click Remove or Delete. Based on the line number and the cartID the asset is removed from the cart. Update the new line items using the getLineItems function.
 

/**
 * The below method demonstrates how to remove a bundle product from an existing cart (every quote has a cart)
 * Lets assume the Quote's Cart has a bundle product called Laptop and its two options are Keyboard and Mouse
 * The input of this method is Quote Number and the line number of the Laptop bundle product
 */
public static void removeBundle(String quoteNumber, Integer lineNumber) 
{
	
	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() && lineNumber != null) 
	{
		
		// Create the request object
		Apttus_CPQApi.CPQ.RemoveBundleRequestDO request = new Apttus_CPQApi.CPQ.RemoveBundleRequestDO();
		request.CartId = cart.get(0).Id;
		request.LineNumber = lineNumber;
		
		// Execute the removeBundle routine
		Apttus_CPQApi.CPQ.RemoveBundleResponseDO response = Apttus_CPQApi.CPQWebService.removeBundle(request);
		
		System.debug('Remove bundle from cart response status = ' + response.IsSuccess);
	}    	
}
CODE

Integration DetailsLink to Integration Details

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

API PrerequisitesLink to API Prerequisites

Response/Request XMLLink to 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!AQQAQFudWwmQHKaOg8qt7T4KJ9MmTK0J055OXmfoUk9bUEL_idltBYg5muQuM4Pm0HVjinAgttLfi55uyxVSvF5yrkoH.rH4</cpq:sessionId>
      </cpq:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <cpq:removeBundle>
         <cpq:request>
            <cpq1:CartId>a1l4P00000Bg7D9QAJ</cpq1:CartId>
            <cpq1:LineNumber>1</cpq1:LineNumber>
         </cpq:request>
      </cpq:removeBundle>
   </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:RemoveBundleResponseDO="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQ">
   <soapenv:Body>
      <removeBundleResponse>
         <result>
            <RemoveBundleResponseDO:IsSuccess>true</RemoveBundleResponseDO:IsSuccess>
         </result>
      </removeBundleResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML