Amounts and currency conversion
Orders in Orbi Payments Gateway support flexible pricing by allowing items to be denominated in different currencies while enforcing a single payment currency per order.
This page explains how amounts are represented, how currency conversion is performed, and how exchange rates and rounding are applied.
Supported item currencies
Order items and modifiers may be priced in any of the following currencies:
| Currency | Description |
|---|---|
MXN | Mexican Peso |
USD | US Dollar |
EUR | Euro |
ARS | Argentine Peso |
COP | Colombian Peso |
BRL | Brazilian Real |
USDT | USD Tether |
USDC | USD Coin |
USDG | Global Dollar |
Items within the same order may use different currencies.
Supported payment currencies
Each order is paid using a single payment currency, selected at creation time.
| Currency | Description |
|---|---|
USDT | USD Tether |
USDC | USD Coin |
USDG | Global Dollar |
BTC | Bitcoin |
ETH | Ethereum |
All item amounts are converted into this payment currency.
Amount representation
All monetary values in the API are represented as decimal strings.
{
"unit_price": "19.99",
"total_amount": "49.97",
"remaining_amount": "10.00"
}Floating-point numbers must not be used.
Decimal precision
Decimal precision is enforced per currency or asset:
| Currency | Decimals |
|---|---|
Fiat currencies (USD, MXN, EUR, ARS, COP, BRL) | 2 |
USDT | 6 |
USDC | 6 |
USDG | 6 |
BTC | 8 |
ETH | 12 |
Amounts are validated and normalized using these precisions.
Conversion process
When an order is created:
-
Each item (and modifier) amount is multiplied by its quantity.
-
If the item currency differs from the payment currency:
- The amount is converted using the latest available exchange rate.
-
All converted amounts are summed to produce:
total_amountremaining_amount
The final totals are always expressed in the payment currency.
Exchange rates
Exchange rates are sourced from trusted providers and refreshed every minute:
-
Fiat currencies
Rates are sourced from providers such as XE or equivalent institutional FX data sources. -
Crypto assets
Rates are sourced from providers such as CoinMarketCap or CoinGecko.
The exact provider may vary by environment or availability.
Rates object
The rates object included in the Order records the exchange rates used during conversion.
{
"rates": {
"USD_USDT": "1.0000",
"MXN_USDT": "0.0583"
}
}Each entry represents:
<BASE>_<QUOTE> = exchange rate used for conversion
This allows merchants to:
- Audit conversions
- Reproduce totals
- Reconcile accounting data
Rounding rules
All conversions follow bankers rounding (round half to even) at the precision of the target currency.
Rounding is applied:
- After each conversion
- Before final aggregation
This ensures:
- Deterministic totals
- Reduced cumulative rounding error
- Consistent reconciliation across systems
Updated 7 months ago