This method can be used to retrieve the price breakup for a cart or specific line item. 


APISignature
getPriceBreakup webService static Apttus_CPQApi.CPQ.GetPriceBreakupResponseDO getPriceBreakup(Apttus_CPQApi.CPQ.GetPriceBreakupRequestDO request)



Parameters
NameTypeDescription
requestApttus_CPQApi.CPQ.GetPriceBreakupRequestDOThe request data object.



Request Data Object - Apttus_CPQApi.CPQ.GetPriceBreakupRequestDO
NameTypeRequiredDescription
CartIdIDYesThe ID of the new cart object. Mandatory parameter.
LineItemIdIDNoThe ID of the line item. This can be null. If it is null the price breakup for all applicable line items in the cart is retrieved. If a value is provided, only the price breakup for that specific line item is retrieved.



Response Data Object - Apttus_CPQApi.CPQ.GetPriceBreakupResponseDO
NameTypeDescription
HasPriceBreakupsBooleanIndicates whether there are price breakups for the cart.
PriceBreakupsList <Apttus_CPQApi.CPQ.PriceBreakupCollDO>The list of price breakup collection objects



Data Object - Apttus_CPQApi.CPQ.PriceBreakupCollDO
NameTypeDescription
BreakupItemsList<Apttus_Config2__PriceBreakup__c>The list of price breakup sobjects associated with the line item.
LineItemIdIDThe ID of the line item associated with the price break sobjects.


Code Sample

Using the sample below you can enable the end-user to view the price breakup for a selected product. Suppose the user has selected a product Laptop, using the Price Breakup API, you can show the end-user the pricing breakup. For example, if the user has bought 25 laptops and for 20 quantities of the laptop a 5% discount is provided on the net price, and for the other 5 quantities, a discount of 10% is given. Using the getPriceBreakup API you can show the user the tiered pricing pattern applied to a product.
 

