CNAB240: versioned payment files and the bank interface
Separate the federation standard, the supported bank profile and the payment rail; validate the file and reconcile execution.
L1–L4 are part of the Pro pass
L0 Explain simply
Asha Traders needs to pay two hundred suppliers. It sends its bank a file rather than typing each payment. (SYNTHETIC / TRAINING ONLY.) is the Brazilian file-layout family used for this company-to-bank exchange.
Its records have 240 positions. The applicable manual determines each field's position, type, padding and encoding. A 240-position contract is not permission to use arbitrary Unicode text; the reviewed Sicredi manual specifies 240 bytes with line endings outside the record.
CNAB240 is an instruction layer, not a clearing or settlement rail. The bank validates the file, carries out accepted instructions through the selected services and reports outcomes. A valid upload is not evidence that all suppliers have been paid.
The useful lesson is versioned contract discipline. Earlier site text presented a bank-to-bank width conflict from a search snippet as established fact. An actual source table does not support that conclusion; the next depths explain the corrected evidence.
PLAIN WORDS · 7 in this section
- padding
- extra filler added to fill a fixed length
- encoding
- writing a meaning down as set characters or codes
- unicode
- a standard list of letters, signs and emoji
- sicredi
- a Brazilian cooperative bank group
- specifies
- states exactly what is required
- bytes
- units of data size, each usually eight bits
- snippet
- a small piece of text or code
PICTURE IT
A pre-printed grid form handed to a counter clerk
Picture a form printed with a fixed row of numbered boxes. A company fills in one letter or digit per box. The clerk at the counter never reads labels. The clerk reads box number three, then box number four. Trusts that each one holds what the printed guide says.
The form does not carry the parcel anywhere. It only tells the clerk what to send and by which courier. The clerk then hands the parcel to that courier, and the courier does the moving.
THE REAL JOB A CNAB240 file lets a company give a bank many payment instructions in one layout that both sides read alike.
- Asha Traders writes the file to the layout
- The bank checks it against its own manual
- Batches open with a header and close with a trailer
- The forma de lançamento
45names Pix - Pix clears and settles the payment
HOW THE PICTURE MAPS
| In the picture | In the payment |
|---|---|
| The pre-printed form with numbered boxes | The CNAB240 layout, where every record is 240 positions long |
| One numbered box | One position, which has a set meaning and no label or separator |
| One printed line of boxes | One record, a single line of the file |
| The note beside a box: digits only, this many wide | The field rule (a picture clause), giving the length, type and any implied decimal point |
| A bundle with a cover sheet and a closing count sheet | A batch, with its own header and trailer inside the file's |
| A main form with an extra form clipped behind it | Segmento A is the core payment; Segmento B adds detail, such as Pix fields |
| The courier box ticked on the cover sheet | Method field (forma de lançamento): 45 Pix transfer, 47 Pix QR code |
| The courier who carries the parcel | Pix, a Brazilian payment rail, which clears and settles the payment after the bank acts |
| The clerk's own desk guide for the same form | The receiving bank's supported profile: its accepted fields, codes and validation rules |
| The company that fills in the forms | The business customer that sends the supplier fileWho: Asha Traders |
WHERE THIS PICTURE STOPS
- A form does not move anything, and neither does the file.
CNAB240clears nothing and settles nothing. The bank makes each payment on the rail the file names. - A human clerk can squint at a crooked box and guess. A positional file cannot. One field of the wrong width can move every later field, so the errors may name fields that are correct.
- The picture shows one printed form. In practice the standard is only the common base. Each bank publishes a supported profile derived from it, so pin the actual manual, service and version. An old two-bank Pix-key width conflict is not established by the opened sources, and this model gives no positions or widths.
- The picture says nothing about what a bank returns for a rejected file. The sources behind this topic do not establish rejection codes, so none is stated.
- A/B is a transfer example; the QR path has
J52Pix. Optional type2/type4records and byte/encoding contracts must be retained.
HOOK
Count the boxes, name the courier: the file orders, never pays.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
Pin the standard, supported bank profile, service and version.
| In the trick | What it stands for |
|---|---|
| Shape question | The record length, the batch structure, the segmentos and the picture clauses, which the standard guarantees |
| Width or code question | Compare actual field widths and code lists; do not treat the old snippet conflict as established. |
| The receiving bank's manual | The supported bank interface contract and applicable federation standard together govern. |
A mnemonic cannot replace actual manual comparison, certification and reconciliation of outcomes.
TELL A FRIEND
CNAB240 is an instruction layer, not a clearing or settlement rail. The bank validates the file, carries out accepted instructions through the selected services and reports outcomes; a valid upload is not evidence that all suppliers have been paid.
OFTEN MIXED UP WITH Brazil: when the central bank builds the instant rail itself. The Brazil topic teaches the rails that move money, such as Pix. This topic teaches only the file that orders a bank to use one. Ask: does it move money, or tell a bank to?
Sources & standards — 2 sources
- Scheme-specific rule
FEBRABAN CNAB240 v10.11 — file structure and Pix paths ↗ — FEBRABAN · Actual FEBRABAN CNAB240 10.11: cover 31 July 2023; filename 21 August 2023; running header 10.9. Reviewed §2.1 p13, J52Pix p32, G029 p176 and G100/G101 p190. Preserve original provenance and historical bank profiles.
Actual primary document opened and relevant sections reviewed 6 November 2026; source-backed scope only, no new artwork reuse licence inferred.
- Scheme-specific rule
Sicredi supplier-payment CNAB240 manual — February 2024 actual table ↗ — Sicredi · Actual Sicredi February 2024 supplier-payment manual,p11: Pix key128–226,99positions; initiation code15–16 and filler17. Contradicts treating an old105-position search snippet as established bank-to-bank divergence. Dated table, not latest-profile certification.
Actual primary document opened and relevant sections reviewed 6 November 2026; source-backed scope only, no new artwork reuse licence inferred.
SEE THE PAYMENT MOVE
PICTURE THE JOURNEY
A job sheet, an agency and a wall board in the trade hallOpen to read the picture, how it matches the payment and where it stops.
PICTURE IT
A job sheet, an agency and a wall board in the trade hall
Picture a building contractor who owes many small bills this week. The contractor does not visit every supplier. Instead, the contractor writes every bill on one long job sheet and gives it to the agency that looks after the contractor's money.
The agency accepts only one layout, and that layout has an edition. Each bill takes a main line and an extra line. The main line holds the sum, the supplier's agency and the supplier's account. The extra line holds more facts, such as the supplier's nickname on the express lane. The sheet also opens with a heading line for the whole batch and ends with a closing line. One column in the heading names the way to send the sums, and here it names the express lane.
The agency first checks every line against its layout. A good line goes on. A line with a column in the wrong place is set aside, and the rest of the sheet carries on.
The job sheet carries nothing. Its work ends when it has named the express lane. The express lane belongs to the trade hall. The hall keeps a wall board with one marker for each agency, and a keeper who moves the markers. For a good line, the keeper slides one agency's marker down and the other agency's marker up in one move.
After that, the contractor's agency lowers the contractor's account. The supplier's agency raises the supplier's account, and the supplier has been paid. Last, the contractor's agency copies the same sheet and writes a result beside every line. A set-aside line is marked as set aside. The contractor fixes that line and sends it again.
THE REAL JOB A CNAB240 file lets a business send its bank a batch of supplier payments and read the results in the same layout.
HOW THE PICTURE MAPS
| In the picture | In the payment |
|---|---|
| The contractor with many bills to settle | The business customer that sends one file of supplier paymentsWho: Asha Traders |
| The long job sheet, one main and one extra line per bill | The file, called the remessa (outgoing file) in CNAB240 |
| The agency's layout, with columns in a set order | The CNAB240 layout: every position has one meaning, set in advance |
| The main line: sum, supplier's agency and supplier's account | Segmento A: amount, beneficiary bank and account |
| The extra line, such as the supplier's nickname on the express lane | Segmento B: complementary data, including the supplier's Pix key |
| The sheet's heading line and its closing line | The batch header and trailer: the opening and closing records of a batch |
| The heading column that names the express lane | The forma de lançamento (method) field in the batch header: 45 names a Pix transfer |
| The agency that looks after the contractor's money | The originator's bank, which checks the file and holds Asha Traders' accountWho: Bank Alfa |
| The agency checking every line, heading and closing line against the layout | Validate layout: record positions, and the batch's opening and closing records |
| The trade hall, with its keeper and wall board | SPI (Instant Payment System), run by Banco Central do Brasil, the central bank |
| The express lane the sheet names | Pix, the payment channel the file names; the file's job ends there |
| The keeper sliding one marker down and the other up in one move | Settlement: the two banks' special Pix settlement accounts at the central bank change together |
| The contractor's agency lowering the contractor's account | Bank Alfa debits Asha Traders' account once settlement completesWho: Bank Alfa |
| The supplier's agency raising the supplier's account | The beneficiary's bank credits its own customerWho: Nordbank |
| The supplier, who has been paid | The supplier is paid once the credit postsWho: Example Supplies Ltd |
| The same sheet copied back with a result beside every line | The retorno file: same layout, one status code per entry |
| A line with a column in the wrong place, set aside | The layout check fails and that one entry is rejected, BADLAYOUT in this flow |
| The rest of the sheet carrying on | In this flow the rest of the batch is unchanged; the rejected entry never settles |
| The contractor fixes that line and sends it again | Asha Traders corrects the Segmento and resubmitsWho: Asha Traders |
WHERE THIS PICTURE STOPS
- The picture cannot show finality. A marker on a wall board looks as if it could be slid back. In the flow, the supplier's credit is final the moment it posts. That rests on how Pix settles in the central bank's system, not on the file. The Brazil topic covers the narrow, named route for getting money back after fraud.
- A marker is not money. In the flow, the banks settle in central bank money, which means the balances they hold at Banco Central do Brasil change. The wall board only shows that movement.
- The picture draws one sheet and one express lane. A real file holds many entries in a batch. It can also name channels other than Pix. This flow follows a single Pix entry from the outgoing file to the return file.
- The picture treats the layout as one rule. In practice FEBRABAN, the Brazilian federation of banks, revises the layout. Each bank also writes its own manual and may use the standard's spare areas differently. The edition a bank and its customer agreed is the one that governs.
- The picture shows one bad line set aside while the rest carry on. That is how this flow draws it. The sources behind it establish the layout and the Pix fields, not how each bank treats a bad entry. A bank's own manual decides whether a layout error holds back one entry, a batch or the whole file.
- The picture shows a result beside each line. The retorno carries a status code for each entry. This flow does not draw the full set of codes, so the picture cannot say what each one means.
- The order of the two account updates is the order this flow draws for one entry. The picture does not claim that every bank orders its own bookkeeping this way.
HOOK
The file orders, Pix pays, and the reply uses the same layout.
REMEMBER IT THIS WAY
A chunk: a long list grouped so it is easier to hold.
Chunk the file by its records: an opening record, then a main line and an extra line for each payment, then a closing record.
| In the trick | What it stands for |
|---|---|
| Batch header | the opening record of a batch |
| Segmento A | amount, beneficiary bank and account |
| Segmento B | complementary data, including the supplier's Pix key |
| Batch trailer | the closing record of a batch |
TELL A FRIEND
A business gives its bank one file of payment orders. The bank checks the layout, sends each good entry over Pix, and returns a file with the result of each.
OFTEN MIXED UP WITH Brazil: when the central bank builds the instant rail itself. That topic shows who owns Pix and why every business reaches it on the same terms. This flow shows one business reaching Pix through a file, where the file only orders and Pix moves the money.
PRACTISE AND KEEP
IMPLEMENTATION RESOURCES
4 RESOURCES
EVIDENCE AT ARM'S REACH
Apply the base message definition first, then the scheme or infrastructure profile that governs this topic.
An XSD checks XML structure. A usage guideline adds profile rules, conditional fields, code restrictions, and business controls. XSD-valid does not mean scheme-compliant.
Sources for this topic — 6 sources
- Official requirement
Layout Padrão CNAB240 ↗ — FEBRABAN (Federação Brasileira de Bancos) · The standard defining the 240-position record layout Brazilian banks exchange with their corporate customers for payments and collections: the record types, the batch structure, and the character position and picture clause of every field
Published openly as a versioned PDF, and this entry does not claim to have opened it: febraban.org.br could not be fetched, so verification relied on two independent web-search excerpts.
The version and date carried here — V 10 11, 21/08/2023 — are read off the published file name rather than from the document itself. And search results list a second file carrying the same version string under a different date, so treat both as the publisher's naming and not as the layout's own declaration.
FEBRABAN revises the layout, and a revision moves field positions, so the version in force between a bank and its customer is what governs. Individual banks publish their own manuals derived from it and are free to use the reserved areas, which is why two banks' CNAB240 files can differ while both conform.
- Market practice
Manual CNAB240 Pagamentos V1.9 (16/04/2024) ↗ — Banco Inter · A Brazilian bank's own manual derived from the standard, carrying the Segmento B field table for Pix, the forma de iniciação code domain, and the forma de lançamento values 45 for a Pix transfer and 47 for a Pix QR code
A bank's manual, not the standard: FEBRABAN's Layout Padrão CNAB240 is the authority and is cited separately. This document was read in full from a public copy; the URL given is the publisher's own site rather than the copy, because the copy's location is not a stable citation. Where this manual and another bank's disagree — and on the Pix key field they do — this site publishes the disagreement rather than choosing between them.
- Market practice
Pagamento a Fornecedores CNAB-240 (2024) ↗ — Sicredi · A second Brazilian bank's manual derived from the same standard, cited for exactly one thing: that it states a different width for the Pix key field and a different code domain for the key type than the first bank's manual does. That is what makes the divergence between bank manuals a documented fact rather than an assertion
Seen through web-search result content only; the document itself was not opened. It is cited solely as the counterpart in a disagreement, never as the authority on any position. Search excerpts only, page not opened. The claim this entry supports is what the search content stated; nothing further is asserted.
- Simplified educational illustration
Payments Signal editorial teaching models — Payments Signal
What this simplifies: One supplier file stands in for a format used across a whole market. No field position or width is published on this page, deliberately: any table printed here would be one bank's presented as everyone's, which is the error the topic warns about. The explanation offered for why the divergence sits in the Pix fields — that a standard's newest extensions are where implementations diverge first — is editorial reasoning rather than a sourced claim. Rejection codes and the way a rejected file is reported back are not established and are not described. Asha Traders is registered cast.
Used wherever diagrams, scenarios, figures, or example values are didactic constructions rather than sourced facts; every such use carries a simplifications disclosure. All people, companies, banks, and list entries in examples are fictional.
- Scheme-specific rule
FEBRABAN CNAB240 v10.11 — file structure and Pix paths ↗ — FEBRABAN · Actual FEBRABAN CNAB240 10.11: cover 31 July 2023; filename 21 August 2023; running header 10.9. Reviewed §2.1 p13, J52Pix p32, G029 p176 and G100/G101 p190. Preserve original provenance and historical bank profiles.
Actual primary document opened and relevant sections reviewed 6 November 2026; source-backed scope only, no new artwork reuse licence inferred.
- Scheme-specific rule
Sicredi supplier-payment CNAB240 manual — February 2024 actual table ↗ — Sicredi · Actual Sicredi February 2024 supplier-payment manual,p11: Pix key128–226,99positions; initiation code15–16 and filler17. Contradicts treating an old105-position search snippet as established bank-to-bank divergence. Dated table, not latest-profile certification.
Actual primary document opened and relevant sections reviewed 6 November 2026; source-backed scope only, no new artwork reuse licence inferred.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.