Pular para o conteúdo principal
POST
Send a CNAB 240 Lerian remittance file

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

X-Organization-Id
string

Midaz organization the CNAB agreement of the file belongs to. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025.

Parâmetros de consulta

dryRun
boolean
padrão:false

true validates the file and every line and answers 200 with status DRY_RUN, storing nothing and consuming no NSA.

Corpo

Content-Type text/plain (any charset parameter, e.g. text/plain; charset=iso-8859-1) or application/octet-stream; anything else is refused with 415 PBP-0908. The whole remittance file, at most 4 MiB (4,194,304 bytes): records of 240 positions, ending in CRLF or LF, in ASCII, Latin-1 or UTF-8. File header, one or more collection batches (batch header, P/Q[/R][/S][/Y-53] segments per title, batch trailer), file trailer. The body is read raw, with a limit, and is not handed to the schema validator.

The body is of type file.

Resposta

OK. Two cases, told apart by status. DRY_RUN: the validation result, with lines. Nothing was stored. Any other status: the same file (same agreement, NSA and content) was received before. This is the first receipt as it stands now, and nothing new was done.

agreementId
string<uuid>
obrigatório

The CNAB agreement the file header names.

Exemplo:

"019a7c1e-4b2d-7f30-9c11-2a5e8d0f4b61"

alerts
enum<string>[]
obrigatório

NSA_GAP: the NSA skips numbers. NSA_OUT_OF_ORDER: the NSA is below the last accepted. The file is processed in both cases.

Opções disponíveis:
NSA_GAP,
NSA_OUT_OF_ORDER
contentSha256
string
obrigatório

SHA-256 of the normalized file (accents removed, CRLF), lowercase hex. Part of the remittance identity with the agreement and the NSA.

Pattern: ^[0-9a-f]{64}$
counts
object
obrigatório
fileGenerationDate
string<date>
obrigatório

Generation date of the file header (G016), always present.

Exemplo:

"2026-11-16"

id
string<uuid> | null
obrigatório

Identifier of the remittance; null only on a DRY_RUN.

notices
enum<string>[]
obrigatório

Fields taken as information only. MESSAGES_NOT_SENT: messages of the batch header, R and S are not sent to the boleto. ACCEPT_FLAG_INFORMATIONAL: the accept flag (25.3P) is kept but not sent. PROTEST_DAYS_IGNORED: protest days (37.3P) ignored with protest code 3 or 7.

Opções disponíveis:
MESSAGES_NOT_SENT,
ACCEPT_FLAG_INFORMATIONAL,
PROTEST_DAYS_IGNORED
nsa
integer<int64>
obrigatório

NSA of the file header (G018).

Intervalo obrigatório: 1 <= x <= 999999
Exemplo:

43

receivedAt
string<date-time>
obrigatório

When the file was received, RFC 3339 in UTC.

recordCount
integer<int64>
obrigatório

Records in the file, headers and trailers included.

requestedBy
string
obrigatório

Subject of the token that sent the file.

Maximum string length: 255
sizeBytes
integer<int64>
obrigatório

Size of the file as sent.

Intervalo obrigatório: 0 <= x <= 4194304
status
enum<string>
obrigatório

VALIDATED: stored, no line started yet. PROCESSING: lines being executed. COMPLETED: every line EXECUTED or REJECTED (also at once, when every line was rejected at validation). DRY_RUN: the answer of a dry run, never stored. Treat the list as open.

Opções disponíveis:
VALIDATED,
PROCESSING,
COMPLETED,
DRY_RUN
titleCount
integer<int64>
obrigatório

Titles (P segments with their companions) in the file; one line each.

completedAt
string<date-time> | null

When every line ended, RFC 3339 in UTC; null before.

expectedNsa
integer<int64> | null

The NSA expected (last accepted + 1) when this one differs from it; null otherwise and on a DRY_RUN. 1000000 means the 6-digit range of G018 is exhausted: no NSA above the last one is accepted, and a lower NSA still free is accepted with NSA_OUT_OF_ORDER.

Intervalo obrigatório: 1 <= x <= 1000000
fileGeneratedAt
string<date-time> | null

Generation date and time of the file header (G016, G017), read as Brasília time and answered in UTC; null when the header has no time.

lines
object[]

Only on a DRY_RUN, every title line with its outcome (id, boletoId and executedAt null). Absent otherwise.