Example: Mixed

Several types can be applied at once in a pricing procedure.

All rules for Calculation Types with a certain combination of Calculation Method and Unit of Measure are inherited for the nested (child) types. For example, if SUM is a parent type then the rules for SUM must be followed for all nested calculation types.

Type = MULT + MAX

Input Conditions JSON Discount Calculation Flow

Unit of Measure = Percent, Amount

Product List Price = 100$

6 Calculation Types are created for the Pricing Procedure:

  1. Calculation Method = Decrease and Structural 10%

  2. Calculation Method = Decrease and Contract 10%

  3. Calculation Method = Decrease and Season 3%

  4. Calculation Method = Decrease and Promo Percent 0%

  5. Calculation Method = Decrease and Promo Amount 4$

  6. Calculation Method = Increase and Vat –10%

{
  "procedure": {
    "type": "MULT",
    "items": [
      {
        "calculationType": "structural" = 10%
      },
        {
        "calculationType": "contract" = 10%
      },
      {
        "type": "MAX",
        "items": [
          {
            "calculationType": "season" = 3%
          },
            {
            "calculationType": "promo_persent" = 0%
          },
          {
            "calculationType": "promo_amount"= 4$
          }
        ]
      },
      {
        "calculationType": "vat" -10%
      }
     ]
    }
   }

Calculating maximum discount according to the formula:

  1. Apply MULT:

    1. 100 * (1 – 0.1) = 90

    2. 90 * (1 – 0.1) = 81

  2. Apply MAX:

    1. 81 * (1 – 0.03) = 78,5

    2. 81 – 4 = 77

  3. Apply Vat to the maximum discount:

    1. 77 (1 – (–0.1)) = 84.7

Total price for an Order Line Item = 84,7$

Type = SUM + MAX

Input Conditions JSON Discount Calculation Flow

Unit of Measure = Percent, Amount

Product List Price = 100$

3 Calculation Types are created for the Pricing Procedure:

  1. Calculation Method = Decrease and Structural 5$

  2. Calculation Method = Decrease and Contract 10%

  3. Calculation Method = Increase and Season 3%

  4. Calculation Method = Decrease and Promo Percent 0%

  5. Calculation Method = Decrease and Promo Amount 2%

{
 "procedure": {
  "type": "SUM",
  "items": [
   {
    "calculationType": "structural" = 5%
   },
   {
    "calculationType": "contract" = 10%
   },
   {
    "type": "MAX",
    "items": [
     {
      "calculationType": "season" = 3%
     },
     {
      "calculationType": "promo_persent" = 0%
     },
     {
      "calculationType": "promo_amount"= 2%
     }
    ]
   }
  ]
 }
}

Calculating the maximum discount according to the formula:

100 * (1 – (0.05 + 0.1 + 0.03)) = 82

Total price for an Order Line Item = 82$

``