# CPA 005 File Generator: Excel or CSV to Canadian EFT File (`hardreset83/cpa-005-file-generator`) Actor

Create the CPA 005 file (AFT, often called EFT file) for payroll and supplier payments by direct deposit, or for pre-authorized debits, from an Excel, CSV or JSON list, ready to upload to your Canadian online banking. Every row is checked first.

- **URL**: https://apify.com/hardreset83/cpa-005-file-generator.md
- **Developed by:** [Flavio D'Orio](https://apify.com/hardreset83) (community)
- **Categories:** Business, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$20.00 / 1,000 payment in the cpa 005 files

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CPA 005 File Generator: Excel or CSV to Canadian EFT File

Still typing payroll or supplier payments one by one into your business online banking? This Actor creates the
**CPA 005 file** (AFT, Automated Funds Transfer, often called **EFT file** or direct deposit file) from an **Excel,
CSV or JSON** list, and you upload it to your Canadian bank in one go to pay everyone at once, or to collect
pre-authorized debits. Every row is **checked first**: institution and transit number, account number, name, amount,
date and transaction code, on the **calendar of the Canadian payments system**. Rows with a mistake never reach the
bank: you find them in an **Excel** report, with the row of your list and the problem in plain words.

### What it checks

- **Institution and transit number**: 3 and 5 digits, in two columns or as one routing number (0IIITTTTT, like
  000112345, or TTTTT-III as on a cheque). It puts back the zeros that Excel drops (1 is 001, 2345 is 02345) and warns
  when the institution number is not one of the Canadian banks, trust companies and credit unions it knows.
- **Account number**: 5 to 12 digits, spaces and dashes taken out. It finds account numbers that Excel turned into
  1.23457E+11, and warns when an account number was a number in Excel (its leading zeros may be gone) or is shorter
  than 7 digits.
- **Name**: accents taken out (Hélène becomes HELENE), characters the banks do not take replaced, in capitals if you
  like, cut to the 30 characters of the file with a warning, so you know what the bank sees.
- **Amount**: above zero, at most two decimals. Reads 1,234.56, $1,234.56, CAD 1,234.56, 1 234,56 $ (as written in
  Quebec) and Excel numbers. 1.250 is refused as ambiguous (1.25 or 1,250?) unless the rest of the column makes it
  clear. At most 99,999,999.99 for a payment.
- **Date**: the payment date of the file, or a date of its own for a row. More than 30 days back or more than 173 days
  ahead is an error (the banks do not take it); a weekend or a holiday of the payments system (New Year's Day, Good
  Friday, Victoria Day, Canada Day, Labour Day, the National Day for Truth and Reconciliation, Thanksgiving,
  Remembrance Day, Christmas, Boxing Day and the days they move to) gets a warning with the day the banks process it.
  05/06/2026 is refused as ambiguous (May or June?): write 2026-06-05.
- **Transaction code**: a code of Standard 007, like 200 (payroll deposit), 450 (miscellaneous payments), 460
  (accounts payable), 470 (fees/dues) or 700 (business pre-authorized debit). Codes kept for governments are refused,
  and so are codes only for debits in a file of credits.
- **Duplicates**: the same payment (institution, transit, account and amount) twice, also in two lists; your own
  account among the people you pay.
- **Your details**: originator ID (up to 10 letters and digits), short name (15 characters), long name (30),
  destination data centre (5 digits), file creation number (1 to 9999), the institution, transit and number of your
  account, and the total of the file.

**Error**: the row does not go in the file, because the bank would refuse or return it. **Warning**: the row goes in
the file, but read it.

The file follows the CPA 005 standard: the header record (A), the credit (C) or debit (D) records with up
to six payments of 240 characters each, the trailer record (Z) with the totals and the counts, all 1464 characters
long, with CR LF line endings. Before it is saved, the Actor reads the file again and checks every record, every
payment, the totals and the counts.

### What you get

- **CPA005_FILE.txt** in the key-value store (Storage tab): the file to upload to your online banking.
- **REPORT.xlsx**: every row of your list with its status, errors, warnings, the fields as they are in the file and
  its record and segment in the file, with filters and the amounts as numbers.
- **Dataset**: one item per row, for Make, Zapier, n8n, your payroll software or your own code.
- **SUMMARY**: file created or not, payments, total, payment date, file creation number, problems, notes and the link
  to the file.

### How to use it

1. Press **Start**: the input form is prefilled with an example list of three suppliers (free), so you see the file
   and the report at once.
2. Fill in your details: the originator ID your bank gave you for CPA 005 files, your short and long name, the
   destination data centre of your bank (in its guide to CPA 005 files) and the institution, transit and number of
   your account.
3. Upload your list, paste it or add a link, choose the transaction code (200 for wages, 450 or 460 for suppliers)
   and the payment date (empty: the next day the payments system is open), and press Start.
4. Download **CPA005_FILE.txt** from the Storage tab and upload it in your online banking, where it imports payment
   files (CPA 005, AFT or EFT files). If a row has an error no file is made: fix the list with REPORT.xlsx (free), or
   switch on «Leave out rows with errors».

A list is enough like this (commas, semicolons or tabs all work):

```
Name,Institution,Transit,Account number,Amount,Reference
Example Supplies Inc,001,00011,1234567,"1,250.00",INV 1001
```

Optional columns: First name and Last name (instead of Name), Routing number (instead of Institution and Transit),
Reference (19 characters, it comes back with a returned payment), Date, Transaction code, Type (credit or debit: a
file is all credits or all debits, and a row of the other kind is shown as an error), Currency, Message. Titles are
also found when written differently (Employee Name, Payee, Inst No, Branch Transit, Acct #, Net Pay, Montant,
Invoice...), in English and French, with title rows above and a total row below, as payroll programs export them.

**File creation number**: every file you send to your bank needs a new one. Leave the field empty and the Actor counts
by itself: 0001 for the first file of your originator ID, then 0002, 0003... (it keeps the last number in a key-value
store of your account named cpa005-file-numbers). If your bank already received files from you, write the next number
once, and the Actor goes on from there. Upload every file only once.

**Automation**: from your payroll or accounting software, Make, Zapier or n8n, call the Actor with the link to the
list or with the payments as JSON (`payments`), and take the file from `fileUrl` in SUMMARY. Switch on «Fail the run
if no file is made» so that the automation stops when a row has an error.

### Example output

The message of the example list:

```
CPA 005 file created: 3 payments, paying $4,276.25 CAD on 2026-11-17, file creation number 0001. Download CPA005_FILE.txt in the Storage tab and upload it to your online banking as a CPA 005 (AFT or EFT) file.
```

The header record (the rest of its 1464 characters is blank):

```
A000000001EXAMPLE001000102632012345                    CAD
```

One payment of the file (240 characters: transaction code, amount in cents, date, institution and transit, account,
names, originator ID, reference, your account for returns):

```
45000001250000263210001000111234567     0000000000000000000000000EXAMPLE BAKERY EXAMPLE SUPPLIES INC          EXAMPLE BAKERY LTD            EXAMPLE001INV 1001           0004012347654321                                            00000000000
```

One item of the dataset:

```json
{
  "status": "included",
  "statusText": "in the file",
  "row": 3,
  "name": "SAMPLE PRINT SHOP",
  "type": "credit",
  "amount": 980.5,
  "currency": "CAD",
  "institution": "002",
  "transit": "12345",
  "accountNumber": "9876543",
  "transactionCode": "450",
  "date": "2026-11-17",
  "reference": "INV 1002",
  "message": "",
  "record": 2,
  "segment": 2,
  "errors": [],
  "warnings": [],
  "source": "example list"
}
```

### Who is it for

- **Small businesses** that pay wages or suppliers from a spreadsheet, and whose bank accepts CPA 005 file uploads in
  its business online banking.
- **Bookkeepers, accountants and payroll services** that prepare payment files for their clients.
- **Developers** of payroll, accounting and marketplace software: a CPA 005 file from one API call, without writing
  the 1464-character layout.

### Options your bank may ask for

- **Originator ID**: the ID your bank gave you when it set you up for CPA 005 (AFT, EFT) files. Some banks write it
  with 0000 after the number: write it exactly as in your bank's guide.
- **Destination data centre**: the 5 digits of the processing centre that receives the file, in your bank's guide.
- **Payments per record**: 6 is the standard; choose 1 only if your bank asks for one payment per record.
- **Names in capitals**: on by default, as most banks ask.
- **Line endings**: CR LF is what most banks take. LF only if your bank asks for it.
- **Currency**: CAD, or USD for USD accounts at Canadian institutions, in a file of its own.
- **Debits**: to collect money with pre-authorized debits you need a PAD agreement signed by every payor, and your bank
  must have set you up for debits. Credits and debits go in separate files.

### Pricing

**$0.02 per payment in the file** ($2 per 100 payments). Free: the example of the input form, lists with errors (no
file is made) and rows left out. Set a maximum cost per run in the run options if you like: if it does not pay for
every payment, no file is made, nothing is charged and the message tells you.

### Privacy and security

The Actor runs in your own Apify account: your lists, the file and the report stay in the storage of your run, and it
sends nothing anywhere else (it only downloads the links you give it). It never contacts a bank and never moves money:
you upload the file yourself. The lists contain names and bank account numbers: delete the run, or set a short data
retention, when you no longer need them. The key-value store cpa005-file-numbers holds only your originator ID and the
last file creation number.

### FAQ

**Will my bank accept the file?** It follows the CPA 005 standard and every payment passes the checks a file can
show. Your bank can still refuse it for reasons that are not in the file (file uploads not enabled for your account,
your limits, its cut-off time, a file creation number it already received), and some banks have rules of their own:
read the warnings and your bank's guide to CPA 005 files.

**Where do I find my originator ID and the destination data centre?** In the agreement or the guide your bank gave you
when it enabled payment file uploads, or in your online banking where you upload the files.

**My bank wants a different file creation number.** Write it in «File creation number»: the next files go on from it.

**I upload the file tomorrow.** Write tomorrow's date in «Day you upload the file»: it is the creation date of the
file, and the dates are checked from that day.

**Is a feature missing?** Ask in the Issues tab.

# Actor input Schema

## `paymentsFile` (type: `string`):

Excel (.xlsx), CSV or TXT with any separator, or JSON. One row per payment, with a row of titles. The columns are found by their titles: name (or first name and last name), institution number, transit number (or one routing number like 000112345), account number, amount. Optional: reference, date, transaction code, type (credit or debit), currency, message.

## `paymentsUrls` (type: `array`):

Direct links (https) to Excel, CSV or JSON lists, for example from Make, Zapier, n8n or a cloud folder. All the lists together make one file.

## `paymentsContent` (type: `string`):

Paste the rows of a CSV or of an Excel sheet (copied cells are separated by tabs), with the row of titles. It is prefilled with an example list, so you can try the tool with one click: the example is free, and it is not used when you upload a list or add a link.

## `payments` (type: `array`):

For APIs and AI agents: \[{"name": "Example Supplies Inc", "institution": "001", "transit": "00011", "accountNumber": "1234567", "amount": 1250.00, "reference": "INV 1001"}]. Other keys: routing, date, transactionCode, type (credit or debit), currency, message.

## `originatorId` (type: `string`):

Up to 10 letters and digits: the ID your bank gave you for CPA 005 (AFT, EFT) files, sometimes called client number or customer number. Write it exactly as in your bank's guide (some banks add 0000 after the number). Prefilled with an example: write yours.

## `shortName` (type: `string`):

The name the people you pay see on their statement, 15 characters. Prefilled with an example: write yours.

## `longName` (type: `string`):

The legal name of your company, 30 characters. Empty: your short name.

## `dataCentre` (type: `string`):

The 5 digits of the processing centre of your bank that receives the file: your bank gives them with your originator ID, in its guide to CPA 005 files. Needed for your own lists (the example list works without it).

## `institutionNumber` (type: `string`):

3 digits. Your account: credits are taken from it, debits are paid into it, and returned payments come back to it. Prefilled with an example: write yours.

## `transitNumber` (type: `string`):

5 digits, your branch. Prefilled with an example: write yours.

## `accountNumber` (type: `string`):

5 to 12 digits. Prefilled with an example: write yours.

## `entryType` (type: `string`):

Credits pay the accounts in the list (wages, suppliers, refunds). Debits collect money from them, with a pre-authorized debit (PAD) agreement signed by each of them. A file is all credits or all debits.

## `transactionCode` (type: `string`):

The type of payment of Standard 007, shown on the statements: 200 for wages, 450 or 460 for suppliers, 470 for fees, 700 for business pre-authorized debits. A row can have its own in a Transaction code column (any code of the standard).

## `paymentDate` (type: `string`):

The day the money reaches the accounts. Empty: the next day the Canadian payments system is open after today. On a weekend or a holiday of the payments system the banks process it on the next open day. Rows can have their own date in a Date column.

## `currency` (type: `string`):

Canadian dollars, or US dollars for USD accounts at Canadian institutions (in a file of its own).

## `fileCreationNumber` (type: `string`):

1 to 9999, a new one for every file you send to your bank. Empty: the next one after the last file this Actor made with your originator ID (the first one is 0001). Write it if your bank already received files from you, or if it asks for another number.

## `defaultReference` (type: `string`):

19 characters for the rows without a reference (the originator's cross reference number). It comes back with a returned payment, so you know which one it was.

## `sundryInformation` (type: `string`):

15 characters of sundry information for the rows without a Message column. Some institutions show it on the statement.

## `paymentsPerRecord` (type: `string`):

6 (the standard): up to six payments in every record of 1464 characters. 1: one payment per record, only if your bank asks for it.

## `uppercase` (type: `boolean`):

On (recommended): names, references and messages in capital letters, as most banks ask. Accents are always taken out (Hélène becomes HELENE).

## `uploadDate` (type: `string`):

Empty: today (Toronto time). It is the creation date in the file, and the payment dates are checked from this day.

## `lineEnding` (type: `string`):

CR LF (Windows) is what most banks take. LF only if your bank asks for it.

## `skipInvalidRows` (type: `boolean`):

Off (recommended): if a row has an error no file is made, and the dataset and REPORT.xlsx say what to fix, for free. On: the file is made with the rows without errors, and the others are listed as errors.

## `columns` (type: `object`):

Only if a column is not found by its title: {"amount": "Net Pay $", "transit": "Branch No"}. Keys: name, firstName, lastName, institution, transit, routing, account, amount, reference, date, direction, transactionCode, currency, sundry.

## `failIfNoFile` (type: `boolean`):

For automations: the run ends as failed when no file is made, so that Make, Zapier or n8n stop. Off: the run succeeds and SUMMARY says fileCreated: false.

## Actor input object example

```json
{
  "paymentsUrls": [],
  "paymentsContent": "Name,Institution,Transit,Account number,Amount,Reference\nExample Supplies Inc,001,00011,1234567,\"1,250.00\",INV 1001\nSample Print Shop,002,12345,9876543,980.50,INV 1002\nDemo Cleaning Co,815,20001,445566778,\"2,045.75\",INV 1003\n",
  "originatorId": "EXAMPLE001",
  "shortName": "Example Bakery",
  "longName": "Example Bakery Ltd",
  "institutionNumber": "004",
  "transitNumber": "01234",
  "accountNumber": "7654321",
  "entryType": "credit",
  "transactionCode": "450",
  "currency": "CAD",
  "paymentsPerRecord": "6",
  "uppercase": true,
  "lineEnding": "crlf",
  "skipInvalidRows": false,
  "failIfNoFile": false
}
```

# Actor output Schema

## `payments` (type: `string`):

Every row of your list: status, errors, warnings, the fields as they are in the file and its record and segment in the file.

## `cpaFile` (type: `string`):

The CPA 005 file to upload to your online banking. It is made only when no row has an error, or when rows with errors are left out.

## `report` (type: `string`):

REPORT.xlsx: every payment with its status and the problem in plain words.

## `summary` (type: `string`):

The result of the run in short: counts, total, payment date, file creation number, problems and the link to the file.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "paymentsUrls": [],
    "paymentsContent": `Name,Institution,Transit,Account number,Amount,Reference
Example Supplies Inc,001,00011,1234567,"1,250.00",INV 1001
Sample Print Shop,002,12345,9876543,980.50,INV 1002
Demo Cleaning Co,815,20001,445566778,"2,045.75",INV 1003`,
    "originatorId": "EXAMPLE001",
    "shortName": "Example Bakery",
    "longName": "Example Bakery Ltd",
    "institutionNumber": "004",
    "transitNumber": "01234",
    "accountNumber": "7654321"
};

// Run the Actor and wait for it to finish
const run = await client.actor("hardreset83/cpa-005-file-generator").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "paymentsUrls": [],
    "paymentsContent": """Name,Institution,Transit,Account number,Amount,Reference
Example Supplies Inc,001,00011,1234567,\"1,250.00\",INV 1001
Sample Print Shop,002,12345,9876543,980.50,INV 1002
Demo Cleaning Co,815,20001,445566778,\"2,045.75\",INV 1003
""",
    "originatorId": "EXAMPLE001",
    "shortName": "Example Bakery",
    "longName": "Example Bakery Ltd",
    "institutionNumber": "004",
    "transitNumber": "01234",
    "accountNumber": "7654321",
}

# Run the Actor and wait for it to finish
run = client.actor("hardreset83/cpa-005-file-generator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "paymentsUrls": [],
  "paymentsContent": "Name,Institution,Transit,Account number,Amount,Reference\\nExample Supplies Inc,001,00011,1234567,\\"1,250.00\\",INV 1001\\nSample Print Shop,002,12345,9876543,980.50,INV 1002\\nDemo Cleaning Co,815,20001,445566778,\\"2,045.75\\",INV 1003\\n",
  "originatorId": "EXAMPLE001",
  "shortName": "Example Bakery",
  "longName": "Example Bakery Ltd",
  "institutionNumber": "004",
  "transitNumber": "01234",
  "accountNumber": "7654321"
}' |
apify call hardreset83/cpa-005-file-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hardreset83/cpa-005-file-generator"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/lVe1Z7EDaVi90Nw67/builds/cPPPyf24Mpd7qy8e2/openapi.json
