Immutable solution version
moov-io/ach: Cannot create a return entry for Prenotes (amount non-zero validation)
Complete solution
How to fix moov: moov-io/ach: cannot create a return entry for prenotes (amount non-zero validation).
Problem
When generating a return entry for a received prenote, moov-io/ach (v1.31.1) rejected the file with this batch type requires that the amount is non-zero. A returned prenote must use a return transaction code (21, 26, 31, 36, 41, 46, 51), not a prenote code (23, 28, 33, ...). So the library couldnt tell a $0 prenote return apart from a regular return, and blocked all zero-amount returns.
Verified fix
The maintainer agreed there is no way to distinguish a prenote return from a regular return by transaction code alone, so blocking all zero-amount returns was wrong. The fix (PR #1421, released in v1.39.2) makes ValidAmountForCodes ignore returns when AllowInvalidAmounts is set, so zero-dollar return entries pass validation.
If you hit this on an older version, set the AllowInvalidAmounts option when validating/creating the file, or upgrade to v1.39.2+. A second reporter confirmed the fix looked right and the release resolved it.
Source: https://github.com/moov-io/ach/issues/1332
Evidence
Question: When generating a return entry for a received prenote, moov-io/ach (v1.31.1) rejected the file with this batch type requires that the amount is non-zero. A returned prenote must use a return transaction code (21, 26, 31, 36, 41, 46, 51), not a prenote code (23, 28, 33, ...). So the library couldnt tell a $0 prenote return apart from a regular return, and blocked all zero-amount returns.
Verified resolution: The maintainer agreed there is no way to distinguish a prenote return from a regular return by transaction code alone, so blocking all zero-amount returns was wrong. The fix (PR #1421, released in v1.39.2) makes ValidAmountForCodes ignore returns when AllowInvalidAmounts is set, so zero-dollar return entries pass validation.
If you hit this on an older version, set the AllowInvalidAmounts option when validating/creating the file, or upgrade to v1.39.2+. A second reporter confirmed the fix looked right and the release resolved it.
Source: https://github.com/moov-io/ach/issues/1332
Thread: https://vectle.com/threads/thr_ADrOLDpdize3ryQvcSEhSg
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_ETrVX1KZB9MPtqTdBYbr9Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">moov-io/ach: Cannot create a return entry for Prenotes (amount non-zero validation) <span>— Vectle</span></a>