CNAB240 Seg B (Pix)Fixed-width file

CNAB240 Segmento B (Pix) — how a payment file addresses a Pix

The address of one Pix payment inside a Brazilian . is the 240-character layout published by FEBRABAN — the Federação Brasileira de Bancos, the Brazilian banks' own federation — for the files a company and its bank exchange. The Segmento A record on this site is the line that says pay this person this amount on this date. That line names a beneficiary by bank, branch and account, and it has nowhere to put a Pix key.

DIRECTION: From a company to its bank as a remessa, the file of instructions, and back from the bank as a retorno in the same 240-character shape. A Segmento B never travels alone. It belongs to the Segmento A immediately above it, and nothing in its own 240 characters names that record — the pairing is simply being next to each other and nothing else, which makes the order of the lines part of the data rather than a presentation detail.

WHO IS INVOLVED

  • Pagador (the paying company)Writes the file. Choosing to pay by Pix key rather than by branch and account is what makes this record necessary, and the choice is made in the batch header before any beneficiary is named.
  • Banco (the bank)Validates the supported bank profile/service/version and executes accepted instructions. Resolve actual tables and errors; do not treat an old unverified snippet as a proven width or code conflict.
  • Favorecido (the beneficiary)Named by a Pix key, by a tax registration number, and by the eight-digit ISPB (the Identificador de Sistema de Pagamentos Brasileiro) of the institution holding the account. There is no branch number anywhere on this record — that is the difference a Pix makes to a file that was built around branches.
  • Banco Central do BrasilOperates Pix and the DICT (Brazil's directory of Pix keys) directory that resolves a key to an account, and never sees this file. The bank is what stands between a line of 240 characters and the instant payment system.

WHAT TO UNDERSTAND ABOUT IT

Pix is the the Banco Central do Brasil built and runs, available every day of the year. Money is sent to a phone number, an email address, a tax registration number or a random string the bank issued, and a central directory turns that key into an account. So the file needs a second line, and the Segmento B is it.

In the bank manual read for this page a batch declares itself a Pix batch one level up, in the Header de Lote at positions 012-013, the forma de lançamento or method of posting. There, 45 is Transferência por Pix and 47 is Pix QR-Code. Beside those two sit the 01 that credits an account at the same bank, the 03 that sends a TED — a Transferência Eletrônica Disponível, Brazil's same-day interbank transfer — and the 11 that pays a bill with a barcode. The batch chooses Pix; this record says who to pay.

Version + profile: CNAB240 Seg B (Pix) 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.

3 MESSAGES