FinchContext
Run with

Build a CPA-005 EFT Payment File

Skill: Convert a payment batch into a CPA Standard 005 EFT file

Region: Canada Category: Payments — Automated Funds Transfer (AFT) / EFT Does: Takes a batch of payment instructions (payroll deposits, supplier payments, pre-authorized debits) and produces the CPA Standard 005 Electronic Funds Transfer (EFT/AFT) file — the fixed-width record file made up of an A (header), one or more C (credit) and/or D (debit) detail records, and a Z (trailer), that an originator uploads to its financial institution for clearing through Payments Canada's Automated Clearing Settlement System (ACSS). Standard: Payments Canada (CPA) Standard 005 — Standards for the Exchange of Financial Data on AFT Files

This is a fixed-width flat file, not XML or JSON: every field sits at an exact column position inside a 1464-character logical record and is space- or zero-padded. Most financial institutions layer their own profile on top of CPA-005 (file naming, originator/data-centre numbers, record-length and segment-count limits, allowed transaction codes, test vs. production flags). Always validate against your FI's AFT/EFT specification before transmitting — column rules below follow the base CPA-005 standard but FI variations are common.


When this applies


Conversion procedure

  1. Read the source. Accept a CSV/JSON/spreadsheet payment register, or pasted key-value text. Each row is one payment: payee name, institution number, transit (branch) number, account number, amount, due/payment date, and credit-vs-debit direction. Header-level inputs (originator number, originator short name, file creation number, return institution/transit/account, currency) are supplied once.
  2. Extract fields. Pull every value in the field map below. If the originator number, an institution/transit/account, an amount, or the due date is missing or ambiguous, stop and ask — never invent a transit or account number.
  3. Normalize identifiers. Strip hyphens/spaces from institution, transit, and account numbers. Institution number = 3 digits; transit (branch) = 5 digits; together they form the 9-digit routing point. Right-justify the account number and zero-fill to 12 positions. Upper-case and pad/truncate names to their fixed widths.
  4. Convert amounts to cents. Amounts are whole cents with no decimal point: $1,234.560000000123456 (10 digits, zero-filled). Never write a dollar sign, comma, or period.
  5. Encode the due date in Julian. The due (payment) date is 0YYDDD — a leading 0, the last two digits of the year, and the 3-digit day-of-year (001–366). Same format for the file creation date in the header.
  6. Assemble the records. One A header, then C/D detail records (each detail record holds up to 6 transaction segments), then one Z trailer. Number every logical record sequentially. Reference the document structure and worked example as the template.
  7. Compute the trailer. Sum the credit count/value and debit count/value across all detail segments and write them into the Z record. Reference the calculation rules.
  8. Validate. Work through the validation checklist; confirm record length and against your FI's AFT spec before upload.

Source → CPA-005 field map

A — File Header record (one per file)

From the source → A-record field (position)
Logical record type = A Record Type, pos 1
Sequence number 0000000001 Logical Record Count, pos 2–10
Originator (client) number Originator's Account / Client Number, pos 11–20
File creation number (sequential per file) File Creation Number, pos 21–24
File creation date → 0YYDDD Creation Date (Julian), pos 25–30
FI data-centre / destination number Destination Data Centre, pos 31–35
(reserved / FI-defined) Reserved, pos 36–1464

C — Credit detail record / D — Debit detail record (repeatable; up to 6 segments each)

From the source → Detail-segment field
Record type C (credit) or D (debit) Record Type, pos 1
Sequence number Logical Record Count, pos 2–10
Originator (client) number Originator's Client Number, pos 11–20
File creation number File Creation Number, pos 21–24
Transaction (CPA) code Transaction Type Code (first field of each segment)
Amount in cents (10 digits) Amount
Due/payment date → 0YYDDD Due Date (Julian)
Institution number (3) + transit (5) Payee/Payor Institution + Transit
Bank account number (≤12, right-justified) Account Number
Originator short name Originator's Short Name
Payee/payor name Payee/Payor Name
Originator (long) name Originator's Long Name
Originator-assigned reference / cross-ref Originator's Reference Number / Cross-Reference No.
Return institution + transit + account Institution/Transit/Account for Returns

