Use Case: A Rule to Add a Product for a Volume Purchase
This use case describes how to create a rule that will automatically add the Premium Service rate plan when the purchase quantity is more than 20.
Set up the Products for the Use Case
- In Zuora, create two products and their rate plans in Product Catalog.
- Name the first product Basic Hardware and name its rate plan Hardware.
- Add a charge of the Per Unit charge model to the Hardware rate plan.
- Name the second product Premium Service and name its rate plan Premium Service Rate Plan.
- Add a charge to the Premium Service Rate Plan.
- In Zuora, run the Product Catalog sync.
Create the Filter
Create a filter condition that you will use in the rule to ensure a product rate plan is added only once.
- In the Filter Conditions tab. click New or New Filter Condition.
- In the Name field, type Check for Premium Service.
- In the Object Type field, click and select Quote Rate Plan.
- Click Add Criteria.
- In the Attribute Type field, click and select Object Field Value.
- Click the Object Field, and in the Quote Rate Plan Field, select Quote Product Name.
- Click Select.
- In the Attribute Type field, select Static Value.
- In the Value field, type Premium Service.
- Click and select is equal to.
- Click Save.
Create the Rule
- In the Rules tab, click New and add the following rule:
- Rule Name: Add Premium Service if Quantity is Over 20
- Active: Select the field.
- Define a condition that checks if the purchase quantity is over 20 in the quote.
- In the CONDITION section, click Add Criteria....
- In the Attribute Type field, click and select Rollup Value.
- In the Object field, click and select Charge.
- In the Rollup Type field, click and select Sum.
- In the Object Field field, click and select Quantity.
- Click is equal to and select is greater than.
- In the Attribute Type field, click and select Static Value.
- In the Value field, type 20.
- Define a condition that checks if Premium Service is already added to the quote.
- Click Add Criterion.
- In the Attribute Type field, click and select Rollup Value.
- In the Object field, click and select Quote Rate Plan.
- In the Filter field, click and select Check for Premium Service.
- In the Rollup Type field, click and select Count.
- Click is equal to and select is less than.
- In the Attribute Type field, select Static Value.
- In the Value field, type 1.
- Define the action that automatically adds Premium Service to the quote.
- In the ACTIONS section, click Add Action....
- In the Action Type field, click and select Add Product.
- In the Product field, click and select Premium Service.
- In the Rate Plan field, click and select Premium Service Rate Plan.
- In the Message field, type "Premium Service added."
- Click Save.
Verify the Rule
- Create a new quote of the New Subscription type.
- Add the Basic Hardware product and Hardware rate plan in the Enhanced Guided Selling flow.
- Set the quantity to 21 in the Lightning Guided Product Selector.
- Verify that the Premium Service product and the Premium Service Rate Plan are added to the quote.
- The Rules Engine Logs section will show the message you specified in the rule, "Premium Service added."