Pular para o conteúdo principal
POST
Cut a return file now

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 belongs to. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025. An agreement of another organization is answered 404, exactly as one that does not exist.

Idempotency-Key
string
obrigatório

Client-supplied idempotency key, a UUID. Required: a request without it, with a value that is not a UUID, or with the nil UUID is refused with 400 PBP-0012. The same key under another organization is refused with 422 PBP-0013.

Corpo

application/json
agreementId
string<uuid>
obrigatório

The CNAB agreement to cut.

Exemplo:

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

Resposta

Created. The return generated by this cut. With movements for more than one file, the first one, with moreReturnsInCut true.

agreementId
string<uuid>
obrigatório

The CNAB agreement the return belongs to.

Exemplo:

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

contentSha256
string
obrigatório

SHA-256 of the file as generated, lowercase hex; a rebuilt file is checked against it.

Pattern: ^[0-9a-f]{64}$
filePurged
boolean
obrigatório

true when the stored file was purged after the retention period; the download then rebuilds it from the journal.

generatedAt
string<date-time>
obrigatório

When the return was generated, RFC 3339 in UTC.

id
string<uuid>
obrigatório

Identifier of the return.

movementCount
integer<int64>
obrigatório

Movements in the file (one T/U pair each); 1 to 49,999, one batch per file (G038).

Intervalo obrigatório: 1 <= x <= 49999
nsa
integer<int64>
obrigatório

Return NSA of the agreement (G018 of the return header); consecutive, no gaps.

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

42

requestedBy
string | null
obrigatório

Subject of the JWT that asked for an ON_DEMAND cut; null for SCHEDULED.

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

Size of the file as generated.

trigger
enum<string>
obrigatório

SCHEDULED: cut at one of the agreement's cut times. ON_DEMAND: cut by POST /v1/cnab/returns.

Opções disponíveis:
SCHEDULED,
ON_DEMAND
moreReturnsInCut
boolean

Only in the 201 of cutCnabReturn: true when movements were left after this file (more than 49,999 to report); the scheduled cut generates the following files in its next cycles, one per transaction, each with its own consecutive NSA and notice; list them with listCnabReturns. Absent in the other operations.