CPA-005 File Format: The Complete Guide

Everything you need to know about generating valid CPA-005 files for Canadian banks. No jargon. No confusion. Just clear answers.

Quick summary: CPA-005 is the standard file format Canadian banks accept for batch EFT payments. If you're uploading payment files to your bank, you're probably using CPA-005.

What is CPA-005?

CPA-005 is a fixed-width text file format used to send batch electronic payments through Canadian banks. When you upload a payment file to your bank's business portal, it's almost certainly in CPA-005 format.

The "CPA" stands for Canadian Payments Association (now called Payments Canada). The "005" refers to the specific standard for credit transfers—paying money out to vendors, employees, or other recipients.

In plain English: CPA-005 is the language your bank speaks for batch payments. Your accounting software speaks Excel. CPA-005 is the translator.

CPA-005 vs other formats

Format Country Use
CPA-005 Canada Credits (paying out money)
CPA-080 Canada Debits (collecting money, PADs)
ACH (NACHA) United States Both credits and debits
BACS United Kingdom Direct credits and debits

Important: US ACH guides don't apply in Canada. If you're searching for payment file help and finding US-focused content, that's why it doesn't match your bank's requirements.

Why CPA-005 exists

Before electronic standards, every bank had its own file format. Businesses needed different files for different banks. Payments Canada (formerly CPA) created standard formats so one file structure works across all Canadian financial institutions.

The benefits

  • Universality: Same format works at RBC, TD, BMO, CIBC, Scotiabank, and every other Canadian bank
  • Reliability: Strict structure means fewer errors and rejected payments
  • Efficiency: Batch processing handles hundreds of payments in one file
  • Security: Standardized validation catches problems before money moves

The tradeoff: CPA-005 is strict. Very strict. A single character in the wrong position can cause rejection. That's why tools that validate files before upload are essential.

Who uses CPA-005?

Any Canadian business that sends batch payments electronically:

Common use cases

  • Payroll: Direct deposit for employees
  • Accounts Payable: Vendor and supplier payments
  • Property Management: Owner disbursements
  • Insurance: Claims payouts
  • Government: Benefits and refunds

Who generates the files

  • Payroll software (ADP, Ceridian, etc.)
  • ERP systems (NetSuite, SAP)
  • Accounting software with EFT modules
  • Dedicated EFT tools (like EFT Flow)
  • Custom internal systems

The gap: Many accounting systems (QuickBooks, Sage, Xero) can export payment lists but can't generate CPA-005 directly. That's where conversion tools bridge the gap.

File structure overview

Every CPA-005 file has the same basic structure:

┌─────────────────────────────────────────┐
│ Header Record (Type A)                  │  ← 1 record, identifies the file
├─────────────────────────────────────────┤
│ Detail Record (Type C or D)             │  ← 1 per payment
│ Detail Record (Type C or D)             │
│ Detail Record (Type C or D)             │
│ ... (as many as needed)                 │
├─────────────────────────────────────────┤
│ Trailer Record (Type Z)                 │  ← 1 record, totals and counts
└─────────────────────────────────────────┘

Key characteristics

  • Fixed width: Each record is exactly 1464 characters (padded with spaces)
  • Text format: Plain ASCII text, no special encoding
  • Record types: A = Header, C = Credit, D = Debit, Z = Trailer
  • No delimiters: Fields are position-based, not comma or tab separated

Why 1464 characters? Historical reasons—it matches old mainframe record lengths. Banks haven't changed it because existing systems depend on it.

Header record (Type A)

The header identifies who is sending the file and when. Every file has exactly one header record.

Key fields

Position Length Field Description
1 1 Record Type Always "A"
2 1 Record Count Always "1" for header
3-11 9 Originator ID Your 9-digit ID assigned by Payments Canada
12-15 4 File Creation Number Sequential number (0001-9999)
16-21 6 Creation Date OJJJJJ format (Julian date)
22-30 9 Destination Data Centre Bank's processing centre code
31-50 20 Reserved Spaces (bank-specific use)
51-80 30 Originator Short Name Your company name (appears on statements)

Common error: The Originator ID must be exactly 9 digits, left-padded with zeros if needed. "123456789" is valid. "12345678" will be rejected.

Detail records (Type C/D)

Each payment gets one detail record. Type C = Credit (paying out), Type D = Debit (collecting).

Key fields for credits (Type C)

Position Length Field Description
1 1 Record Type "C" for credit
2-4 3 Transaction Type Usually "200" or "430" (payroll)
5-14 10 Amount In cents, right-justified, zero-filled
15-20 6 Payment Date OJJJJJ format (Julian)
21-29 9 Institution/Transit Bank ID (3 digits) + Transit (5 digits)
30-41 12 Account Number Recipient's account number
42-66 25 Reserved Spaces
67-96 30 Recipient Name Payee name (appears on their statement)

Amount formatting

Amounts are in cents, not dollars. $1,234.56 becomes "0000123456" (10 digits, right-justified, zero-filled).

Common error: Decimal points. The amount field has NO decimal point. If you include one, the file will be rejected or (worse) process the wrong amount.

Institution and transit numbers

The 9-digit bank routing number combines:

  • Institution number (3 digits): Identifies the bank (e.g., 001 = BMO, 003 = RBC, 004 = TD)
  • Transit number (5 digits): Identifies the specific branch

Format: Institution + Transit. Example: "003" + "12345" = "00312345" (with leading zero padding as needed).

