Applying Constraint Rules to a Cart
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.
API |
Signature |
---|---|
applyConstraintRules |
webService static void applyConstraintRules(Id cartId, Boolean finalCheck) |
Parameters |
||
---|---|---|
Name |
Type |
Description |
cartId | ID |
The id of the cart. |
finalCheck | Boolean |
If 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.
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.