Amount Format

Aprende a construir el campo amount en unidades mínimas según la moneda de tu país y evita cobros con el monto equivocado

Every Kushki ONE Connect endpoint that involves money shares the same amount object. Before you build your first request, you need one rule: amounts are sent as integers, in the currency’s smallest unit.

Never send periods, commas, spaces or any other separator.

Your currency and its decimals

In Chile you operate in Chilean pesos (CLP), which use no decimals.

The conversion rule

The value is sent as it is, with no zeros added.

To chargeYou send
1,244 CLP1244
12,000 CLP12000
15,990 CLP15990

How the amount adds up

The amount charged is the sum of every field in the amount object.

FieldWhat it represents
subtotal_ivaThe portion of the sale subject to tax
ivaThe tax amount on that portion
subtotal_iva0The exempt portion. Use this field alone when the sale has no breakdown
extra_taxesIndustry-specific taxes: airport_tax, iac, ice, travel_agency. Send 0 when they do not apply
tipTip. Requires the capability enabled in the DMS

Full example

A retail sale: 15,990 CLP, of which 2,553 is 19% VAT.

ComponentValueMinor units
subtotal_iva13,437 CLP13437
iva2,553 CLP2553
Total charged15,990 CLP15990
{
"amount": {
"iva": 2553,
"subtotal_iva": 13437,
"subtotal_iva0": 0,
"extra_taxes": { "airport_tax": 0, "iac": 0, "ice": 0, "travel_agency": 0 }
},
"client_transaction_id": "9a8b7c6d-2222-4000-8000-ffeeddccbbaa"
}

Sale with no tax breakdown

When you do not itemize taxes, put the whole amount in subtotal_iva0:

{
"amount": {
"iva": 0,
"subtotal_iva": 0,
"subtotal_iva0": 11800,
"extra_taxes": { "airport_tax": 0, "iac": 0, "ice": 0, "travel_agency": 0 }
},
"client_transaction_id": "1a2b3c4d-3333-4000-8000-112233445566"
}

Convert without losing cents

Pass the value as a string, not as a decimal number: Decimal(12.44) inherits the same binary error you are trying to avoid.

  • Javascript
  • Python
const DECIMALS = { COP: 2, MXN: 2, PEN: 2, CLP: 0 };
function toMinorUnits(value, currency) {
const [whole, frac = ""] = String(value).split(".");
const exp = DECIMALS[currency];
return Number(whole + frac.padEnd(exp, "0").slice(0, exp));
}
toMinorUnits("12.44", "COP"); // 1244
toMinorUnits("1244", "CLP"); // 1244
from decimal import Decimal
DECIMALS = {"COP": 2, "MXN": 2, "PEN": 2, "CLP": 0}
def to_minor_units(value: str, currency: str) -> int:
exp = DECIMALS[currency]
return int(Decimal(value).scaleb(exp).to_integral_value())
to_minor_units("12.44", "COP") # 1244
to_minor_units("1244", "CLP") # 1244

Common mistakes

MistakeWhat happensHow to avoid it
Sending the amount with decimalsThe charge goes out with the wrong amount, or the request is rejectedConvert to minor units before sending
Sending the amount as text with separatorsValidation errorStrip every separator and send an integer
Converting with floating pointOne-cent difference on some amountsUse integers or a decimal type
Reusing an amount returned by a webhookWrong magnitudeEvents return decimals (12000.0); requests carry integers

If you operate in several markets

This section applies only if your POS system serves merchants in more than one country.

CurrencyCountryDecimals
COPColombia2
MXNMexico2
PENPeru2
CLPChile0
Accept payments with Kushki ONE

With the amount correctly built, review the payment flows: direct sale, pre-authorization, capture, post-tip and void.

Error catalog

Look up the amount validation codes and their recommended corrective actions.