Skip to content

moov-io/fincen

Repository files navigation

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

fincen

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.

Moov's fincen project implements a reader, writer, and validator for Fincen BSA forms in an HTTP server and Go library.

Fincen (Financial crimes enforcment network) BSA data transmission methods for the the BSA E-Filing System.

A go library for reading and writing Fincen BSA forms. It is capable of generating, validating, and batching submissions.

The HTTP server is available in a Docker image and the Go package github.com/moov-io/fincen is available.

Table of contents

Project status

The project is Fincen which is a financial reporting for the United States.

There are many forms that are required in this project. Now implemented XML forms only in following link. (Non XML form will implement in another sub project) https://bsaefiling.fincen.treas.gov/FilingInformation.html

The final phase of the project will be a service that collects fillings and then on a scheduled time will batch the fillings and submit them electronically. https://bsaefiling.fincen.treas.gov/docs/SDTMRequirements.pdf

Supported Forms

  • FinCEN Currency Transaction Report (FinCEN Report 112)
  • FinCEN Designation of Exempt Person (FinCEN Report 110)
  • FinCEN Suspicious Activity Report (FinCEN Report 111)
  • Report of Foreign Bank and Financial Accounts (FinCEN Report 114)
  • Report of Cash Payments Over $10,000 Received in a Trade or Business (FinCEN Form 8300)

Usage

The Fincen project implements an HTTP server and Go library for creating and modifying Fincen BSA forms.

Docker

We publish a public Docker image moov/fincen on Docker Hub with every tagged release of Fincen.

Pull & start the Docker image:

docker pull moov/fincen:latest
docker run -p 8206:8206 -p 8207:8207 moov/fincen:latest

Validate a file on the HTTP server:

curl -X POST --data-binary "@./data/samples/ctr_batch.txt" http://localhost:8088/validator
{"status":"valid file"}

Reformat the file with generated attributes:

curl -X POST --data-binary "@./data/samples/ctr_batch.txt" http://localhost:8088/reformat
<EFilingBatchXML ActivityCount="1" TotalAmount="47000" PartyCount="6" SeqNum="1"
                     xsi:schemaLocation="www.fincen.gov/base https://www.fincen.gov/base https://www.fincen.gov/base/EFL_8300XBatchSchema.xsd"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:fc2="www.fincen.gov/base">
    <Activity SeqNum="1">
...

Google Cloud Run

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-fincen-demo

Enable the Container Registry API for your project and associate a billing account if needed. Then, open the Cloud Shell terminal and run the following Docker commands, substituting your unique project ID:

docker pull moov/fincen
docker tag moov/fincen gcr.io/<PROJECT-ID>/fincen
docker push gcr.io/<PROJECT-ID>/fincen

Deploy the container to Cloud Run:

gcloud run deploy --image gcr.io/<PROJECT-ID>/fincen --port 8206

Select your target platform to 1, service name to fincen, and region to the one closest to you (enable Google API service if a prompt appears). Upon a successful build you will be given a URL where the API has been deployed:

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

Now you can list files stored in-memory:

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

You should get this response:

null

Go library

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.

$ git@github.com:moov-io/fincen.git

$ go get -u github.com/moov-io/fincen

The package github.com/moov-io/fincen offers a Go-based Fincen file reader and writer.

Build report form

Creating XML Batch Reporting form

Fincen project used general XML batch reporting form struct. Available types are "SUBMISSION", "CTRX", "SARX", "DOEPX", "FBARX", "8300X"

// create report with type
newReport := NewReport(fincen.ReportSubmission)

Adding activities by each type

Activity should add into the form struct using sub package

// create activity (ctr)
var newActivity currency_transaction.ActivityType

...
setting newActivity
...

err := newReport.AppendActivity(&newActivity)

Generating new xml attributes

err = newReport.GenerateAttrs()

Validating report form

err = newReport.Validate()

Command Line

The fincen binary on each release can be used on the command line.

Work seamlessly with Fincen BSA form from the command line.

Usage:
  fincen <command> [flags]

Available commands:
  summary: display form summary
  validate: validate financial report form
  reformat: reformat financial report for

In-browser Fincen form parser

Using our in-browser utility, you can instantly verify and reformat Fincen BSA forms.

Learn about Fincen

FAQ

Is there an in-browser tool? Yes! You can find our browser utility at http://oss.moov.io/fincen/.

Getting help

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

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!

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.

License

Apache License 2.0 - See LICENSE for details.