一、什么是 ACH、NACHA
自动清算所(ACH)网络是由 NACHA 运行的电子资金转移系统,以前称为全国自动票据交换所协会 ,1974 年至今。该支付系统提供 ACH 交易,用于美国的工资单、直接存款、退税、消费账单、纳税以及更多支付服务。
关键要点
-
自动清算所(ACH)是一个电子资金转移系统,它为美国的支付提供便利。
-
ACH 由国家自动化信息交换所协会(NACHA)管理。
最近的规则变化使得通过 ACH 进行的大多数借贷交易能够在同一个工作日进行清算。
ACH 网络的工作原理
NACHA 是一个自我调节的机构,它为 ACH 网络提供管理、开发、管理和规则。本组织的业务规则旨在促进网络内电子支付规模和范围的增长。
ACH 网络是一个电子系统,为金融机构提供服务,以促进美国的金融交易。它代表了 1 万多家金融机构,2019 年 ACH 交易总额超过 55 万亿美元,实现了近 250 亿次电子金融交易。
ACH 网络本质上是一个金融中心,帮助人们和组织将资金从一个银行账户转移到另一个账户。ACH 交易包括直接存款和直接支付,包括企业对企业 (B2B)交易和消费者交易。
发起人使用 ACH 网络启动直接存款或直接支付交易。发起人可以是个人、组织或机构,ACH 交易可以是借方或贷方。发端人的银行,也被称为发端存款金融机构(ODFI),将 ACH 交易和其他 ACH 交易一起分批,在一天中的固定时间发送出去。
ACH 运营商(美联储或票据交换所)从 ODFI 接收 ACH 交易批,包括发起人的交易。ACH 操作员对批量进行排序,并将交易提供给预期接收方的银行或金融机构,也称为接收方存款金融机构(RDFI)。接收者的银行账户接收交易,从而对两个账户进行对账并结束流程。
ACH 网络的好处
由于 ACH 网络将金融交易集中在一起,并在一天中以特定的时间间隔进行处理,因此它使在线交易变得非常快速和简单。NACHA 规则规定平均 ACH 借方交易在一个工作日内结算,平均 ACH 贷方交易在一到两个工作日内结算。
NACHA 操作规则的更改将扩大对当日 ACH 交易的访问,这将允许在 2021 年 3 月 19 日之前对大部分(如果不是全部)ACH 交易进行当日结算。
利用 ACH 网络来方便电子转账 货币流通也提高了商业交易的效率和及时性。最近,ACH 转账使个人通过直接存款转账或电子支票直接从银行账户向对方汇款变得更容易、更便宜。
个人银行服务的 ACH 通常需要两到三个工作日才能清算资金,但从 2016 年开始,NACHA 分三个阶段进行同日 ACH 结算。第 3 阶段 该协议于 2018 年 3 月推出,要求 RDFI 在交易结算日的 RDFI 当地时间下午 5 点之前,向接收方提供当日 ACH 贷记和借记交易以供提取,但须遵守 NACHA 规则下的返还权。
二、ACH 解析规则
解析util:ach文件解析案例: ach文件解析案例
ACH NACHA 文件是固定宽度的 ASCII 文本文件,宽度为 94 个字符。
必须为 94 个字符,如果有字段没有占用足够的长度则用空格填充;如果超过则进行截取。
其中每行的第一个字符代表的含义如下:
1 - File Header:文件头
5 - Batch Header:批次头
6 - Transactions:交易
7 - Addenda record (optional):附录(可选)
8 - Batch Footer:批次尾
9 - File Footer:文件尾
一个文件中只能有一个文件头,一个文件尾,但是可以有多个批次头,多个批次尾,每个批次中又可以包含多个交易信息
示例:
行解析规则
2.1、文件头(1)、尾(9)解析规则
注:填充记录 - 灰色部分:
ACH 文件需要以 10 条记录的倍数创建。
在这个示例中,有 9 条记录,包括用黄色标注的文件页眉和页脚。在这种情况下,我们需要添加一个额外的填充记录(99999…),使文件包含 10 个记录的倍数。
因此,ACH 可以具有从没有填充(99999…)到 9 个填充记录的任意位置。
文件 头解析(1)
File Header (1 record) | |||||
Positions | Length | Name | Contents | Description | 备注 |
1-1 | 1 | Record Type Code | 1 | Constant | 行类型 |
2-3 | 2 | Priority Code | 01 | Constant | 优先码 |
4-13 | 10 | Immediate Destination | bNNNNNNNNNN | Typically your bank's 9 digit ABA Routing number, preceding with a blank space. Determined by your bank. | 发报行 ABA 前面有一个空格 |
14-23 | 10 | Immediate Origin | Numeric | Typically a "1" + your Federal ID number. Determined by your bank. | 汇款方 company ID |
24-29 | 6 | File Creation Date | YYMMDD | Must be in YYMMDD format | 文件创建日期 |
30-33 | 4 | File Creation Time | HHMM | Must be in HHMM format (use 24 hour format) | 文件创建时间 |
34-34 | 1 | File ID Modifier | Alphanumeric | Alphanumeric field, upper-case A-Z and 0-9 allowed. Start with A and increment for each file created during the calendar day. | 文件调节器 字母 (A-Z) 或者数字 |
35-37 | 3 | Record Size | 094 | Constant | 行大小 |
38-39 | 2 | Blocking Factor | 10 | Constant | |
40-40 | 1 | Format Code | 1 | Constant | 格式 |
41-63 | 23 | Immediate Destination Name | Alphanumeric | Enter your bank's name | 银行名称 |
64-86 | 23 | Immediate Origin Name | Alphanumeric | Enter your company's name | 公司名称 |
87-94 | 8 | Reference Code | Blank | 8 blank spaces - constant | 填充数据 |
文件尾解析(9)
File Footer (9 record) | |||||
Positions | Length | Name | Contents | Description | 备注 |
1-1 | 1 | Record Type Code | 9 | Constant | 记录头 |
2-7 | 6 | Batch Count | Numeric | Number of batches in file | 批次数 |
8-13 | 6 | Block Count | Numeric | Number of blocks in file (10 records = 1 block) | 块数(10 行一个块) |
14-21 | 8 | Entry/Addenda Count | Numeric | Number of detail entry (transactions) and addenda records within the file. | 交易数 + 附录数 |
22-31 | 10 | Entry Hash | Numeric | Sum of the receiving DFI ID (first 8 digits of the other party's ABA routing number) for each entry/transaction within the file. If the sum exceeds 10 places, use the rightmost 10 digits. | 文件中每个条目 / 事务的接收 DFI ID(另一方 ABA 路由号的前 8 位)的总和。如果总和超过 10 位,请使用最右边的 10 位数字。 |
32-43 | 12 | Total Debit Entry Dollar Amount | Numeric | Total debits for the file. No decimal. | 借方总金额(没有小数) |
44-55 | 12 | Total Credit Entry Dollar Amount | Numeric | Total credits for the file. No decimal. | 贷方总金额(没有小数) |
56-94 | 39 | Reserved | Blank | Constant | 填充数据 |
2.2、批次头(5)、尾(8)解析
批次头(5)解析
Batch Header (5 record) | |||||
Positions | Length | Name | Contents | Description | 备注 |
1-1 | 1 | Record Type Code | 5 | Constant | 行类型 |
2-4 | 3 | Service Class Code | 200 220 225 | Represents whether the batch contains: 200 Both Debits and Credits, mixed 220 Credits 225 Debits | 表示批是否包含: 200 Debits 和 Credits 都有 220 Credits 225 Debits |
5-20 | 16 | Company Name | Alphanumeric | Your company name. Often the same as the Immediate Origin Name in the file header. PRINTED - This value will appear on the other party's bank statement | 汇款方名称 |
21-40 | 20 | Company Discretionary Data | Alphanumeric | Optional. May be instructed by your bank. Otherwise (typically), leave blank | |
41-50 | 10 | Company Identification | Numeric | Typically a "1" + your Federal ID number. Determined by your bank. Often the same as the Immediate Origin ID in the file header. No hyphen, numbers only. | 汇款方账号 |
51-53 | 3 | Standard Entry Class Code (SEC) | PPD, CCD | 3 letter mnemonic which identifies the batch and its' layout. PPD - used if the other party is an individual (ie. payroll) CCD - used if the other party is a corporate account (ie. vendor payments and customer collections). Other values (not part of this layout/sample) include ARC, BOC, CTX, IAT, TEL and WEB. | 可用 PPD(个人)、CCD(企业)区分收款方类型 |
54-63 | 10 | Company Entry Description | Alphanumeric | A description as to the general nature of the transactions to help the other parties identify the purpose. Examples: Payroll, Payables, etc... PRINTED - This value will appear on the other party's bank statement | 汇款附言 |
64-69 | 6 | Company Descriptive Date | Alphanumeric, often YYMMDD | Optional. Descriptive date - often in YYMMDD with the same value as the effective date. Useful in recurring transaction scenarios, such as payroll. PRINTED - This value may appear on the other party's bank statement | |
70-75 | 6 | Effective Entry Date | YYMMDD | Effective / transaction date. Date the other party is to be debited or credited. | 到账日期 |
76-78 | 3 | Reserved | Blank | Julian Settlement Date - left blank. Will be filled in by your bank. | |
79-79 | 1 | Originator Status Code | 1 | Constant | |
80-87 | 8 | Originating DFI ID | Numeric | Enter the first 8 digits of your ABA routing number | 汇款方 ABA 前 8 位 |
88-94 | 7 | Batch Number | Numeric | Start with 00000001 and increment by 1 for each batch. | 批次号 |
批次尾(8)解析
Batch Footer (8 record) | |||||
Positions | Length | Name | Contents | Description | |
1-1 | 1 | Record Type Code | 8 | Constant | 行类型 |
2-4 | 3 | Service Class Code | 200 220 225 | Represents whether the batch contains: 200 Both Debits and Credits, mixed 220 Credits 225 Debits Must match the entry in the batch header. | 表示批是否包含: 200 Debits 和 Credits 都有 220 Credits 225 Debits |
5-10 | 6 | Entry/Addenda Count | Numeric | Number of detail entry (transactions) and addenda records within the batch. | |
11-20 | 10 | Entry Hash | Numeric | Sum of the receiving DFI ID (first 8 digits of the other party's ABA routing number) for each entry/transaction within the batch. If the sum exceeds 10 places, use the rightmost 10 digits. | |
21-32 | 12 | Total Debit Entry Dollar Amount | Numeric | Total debits for the batch. No decimal. | |
33-44 | 12 | Total Credit Entry Dollar Amount | Numeric | Total credit for the batch. No decimal. | |
45-54 | 10 | Company Identification | Numeric | Typically a "1" + your Federal ID number. Determined by your bank. Must match the entry in the batch header. | |
55-73 | 19 | Message Authentication Code | Blank | Blank | |
74-79 | 6 | Reserved | Blank | Blank | |
80-87 | 8 | Originating DFI ID | Numeric | Enter the first 8 digits of your ABA routing number Must match the entry in the batch header. | |
88-94 | 7 | Batch Number | Numeric | Start with 00000001 and increment by 1 for each batch. Must match the entry in the batch header. |
2.3、交易(6)解析
Entry Detail / Transaction (6 record) | |||||
Positions | Length | Name | Contents | Description | 备注 |
1-1 | 1 | Record Type Code | 6 | Constant | 行类型 |
2-3 | 2 | Transaction Code | 22 32 27 37 etc... | For credit (ie. payroll, vendor payments) transactions: 22 Checking account 32 Savings account For debit (ie. collections from a customers) transactions: 27 Checking account 37 Savings account For pre-notes: 23/28 for checking credit/debit 33/38 for savings debit/credit See ACH Rules for additional codes. | 交易及收款账户类型。credit 汇入,debit 汇出。 |
4-11 | 8 | Receiving DFI ID | Numeric | First 8 digits of the other party's ABA routing number | 收款行 ABA 前 8 位 |
12-12 | 1 | Check Digit | Numeric | Last digit of the other party's ABA routing number | 收款行 ABA 第 9 位 |
13-29 | 17 | DFI Account Number | Alphanumeric | Other party's account number. Note: This is an alphanumeric field and should be left justified. | 收款方账号 |
30-39 | 10 | Amount | Numeric | Transaction amount. No decimal. | 金额(无小数位),已乘 100。 |
40-54 | 15 | Identification Number | Alphanumeric | Optional. Helps the receiver (other party) identify themselves within your system, should they need to contact you. Typically their account number. PRINTED - This value may appear on the other party's bank statement | |
55-76 | 22 | Receiving Company Name | Alphanumeric | The other party's company name (in CCD) - or if a consumer transaction (in PPC) such as payroll, the individual's name. | 收款方名称 |
77-78 | 2 | Discretionary Data | Alphanumeric | Typically blank, unless instructed otherwise by your bank. | |
79-79 | 1 | Addenda Record Indicator | 0 or 1 | 0 - No addenda following 1 - Addenda following | 是否有附录 |
80-94 | 15 | Trace Number | Numeric | The first 8 digits of your Originating DFI number, followed by the entry detail sequence number, | 交易号 |
2.4、附录(7)解析
Addenda Record - optional (7 record) | |||||
Positions | Length | Name | Contents | Description | 备注 |
1-1 | 1 | Record Type Code | 7 | Constant | |
2-3 | 2 | Addenda Type Code | 05 | Constant. Only valid value for CCD and PPD originations. Other SEC codes can contain other values. | |
4-83 | 80 | Payment Related Information | Alphanumeric | Invoice or other remittance information specific to the entry detail / transaction. PRINTED - This value may appear on the other party's bank statement Note: Do NOT rely on the other party obtaining this information. Most bank's require an election for additional services to receive this. | 其他汇款信息 |
84-87 | 4 | Addenda Sequence Number | 0001 | As PPD and CCD codes only support 1 addenda record, this will always be 0001. | |
88-94 | 7 | Entry Detail Sequence Number | Numeric | This 7 digit field contains the last 7 digits of the related (preceding) entry detail / transaction record's trace number. |
三、ABA 校验位补全规则
由于 NACHA 文件中包含的汇款行 ABA 仅提供 8 位,第 9 位校验位需根据算法计算得出。详细规则如下:
例如此 ABA 号前八位 02100002,需计算第 9 位。
-
计算如下公式:第 1 位乘 3,第二位乘 7,第三位乘 1,第四位乘 3,第五位乘 7,第六位乘 1,第七位乘 3,第八位乘 7;
-
之后将以上乘积结果相加后,得到总和为 (0 x 3) + (2 x 7) + (1 x 1) + (0 x 3) + (0 x 7 ) + (0 x 1) + (0 x 3) + (2 x 7) = 29;
-
找到大于该总和最近的能被 10 整除的数字,此示例中为 30;
-
用该数字减去乘积总和即可得到校验位数字,此示例即为 30-29=1;
-
若乘积总和可被 10 整除,则校验位数字为 0。