PHPackages                             jeremib/nacha-lib-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jeremib/nacha-lib-php

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jeremib/nacha-lib-php
=====================

PHP Library for creating NACHA files.

v0.1(9y ago)0428↓88.9%1[1 PRs](https://github.com/jeremib/NachaLibPHP/pulls)GNU General Public LicensePHP

Since Jan 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/jeremib/NachaLibPHP)[ Packagist](https://packagist.org/packages/jeremib/nacha-lib-php)[ RSS](/packages/jeremib-nacha-lib-php/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Create NACHA files in PHP
-------------------------

[](#create-nacha-files-in-php)

Supports debit (collecting money from others) and credit (transferring money to others) transactions.

Originally developed by .

Usage:
------

[](#usage)

```
include 'Nacha.php';
$nacha = new NachaFile();
$nacha->setBankRT('123456789')// Your bank's routing number
      ->setCompanyId('9876543210')// Usually your company Fed tax id with something the bank tells you to put on the front.
      ->setSettlementAccount('44444444444') // Your bank account you want the money to go into
      ->setFileID('9876543210')// Probably the same as your Company ID but your bank will tell you what this should be.
      ->setOriginatingBank('BANK ON IT')// Text name of your bank
      ->setFileModifier('A')// Usually just A - for the first file of the day.  Change to 'B' for second file of the day and so on.
      ->setCompanyName('MY COMPANY')//16 chars - your company name
      ->setBatchInfo('Monthly Subscriptions') // Text description for the batch
      ->setDescription('Subscription', '05/17/2012') // Description shown on customers statements and date of invoice
      ->setEntryDate(date('m/d/Y')); // The day you want the payments to be processed. This example shows today.
```

Then push in the customer payments. Each customer record should look like:

```
$payment = array("AccountNumber"=>'1234567', // The customer's CRM account number (not bank account number)
                 "TotalAmount"=>30.00, // Amount they are paying you if it's a debit - or that you're paying them if it's a credit.
                 "BankAccountNumber"=>'123456789', // Customer's bank account number
                 "RoutingNumber"=>'987654321', // Customer's bank routing number
                 "FormattedName"=>'Joe Smith', // Customer's name
                 "AccountType"=> 'CHECKING'); // Could be 'CHECKING' or 'SAVINGS' - customer's bank account type

// Add a debit - taking money from someone and puting it in your account
if(!$nacha->addDebit($payment)){
   // Error adding this debit.  Must be something wrong.  Check the $nacha->errorRecords.
}

// You can safely mix debits and credits in the same batch.
// Add a credit - sending your money to someone elses bank account
if(!$nacha->addCredit($payment)){
   // Error adding this credit.  Must be something wrong.  Check the $nacha->errorRecords.
}

// Generate the NACHA file contents
try{
    $nacha->generateFile();
    // Put the file contents on the file system
    if(!file_put_contents('./ACH_MyCompany_NACHA_file.txt', $nacha->fileContents)){
        throw new Exception('Unable to save NACHA file');
    }
}catch(Exception $e){
    // Something went wrong with the file generation
    print_r($e->getMessage());
}
```

Copyright 2012

Modified by

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3456d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/565742?v=4)[Jeremi Bergman](/maintainers/jeremib)[@jeremib](https://github.com/jeremib)

---

Top Contributors

[![snsparrish](https://avatars.githubusercontent.com/u/819815?v=4)](https://github.com/snsparrish "snsparrish (10 commits)")[![geenasuresh](https://avatars.githubusercontent.com/u/5643268?v=4)](https://github.com/geenasuresh "geenasuresh (3 commits)")[![jeremib](https://avatars.githubusercontent.com/u/565742?v=4)](https://github.com/jeremib "jeremib (2 commits)")[![bradrozier](https://avatars.githubusercontent.com/u/1139192?v=4)](https://github.com/bradrozier "bradrozier (1 commits)")

### Embed Badge

![Health badge](/badges/jeremib-nacha-lib-php/health.svg)

```
[![Health](https://phpackages.com/badges/jeremib-nacha-lib-php/health.svg)](https://phpackages.com/packages/jeremib-nacha-lib-php)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
