Returns the list of rounding rules, optionally filtered by currency and country
Browsing & Catalog
Rounding rules
Returns the list of rounding rules for a merchant, optionally filtered by currency and country.
POST
Returns the list of rounding rules, optionally filtered by currency and country
Returns the list of rounding rules, optionally filtered by currency and country
The
RangeBehavior on each RoundingRange selects one of the behaviors below. Expand for the calculation logic, the important notices, and worked samples.
RangeBehaviors enumeration — calculation logic
RangeBehaviors enumeration — calculation logic
1 — Absolute target. In this behavior all the values within the specified range (2 — Relative Decimal target. In this behavior all the values within the specified range (3 — Relative Whole target. In this behavior ALL the values within the specified range (4 — Nearest target. In this behavior,
LowerTarget, UpperTarget, Threshold and RoundingExceptions) denote the values themselves as is, without the need for any additional math operations. Getting rounding result (R) for the source number (S) must be implemented as follows:LowerTarget, UpperTarget, Threshold and RoundingExceptions) represent floating point numbers between 0 (inclusive) and 1 (inclusive), used to calculate the respective absolute values, relative to the calculation base (B) as follows:LowerTarget, UpperTarget, Threshold and RoundingExceptions) represent non-negative whole numbers, while TargetBehaviorHelperValue (V) is used to determine the calculation base (B). V must be a power of 10 (10, 100, 1000, etc.) and denotes the order of magnitude for the range “split” by the Threshold. For example, if Threshold = 9 we need to know if this is 9 out of 10 or 9 out of 100. Getting rounding result (R) for the source number (S) must be implemented as follows:LowerTarget and UpperTarget represent non-negative floating-point numbers, while TargetBehaviorHelperValue (V) is used to determine the calculation base (B). V must be a whole divisor of any power of 10 (5, 10, 25, 50, 100, 250, 500, 1000, etc.). The threshold must be any floating-point number between 0 (inclusive) and V (exclusive). Getting rounding result (R) for the source number (S) must be implemented as follows:Important notices
Important notices
- If the result of rounding is a negative number, it must be set to zero, for any rounding behavior defined in the table above.
- If either
LowerTargetorUpperTargetvalue violates MaxDecimalPlaces setting for the respective currency, this value must be truncated accordingly. For example, ifUpperTargetis set to 0.999 for USD, it must be truncated to 0.99 before using in any further calculations.
Rounding rules samples
Rounding rules samples
The following samples indicate how rounding X to Y (X → Y) is implemented using the respective settings. Each numbered column is one settings scenario together with its sample results (re-extracted from the source table, preserving column alignment).
| Setting | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| Sample results (X → Y) | 0.25 → 0 3 → 0 1.5 → 1.5 2 → 2 | 22.47 → 21.95 22.48 → 22.99 22.50 → 22.50 33.75 → 33.75 | 2047 → 1995 2048 → 2100 | 122.26 → 124.99 122.25 → 119.99 127.26 → 129.99 121.50 → 121.50 127.50 → 127.50 123 → 123 128 → 128 | 2047 → 1999 2048 → 2100 |
| From | 0 | 1 | 1000 | 100 | 1000 |
| To | 3 | 250 | 10000 | 1000 | 10000 |
| Threshold | 3.01 | 0.48 | 48 | 2.26 | 48 |
| LowerTarget | 0 | 0.95 | 95 | 0.99 | 0 |
| UpperTarget | 0 | 0.99 | 100 | 0.99 | 1 |
| RangeBehavior | 1 Absolute | 2 Relative Decimal | 3 Relative Whole | 4 Nearest | 4 Nearest |
| TargetBehaviorHelperValue | 100 | 5 | 100 | ||
| RoundingExceptions | 1.5, 2 | 0.50, 0.75 | 1.50, 2.50, 3 |
Query Parameters
2-char ISO country code. If not specified, rounding rules for all the countries supported by the Merchant will be returned
3-char ISO currency code. If not specified, rounding rules for all the currencies supported by the Merchant will be returned
Response
200 - application/json
List of rounding rules.
Returns list of rounding rules for currency.