Z — File Trailer record (one per file)

From the source → Z-record field (position)
Record type Z Record Type, pos 1
Sequence number Logical Record Count, pos 2–10
Originator (client) number Originator's Client Number, pos 11–20
File creation number File Creation Number, pos 21–24
Σ debit amounts (cents, 14 digits) Total Value of Debit Transactions
Count of debit transactions (8 digits) Total Number of Debit Transactions
Σ credit amounts (cents, 14 digits) Total Value of Credit Transactions
Count of credit transactions (8 digits) Total Number of Credit Transactions

Document structure

CPA-005 AFT FILE  (each logical record = 1464 characters)
├── A  File Header record            (exactly one, first)
│     record type · seq · originator no. · file creation no. · creation date (Julian) · destination DC
├── C  Credit detail record(s)       (zero or more — money OUT to payees, e.g. payroll/vendor)
│     │  header fields (type · seq · originator no. · file creation no.)
│     └── 1–6 transaction segments, each:
│          txn code · amount (cents) · due date (Julian) · institution · transit · account
│          · originator short name · payee name · originator long name · reference · return inst/transit/acct
├── D  Debit detail record(s)        (zero or more — money IN, e.g. pre-authorized debits)
│     └── same segment layout as C (1–6 segments per record)
└── Z  File Trailer record           (exactly one, last)
      record type · seq · originator no. · file creation no. · total debit value/count · total credit value/count

Code tables

Record types

Code Record
A File header (logical record 1)
C Credit (forward) detail — money paid to a payee
D Debit detail — money pulled from a payor (pre-authorized debit)
Z File trailer (totals)

Transaction (CPA) codes — selected

Code Meaning
200 Payroll deposit (regular)
230 Pension
250 Dividends
300 Vendor / supplier payment (business payable)
330 Annuity
430 Pre-authorized debit — insurance
450 Pre-authorized debit — utilities / regular bill payment
460 Pre-authorized debit — recurring (other)
470 Federal government payment

Transaction codes are 3-digit CPA codes; the full list lives in CPA Standard 007 / your FI's AFT spec. Use the code your FI maps to the payment's purpose — credits (200–299) on C records, debits (400–499) on D records, government codes per the FI.

Routing components

Component Width Notes
Institution number 3 e.g. 001 RBC, 002 BMO, 003 Scotiabank, 004 TD, 006 National Bank, 010 CIBC, 016 HSBC, 815 Desjardins
Transit (branch) number 5 the branch's MICR transit
Account number ≤12 right-justified, zero-filled to field width

Calculation rules


Worked example (end-to-end)

Originator ACME PAYROLL (client number 0123456789, short name ACME PAY), file creation number 0001, file created 2026-03-13 (day 072 → Julian 026072), destination data centre 00510. One payroll credit (txn code 200) of $2,500.00 due 2026-03-16 (day 075 → 026075) to JANE Q SAMPLE, account 001-12345-000123456789, with return account 001-12345-000999888777.

The trailer reports 1 credit transaction totalling 250000 cents, 0 debits.

A000000001012345678900010260720051000000000000000000000000000000000000000000000000000000000000000000
C000000002012345678900010002000000250000026075001123450001234567890000ACME PAY       JANE Q SAMPLE                 ACME PAYROLL                  PAYRUN-2026-06          0011234500009998887770000000000000000000000000
Z000000003012345678900010000000000000000000000000000000025000000000001000000000000000000000000000000

Field walk-through (key positions):

Normalisations shown: $2,500.000000250000 (cents, no separators); 2026-03-16 → Julian 026075; account 123456789000123456789 (right-justified, 12); names upper-cased and space-padded; institution/transit zero-padded to 001/12345. (The blocks above are illustrative widths; the real record is exactly 1464 characters — pad each field to its FI-specified column before upload.)


Validation checklist


Last updated: 2026-06-13 — verify the CPA Standard 005 record layout, transaction-code list, and your financial institution's AFT/EFT file specification (record length, field positions, originator/data-centre numbers, cut-off times) before use.