• Stars
    star
    425
  • Rank 98,276 (Top 2 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ACH implements a reader, writer, and validator for Automated Clearing House (ACH) files. The HTTP server is available in a Docker image and the Go package is available.

Moov Banner Logo

Project Documentation ยท API Endpoints ยท API Guide ยท Community ยท Blog

GoDoc Build Status Coverage 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 Variable Description Default
ACH_FILE_TTL Time to live (TTL) for *ach.File objects stored in the in-memory repository. 0 = No TTL / Never delete files (Example: 240m)
LOG_FORMAT Format for logging lines to be written as. Options: json, plain - Default: plain
HTTP_BIND_ADDRESS Address for ACH to bind its HTTP server on. This overrides the command-line flag -http.addr. Default: :8080
HTTP_ADMIN_BIND_ADDRESS Address for ACH to bind its admin HTTP server on. This overrides the command-line flag -admin.addr. Default: :9090
HTTPS_CERT_FILE Filepath containing a certificate (or intermediate chain) to be served by the HTTP server. Requires all traffic be over secure HTTP. Empty
HTTPS_KEY_FILE Filepath 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 Code Description Example Read Write
ACK Acknowledgment Entry for CCD Credit ACK Read ACK Write
ADV Automated Accounting Advice Prenote Debit ADV Read ADV Write
ARC Accounts Receivable Entry Debit ARC Read ARC Write
ATX Acknowledgment Entry for CTX Credit ATX Read ATX Write
BOC Back Office Conversion Debit BOC Read BOC Write
CCD Corporate credit or debit Debit CCD Read CCD Write
CIE Customer-Initiated Entry Credit CIE Read CIE Write
COR Automated Notification of Change(NOC) NOC COR Read COR Write
CTX Corporate Trade Exchange Debit CTX Read CTX Write
DNE Death Notification Entry DNE DNE Read DNE Write
ENR Automatic Enrollment Entry ENR ENR Read ENR Write
IAT International ACH Transactions Credit IAT Read IAT Write
MTE Machine Transfer Entry Credit MTE Read MTE Write
POP Point of Purchase Debit POP Read POP Write
POS Point of Sale Debit POS Read POS Write
PPD Prearranged payment and deposits Debit Credit PPD Read PPD Write
RCK Represented Check Entries Debit RCK Read RCK Write
SHR Shared Network Entry Debit SHR Read SHR Write
TEL Telephone-Initiated Entry Debit TEL Read TEL Write
TRC Truncated Check Entry Debit TRC Read TRC Write
TRX Check Truncation Entries Exchange Debit TRX Read TRX Write
WEB Internet-initiated Entries Credit WEB Read WEB Write
XCK Destroyed Check Entry Debit XCK Read XCK Write
Segment Files
SEC Code Name Example Read Write
IAT International ACH Transactions Credit IAT Read IAT Write
PPD Prearranged payment and deposits Debit Credit PPD Read PPD 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.

channel info
Project Documentation Our project documentation available online.
Twitter @moov You 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 Issue If you are able to reproduce a problem please open a GitHub Issue under the specific project that caused the error.
moov-io slack Join 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. Current overall coverage can be found on Codecov.

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.

More Repositories

1

watchman

AML/CTF/KYC/OFAC Search of global watchlist and sanctions
Go
305
star
2

iso8583

A golang implementation to marshal and unmarshal iso8583 message.
Go
287
star
3

paygate

A RESTful API enabling electronic payments to be submitted and received without a deep understanding payment file specification
Go
130
star
4

awesome-fintech

A curated collection of open source fintech libraries and resources.
118
star
5

metro2

Open Source Metro 2 consumer credit history report for credit report file creation and validation
Go
85
star
6

fed

Fuzzy FedACH and FedWire ABA Routing Number and Bank Name Lookup.
Go
80
star
7

wire

FedWire funds service file parser and writer. The HTTP server is available in a Docker image and the Go package is available.
Go
74
star
8

customers

Customer registry supporting Know Your Customer (KYC), Customer Identification Program (CIP), and OFAC checks
Go
65
star
9

imagecashletter

X9โ€™s Specifications for ICL (Image Cash Letter) to provide Check 21 services. The HTTP server is available in a Docker image and the Go package is available.
Go
57
star
10

terms-dictionary

Simple definitions of terms, acronyms, abbreviations, companies, and projects related to financial services and Moov.
56
star
11

iso20022

Enabling ISO 20022 standards in the Go programming language
Go
55
star
12

achgateway

Payment gateway enabling automated ACH operations in a distributed and fault tolerant way.
Go
49
star
13

signedxml

pure go library for processing signed XML documents
Go
48
star
14

accounts

accounts - General Ledger and financial account service with an HTTP API
Go
45
star
15

irs

Internal Revenue Service (IRS) Filing Information Returns Electronically (FIRE)
Go
40
star
16

go-sftp

A Go client for performing common SFTP operations
Go
33
star
17

iso8583-connection

๐Ÿ“ก Go-powered ISO8583 connection handler offering advanced binary framing, message interleaving, and a robust connection pool for load distribution and seamless reconnections.
Go
33
star
18

rtp20022

ISO20022 messages in Go for Real Time Payments (RTP)
Go
30
star
19

infra

Infrastructure setup for OSS moov.io and Moov Financial
Shell
23
star
20

cryptfs

Implementation of io/fs.FS that transparently encrypts and decrypts files
Go
15
star
21

ruby-ach-demo

Automated Clearing House (ACH) demo in ruby
Ruby
15
star
22

base

core libraries used in Moov projects
Go
15
star
23

ach-node-sdk

Generated Typescript SDK for the moov-io/ach service
TypeScript
14
star
24

fincen

Fincen BSA E-Filing forms
Go
14
star
25

ach-test-harness

Programmatic and configurable ACH scenario testing of returns, NOC/corrections, reconciliation, etc.
Go
14
star
26

ach-node-example

TypeScript
12
star
27

bai2

BAI2 file format is a cash management balance reporting standard
Go
11
star
28

ach-web-viewer

Web interface for viewing ACH files in a variety of sources (filesystem, GCS buckets, etc)
Go
9
star
29

fintech-devcon-agenda

The official Fintech DevCon 2021 schedule
9
star
30

compliance

Open Source templates for polices, procedures, and narratives.
Shell
6
star
31

1120x

XSLT
5
star
32

bankcron

CLI wrapper to only run commands on banking days
Go
5
star
33

charts

Kubernetes Helm Charts for the Moov ecosystem
Mustache
4
star
34

x12

ASC X12 standards reader/writer
Go
4
star
35

pinblock

Personal Identification Number (PIN) management and security in financial services.
Go
4
star
36

fintech-FAQs

A place to ask and answer common questions about building a fintech offering
3
star
37

iso4217

๐Ÿ’ฐ Golang package providing ISO 4217 currency data and validation, facilitating efficient currency lookup via alpha and numeric codes.
Go
3
star
38

dukpt

ANSI X9.24 DUKPT libraries and tools
Go
3
star
39

cadeft

Canadian Payments Association CPA-005 Layout - 1464 byte file
Go
3
star
40

check-imaging

Python
2
star
41

moov-slack-code-of-conduct

The code of conduct for participating in the Moov slack community
2
star
42

fips-state-codes

Go
2
star
43

homebrew-comply-fork

Homebrew tap for Comply
Ruby
1
star