Pricing Procedure v. 1.0

The Pricing Procedure object defines the method and succession of discount calculations for each order. The procedure is specified in JSON format in the Pricing Procedure field or by using the Procedure Builder.

Since CT Orders 2.0, the pricing procedure v. 2.0 is available.

Syntax Sample

{
  "procedure": {
    "type": "value",
    "round": "value",
    "roundTo": "value",
    "isIgnoresNull": "value",
    "items": [
      {
        "calculationType": "external id discount 1"
      },
      {
        "calculationType": "external id discount 2"
      }
    ]
  }
}

JSON Key Description

Key Type Required Comment

isIgnoresNull

Boolean

No

If true that between the Calculated Type records will be selected minimum discount except for 0 discounts.

  • The default value is true.

  • The result will be 0 if all Calculated Types are 0.

Applicable if "type":"MIN".

items

Array

Yes

An array of calculated discounts. At least one item must be provided.

calculationType

String

No

The value from the External ID field of the Calculation Type record.

procedure

Object

Yes

Pricing Procedure.

round

Enum

No

The condition for rounding. If set, values will be rounded according to the selected value. Available values:

  • item is used to round a value separately for each Calculation Type.

  • group is used to round the total cost of all listed Calculation Types.

Otherwise, the value will be rounded after all discounts are calculated according to the number of digits in the Unit Price field on the Order Line Item record.

roundTo

Integer

No

The precision for rounding in the number of decimals (digits after the comma).

If a round key is specified and roundTo is not, the rounding precision is based on the Unit Price field on the Order Line Item record.
  • Available values are integers from 0 to 8. The number of digits is added to decimals after the comma.

  • The percentages are counted as decimals, for example, 5% is 0.05.

type

Enum

Yes

Available values:

A nested type inherits the constraints of its parent type. See the description in the Type Values Description table.
  • MIN

  • MAX

  • MULT

  • SUM

Type Values Description

Operator Description Example

MAX

The discount with maximum discount or markup is applied depending on a selected Calculation Method of Calculation Type.

  • The maximum discount is selected for all nested Calculation Types.

Important notes:

  • Calculation Types with different Calculation Methods cannot be used with the MAX operator.

  • If the parent MAX operator has the child SUM operator, you have to compare in Unit of Measure = Percent only.

  • Inside MAX operator you can compare discounts in % and discount in Amt because before comparison the system will calculate the price with a discount before making a decision.

MIN

The discount with minimum discount or markup is applied depending on a selected Calculation Method of Calculation Type.

  • The minimum discount is selected for all nested Calculation Types.

  • Zero discounts do not count if isIgnoresNul does not apply.

Calculation Types with different Calculation Methods cannot be used with the MIN operator.

MULT

Sequential application of discounts.

  • Each subsequent discount is applied to a product price that is calculated after the previous discount has been applied.

  • The operator can be applied for any Calculation Type combination of Calculation Method and Unit of Measure.

  • The operator can be used with additional attributes, such as isIgnoresNull,round, and isIgnoresNull.

Calculation Types with different Units of Measure (% and amount) can only be used with the MULT operator.

Given:

Product List Price = 100$

Discount A = 10%

Discount B = 10%

Discount С = 20%

Then:

Operation: 100 (A) → 90 (B) → 81 © → 64.8$

SUM

Simultaneous application of a total sum of all discounts. The operator can be used for Calculation Type with Unit of Measure = Percent and any Calculation Method.

Given:

Product List Price = 100$

Discount A = 10%

Discount B = 10%

Discount С = 20%

Then:

Operation: SUM discounts = 40%

Apply discount: 100 → 60$

``