This processes and applies all the constraint rules.

Best Practice

It is recommended that you use the associateConstraintRules API before using this API. Directly using this API may not trigger the constraint rule.


APISignature
applyConstraintRuleswebService static void applyConstraintRules(Id cartId, Boolean finalCheck)



Parameters
NameTypeDescription
cartIdIDThe id of the cart.
finalCheckBooleanIf this is set to true, runs rules that are marked as check on finalization.


Code Sample

The sample below enables you to apply constraint rules to a cart with a specific cart ID. If you set the finalCheck flag as true, the constraint rules are run when you finalize the cart. If the flag is set as false, the rules are run before cart finalization. For example, if you want to add a Shipping Costs constraint rule only after the cart is finalized, set the finalCheck as true and the shipping costs constraint rule is applied once the user finalized the cart. If you want to apply constraint rules before the cart is finalized, set finalCheck as false. For example, if you set the finalCheck flag as false, installation charges are added along with a product selected before the cart is finalized.
 

public void applyConstraintRules()
{
	// For rules that are not marked as Check on Finalization
	Apttus_CPQApi.CPQWebService.applyConstraintRules(cartID, false);
	
	// For rules that are marked as Check on Finalization
	//Apttus_CPQApi.CPQWebService.applyConstraintRules(cartID, true);
}
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">
   <soapenv:Header>
      <cpq:SessionHeader>
         <cpq:sessionId>00D4P000000z7dE!AQQAQFudWwmQHKaOg8qt7T4KJ9MmTK0J055OXmfoUk9bUEL_idltBYg5muQuM4Pm0HVjinAgttLfi55uyxVSvF5yrkoH.rH4</cpq:sessionId>
      </cpq:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <cpq:applyConstraintRules>
         <cpq:cartId>a1l4P00000Bg7CkQAJ</cpq:cartId>
         <cpq:finalCheck>false</cpq:finalCheck>
      </cpq:applyConstraintRules>
   </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">
   <soapenv:Body>
      <applyConstraintRulesResponse/>
   </soapenv:Body>
</soapenv:Envelope>
XML