public void getPriceBreakup()
{
	lstPriceBreakup = new List<PriceBreakUpWrapperClass>();
	//For a selected product in a cart execute this loop. 
	for(LineItemWrapperClass objLineItemWrapperClass: lstWrapItems) 
	{
		if(objLineItemWrapperClass.selected)
		{
			Apttus_CPQApi.CPQ.GetPriceBreakupRequestDO priceBreakUpRequest = new Apttus_CPQApi.CPQ.GetPriceBreakupRequestDO();
			priceBreakUpRequest.CartId = cartId;
			priceBreakUpRequest.LineItemId = objLineItemWrapperClass.Id;
			
			//Pass the parameters to the API
			Apttus_CPQApi.CPQ.GetPriceBreakupResponseDO priceBreakUpResponse = Apttus_CPQApi.CPQWebService.getPriceBreakup(priceBreakUpRequest);
			
			//If the response returns true i.e. HasProducts=true execute the loop below and fetch the priceBreakup list.
			if(priceBreakUpResponse.HasPriceBreakups) 
			{
				lstPriceBreakUpCalls = new List<Apttus_CPQApi.CPQ.PriceBreakupCollDO>();
				lstPriceBreakUpCalls = priceBreakUpResponse.PriceBreakups;
				
				for(Apttus_CPQApi.CPQ.PriceBreakupCollDO objPriceBreakUpCall : lstPriceBreakUpCalls ) 
				{
					//priceBreakUpList = new List<Apttus_Config2__PriceBreakup__c>();
					//priceBreakUpList = objPriceBreakUpCall.BreakupItems;
					
					String lineItemID = objPriceBreakUpCall.LineItemId;
					
					List<Apttus_Config2__PriceBreakup__c> liSOpriceBreakUpList = [select id, Apttus_Config2__Sequence__c, Apttus_Config2__BreakupType__c,
					Apttus_Config2__TierStartValue__c, Apttus_Config2__TierEndValue__c, Apttus_Config2__TierQuantity__c, Apttus_Config2__TierBasePrice__c, Apttus_Config2__TierExtendedPrice__c from Apttus_Config2__PriceBreakup__c where Apttus_Config2__LineItemId__c = :lineItemID];
					
					for(Apttus_Config2__PriceBreakup__c lipriceBreakUpList : liSOpriceBreakUpList)
					{
						PriceBreakUpWrapperClass objPriceBreakUpWrapperClass = new PriceBreakUpWrapperClass();
						objPriceBreakUpWrapperClass.BreakUpID = lipriceBreakUpList.Id;
						objPriceBreakUpWrapperClass.Sequence = lipriceBreakUpList.Apttus_Config2__Sequence__c;
						objPriceBreakUpWrapperClass.BreakupType = lipriceBreakUpList.Apttus_Config2__BreakupType__c;
						objPriceBreakUpWrapperClass.TierStartValue = lipriceBreakUpList.Apttus_Config2__TierStartValue__c;
						objPriceBreakUpWrapperClass.TierEndValue = lipriceBreakUpList.Apttus_Config2__TierEndValue__c;
						objPriceBreakUpWrapperClass.TierQty = lipriceBreakUpList.Apttus_Config2__TierQuantity__c;
						objPriceBreakUpWrapperClass.TierUnitPrice = lipriceBreakUpList.Apttus_Config2__TierBasePrice__c;
						objPriceBreakUpWrapperClass.TierUnitPrice = objPriceBreakUpWrapperClass.TierUnitPrice.setScale(2, System.RoundingMode.HALF_UP);
						objPriceBreakUpWrapperClass.TierExtendedPrice = lipriceBreakUpList.Apttus_Config2__TierExtendedPrice__c;
						objPriceBreakUpWrapperClass.TierExtendedPrice = objPriceBreakUpWrapperClass.TierExtendedPrice.setScale(2, System.RoundingMode.HALF_UP);
						
						lstPriceBreakup.add(objPriceBreakUpWrapperClass);
					}

				}
			}
			//If the product selected has no price breakups show an appropriate message.
			else
			{
				ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.info, 'No Price Breakup Available.'));
			}
		}
	}
}
CODE

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 Prerequisites

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:getPriceBreakup>
         <cpq:request>
            <cpq1:CartId>a1l4P00000Bg7DTQAZ</cpq1:CartId>
            <cpq1:LineItemId>a1V4P0000053bKq</cpq1:LineItemId>
         </cpq:request>
      </cpq:getPriceBreakup>
   </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:GetPriceBreakupResponseDO="http://soap.sforce.com/schemas/class/Apttus_CPQApi/CPQ" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <getPriceBreakupResponse>
         <result>
            <GetPriceBreakupResponseDO:HasPriceBreakups>true</GetPriceBreakupResponseDO:HasPriceBreakups>
            <GetPriceBreakupResponseDO:PriceBreakups>
               <GetPriceBreakupResponseDO:BreakupItems xsi:type="Apttus_Config2__PriceBreakup__c">
                  <Id>a1W4P00000FIAW0UAP</Id>
                  <Apttus_Config2__BreakupType__c>Tier Price</Apttus_Config2__BreakupType__c>
                  <Apttus_Config2__LineItemId__c>a1V4P0000053bKqUAI</Apttus_Config2__LineItemId__c>
                  <Apttus_Config2__Sequence__c>1</Apttus_Config2__Sequence__c>
                  <Apttus_Config2__TierBasePrice__c>2204.25000</Apttus_Config2__TierBasePrice__c>
                  <Apttus_Config2__TierEndValue__c>10.00000</Apttus_Config2__TierEndValue__c>
                  <Apttus_Config2__TierQuantity__c>10.00000</Apttus_Config2__TierQuantity__c>
                  <Apttus_Config2__TierStartValue__c>0.00000</Apttus_Config2__TierStartValue__c>
                  <Name>PB-00000084</Name>
               </GetPriceBreakupResponseDO:BreakupItems>
               <GetPriceBreakupResponseDO:BreakupItems xsi:type="Apttus_Config2__PriceBreakup__c">
                  <Id>a1W4P00000FIAW1UAP</Id>
                  <Apttus_Config2__BreakupType__c>Tier Price</Apttus_Config2__BreakupType__c>
                  <Apttus_Config2__LineItemId__c>a1V4P0000053bKqUAI</Apttus_Config2__LineItemId__c>
                  <Apttus_Config2__Sequence__c>2</Apttus_Config2__Sequence__c>
                  <Apttus_Config2__TierBasePrice__c>1469.50000</Apttus_Config2__TierBasePrice__c>
                  <Apttus_Config2__TierEndValue__c>25.00000</Apttus_Config2__TierEndValue__c>
                  <Apttus_Config2__TierQuantity__c>15.00000</Apttus_Config2__TierQuantity__c>
                  <Apttus_Config2__TierStartValue__c>10.00000</Apttus_Config2__TierStartValue__c>
                  <Name>PB-00000085</Name>
               </GetPriceBreakupResponseDO:BreakupItems>
               <GetPriceBreakupResponseDO:BreakupItems xsi:type="Apttus_Config2__PriceBreakup__c">
                  <Id>a1W4P00000FIAW2UAP</Id>
                  <Apttus_Config2__BreakupType__c>Tier Price</Apttus_Config2__BreakupType__c>
                  <Apttus_Config2__LineItemId__c>a1V4P0000053bKqUAI</Apttus_Config2__LineItemId__c>
                  <Apttus_Config2__Sequence__c>3</Apttus_Config2__Sequence__c>
                  <Apttus_Config2__TierBasePrice__c>2939.00000</Apttus_Config2__TierBasePrice__c>
                  <Apttus_Config2__TierEndValue__c>40.00000</Apttus_Config2__TierEndValue__c>
                  <Apttus_Config2__TierQuantity__c>15.00000</Apttus_Config2__TierQuantity__c>
                  <Apttus_Config2__TierStartValue__c>25.00000</Apttus_Config2__TierStartValue__c>
                  <Name>PB-00000086</Name>
               </GetPriceBreakupResponseDO:BreakupItems>
               <GetPriceBreakupResponseDO:BreakupItems xsi:type="Apttus_Config2__PriceBreakup__c">
                  <Id>a1W4P00000FIAW3UAP</Id>
                  <Apttus_Config2__BreakupType__c>Total</Apttus_Config2__BreakupType__c>
                  <Apttus_Config2__LineItemId__c>a1V4P0000053bKqUAI</Apttus_Config2__LineItemId__c>
                  <Apttus_Config2__NetUnitPrice__c>2204.25000</Apttus_Config2__NetUnitPrice__c>
                  <Apttus_Config2__Sequence__c>4</Apttus_Config2__Sequence__c>
                  <Apttus_Config2__TierBasePrice__c>2204.25000</Apttus_Config2__TierBasePrice__c>
                  <Apttus_Config2__TierQuantity__c>40.00000</Apttus_Config2__TierQuantity__c>
                  <Name>PB-00000087</Name>
               </GetPriceBreakupResponseDO:BreakupItems>
               <GetPriceBreakupResponseDO:LineItemId>a1V4P0000053bKqUAI</GetPriceBreakupResponseDO:LineItemId>
            </GetPriceBreakupResponseDO:PriceBreakups>
         </result>
      </getPriceBreakupResponse>
   </soapenv:Body>
</soapenv:Envelope>
XML