Categorygithub.com/moov-io/ach
modulepackage
1.45.5
Repository: https://github.com/moov-io/ach.git
Documentation: pkg.go.dev

# README

Moov Banner Logo

Project Documentation · API Endpoints · API Guide · Community · Blog

GoDoc Build Status Go Report Card Repo Size Apache 2 License Slack Channel Docker Pulls GitHub Stars Twitter

moov-io/ach

Moov's mission is to give developers an easy way to create and integrate bank processing into their own software products. Our open source projects are each focused on solving a single responsibility in financial services and designed around performance, scalability, and ease of use.

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files following the Nacha standards. ACH is the primary method of electronic money movement throughout the United States. The HTTP server is available in a Docker image and the Go package github.com/moov-io/ach is available.

If you're looking for an event driven ACH engine for uploading/downloading files and operations we have built moov-io/achgateway and run it in production. Our article How and When to use the Moov ACH Library will help to generate ACH files for upload to your ODFI.

Table of contents

Project status

Moov ACH is actively used in multiple production environments. Please star the project if you are interested in its progress. The project supports generating and parsing all Standard Entry Class (SEC) codes and validating files according to the Nacha standards. If you have layers above ACH to simplify tasks, perform business operations, or found bugs we would appreciate an issue or pull request. Thanks!

Usage

The ACH project implements an HTTP server and Go library for creating and modifying ACH files. There are client libraries available for both Go and Node/JavaScript. We also have an extensive list of examples of the reader and writer applied to various ACH transaction types.

Docker

We publish a public Docker image moov/ach from Docker Hub or use this repository. No configuration is required to serve on :8080 and metrics at :9090/metrics in Prometheus format. We also have Docker images for OpenShift published as quay.io/moov/ach.

Pull & start the Docker image:

docker pull moov/ach:latest
docker run -p 8080:8080 -p 9090:9090 moov/ach:latest

List files stored in-memory:

curl localhost:8080/files
{"files":[],"error":null}

Create a file on the HTTP server:

curl -X POST --data-binary "@./test/testdata/ppd-debit.ach" http://localhost:8080/files/create
{"id":"<YOUR-UNIQUE-FILE-ID>","error":null}

Read the ACH file (in JSON form):

