CNAB400 DetalheFixed-width file

CNAB400 Detalhe — one collection in a 400-position Brazilian file

One instruction inside a Brazilian CNAB400 file — a remessa, the file a company sends its bank to register the amounts it wants collected. Every record in the file is exactly 400 characters, and this is the detail line: collect this much from this person by this date. It is worth meeting for a reason that has nothing to do with Brazil. CNAB400 is what a format looks like when every bank writes its own version of it, and the honest answer to how much it varies is not that it varies. It is that the front of the record varies completely and the back of it barely varies at all.

DIRECTION: From a company to its bank as a remessa, the file of collection instructions, and back from the bank as a retorno in the same 400-position shape, carrying what happened to each one. Read the file direction first because the same positions mean different things. In the instruction file, characters 111 to 120 hold the company's document number. In the bank's response, the bank records the event date across the start of that range.

WHO IS INVOLVED

  • Cedente, the company collectingWrites the file. Its receivables system produces one detail record per amount it wants registered, numbers every record in sequence, and closes the file with a trailer.
  • Banco cobrador, the collecting bankReads the file against its own manual rather than against a shared one, registers each title, arranges the boleto — the payment slip the payer settles — and answers in a retorno. Which manual applies is the entire subject of this page.
  • Pagador, the person or company being billedNamed in the record by tax registration number, name, address, postcode, city and state, and by no bank details at all. Characters 219 to 351 are almost entirely about them, which is what makes this a billing document rather than a payment instruction.

Version + profile: CNAB400 Detalhe is a fixed-width layout, so a field is found by counting characters and a layout version is not cosmetic: when a publisher revises the document, positions move and a reader that counts to the old offset reads the wrong field rather than failing. Check the version your counterparty is sending before building against this page, and check whether they have a house variant — several of these formats are published as a standard that banks are free to extend.

1 MESSAGE