Skip to main content
Every amount you send to the Yuno API is an object with a currency and a value. currency is an ISO 4217 alpha-3 code. value is the amount in major units of that currency: send 25 for USD 25.00, not 2500. Sixteen currencies have no minor units. For these currencies, value must be a whole number. Yuno does not round or truncate the value for you: a request with a fractional value returns 400 INVALID_PARAMETERS before Yuno creates anything.
Request

Zero-decimal currencies

Every other currency accepts a decimal value. COP is not on the list, because ISO 4217 gives the Colombian peso two decimal digits, so COP 11833.2 is accepted while KRW 11833.2 is not. The decimal digits of each country’s currency are listed in the Country reference. Trailing zeros do not fail the check: 11833.00 is accepted for KRW, 11833.2 is rejected.

Where the rule applies

Yuno checks every field that carries a value next to a currency code, on the request that creates the operation and on the request that updates it:

The error

Response
The message names the field that failed. A fractional cardholder_amount returns The field 'currency_conversion.cardholder_amount' has an invalid amount.

Round once, when you build the order

If your catalog prices items in two decimals, round each line to a whole unit when you build the order, with the rounding rule your pricing requires, and store the rounded values. Send those same whole numbers on the checkout session, the payment, and every refund. Do not round at each API call from the two-decimal values. A total rounded once and a set of line items rounded one by one can differ by a unit, which makes a partial refund fail or the sum of the refunds exceed the charged amount. For a partial refund, compute the refund value from the stored whole-unit line amounts and check that the sum of all refunds of the payment does not exceed its charged amount.value.

Example

The first request is rejected because value has a fractional part. The second request is the same order with the value rounded to the won.
Rejected
Response
Accepted
A partial refund of the same payment follows the same rule:
Partial refund
  • Reference: Troubleshooting lists this error with the other common responses.
  • Reference: Country reference gives the currency and its decimal digits for each country.
  • Guide: Refund payments covers complete and partial refunds.
  • Reference: Payment details breaks a total into fees, shipping, tips, taxes, and discounts.