curl http://localhost:8080/files/<YOUR-UNIQUE-FILE-ID>
{"file":{"id":"<YOUR-UNIQUE-FILE-ID>","fileHeader":{"id":"","immediateDestination":"231380104","immediateOrigin":"121042882", ...

Google Cloud Run button

To get started in a hosted environment you can deploy this project to the Google Cloud Platform.

From your Google Cloud dashboard create a new project and call it:

moov-ach-demo

Click the button below to deploy this project to Google Cloud.

Run on Google Cloud

Note: If you get an error about the image being marked as "Do Not Trust" follow the below steps.

Error: You launched this custom Cloud Shell image as "Do not trust"
$ cloudshell_open --repo_url "https://github.com/moov-io/ach" --page "shell" --git_branch "master"
Error: You launched this custom Cloud Shell image as "Do not trust".
In this mode, your credentials are not available and this experience
cannot deploy to Cloud Run. Start over and "Trust" the image.
Error: aborting due to untrusted cloud shell environment

This error occurs when some security settings on your account / cloud shell are locked down. To run ACH you need to trust the image, so in the top-right click to restart this image as Trusted.

Click to "Return to default"

Then you'll need to clone down and launch ACH. Pick option #3 to clone this project.

cloudshell_open --repo_url "https://github.com/moov-io/ach" --page "shell" --git_branch "master"

Start the ACH server inside the cloned repository.

go run ./cmd/serverr

Connect to the web preview (e.g. https://YOUR-ACH-APP-URL.a.run.app:8080/files)


In the cloud shell you should be prompted with:

Choose a project to deploy this application:

Using the arrow keys select:

moov-ach-demo

You'll then be prompted to choose a region, use the arrow keys to select the region closest to you and hit enter.

Choose a region to deploy this application:

Upon a successful build you will be given a URL where the API has been deployed:

https://YOUR-ACH-APP-URL.a.run.app

From the cloud shell you need to cd into the ach folder:

cd ach

Now you can list files stored in-memory:

curl https://YOUR-ACH-APP-URL.a.run.app/files

You should get this response:

{"files":[],"error":null}

Create a file on the server:

curl -X POST --data-binary "@./test/testdata/ppd-debit.ach" https://YOUR-ACH-APP-URL.a.run.app/files/create

You should get this response:

{"id":"<YOUR-UNIQUE-FILE-ID>","error":null}

Finally, read the contents of the file you've just posted:

curl https://YOUR-ACH-APP-URL.a.run.app/files/<YOUR-UNIQUE-FILE-ID>

You should get this response:

{"file":{"id":"<YOUR-UNIQUE-FILE-ID>","fileHeader":{"id":"...","immediateDestination":"231380104","immediateOrigin":"121042882", ...

HTTP API

The package github.com/moov-io/ach/server offers an HTTP and JSON API for creating and editing files. If you're using Go the ach.File type can be used, otherwise you can send properly formatted JSON. We have an example JSON file, but each SEC type will generate different JSON.

Examples: Go | Ruby

Configuration settings

Environmental VariableDescriptionDefault
ACH_FILE_TTLTime to live (TTL) for *ach.File objects stored in the in-memory repository.0 = No TTL / Never delete files (Example: 240m)
LOG_FORMATFormat for logging lines to be written as.Options: json, plain - Default: plain
HTTP_BIND_ADDRESSAddress for ACH to bind its HTTP server on. This overrides the command-line flag -http.addr.Default: :8080
HTTP_ADMIN_BIND_ADDRESSAddress for ACH to bind its admin HTTP server on. This overrides the command-line flag -admin.addr.Default: :9090
HTTPS_CERT_FILEFilepath containing a certificate (or intermediate chain) to be served by the HTTP server. Requires all traffic be over secure HTTP.Empty
HTTPS_KEY_FILEFilepath of a private key matching the leaf certificate from HTTPS_CERT_FILE.Empty

Data persistence

By design ACH does not persist (save) any data about the files, batches, or entry details created. The only storage occurs in memory of the process and upon restart ACH will have no files, batches, or data saved. Also, no in memory encryption of the data is performed.

Go library

This project uses Go Modules and Go v1.18 or newer. See Golang's install instructions for help in setting up Go. You can download the source code and we offer tagged and released versions as well. We highly recommend you use a tagged release for production.

# Pull down into the Go Module cache
$ go get -u github.com/moov-io/ach

# Show the documentation for the BatchHeader package
$ go doc github.com/moov-io/ach BatchHeader

The package github.com/moov-io/ach offers a Go-based ACH file reader and writer. To get started, check out a specific example:

Supported Standard Entry Class (SEC) codes
SEC CodeDescriptionExampleReadWrite
ACKAcknowledgment Entry for CCDCreditACK ReadACK Write
ADVAutomated Accounting AdvicePrenote DebitADV ReadADV Write
ARCAccounts Receivable EntryDebitARC ReadARC Write
ATXAcknowledgment Entry for CTXCreditATX ReadATX Write
BOCBack Office ConversionDebitBOC ReadBOC Write
CCDCorporate credit or debitDebitCCD ReadCCD Write
CIECustomer-Initiated EntryCreditCIE ReadCIE Write
CORAutomated Notification of Change(NOC)NOCCOR ReadCOR Write
CTXCorporate Trade ExchangeDebitCTX ReadCTX Write
DNEDeath Notification EntryDNEDNE ReadDNE Write
ENRAutomatic Enrollment EntryENRENR ReadENR Write
IATInternational ACH TransactionsCreditIAT ReadIAT Write
MTEMachine Transfer EntryCreditMTE ReadMTE Write
POPPoint of PurchaseDebitPOP ReadPOP Write
POSPoint of SaleDebitPOS ReadPOS Write
PPDPrearranged payment and depositsDebit CreditPPD ReadPPD Write
RCKRepresented Check EntriesDebitRCK ReadRCK Write
SHRShared Network EntryDebitSHR ReadSHR Write
TELTelephone-Initiated EntryDebitTEL ReadTEL Write
TRCTruncated Check EntryDebitTRC ReadTRC Write
TRXCheck Truncation Entries ExchangeDebitTRX ReadTRX Write
WEBInternet-initiated EntriesCreditWEB ReadWEB Write
XCKDestroyed Check EntryDebitXCK ReadXCK Write
Segment Files
SEC CodeNameExampleReadWrite
IATInternational ACH TransactionsCreditIAT ReadIAT Write
PPDPrearranged payment and depositsDebit CreditPPD ReadPPD Write

Command line

On each release there's an achcli utility released. This tool can display ACH files in a human-readable format which is easier to read than their plaintext format. It also allows masking DFIAccountNumber values with the -mask flag.

Download the latest release for your computer

$ achcli test/testdata/ppd-debit.ach
Describing ACH file 'test/testdata/ppd-debit.ach'

  Origin     OriginName    Destination  DestinationName       FileCreationDate  FileCreationTime
  121042882  My Bank Name  231380104    Federal Reserve Bank  190624            0000

  BatchNumber  SECCode  ServiceClassCode  CompanyName      DiscretionaryData  Identification  EntryDescription  DescriptiveDate
  1            PPD      225 (Debits Only)  Name on Account                     121042882       REG.SALARY

    TransactionCode   RDFIIdentification  AccountNumber      Amount     Name                    TraceNumber      Category
    27 (Checking Debit)  23138010            12345678           100000000  Receiver Account Name   121042880000001

  ServiceClassCode  EntryAddendaCount  EntryHash  TotalDebits  TotalCredits  MACCode  ODFIIdentification  BatchNumber
  225 (Debits Only)  1                  23138010   100000000    0                      12104288            1

  BatchCount  BlockCount  EntryAddendaCount  TotalDebitAmount  TotalCreditAmount
  1           1           1                  100000000         0

In-browser ACH file parser

Using our in-browser utility, you can instantly convert ACH files into JSON. Either paste in ACH file content directly or choose a file from your local machine. This tool is particularly useful if you're handling sensitive PII or want perform some quick tests, as operations are fully client-side with nothing stored in memory.

SDKs

Below are some SDKs generated from the API documentation:

Learn about ACH

FAQ

Is there an in-browser tool for converting ACH files into JSON? Yes! You can find our browser utility at http://oss.moov.io/ach/.
Is my data being saved somewhere? No, we do not save any data related to files, batch, or entry details. All processing is done in-memory.
What ACH transaction types are supported? We support generating and parsing all Standard Entry Class (SEC) codes.
Where can I find the official Nacha Operating Rules? You can purchase the most recent Nacha Operating Rules and Guidelines resource directly from their webstore. Additionally, Nacha has published a free ACH guide for developers.

Getting help

If you have ACH-specific questions, NACHA (National Automated Clearing House Association) has their complete specification for all file formats and message types.

channelinfo
Project DocumentationOur project documentation available online.
Twitter @moovYou can follow Moov.io's Twitter feed to get updates on our project(s). You can also tweet us questions or just share blogs or stories.
GitHub IssueIf you are able to reproduce a problem please open a GitHub Issue under the specific project that caused the error.
moov-io slackJoin our slack channel to have an interactive discussion about the development of the project.

Supported and tested platforms

  • 64-bit Linux (Ubuntu, Debian), macOS, and Windows
  • Raspberry Pi

Note: 32-bit platforms have known issues and are not supported.

Contributing

Yes please! Please review our Contributing guide and Code of Conduct to get started! Check out our issues for first time contributors for something to help out with.

This project uses Go Modules and Go v1.18 or newer. See Golang's install instructions for help setting up Go. You can download the source code and we offer tagged and released versions as well. We highly recommend you use a tagged release for production.

Releasing

To make a release of ach simply open a pull request with CHANGELOG.md and version.go updated with the next version number and details. You'll also need to push the tag (i.e. git push origin v1.0.0) to origin in order for CI to make the release.

Testing

We maintain a comprehensive suite of unit tests and recommend table-driven testing when a particular function warrants several very similar test cases. To run all test files in the current directory, use go test.

Fuzzing

We currently run fuzzing over ACH in the form of a Github Action. Please report crashes examples to [email protected]. Thanks!

Related projects

As part of Moov's initiative to offer open source fintech infrastructure, we have a large collection of active projects you may find useful:

  • Moov Watchman offers search functions over numerous trade sanction lists from the United States and European Union.

  • Moov Fed implements utility services for searching the United States Federal Reserve System such as ABA routing numbers, financial institution name lookup, and FedACH and Fedwire routing information.

  • Moov Wire implements an interface to write files for the Fedwire Funds Service, a real-time gross settlement funds transfer system operated by the United States Federal Reserve Banks.

  • Moov Image Cash Letter implements Image Cash Letter (ICL) files used for Check21, X.9 or check truncation files for exchange and remote deposit in the U.S.

  • Moov Metro 2 provides a way to easily read, create, and validate Metro 2 format, which is used for consumer credit history reporting by the United States credit bureaus.

License

Apache License 2.0 - See LICENSE for details.

# Packages

# Functions

CalculateCheckDigit returns a check digit for a routing number Multiply each digit in the Routing number by a weighting factor.
CheckRoutingNumber returns a nil error if the provided routingNumber is valid according to NACHA rules.
ConvertBatchType will take a batch object and convert it into one of the correct batch type.
DefaultFileAcceptor is the default logic for which file extensions to merge and how to read them.
FileFromJSON attempts to return a *File object assuming the input is valid JSON.
FileFromJSONWith attempts to return a *File object assuming the input is valid JSON.
Flatten returns a flattened version of a File, where batches with similar batch headers are consolidated.
LookupChangeCode will return a struct representing the reason and description for the provided NACHA change code.
LookupReturnCode will return a struct representing the reason and description for the provided NACHA return code.
MergeDir will consolidate a directory of ACH files into as few files as possible.
MergeFiles is a helper function for consolidating an array of ACH Files into as few files as possible.
MergeFilesWith is a function for consolidating an array of ACH Files into a few files as possible.
NewAddenda02 returns a new Addenda02 with default values for none exported fields.
NewAddenda05 returns a new Addenda05 with default values for none exported fields.
NewAddenda10 returns a new Addenda10 with default values for none exported fields.
NewAddenda11 returns a new Addenda11 with default values for none exported fields.
NewAddenda12 returns a new Addenda12 with default values for none exported fields.
NewAddenda13 returns a new Addenda13 with default values for none exported fields.
NewAddenda14 returns a new Addenda14 with default values for none exported fields.
NewAddenda15 returns a new Addenda15 with default values for none exported fields.
NewAddenda16 returns a new Addenda16 with default values for none exported fields.
NewAddenda17 returns a new Addenda17 with default values for none exported fields.
NewAddenda18 returns a new Addenda18 with default values for none exported fields.
NewAddenda98 returns an reference to an instantiated Addenda98 with default values.
NewAddenda98Refused returns an reference to an instantiated Addenda98Refused with default values.
NewAddenda99 returns a new Addenda99 with default values for none exported fields.
NewAddenda99Contested returns a new Addenda99Contested with default values for none exported fields.
NewAddenda99Dishonored returns a new Addenda99Dishonored with default values for none exported fields.
NewADVBatchControl returns a new ADVBatchControl with default values for none exported fields.
NewADVEntryDetail returns a new ADVEntryDetail with default values for non exported fields.
NewADVFileControl returns a new ADVFileControl with default values for none exported fields.
NewBatch takes a BatchHeader and returns a matching SEC code batch type that is a batcher.
NewBatchACK returns a *BatchACK.
NewBatchADV returns a *BatchADV.
NewBatchARC returns a *BatchARC.
NewBatchATX returns a *BatchATX.
NewBatchBOC returns a *BatchBOC.
NewBatchCCD returns a *BatchCCD.
NewBatchCIE returns a *BatchCIE.
NewBatchControl returns a new BatchControl with default values for none exported fields.
NewBatchCOR returns a *BatchCOR.
NewBatchCTX returns a *BatchCTX.
NewBatchDNE returns a *BatchDNE.
NewBatchENR returns a *BatchENR.
NewBatchHeader returns a new BatchHeader with default values for non exported fields.
NewBatchMTE returns a *BatchMTE.
NewBatchPOP returns a *BatchPOP.
NewBatchPOS returns a *BatchPOS.
NewBatchPPD returns a *BatchPPD.
NewBatchRCK returns a *BatchRCK.
NewBatchSHR returns a *BatchSHR.
NewBatchTEL returns a *BatchTEL.
NewBatchTRC returns a *BatchTRC.
NewBatchTRX returns a *BatchTRX.
NewBatchWEB returns a *BatchWEB.
NewBatchXCK returns a *BatchXCK.
NewEntryDetail returns a new EntryDetail with default values for non exported fields.
NewErrBatchAddendaCount creates a new error of the ErrBatchAddendaCount type.
NewErrBatchAddendaTraceNumber creates a new error of the ErrBatchAddendaTraceNumber type.
NewErrBatchAmount creates a new error of the ErrBatchAmount type.
NewErrBatchAscending creates a new error of the ErrBatchAscending type.
NewErrBatchCalculatedControlEquality creates a new error of the ErrBatchCalculatedControlEquality type.
NewErrBatchCategory creates a new error of the ErrBatchCategory type.
NewErrBatchExpectedAddendaCount creates a new error of the ErrBatchExpectedAddendaCount type.
NewErrBatchHeaderControlEquality creates a new error of the ErrBatchHeaderControlEquality type.
NewErrBatchIATNOC creates a new error of the ErrBatchIATNOC type.
NewErrBatchRequiredAddendaCount creates a new error of the ErrBatchRequiredAddendaCount type.
NewErrBatchServiceClassTranCode creates a new error of the ErrBatchServiceClassTranCode type.
NewErrBatchTraceNumberNotODFI creates a new error of the ErrBatchTraceNumberNotODFI type.
NewErrFileBatchNumberAscending creates a new error of the ErrFileBatchNumberAscending type.
NewErrFileCalculatedControlEquality creates a new error of the ErrFileCalculatedControlEquality type.
NewErrFileUnknownSEC creates a new error of the ErrFileUnknownSEC type.
NewErrRecordType creates a new error of the ErrRecordType type.
NewErrUnknownRecordType creates a new error of the ErrUnknownRecordType type.
NewErrValidCheckDigit creates a new error of the ErrValidCheckDigit type.
NewErrValidFieldLength creates a new error of the ErrValidFieldLength type.
NewFile constructs a file template.
NewFileControl returns a new FileControl with default values for none exported fields.
NewFileHeader returns a new FileHeader with default values for none exported fields.
NewIATBatch takes a BatchHeader and returns a matching SEC code batch type that is a batcher.
NewIATBatchHeader returns a new BatchHeader with default values for non exported fields.
NewIATEntryDetail returns a new IATEntryDetail with default values for non exported fields.
NewIterator returns an Iterator.
NewMerger returns a Merge which can have custom ValidateOpts.
NewReader returns a new ACH Reader that reads from r.
NewRecordWrongLengthErr creates a new error of the RecordWrongLengthErr type.
SegmentFileConfiguration returns a new SegmentFileConfiguration with default values for non exported fields.
NewWriter returns a new Writer that writes to w.
NewWriter returns a new Writer that writes to w.
ParseDNEPaymentInformation returns an DNEPaymentInformation for a given Addenda05 record.
ParseENRPaymentInformation returns an ENRPaymentInformation for a given Addenda05 record.
ReadDir will attempt to parse all ACH files in the given directory.
ReadFile attempts to open a file at path and read the contents before closing and returning the parsed ACH File.
ReadFiles attempts to open files at the given paths and read the contents of each before closing and returning the parsed ACH Files.
ReadJSONFile will consume the specified filepath and parse the contents as a JSON formatted ACH file.
ReadJSONFileWith will consume the specified filepath and parse the contents as a JSON formatted ACH file with custom ValidateOpts.
StandardTransactionCode checks the provided TransactionCode to verify it is a valid NACHA value.
ParseCorrectedData returns the string properlty formatted and justified for an Addenda98.CorrectedData field.

# Constants

ACK ACH Payment Acknowledgment - A code that indicates acknowledgment of receipt of a corporate credit payment (CCD).
ADV Automated Accounting Advice – A code that provides accounting information regarding an Entry.
ARC Accounts Receivable Entry – A code that indicates a consumer check converted to a one-time ACH debit.
ATX Financial EDI Acknowledgment - A code that indicates acknowledgement by the Receiving Depository Financial Institution (RDFI) that a Corporate Credit Exchange (CTX) has been received.
AutomatedAccountingAdvices indicates a batch can only have Automated Accounting Advices (debit and credit).
BOC Back Office Conversion Entry - A code that indicates single entry debit initiated at the point of purchase or at a manned bill payment location to transfer funds through conversion to an ACH debit entry during back office processing.
CategoryDishonoredReturn defines the entry as being a dishonored return initiated by the ODFI to the RDFI that submitted the return entry.
CategoryDishonoredReturnContested defines the entry as a contested dishonored return initiated by the RDFI to the ODFI that submitted the dishonored return.
CategoryForward defines the entry as being sent to the receiving institution.
CategoryNOC defines the entry as being a notification of change of a forward entry to the originating institution.
CategoryReturn defines the entry as being a return of a forward entry back to the originating institution.
CCD Corporate Credit or Debit Entry - A code that indicates an entry initiated by an Organization to transfer funds to or from an account of that Organization or another Organization.
CheckingCredit is a credit to the receiver's checking account.
CheckingDebit is a debit to the receivers checking account.
CheckingPrenoteCredit is a pre-notification of a credit to the receiver's checking account.
CheckingPrenoteDebit is a pre-notification of a debit to the receiver's checking account.
CheckingReturnNOCCredit is a return that credits the receiver's checking account.
CheckingReturnNOCDebit is a return that debits the receiver's checking account.
CheckingZeroDollarRemittanceCredit is a zero dollar remittance data credit to a checking account for CCD, CTX, ACK, and ATX entries.
CheckingZeroDollarRemittanceDebit is a zero dollar remittance data debit to a checking account for CCD, CTX, ACK, and ATX entries.
CIE Customer Initiated Entry - A code that indicates a credit entry initiated on behalf of, and upon the instruction of, a consumer to transfer funds to a non-consumer Receiver.
COR Notification of Change or Refused Notification of Change - A code used by an RDFI or ODFI when originating a Notification of Change or Refused Notification of Change in automated format.
CreditForCreditsReceived is an accounting entry credits for ACH credits received.
CreditForCreditsRejected is an accounting entry credit for ACH credits in rejected batches.
CreditForDebitsOriginated is an accounting entry credit for ACH debits originated.
CreditsOnly indicates a batch can only have credit ACH entries.
CreditSummary is an accounting entry for summary credit for respondent ACH activity.
CTX Corporate Trade Exchange - A code that indicates the ability to collect and disburse funds and information between companies.
DebitForCreditsOriginated is an accounting entry debit for ACH credits originated.
DebitForDebitsReceived is an accounting entry debit for ACH debits received.
DebitForDebitsRejectedBatches is an accounting entry debit for ACH debits in rejected batches.
DebitsOnly indicates a batch can only have debit ACH entries.
DebitSummary is an accounting entry for summary debit for respondent ACH activity.
DNE Death Notification Entry - A code that United States Federal agencies (e.g.
ENR Automated Enrollment Entry - A code indicating enrollment of a person with an agency of the US government for a depository financial institution.
GLCredit is a credit to the receiver's general ledger (GL) account.
GLDebit is a debit to the receiver's general ledger (GL) account.
GLPrenoteCredit is a pre-notification of a credit to the receiver's general ledger (GL) account.
GLPrenoteDebit is a pre-notification of a debit to the receiver's general ledger (GL) account.
GLReturnNOCCredit is a return that credits the receiver's general ledger (GL) account.
GLReturnNOCDebit is a return that debits the receiver's general ledger (GL) account.
GLZeroDollarRemittanceCredit is a zero dollar remittance data credit to the receiver's general ledger (GL) account.
GLZeroDollarRemittanceDebit is a zero dollar remittance data debit to the receiver's general ledger (GL) account.
IAT International ACH Transaction - A code IAT indicating a credit or debit ACH entry that is part of a payment transaction involving a financial agency's office (i.e., depository financial institution or business issuing money orders) that is not located in the territorial jurisdiction of the United States.
IATCOR is the valid value for IATBatchHeader.IATIndicator for IAT Notification Of Changr.
LoanCredit is a credit to the receiver's loan account.
LoanDebit is a debit (Reversal's Only) to the receiver's loan account.
LoanPrenoteCredit is a pre-notification of a credit to the receiver's loan account.
LoanReturnNOCCredit is a return that credits the receiver's loan account.
LoanReturnNOCDebit is a return that debits the receiver's loan account.
LoanZeroDollarRemittanceCredit is a zero dollar remittance data credit to the receiver's loan account.
MixedDebitsAndCredits indicates a batch can have debit and credit ACH entries.
MTE Machine Transfer Entry - A code that indicates when a consumer uses their debit card at an Automated Teller Machine (ATM) to withdraw cash.
NachaBatchDebitCreditLimit is the maximum amount allowed by the Nacha format for a batch's debit/credit total (12 digits).
NachaEntryAmountLimit is the maximum amount allowed by the Nacha format for an entry (10 digits).
NachaFileDebitCreditLimit is the maximum amount allowed by the Nacha format for a batch's debit/credit total (12 digits).
POP Point of Purchase Entry - A code that indicates a check presented in-person to a merchant for purchase is presented as an ACH entry instead of a physical check.
POS Point of Sale Entry - A code that indicates a debit entry initiated at an "electronic terminal" to a consumer account of the receiver to pay an obligation incurred in a point-of-sale transaction, or to effect a point-of-sale terminal cash withdrawal.
PPD Prearranged Payment and Deposit Entry - A code that indicates an entry initiated by an organization based on a standing or a single entry authorization to transfer funds.
RCK Re-presented Check Entry - A code that indicates a physical check that was presented but returned because of insufficient funds may be represented as an ACH entry.
RecordLength character count of each line representing a letter in a file.
SavingsCredit is a credit to the receiver's savings account.
SavingsDebit is a debit to the receivers savings account.
SavingsPrenoteCredit is a pre-notification of a credit to the receiver's savings account.
SavingsPrenoteDebit is a pre-notification of a debit to the receiver's savings account.
SavingsReturnNOCCredit is a return that credits the receiver's savings account.
SavingsReturnNOCDebit is a return that debits the receiver's savings account.
SavingsZeroDollarRemittanceCredit is a zero dollar remittance data credit to a savings account for CCD and CTX entries.
SavingsZeroDollarRemittanceDebit is a zero dollar remittance data debit to a savings account for CCD and CTX entries.
SHR Shared Network Transaction - A code that indicates a debit Entry initiated at an "electronic terminal," as that term is defined in Regulation E, to a Consumer Account of the Receiver to pay an obligation incurred in a point-of-sale transaction, or to effect a point-of-sale terminal cash withdrawal.
TEL Telephone Initiated Entry - A code indicating a Telephone-Initiated consumer debit transaction.
TRC Check Truncation Entry - is a code used to identify a debit entry of a truncated check.
TRX Check Truncation Entries Exchange - used to identify a debit entry exchange of truncated checks (multiple).
Version Number.
WEB Internet-Initiated/Mobile Entry - A code indicating an entry submitted pursuant to an authorization obtained solely via the Internet or a mobile network.
XCK Destroyed Check Entry - A code indicating a debit entry initiated for destroyed check eligible items.

# Variables

ErrAddenda98ChangeCode is given when there's an invalid addenda change code.
ErrAddenda98CorrectedData is given when the corrected data does not corespond to the change code.
ErrAddenda98RefusedChangeCode is given when there's an invalid addenda refused change code.
ErrAddenda98RefusedTraceSequenceNumber is given when there's an invalid addenda trace sequence number.
ErrAddenda99ContestedReturnCode is given when there's an invalid dishonored return code.
ErrAddenda99DishonoredReturnCode is given when there's an invalid dishonored return code.
ErrAddenda99ReturnCode is given when there's an invalid return code.
ErrAddendaTypeCode is given when there's an invalid addenda type code.
ErrBatchAddendaCategory is the error given when the addenda isn't allowed for the batch's type and category.
ErrBatchAddendaIndicator is the error given when the addenda indicator is incorrectly set.
ErrBatchADVCount is the error given when an ADV batch has too many entries.
ErrBatchAmountNonZero is the error given when an entry for a non-zero amount is in a batch that requires zero amount entries.
ErrBatchAmountZero is the error given when an entry for zero amount is in a batch that requires non-zero amount entries.
ErrBatchCheckSerialNumber is the error given when a batch requires check serial numbers, but it is missing.
ErrBatchCompanyEntryDescriptionAutoenroll is the error given when the Company Entry Description is invalid (needs to be 'Autoenroll').
ErrBatchCompanyEntryDescriptionREDEPCHECK is the error given when the Company Entry Description is invalid (needs to be 'REDEPCHECK').
ErrBatchCORAddenda is given when an entry in a COR batch does not have an addenda98.
ErrBatchDebitOnly is the error given when a batch which can only have debits has a credit.
ErrBatchInvalidCardTransactionType is the error given when a card transaction type is invalid.
ErrBatchNoEntries is the error given when a batch doesn't have any entries.
ErrBatchOriginatorDNE is the error given when a non-government agency tries to originate a DNE.
ErrBatchSECType is the error given when the batch's header has the wrong SEC for its type.
ErrBatchServiceClassCode is the error given when the batch's header has the wrong SCC for its type.
ErrBatchTransactionCode is the error given when a batch has an invalid transaction code.
ErrBatchTransactionCodeAddenda is the error given when a batch has an addenda on a transaction code which doesn't allow it.
ErrBlockingFactor is given when there's an invalid blocking factor.
ErrCardTransactionType is given when there's an invalid card transaction type.
ErrConstructor is given when there's a mandatory field is not initialized correctly, and prompts to use the constructor.
ErrFieldInclusion is given when a field is mandatory and has a default value.
ErrFieldRequired is given when a field is required.
ErrFileAddendaOutsideBatch is the error given if an addenda is outside of a batch.
ErrFileAddendaOutsideEntry is the error given if an addenda is outside of an entry.
ErrFileADVOnly is the error given if an ADV only file has a non-ADV batch.
ErrFileBatchControlOutsideBatch is the error given if a batch control record is outside of a batch.
ErrFileConsecutiveBatchHeaders is the error given when multiple batch header records occur in sequence.
ErrFileControl is the error given if there is the wrong number of file control records.
ErrFileEntryOutsideBatch is the error given if an entry is outside of a batch.
ErrFileHeader is the error given if there is the wrong number of file headers.
ErrFileIATSEC is the error given if an IAT batch uses the normal NewBatch.
ErrFileNoBatches is the error given if a file has no batches.
ErrFileTooLong is the error given when a file exceeds the maximum possible length.
ErrForeignExchangeIndicator is given when there's an invalid foreign exchange indicator.
ErrForeignExchangeReferenceIndicator is given when there's an invalid foreign exchange reference indicator.
ErrFormatCode is given when there's an invalid format code.
ErrIATBatchAddendaIndicator is given when there's an invalid addenda record for an IAT batch.
ErrIdentificationNumber is given when there's an invalid identification number.
ErrIDNumberQualifier is given when there's an invalid identification number qualifier.
ErrNegativeAmount is the error given when an Amount value is negaitve, which is against NACHA rules and guidelines.
ErrNonAlphanumeric is given when a field has non-alphanumeric characters.
ErrOrigStatusCode is given when there's an invalid originator status code.
ErrRecordSize is given when there's an invalid record size.
ErrSECCode is given when there's an invalid standard entry class code.
ErrServiceClass is given when there's an invalid service class code.
ErrTransactionCode is given when there's an invalid transaction code.
ErrTransactionTypeCode is given when there's an invalid transaction type code.
ErrUpperAlpha is given when a field is not in uppercase.
ErrValidDay is given when there's an invalid day.
ErrValidISO3166 is the error given when a field has an invalid ISO 3166-1-alpha-2 code.
ErrValidISO4217 is the error given when a field has an invalid ISO 4217 code.
ErrValidMonth is given when there's an invalid month.
ErrValidState is the error given when a field has an invalid US state or territory.
ErrValidYear is given when there's an invalid year.

# Structs

Addenda02 is a Addendumer addenda which provides business transaction information for Addenda Type Code 02 in a machine readable format.
Addenda05 is a Addendumer addenda which provides business transaction information for Addenda Type Code 05 in a machine readable format.
Addenda10 is an addenda which provides business transaction information for Addenda Type Code 10 in a machine readable format.
Addenda11 is an addenda which provides business transaction information for Addenda Type Code 11 in a machine readable format.
Addenda12 is an addenda which provides business transaction information for Addenda Type Code 12 in a machine readable format.
Addenda13 is an addenda which provides business transaction information for Addenda Type Code 13 in a machine readable format.
Addenda14 is an addenda which provides business transaction information for Addenda Type Code 14 in a machine readable format.
Addenda15 is an addenda which provides business transaction information for Addenda Type Code 15 in a machine readable format.
Addenda16 is an addenda which provides business transaction information for Addenda Type Code 16 in a machine readable format.
Addenda17 is an addenda which provides business transaction information for Addenda Type Code 17 in a machine readable format.
Addenda18 is an addenda which provides business transaction information for Addenda Type Code 18 in a machine readable format.
Addenda98 is a Addendumer addenda record format for Notification OF Change(98) The field contents for Notification of Change Entries must match the field contents of the original Entries.
Addenda99 utilized for Notification of Change Entry (COR) and Return types.
ADVBatchControl contains entry counts, dollar total and has totals for all entries contained in the preceding batch.
ADVEntryDetail contains the actual transaction data for an individual entry.
ADVFileControl record contains entry counts, dollar totals and hash totals accumulated from each batchADV control record in the file.
Batch holds the Batch Header and Batch Control and all Entry Records.
BatchACK is a batch file that handles SEC payment type ACK and ACK+.
BatchADV holds the Batch Header and Batch Control and all Entry Records for ADV Entries The ADV entry identifies a Non-Monetary Entry that is used by an ACH Operator to provide accounting information regarding an entry to participating DFI's.
BatchARC holds the BatchHeader and BatchControl and all EntryDetail for ARC Entries.
BatchATX holds the BatchHeader and BatchControl and all EntryDetail for ATX (Acknowledgment) Entries.
BatchBOC holds the BatchHeader and BatchControl and all EntryDetail for BOC Entries.
BatchCCD is a batch file that handles SEC payment type CCD and CCD+.
BatchCIE holds the BatchHeader and BatchControl and all EntryDetail for CIE Entries.
BatchControl contains entry counts, dollar total and has totals for all entries contained in the preceding batch.
BatchCOR COR - Automated Notification of Change (NOC) or Refused Notification of Change This Standard Entry Class Code is used by an RDFI or ODFI when originating a Notification of Change or Refused Notification of Change in automated format.
BatchCTX holds the BatchHeader and BatchControl and all EntryDetail for CTX Entries.
BatchDNE is a batch file that handles SEC code Death Notification Entry (DNE) United States Federal agencies (e.g.
BatchENR is a non-monetary entry that enrolls a person with an agency of the US government for a depository financial institution.
BatchError is an Error that describes batch validation issues.
BatchHeader identifies the originating entity and the type of transactions contained in the batch (i.e., the standard entry class, PPD for consumer, CCD or CTX for corporate).
BatchMTE holds the BatchHeader, BatchControl, and EntryDetail for Machine Transfer Entry (MTE) entries.
BatchPOP holds the BatchHeader and BatchControl and all EntryDetail for POP Entries.
BatchPOS holds the BatchHeader and BatchControl and all EntryDetail for POS Entries.
BatchPPD holds the Batch Header and Batch Control and all Entry Records for PPD Entries.
BatchRCK holds the BatchHeader and BatchControl and all EntryDetail for RCK Entries.
BatchSHR holds the BatchHeader and BatchControl and all EntryDetail for SHR Entries.
BatchTEL is a batch that handles SEC payment type Telephone-Initiated Entries (TEL) Telephone-Initiated Entries (TEL) are consumer debit transactions.
BatchTRC holds the BatchHeader and BatchControl and all EntryDetail for TRC Entries.
BatchTRX holds the BatchHeader and BatchControl and all EntryDetail for TRX Entries.
BatchWEB creates a batch file that handles SEC payment type WEB.
BatchXCK holds the BatchHeader and BatchControl and all EntryDetail for XCK Entries.
ChangeCode holds a change Code, Reason/Title, and Description table of return codes exists in Part 4.2 of the NACHA corporate rules and guidelines.
CorrectedData is a struct returned from our helper method for parsing the NOC/COR corrected data from Addenda98 records.
ENRPaymentInformation structure.
EntryDetail contains the actual transaction data for an individual entry.
ErrBatchAddendaCount is the error given when there are too many addenda than allowed for the batch type.
ErrBatchAddendaTraceNumber is the error given when the entry detail sequence number doesn't match the trace number.
ErrBatchAmount is the error given when the amount exceeds the batch type's limit.
ErrBatchAscending is the error given when the trace numbers in a batch are not in ascending order.
ErrBatchCalculatedControlEquality is the error given when the control record does not match the calculated value.
ErrBatchCategory is the error given when a batch has entires with two different categories.
ErrBatchExpectedAddendaCount is the error given when the batch type has entries with a field for the number of addenda, and a different number of addenda are foound.
ErrBatchHeaderControlEquality is the error given when the control record does not match the calculated value.
ErrBatchIATNOC is the error given when an IAT batch has an NOC, and there are invalid values.
ErrBatchRequiredAddendaCount is the error given when the batch type requires a certain number of addenda, which is not met.
ErrBatchServiceClassTranCode is the error given when the transaction code is not valid for the batch's service class.
ErrBatchTraceNumberNotODFI is the error given when a batch's ODFI does not match an entry's trace number.
ErrFileBatchNumberAscending is the error given when the batch numbers in a file are not in ascending order.
ErrFileCalculatedControlEquality is the error given when the control record does not match the calculated value.
ErrFileUnknownSEC is the error given when a record does not have a known type.
ErrRecordType is the error given when the field does not have the right record type.
ErrUnknownRecordType is the error given when a record does not have a known type.
ErrValidCheckDigit is the error given when the observed check digit does not match the calculated one.
ErrValidFieldLength is the error given when the field does not have the correct length.
FieldError is returned for errors at a field level in a record.
File contains the structures of a parsed ACH File.
FileControl record contains entry counts, dollar totals and hash totals accumulated from each batch control record in the file.
FileError is an error describing issues validating a file.
FileHeader is a Record designating physical file characteristics and identify the origin (sending point) and destination (receiving point) of the entries contained in the file.
IATBatch holds the Batch Header and Batch Control and all Entry Records for an IAT batch An IAT entry is a credit or debit ACH entry that is part of a payment transaction involving a financial agency's office (i.e., depository financial institution or business issuing money orders) that is not located in the territorial jurisdiction of the United States.
IATBatchHeader identifies the originating entity and the type of transactions contained in the batch for SEC Code IAT.
IATEntryDetail contains the actual transaction data for an individual entry.
Iterator is a data structure for processing an ACH file one entry at a time.
Offset contains the associated information to append an 'Offset Record' on an ACH batch during Create.
Reader reads records from an ACH-encoded file.
RecordWrongLengthErr is the error given when a record is the wrong length.
ReturnCode holds a return Code, Reason/Title, and Description Table of return codes exists in Part 4.2 of the NACHA corporate rules and guidelines.
SegmentFileConfiguration contains configuration setting for sorting during Segment File Creation.
ValidateOpts contains specific overrides from the default set of validations performed on a NACHA file, records and various fields within.
WriteOpts defines options for writing a file.
Writer writes a File to an io.Writer.

# Interfaces

Batcher abstract the different ACH batch types that can exist in a file.
Merge can merge ACH files with custom ValidateOpts.

# Type aliases