Pricing rules
Table of contents
Pricing rules are a used by CloudBilling to determine what calculations to perform on a certain purchase. Pricing rules depend heavily on the correct configuration of the Customer Cluster and Product Cluster. Therefore, it is important to first understand fully how the Customer and Product clusters are structured in the environment that is being worked in. The below table of contents can be used to navigate this page.
Pricing rule navigation
The pricing rules can be found under the header “Pricing Rules” in the menu bar of CloudBilling, as can be seen in Figure Pricing Rules 1. When clicking on the header, the user is navigated to an overview of all active pricing rules in the environment. The [Valid Only] box under the text “Status” is ticked by default, which means that only rules that are currently in use are shown. Searching for specific pricing rules can be done on the Rule Name, Product Cluster and Customer Cluster, or the specific rule type. The rule types will be explained in more detail in the next paragraph.
Figure Pricing Rules 1: Pricing rules page
Pricing rules can be clicked to investigate the settings of a specific rule. Similarly to adding other aspects in CloudBilling, the [Add] button can be used to make a new pricing rule. When this button is pressed, it will redirect the user to the “Add Pricing Rule” page, as shown in Figure Pricing Rules 2. Pricing rules can always be adjusted but adjusting pricing rules will also make the invoices that use these pricing rules, recalculate. Therefore, it might take some time before changes to pricing rules can be seen on the invoices, as a pricing rule can also apply to “All Customers”. Thus, this will reapply the calculations to all customers that use this pricing rule as well.
Figure Pricing Rules 2: Add Pricing Rule screen
Types of pricing rules
There are eight different types of pricing rules that can be used by CloudBilling to perform different types of calculations. The different types of pricing rules can be found in Figure Pricing Rules 3 but are also listed below. Pricing rule types:
- Price
- Adjust percentage
- Adjust fixed
- Sum
- Ladder
- Group Price
- Max Price
- Min Price The pricing rules, and how to implement them, will be explained in this order. The structure of pricing rules is often Price, then an Adjust percentage, followed by a Sum.
Figure Pricing Rules 3: Pricing rule types
When setting up a new pricing rule, it is wise to indicate in the name of the pricing rule what type of pricing rule it is in combination with the product that the pricing rule applies to, for easy identification of the functionality of a pricing rule. The structure of a pricing rule name will, based on this presumption, standardly look like: Pricing rule type + product cluster the rule applies to. For customer specific rules, it is wise to also add the customer the rule applies to in the name.
A rule should always have a rule name, type, product cluster and customer cluster. Additionally, a value and cost can be applied, as well as a valid from and to dates for a pricing rule. Decimals in values always use a dot rather than a comma. Ordering is applied in the steps for making pricing rules and will be explained in more detail in section Rule Order. For these steps it is important to understand that the rule order tells CloudBilling in what order to apply the pricing rules to a purchase. The lowest rule order will be applied first, while higher rule orders will be applied later. Rule orders can be used as minus numbers, which is common practice.
Price
A pricing rule with type Price is used to set a simple price for a product. This type is also the standard type that is applied when a new pricing rule is made. It is often necessary to apply a price rule first, as a purchase does not have to contain a price. A pricing rule with a value will assure that a product always has a standard price. Furthermore, the price rule can be necessary for other pricing rules, to perform further calculations. Without a price, a multiplication rule will not have an effect whatsoever. Below follow the steps to adding a Price rule.
Step by step: How to add a “Price” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- In the field [Rule Name], write “PRICE” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the corresponding customer cluster.
- In the [Value], add the price. The price should exclude taxes. Cents must be written after a dot, rather than a comma, e.g., 2.40 will imply that a price is 2 euros and 40 cents.
- A cost, when present, can be added in the same way in the [Cost] field.
- Write -2 in the [Order] field.
- The [Valid From] and [Valid To] dates can be filled out if the rule needs to be applied from or to a certain date.
- Click on [Save]. In Figure Pricing Rules 4 an example of a Price type pricing rule that these steps will produce is shown.
Figure Pricing Rules 4: Price Type pricing rule
Adjust Percentage
An adjust percentage rule is a pricing rule that will apply a percentage multiplication to a previously set price. Because of this, an adjust percentage rule will often be set after a pricing rule or after a SUM rule. These rules can be used to give a customer a discount by setting a negative value in the pricing rule, or an uplift by setting a positive value in the pricing rule. Thereby, adjust percentage rules can be used to apply VAT rules to customers or customer groups. When applying VAT rules, it is often also necessary to add a separate line to show only the VAT amount on an invoice. Because of this, the Adjust Percentage rule offers the options which does just that. This section will explain to add a general adjust percentage rule, as well as add a VAT rule with a separate line item. The specifics of a separate line item will be explained in the section Separate line items.
Adjust percentage rules often use Billing Output Tags. Billing Output Tags are often environment specific, though in this manual the commonly used tags will be used when applicable, as an example. Due to the standard structure of pricing rules, adjust percentage rules are often used to show prices on specification pages, while sum rules are often used to show lines on the summary page. Billing Output Tags, or BOTs, will be explained in more detail in section Billing Output Tags.
Step by step: How to add an “Adjust Percentage” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Adjust Percentage.
- In the field [Rule Name], write “ADJUST PERCENTAGE” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the customer cluster.
- In the [Value], add the percentage that you want to use as a discount or an uplift.
- A cost discount or uplift can be added in the same way in the [Cost] field.
- Write 0 in the [Order] field.
- The [Valid From] and [Valid To] dates can be filled out if the rule needs to be applied from or to a certain date.
- Click on [Save].
In Figure Pricing Rules 5 an example of an Adjust Percentage type pricing rule that these steps will produce is shown. In this case, this rule will produce a discount of five percent.
Figure Pricing Rules 5: Adjust Percentage Type pricing rule
Step by step: How to add an “Adjust Percentage VAT” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Adjust Percentage.
- In the field [Rule Name], write “VAT” combined with the name of the customer cluster it applies to. Usually this will be a country.
- In the field [Rule Name], write “VAT” combined with the country name to which the VAT rate applies.
- In the [Product Cluster] field, select “All Products”.
- In the [Customer Cluster] field, type the name of the customer cluster that the VAT should apply to, this will again often be a cluster named after a country.
- In the [Value] field, add the VAT that applies to this country as a positive number.
- As the [Rule Order] use a high order, often 30 is used, to ensure that the VAT is applied after the last rule.
- Enable [Separate Line Item].
- In the [Output Tags] of the Separate Line Item, add “Summary” and “TotalVAT” as BOTs.
- In the [Billing Output Tags] of the rule, add “Summary” and “TotalInclVAT”.
- Click on [Save].
In Figure Pricing Rules 6, an example of a VAT rule is added. These rules are often made during an implementation by CloudBilling employees. More info on BOTs can be found in section Billing Output Tags.
Figure Pricing Rules 6: Adjust Percentage VAT pricing rule
Adjust Fixed
In a similar way as a general adjust percentage rule, an adjust fixed rule can be added. The difference between these two rule types is that an adjust fixed rule uses a fixed amount as a discount or an uplift, rather than a percentage. Below follow the steps to add an adjust fixed rule.
Step by step: How to add an “Adjust Fixed” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Adjust Fixed.
- In the field [Rule Name], write “ADJUST FIXED” combined with the product cluster. In case the rule is customer specific, add the customer’s name in front of the product cluster name.
- Add an appropriate [Rule Order], this could be on the same height as an adjust percentage would be. Otherwise, this could be after a SUM rule if the fixed amount is discounted or uplifted on a whole product category.
- In the [Product Cluster] field, add the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, add the customer (cluster) the rule should apply to.
- In the [Value] field, add the amount. A positive number will function as an uplift, while a negative number will function as a discount.
- Click on [Save].
In Figure Pricing Rules 7, an example of an adjust fixed rule is presented. When necessary, BOTs and separate line items could be applied to this rule. Refer to sections Billing Output Tags and Secondary settings (Rounding, Pro Rata, Advanced) for more information.
Figure Pricing Rules 7: Adjust Fixed Type pricing rule
Sum
A Sum type pricing rule is used to add up every earlier result in the pricing rule order. A sum is used on different order levels in the pricing rule structure. Usually, products are summed together, after which the product clusters are summed together, until all products are summed together to retrieve the total amount for the invoice. Since sum rules are often used to show a line on the invoice, either on the summary page or on the specifications page, these rules often contain Billing Output Tags. More information on Billing Output Tags and how to use them, can be found in section Billing Output Tags.
Sum rules do not have a value or a cost but do have “Grouping” settings. The Group By setting on a pricing rule can be used to have the sum group purchases that go through it by a certain value. The available options are Group By: Purchase Date, Source Product, or Text/Numeric/Date metadata. When these are selected, a sum can apply to a specific grouping of products, which will result in more lines on the invoice. Additionally, Aggregation settings are present on Sum pricing rules. The standard setting is a simple sum. Aside from that, there can be an aggregation set to the minimum, the maximum and the average.
Step by step: How to add a “Sum” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Sum.
- In the field [Rule Name], write “SUM” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer’s name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the corresponding customer cluster.
- Add the correct Billing Output Tags. Usually these contain “Specifications” or “Summary” .
- Write 5 in the [Order] field.
- The [Valid From] and [Valid To] dates can be filled out if the rule needs to be applied from or to a certain date.
- Grouping and aggregation options could be used when applicable as described above.
- Click on [Save]. An example of a sum rule made using these steps can be found in Figure Pricing Rules 8 below.
Figure Pricing Rules 8: Sum Type pricing rule
Ladder
Ladder rules work similarly to a pricing table. These types of rules are useful when making pricing agreements that include prices for a product changing when more or less of the product is consumed by the customer. Two examples of ladder usages include, the first five products being free for the customer, after which they start paying the normal price for a product, or a product becoming cheaper when a customer consumes more of it.
Usually, a ladder rule is used instead of a simple pricing rule. To achieve a correct setup for a ladder rule, it is often important that the number of products goes through the pricing rule at once. Because of this, a pre-ladder sum pricing rule is set up. This is a simple summing rule, which will ensure that the total number of products goes through the ladder at the same time, rather than one-by-one. A pre-ladder sum follows the same steps as a normal pricing rule but will have to take place before the order of the ladder rule. Additionally, the name will be changed from SUM to PRE-LADDER, to reflect the purpose of the rule.
Add a PRE-LADDER SUM rule to ensure the ladder functions as expected.
The ladder settings contain a step type, a price type, and steps, as can also be seen in Figure Pricing Rules 9. A ladder step type can either be segmented or staggered. The segmented step type entails that the total quantity that is purchased will determine the price. Only the step that is reached with the total amount will thus determine the price for every single unit at once when this setting is used. The staggered step type entails that product prices are based on the quantity group they belong to. In this case, the first set of products will be priced by step one of the ladder, while the rest of the products are priced by the second step of the ladder. Usually, the staggered ladder step type is used.
The price type of the ladder determines how the prices are applied. Unit price means that the given price is applied per product in the range, while group price means that the price is applied to the group of products once the step is reached. The group price will then also be applied if the step of a ladder is not filled in product quantity. Unit price is often used as the standard.
The steps of a ladder determine the ranges of the quantities per step, combined with the value (price) and cost of those steps. When a from-value of the first step is left empty, the step will assume that there is no lowest value. The same happens when the to-value is left empty, the step will then assume that there is no highest value. It is recommended to leave the to-value of the highest step empty, as to ensure no usage can be missed by a capped value.
Step by step: How to add a “Ladder” rule:
- Select [Pricing Rules] in the menu. Note: ensure the pre-ladder sum is made beforehand.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Ladder.
- In the field [Rule Name], write “LADDER” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer’s name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the corresponding customer cluster.
- Put -2 in the [Order] field.
- Select the appropriate [Step Type].
- [Segmented]: the total quantity purchased defines the prices.
- [Staggered]: products are priced based on the quantity group they belong to.
- Select the appropriate [Price Type].
- [Unit Price]: the given price is applied per product in the range.
- [Group Price]: a price is applied per quantity group, even when the range of a group is not fully filled with purchases.
- Click on the [+ Add] button.
- Define the quantity range in the [From] and [To] fields. An empty field means indefinite.
- Note that the [From] value is not included and the [To] value is. For example, 0-10 includes 1 until and including 10.
- Set the [Value] for that range. This is the price. [Cost] can also be added if appropriate.
- Repeat steps 10 to 23 to create a ladder.
- The [Valid From] and [Valid To] dates can be filled out if the rule needs to be applied from or to a certain date.
- Click on [Save].
Figure Pricing Rules 9: Ladder Type pricing rule
Figure Pricing Rules 9 illustrates what a standard ladder rule would look like, using a staggered step type and a price type set to unit price. This rule shows a product that becomes cheaper when more usage is coming through the system.
Group Price
Group prices can be used to set the price for a selection of purchases based on a set of criteria. A Group price that does not use any specific criteria will, therefore, be used for the whole set of purchases. Other grouping types will allow the Group price to be applied to split up groups of purchases. The Group By option is thus often used while setting up this product. The types were briefly described before, but will be explained in more detail in the following list:
- [None]: no grouping. One price is the output of this pricing rule.
- [PurchaseDate]: group purchases per period, specified in [Group UOM].
- This can be None, Hour, Day, Week, Month or Year, specifying the interval for the groupings.
- Additionally, the start of the week can be defined for this option.
- [SourceProduct]: group on the Tag name of the product cluster.
- [Meta: Text]: group on a text metadata field from the meta data of a purchase.
- [Meta: Number]: group on a number metadata field from the meta data of a purchase.
- [Meta: Date]: group on a date metadata field from the meta data of a purchase.
- Metadata contains a type, a key, and a value. As can be seen in Figure Pricing Rules 10.
- To correctly Group by a metadata field, the type and the correct key must be known and used in the rule.
Figure Pricing Rules 10: Example metadata fields
Additionally, the Group By rule has more elaborate aggregation options. Aside from the quantity aggregation, there can also be an aggregation on the value type and the cot value type. The latter two can be either set to the Total Group Price, or by the Unit price. The total unit price is the default setting of the rule, which means the price that is defined in the [Value] field is used for the grouped purchases. When the unit price is used for the aggregation type, the price defined in the [Value] field is applied per purchase.
The Quantity aggregation in a Group price works as following:
- [Sum]: purchases are summed up for the grouped setting that is chosen.
- [Min]: the lowest value is selected for the grouped setting that is chosen.
- [Max]: the highest value is selected for the grouped setting that is chosen.
- [Average]: the average value is calculated for the grouped setting chat is chosen.
Step by step: How to add a “Group Price” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Group Price.
- In the field [Rule Name], write “GROUP PRICE” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the corresponding customer cluster.
- Use an appropriate rule order, this rule is often used instead of a pricing rule, or after a sum rule. Examples of the order would thus be -2 or 6, respectively.
- Add the price in the [Value] field. Optionally, also add the [Cost].
- Select the appropriate [Group By] option.
- Select the appropriate [Quantity Aggregation], [Value Type] and [Cost Value Type].
- Add Billing Output Tags if appropriate.
- Click on [Save].
Figure Pricing Rules 11 shows an example of a customer specific rule that ensures that the customer will always pay a set price per day of using the product.
Figure Pricing Rules 11: Group Price Type pricing rule
Max price and Min price
Since Max prices and Min prices function in the exact opposite ways, it is appropriate to elaborate upon these rules in just one section. Since the Max price and the Min price rules are set up in the exact same way, this section will only include one set of steps and one example pricing rule.
A max price ensures that a customer is only charged until a maximum agreed upon price. Similarly, a min price ensures that the customer always gets charged for the minimum agreed upon price. Because of these rules using a total amount to determine whether the maximum or the minimum price has been reached, they will always need a preceding sum rule. This works like a pre-ladder sum rule and functions like a normal sum rule. It is wise to change the name of this sum rule to PRE MAX PRICE or PRE MIN PRICE for max price and min price rules respectively. Therefore, min prices and max prices are often used at Rule Order 6 or higher.
Add a PRE-MAX PRICE and SUM or PRE-MIN PRICE and SUM rule to ensure the Max and Min price rules function as expected.
Step by step: How to add a “Max Price” or “Min Price” rule:
- Select [Pricing Rules] in the menu.
- Click on the [Add] button to open the “Add Pricing Rule” page.
- Set the [Type] to Max Price or Min Price.
- In the field [Rule Name], write “MAX PRICE” or “MIN PRICE” combined with the name of the product cluster the rule will apply to. a. In case of a customer specific price, add the customer name before or after the product cluster name.
- In the [Product Cluster] field, type the product name and select the product (cluster) the rule should apply to.
- In the [Customer Cluster] field, type “all customers” and select the relevant search result. a. In case of a customer specific price, select the corresponding customer cluster.
- Use an appropriate rule order, the order should be higher than the order of the Pre-sum rule that was made.
- Add the price in the [Value] field. Optionally, also add the [Cost].
- Add Billing Output Tags if appropriate.
- Click on [Save]. On the following page an example Max price rule can be found in Figure Pricing Rules 12.
Figure Pricing Rules 12: Max Price Type pricing rule
Rule order
As shown in the previous section and sub-sections, pricing rules always need to be specified for a combination of a product cluster and a customer cluster. As illustrated, it is normal for there to be several pricing rules, like a price, an adjust percentage and a sum rule, for the same combination of product cluster and customer cluster. This is also why the rule order is very important. The rule order determines the order in which pricing rules are executed by CloudBilling.
The rule execution order depends on three factors: the rule order that was set in the pricing rules, the rule order in which product clusters are carried out, and the rule order in which customer clusters are carried out. The product clusters are always executed bottom-up, from the products, back up through the product clusters to All Products. Contrarily, the execution order of customer clusters is top-down. First, the rules for All Customers will be carried out, followed by lower clusters and specific customers. This entails that a pricing rule for the product Usage for All Customers will be carried out first, which could then be followed with a pricing rule for the product Usage for a specific customer. When these two rules are put on the same rule order, the engine will choose the most appropriate rule and use the customer-specific rule only.
Sequentially, the rule order will be carried out as following:
- The product cluster is taken into consideration bottom-up, from the lowest product (cluster) upwards to All Products.
- The set pricing rule order, where the lowest number will be executed first. This order can be set in the minus.
- The customer cluster will be used top-down when the set order is the same, from the highest customer cluster “All Customers” down to specific customers. These steps in the sequence are all, separately, visualized in Figure Pricing Rules 13 below. Rule order is portrayed in the middle, as it relates to different levels of products, product clusters, customers, and customer clusters.
Figure Pricing Rules 13: Rule execution order visualization
As mentioned in the previous section, there is a standard rule order that is often used. This follows the structure of a Price rule, followed by an Adjust percentage rule and a Sum rule. The standard order is often -2, 0 and 5, respectively. This allows to add extra rules for customers if necessary.
Other structures include the product using a Ladder rule to determine the standard pricing, then there will be a Pre-ladder sum before the Ladder rule. An order for these pricing rules will often be -2 for the pre-ladder sum and -1 for the Ladder rule, after that it is wise to use a Sum rule again on order 0 so that any uplifts or discounts are given over the total price for that product.
Any other pricing rule constructions will often be made by CloudBilling employees. However, they can be explained during training or inquired about through our different contact options.
Billing Output Tags
Billing Output Tags were mentioned to have an important role in how items show up on the invoice. Billing Output Tags ( BOTs) allow both the user as the CloudBilling employee to easily retrieve information from a certain pricing rule. Most BOTs are used to retrieve the information on that pricing rule to be used in the invoice template. This allows the invoice template to get the correct information based on the tags and print it as a line on the invoice. Additionally, the tags can be used to save specific information on pricing rules that is needed by the customer their systems, like a GL code. These customer specific fields could then be retrieved and printed in an export, for example.
Billing Output Tags were already shown in the pricing rules section of this chapter. This section will introduce some of the most used Billing Output Tags that are used by the template. These tags are provided as an overview in Table 1.
Most CloudBilling invoices use a Summary page and a Specification page. Therefore, the tags “Summary” and “Specification” are often used on respectively a SUM rule and a PRICE rule. The Summary tag will then be retrieved by the template to print a line on the summary page of the invoice. The Specification tag is, similarly, used to determine what items should be on the specification page. Additionally, a “cat:” tag is often used in combination with a “product category” to determine what section or category a product line item belongs to. A section can then also have a SubTotal line printed based on the combination of a Summary and a SubTotal tag. The last sum rule before the VAT rule will get the tag Total or TotalExclVAT, so that a line item can be printed with the total excluding VAT.
VAT related rules are Adjust percentage pricing rules that use the Separate line item function. These rules use the tags TotalVAT, TotalExclVAT and TotalInclVAT. TotalVAT is placed on the BOTs of the separate line item, while the TotalInclVAT is placed on the BOTs of the rule. This will ensure that the separate line item will print only the VAT, while the normal BOTs ensure that the total including the VAT is also printed.
In Figure Pricing Rules 14, an example of an invoice is shown that shows how these Billing Output Tags relate to the line items that show on the invoice. The blocks will show the line item in question, and the tags will be shown as text.
Billing Output Tag | Usage |
---|---|
Summary | Placing results on the summary page of an invoice |
Specification | Placing results on the specification/detail page(s) of an invoice |
cat: | product category Defining a subcategory of products to be grouped on an invoice |
SubTotal | Placing a result of a group of different products on an invoice |
Total | Placing the total amount excluding VAT on an invoice |
TotalVAT | Placing the VAT amount on an invoice |
TotalInclVAT | Placing the total amount including VAT on an invoice |
<a name=”table1></a>
Table 1: Commonly used Billing Output Tags
Figure Pricing Rules 14: Example invoice with Billing Output Tags per line item
Scope
The Scope of a pricing rule consists of the Product Cluster and Customer Cluster the rule applies to, in combination with the Valid From and Valid To date. All these fields are used to determine whether the rule should be used in the pricing scheme on a certain invoice. The Product and Customer clusters set in a pricing rule, determine respectively the product (cluster) and customers a rule should be applied for, and have an influence on the Rule Order, as explained in earlier sections. Often, there is a standard set of pricing rules that applies to “All Customers” and have at least one Sum type pricing rule for each product cluster from the product up to “All Products”.
The Valid From and Valid To fields are date fields that can be used to determine when a pricing rule should be applied based on the date and time. Often, these fields are used to give a temporary discount or uplift for a certain period. When left empty, the rule will always be valid. To make a rule invalid, a Valid To date can be set on a date a few months in the past.
Grouping and aggregation
The Grouping and Aggregation options exist on the “Group Price” and “Sum” type pricing rules and will appear as an additional section to the right of the pricing rules, as can be seen in Figure Pricing Rules 11. A more detailed view of the Grouping and the pricing options can be seen in Figure Pricing Rules 15. This section will explain, in more detail, what the different Grouping and aggregation options are.
Figure Pricing Rules 15: Grouping and Aggregation options
The Grouping and Aggregation options were also briefly touched upon in the Group Price pricing rule section. Grouping can be used to Group purchases on different data values. The option is set to “None” by default. However, a group price or sum rule can also be used to respectively price a group of products or show a group of products on the invoice based on the purchase date, source product, or a metadata field.
The purchase date option will group purchases on a specified period, which can be per hour, day week, month, or year. This is done with the Group UOM setting, which specifies the interval for the groupings. There is also a setting to specify the starting day of the week, specifically for week intervals. The source product will group on the tag name of the product cluster. Additionally, there is also an option to filter on the three different types of metadata that comes in with the purchase, text, number, or date metadata. The metadata fields contain a key-value pair, where the key needs to be filled out in the pricing rule to determine what field to filter on.
There are also aggregation options on both SUM and GROUP PRICE type rules. The quantity aggregation exists on both these rule types. The quantity aggregation is set to “Sum” by default, but can also be put to Max, Min, or Average. This will have the effect that, respectively, only the maximum, minimum, or average quantity will be taken into consideration for the following pricing rules.
The Group price rules also have the option to group on value type or cost value type. These aggregations are by default on the Total Group Price, which means that the price of all units together is used. However, they can also be set to Unit Price, which will ensure that the price defined in the value or cost field is used for each unit, for the value unit price and cost unit price, respectively.
Separate line items
Separate line items can be used for Adjust Percentage and Adjust Fixed rules and appear to the right side of the General pricing rule settings (Figure Pricing Rules 16). When the box “Separate Line Item” is ticked, the box with Output Tags appears. The separate line-item option can be used to show an uplift or a discount as a line on its own on the invoice. Furthermore, separate line items are also used to show the VAT amount as a line on the invoice. The output tags that are put in this option are, therefore, essential for how these lines are shown on the invoice. This is entirely dependent on how the invoice template is configured. Because of this, it is wise to discuss with your assigned CloudBilling consultant on what tags should be used, or to copy the tags from a pricing rule with a similar or the same function.
Figure Pricing Rules 16: Separate line-item option
Tags that are often used on the separate line item are for discounts and VAT rules. These are often configured as “Discount” for rules that give a discount and a combination of “TotalVAT” with “Summary” for VAT rules.
Expressions
Expressions can be found in the additional settings under the “Scope” section (Figure Pricing Rules 17). There are four different types of expressions: value, cost, rule condition, and item condition expressions. The expression boxes all function as small pieces of code, in which C# code can be used to adjust the pricing rule information. Often, these pieces of code are provided by the CloudBilling consultant as these can be quite complex for users that have no experience with coding. If preferred, an advanced training is available for users that want to be able to create these types of pricing rules themselves.
Figure Pricing Rules 17: Expression option
Value and cost expressions can use these pieces of code to make an adjustment to the value or the cost of a pricing rule. To do this, information from the purchase metadata or the customer metadata can be retrieved. A good example of the use of the value and cost expressions is in the case of exchange rates. The rule will then retrieve the metadata field “ExchangeRateUsed” to use as a calculation on both the value and the cost. Figure Pricing Rules 18 shows an example of value and cost expressions. The ExchangeRateUsed is a metadata field on the purchase that is retrieved. This number is then used, times 100 and minus 100 to get an appropriate percentage. This percentage is in its turn used in the pricing rule on the value and the cost.
Figure Pricing Rules 18: Value and cost expression examples
Rule condition expressions and item condition expressions can respectively be used to determine whether a rule should be applied at all, or whether an item should go through the pricing rule. The latter rule is executed on each instance of the rule running on a source item and indicates whether the rule should run for the current source item or not. This condition, therefore, has access to using the source item metadata as well. An example of an Item Condition Expression can be found in Figure Pricing Rules 19. This rule checks whether the quantity of a source item is smaller than or equal to one. If the condition is true, the rule will be used for this item, otherwise the rule will not be applied. Similarly, it can be decided for Rule condition expressions, whether a rule should be applied or not. A rule can, for example, only be applied for a quantity that is higher than a certain number. A second rule should then exist that applies for the items under that number.
Figure Pricing Rules 19: Item Condition expression example
Secondary settings (Rounding, Pro Rata, Advanced)
Additionally, there are the secondary settings on pricing rules, which can all be found as collapsed options at the bottom of a pricing rule. When expanding the sections the options for the Rounding, Pro Rata, and Advanced sections can be viewed (Figure Pricing Rules 20).
Rounding options allow for a pricing rule to either round for the value or the cost. The default setting is “None”. The rounding can also be put to the nearest, meaning that it will either round up, or down, to which value is nearest (0.04 down, 0.06 up). Additionally, the rounding can also be set to always round Up or Down. The banker’s rounding is an option that uses an algorithm for rounding quantities to integers, in which numbers which are equidistant from the two nearest integers are rounded to the nearest even integer. Thus, 0.5 rounds down to 0, while 1.5 rounds up to 2.
Pro rata is a Latin term used to describe a proportionate allocation. This means that the pro-rated purchase is distributed in equal portions. In the case of the pro rata settings in the pricing rules, it will be distributed over a time unit. Pro rata options allow for pricing rules to make prorated calculations, the default setting here is also “None”. The “Charge Per” option allows the user to make a prorated calculation on the following time units: second, minute, hour, day, month, year, or billing period. Additionally, the Start or End time can be rounded in the same manners as described for the rounding options.
Figure Pricing Rules 20: Secondary pricing rule options: Rounding, Pro Rata, Advanced
The advanced options include the “Show in price plan” tick box, override rule option, “Output to invoice” tick box, and the copy metadata options. The Show in price plan tick box determines whether the pricing rule will be highlighted in the customer cockpit. By default it is turned off and it is not often used. The override rule option can be used when a pricing rule should be used instead of an already existing pricing rule. This is often done for customer specific rules, or when other pricing rules are still valid but should not be used. CloudBilling will, when an override is in place, always decide to skip the rule that is being overridden. The output to invoice tick box is always turned on and determines that the rule should be used in the invoice calculations. Lastly, there are copy metadata options. These can be set to None, Optimistic, or Custom. This determines how metadata is treated on the pricing rules. When set to None, no metadata will be taken with to the next pricing rule. The optimistic option tries to take as much metadata as possible if the same key will always have the same value for all purchases in a sum rule. The custom option allows to manually put in different metadata keys that should be taken with to the next pricing rule. The default option is always set to Optimistic.