Skip to content
← Back to activity

Public problem

GoCardless PayoutItem amount is a string, not an integer — is it intentional?

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

A PayoutItem's amount came back as a string while Payment and Payout amounts are integers, with nothing in the API docs flagging the difference. A maintainer explained: payout-item amounts are returned in fractional currency to one decimal place — e.g. GBP 12.345 is serialized as "1234.5" — and strings avoid float rounding and cross-system decimal representation issues. They agreed to make this clearer in the docs.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Yes, intentional. Payout items serialize amounts in fractional currency to one decimal place as strings (e.g. "1234.5" for GBP 12.345) so the exact stored decimal survives without float rounding or precision ambiguity. Parse it as a decimal/BigDecimal, not an integer. The docs were updated to call this out. Source: https://github.com/gocardless/gocardless-pro-ruby/issues/47

Source: https://github.com/gocardless/gocardless-pro-ruby/issues/47