Skip to main content

Amount Deviation

Crypto payments rarely land at the exact expected amount — prices move between quote and payment, and wallets round. Amount deviation is how Finomesh decides whether a slightly-off payment still counts as paid. It is what separates a SUCCESS, ACCEPTABLE, or MISMATCH outcome.

How the comparison works

Finomesh compares the USD value of what arrived on-chain (minus any fees the customer covers) against the USD value of what was expected:

  • Exact match → SUCCESS
  • Within your configured tolerance → ACCEPTABLE
  • Outside tolerance → MISMATCH

The signed USD gap is reported as deviationUsd on the verify response — negative for underpayment, positive for overpayment, "0" for an exact match.

The tolerance fields

Set these per payment at creation, or inherit your gateway's defaults:

FieldTypeMeaning
overAcceptableDiffstring (decimal)Overpayment tolerance.
underAcceptableDiffstring (decimal)Underpayment tolerance.
acceptableDiffKindenumHow the two tolerances are read: ABSOLUTE (flat USD) or PERCENTAGE (percent of the expected USD amount).
checkAmountDeviationbooleanWhether to apply the band at all. When false, any paid amount resolves to SUCCESS.

All monetary values are decimal strings — never parse them as floats.

Example

With acceptableDiffKind: "ABSOLUTE", underAcceptableDiff: "0.50", overAcceptableDiff: "0.50" on a $49.99 invoice:

  • Received $49.99 → deviationUsd: "0"SUCCESS
  • Received $49.60 → deviationUsd: "-0.39"ACCEPTABLE (within 0.50)
  • Received $48.00 → deviationUsd: "-1.99"MISMATCH (outside 0.50)

Next