Returns the list of rounding rules, optionally filtered by currency and country
curl --request POST \
--url https://{globale_api_domain}/Browsing/RoundingRulesimport requests
url = "https://{globale_api_domain}/Browsing/RoundingRules"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{globale_api_domain}/Browsing/RoundingRules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{globale_api_domain}/Browsing/RoundingRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/Browsing/RoundingRules"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{globale_api_domain}/Browsing/RoundingRules")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Browsing/RoundingRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"RoundingRule": [
{
"CountryCode": "<string>",
"CurrencyCode": "<string>",
"RoundingRanges": [
{
"From": 123,
"LowerTarget": 123,
"RangeBehavior": 1,
"RoundingExceptions": [
{
"ExceptionValue": 123
}
],
"TargetBehaviorHelperValue": 123,
"Threshold": 123,
"To": 123,
"UpperTarget": 123
}
],
"RoundingRuleId": 123
}
]
}Rounding rules (Merchant to Global-e)
Returns the list of rounding rules for a merchant, optionally filtered by currency and country.
POST
/
Browsing
/
RoundingRules
Returns the list of rounding rules, optionally filtered by currency and country
curl --request POST \
--url https://{globale_api_domain}/Browsing/RoundingRulesimport requests
url = "https://{globale_api_domain}/Browsing/RoundingRules"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://{globale_api_domain}/Browsing/RoundingRules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{globale_api_domain}/Browsing/RoundingRules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{globale_api_domain}/Browsing/RoundingRules"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{globale_api_domain}/Browsing/RoundingRules")
.asString();require 'uri'
require 'net/http'
url = URI("https://{globale_api_domain}/Browsing/RoundingRules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"RoundingRule": [
{
"CountryCode": "<string>",
"CurrencyCode": "<string>",
"RoundingRanges": [
{
"From": 123,
"LowerTarget": 123,
"RangeBehavior": 1,
"RoundingExceptions": [
{
"ExceptionValue": 123
}
],
"TargetBehaviorHelperValue": 123,
"Threshold": 123,
"To": 123,
"UpperTarget": 123
}
],
"RoundingRuleId": 123
}
]
}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:If (S = Exceptionn) then R = Exceptionn
If (S < Threshold) then R = LowerTarget
If (S >= Threshold) then R = UpperTarget
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:For source number (S): B = whole part of S
LowerTarget (absolute): LA = B – 1 + LowerTarget
UpperTarget (absolute): UA = B + UpperTarget
Threshold (absolute): TA = B + Threshold
Exceptionn (absolute): EAn = B + Exceptionn
If (S = EAn) then Result (R) = EAn
If (S < TA) then R = LA
If (S >= TA) then R = UA
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:For source number (S): B = S rounded down to the closest multiple of V
For example if (S = 56789 and V = 1000) then B = 56000
LowerTarget (absolute): LA = B – V + LowerTarget
UpperTarget (absolute): UA = B + UpperTarget
Threshold (absolute): TA = B + Threshold
Exceptionn (absolute): EAn = B + Exceptionn
If (S = EAn) then Result (R) = EAn
If (S < TA) then R = LA
If (S >= TA) then R = UA
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:For source number (S): B = S rounded down to the closest multiple of V
For example, if (S = 123 and V = 5) then B = 120
LowerTarget (absolute): LA = B – 1 + LowerTarget
UpperTarget (absolute): UA = B – 1 + V + UpperTarget
Threshold (absolute): TA = B + Threshold
Exceptionn (absolute): EAn = B + Exceptionn
If (S = EAn) then Result (R) = EAn
If (S < TA) then R = LA
If (S >= TA) then R = UA
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.
Show child attributes
Show child attributes

