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 Mexico you operate in Mexican pesos (MXN), which use two decimals.

The conversion rule

The last two digits of the integer are always the fractional part. When the amount has no fraction, add the two zeros anyway.

To chargeYou send
12.44 MXN1244
12.00 MXN1200
1,000.00 MXN100000
1,160.00 MXN116000

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 1,000.00 MXN sale with 16% VAT.

ComponentValueMinor units
subtotal_iva1,000.00 MXN100000
iva160.00 MXN16000
Total charged1,160.00 MXN116000
{
"amount": {
"iva": 16000,
"subtotal_iva": 100000,
"subtotal_iva0": 0,
"extra_taxes": { "airport_tax": 0, "iac": 0, "ice": 0, "travel_agency": 0 }
},
"client_transaction_id": "3c4d5e6f-1111-4000-8000-aabbccddeeff"
}

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.