Skip to content

Latest commit

 

History

History
38 lines (28 loc) · 1.35 KB

balanced-offset.md

File metadata and controls

38 lines (28 loc) · 1.35 KB
layout title hide_hero show_sidebar menubar
page
Balanced offset
true
false
docs-menu

Balanced offsets

ACH files can have "offset records" which are EntryDetail records that balance a file's debits and credits. This means if there are debits, there is a credit offset matching the sum of the debits. If there are credits, there is a debit offset matching the sum of the credits. They are mutually exclusive.

Offset files are used to offset transactions from a single account inside of the ODFI. The Offset is the last record which settles the funds into a single ODFI account.

Note: Balanced offset files (via WithOffset) are only in ACH v1.1.0 and later.

Setting offset metadata

An ACH Batch supports calling WithOffset to set offset information such as routing number, account number, account type, and a description.

bh := ach.NewBatchHeader()
// fill in the fields

ed := ach.NewEntryDetail()
// fill in the fields

batch := ach.NewBatch(bh)
batch.AddEntry(ed)
batch.WithOffset(&ach.Offset{
    RoutingNumber: "...",
    AccountNumber: "...",
    AccountType: OffsetSavings,
    Description: "...",
})

// On each batch.Create() call the offset record will be re-tabulated