Trailer record (Type Z)

The trailer provides totals for validation. Banks compare trailer totals against actual record contents.

Key fields

Position Length Field Description
1 1 Record Type Always "Z"
2-14 14 Total Credit Amount Sum of all credit amounts (in cents)
15-22 8 Total Credit Count Number of credit records
23-36 14 Total Debit Amount Sum of all debit amounts (in cents)
37-44 8 Total Debit Count Number of debit records

Why it matters: If your trailer total doesn't match the sum of detail records, the entire file is rejected. This is a common cause of "file rejected" errors with no clear explanation.

Common CPA-005 errors and fixes

Banks reject files for these reasons most often:

1. Invalid institution/transit number

Symptom: "Invalid routing number" or "Institution not found"

Cause: Wrong bank code, invalid transit, or transposed digits

Fix: Verify against a void cheque or bank statement. Institution must be 3 digits, transit must be 5 digits.

2. Account number format error

Symptom: "Invalid account number"

Cause: Account number too long/short, or contains invalid characters

Fix: Account numbers should be numeric only, 7-12 digits depending on bank. No dashes or spaces.

3. Amount formatting

Symptom: Wrong payment amounts or rejection

Cause: Decimal points included, or amount not in cents

Fix: Convert to cents (multiply by 100), remove decimals, right-justify with leading zeros.

4. Name field issues

Symptom: "Invalid character in name field"

Cause: Special characters (accents, &, @, etc.) or name too long

Fix: Stick to A-Z, 0-9, spaces, and basic punctuation. Truncate to field length.

5. Trailer total mismatch

Symptom: "Control total does not match"

Cause: Sum in trailer doesn't equal sum of detail records

Fix: Recalculate trailer totals. Check for rounding errors in amount calculations.

6. Record length errors

Symptom: "Invalid record length"

Cause: Records not exactly 1464 characters

Fix: Ensure every record is padded with spaces to exactly 1464 characters.

7. Date format errors

Symptom: "Invalid date" or payment not processing

Cause: Date not in Julian format (OJJJJJ) or date in the past

Fix: Convert to Julian. "O" = last digit of year, "JJJJJ" = day of year (001-366).

8. Duplicate file creation number

Symptom: "Duplicate file" rejection

Cause: File creation number (in header) was already used

Fix: Increment the file creation number for each new file. Track what numbers you've used.

Bank-specific requirements

While CPA-005 is a standard, banks have minor variations:

RBC

  • Strict about originator ID format
  • Requires specific destination data centre codes
  • May require file naming conventions

TD

  • Accepts standard CPA-005 format
  • May have specific portal upload requirements
  • Timing cutoffs for same-day processing

BMO

  • Standard 1464-byte format
  • Also accepts shorter DAT format variants
  • Specific test file procedures

CIBC

  • Standard format accepted
  • Portal-specific file size limits
  • Validation reporting available

Note: Contact your bank for their specific documentation. Requirements can change, and some banks have undocumented preferences.

CPA-005 validation checklist

Before uploading, verify:

File structure

  • □ Exactly one header record (Type A)
  • □ One or more detail records (Type C or D)
  • □ Exactly one trailer record (Type Z)
  • □ Every record is 1464 characters
  • □ No blank lines or extra characters

Header record

  • □ Originator ID is 9 digits
  • □ File creation number is unique (not used before)
  • □ Creation date is valid Julian format
  • □ Destination data centre is correct for your bank

Detail records

  • □ Institution numbers are valid (3 digits)
  • □ Transit numbers are valid (5 digits)
  • □ Account numbers are numeric only
  • □ Amounts are in cents, no decimals
  • □ Amounts are right-justified, zero-filled
  • □ Names contain only valid characters
  • □ Payment dates are not in the past

Trailer record

  • □ Credit total matches sum of credit records
  • □ Credit count matches number of credit records
  • □ Debit total matches sum of debit records (if any)
  • □ Debit count matches number of debit records (if any)

Tools for generating CPA-005 files

Options for creating valid CPA-005 files:

Manual creation

Technically possible with a text editor. Not recommended. The strict formatting requirements make errors almost inevitable.

Payroll/ERP systems

Large payroll providers (ADP, Ceridian) and ERP systems (NetSuite, SAP) often have built-in CPA-005 generation. Check your existing software first.

Dedicated EFT tools

Tools like EFT Flow convert your existing payment exports (Excel, CSV) into CPA-005. Useful when your accounting software doesn't generate the right format.

How EFT Flow helps

  • Import any format: Excel, CSV, QuickBooks exports—anything with payment data
  • Map once, reuse: Set up column mapping once, use it for every export
  • Validate before export: Catch errors before your bank does
  • Bank-ready output: Properly formatted CPA-005 files
  • Local processing: Your data never leaves your machine

Summary

CPA-005 is the standard file format for Canadian batch EFT payments. Key points:

  • Fixed-width format: 1464 characters per record
  • Three record types: Header (A), Detail (C/D), Trailer (Z)
  • Amounts in cents, no decimal points
  • Strict validation—small errors cause rejection
  • Universal across Canadian banks (with minor variations)

The format is unforgiving, but tools that validate before upload make it manageable. If you're manually creating these files or wrestling with rejections, there are better ways.

Stop fighting with payment files

EFT Flow converts your existing exports into valid CPA-005 files. Validation catches errors before you upload. No per-transaction fees.