Skip to main content

Amount format

Waffo amounts are represented uniformly as the String type. Do not use Number, float, or double.
String is required instead of Number to avoid floating-point precision issues. 0.1 + 0.2 = 0.30000000000000004 is not acceptable in financial contexts.

Decimal place rules

Different currencies have different decimal place requirements.
Passing the wrong number of decimal places returns a parameter error (A0003).

2 decimal places (most currencies)

The following currencies use 2 decimal places. You can omit the decimal places or use fewer than 2. Amount validation fails if any fractional digit beyond the second decimal place is non-zero.

Currencies with 0 decimal places

For these currencies with 0 decimal places (JPY, KRW, VND, CLP, and others), you can omit the decimal places or include fractional digits that are all zeros. Amount validation fails if any fractional digit is non-zero.

Special currencies (0 decimals same-currency, 2 decimals cross-currency)

The following currencies do not allow decimals for same-currency orders, but allow 2 decimal places for cross-currency orders:

Same-currency vs cross-currency orders

Cross-currency order parameters

Whether an order is cross-currency depends on whether the order currency differs from the user’s actual payment currency, not on orderCurrency alone. The following example shows only the parameters relevant to a cross-currency order: you price the order in USD, and the user pays in IDR with DANA.
In a cross-currency scenario, userCurrency is optional. payMethodCountry is also optional: omit it to avoid restricting countries through this field, or pass it to filter available payment methods by the specified country. Waffo handles exchange rate conversion automatically. The user sees the local currency amount on the checkout page. Before creating a cross-currency order, confirm that your Merchant account has the selected payment method and order currency enabled. If you receive A0018, check that paymentInfo.payMethodType, paymentInfo.payMethodName, and orderCurrency match your enabled payment methods and currencies. Contact Waffo support if you need to enable or change them.

Country and region codes

Country and region fields such as payMethodCountry and userCountryCode use ISO 3166-1 alpha-3 three-letter codes, for example IDN (Indonesia), PHL (the Philippines), and HKG (Hong Kong). Do not pass two-letter alpha-2 codes such as ID, PH, or HK. See the ISO 3166-1 alpha-3 country and region code list for all codes.

Full currency list