Skip to main content
GET
Get a CNAB agreement

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

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.

Path Parameters

agreement_id
string<uuid>
required

Identifier of the CNAB agreement.

Example:

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

Response

OK. The CNAB agreement.

agreementCode
string
required

The collections agreement's 7-digit code, sent in the file header (G007, left-aligned).

Pattern: ^[0-9]{7}$
Example:

"1234567"

bankCode
string
required

G001. The bankCode of the tenant's PCR connection, the first 3 positions of its barcodes. A file whose header carries another bank code is refused whole.

Pattern: ^[0-9]{3}$
Example:

"699"

collectionsAgreementId
string<uuid>
required

The collections agreement the CNAB agreement files for.

Example:

"0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a71"

createdAt
string<date-time>
required

When the agreement was created, RFC 3339 in UTC.

Example:

"2026-11-15T13:20:00Z"

id
string<uuid>
required

Identifier of the CNAB agreement.

Example:

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

lastRemittanceNsa
integer<int64>
required

Highest remittance NSA accepted (G018); 0 before the first. The next is expected at lastRemittanceNsa + 1.

Required range: 0 <= x <= 999999
Example:

43

lastReturnNsa
integer<int64>
required

NSA of the last return generated; 0 before the first. Returns never skip a number.

Required range: 0 <= x <= 999999
Example:

42

ledgerId
string<uuid>
required

Midaz ledger of the titles.

Example:

"0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a10"

midazAccountId
string<uuid>
required

Midaz account of the titles.

Example:

"0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a6d"

nextCutAt
string<date-time>
required

Next scheduled cut, RFC 3339 in UTC.

Example:

"2026-11-17T10:00:00Z"

organizationId
string<uuid>
required

Midaz organization of the agreement.

Example:

"0192a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a01"

portfolio
enum<string>
required

Portfolio (C006, 14.3P), read from the collections agreement on every read and never stored. Always "1" (simple collection) in V1.

Available options:
1
Example:

"1"

releasePolicy
enum<string>
required

Credit release policy of the collections agreement, read from it on every read and never stored. AFTER_CANCELLATION_WINDOW releases the credit only after the window in which the payer's bank may cancel the write-off has closed; AT_SETTLEMENT releases it on settlement, and a chargeback after the release comes back as movement 90.

Available options:
AFTER_CANCELLATION_WINDOW,
AT_SETTLEMENT
Example:

"AFTER_CANCELLATION_WINDOW"

returnCutTimes
string[]
required

Return cut times, BrasΓ­lia time, in ascending order.

Required array length: 1 - 24 elements

Cut time HH:MM, BrasΓ­lia time (America/Sao_Paulo).

Pattern: ^([01][0-9]|2[0-3]):[0-5][0-9]$
speciesCode
string
required

Title species (G065, 24.3P), read from the collections agreement on every read and never stored.

Pattern: ^[0-9]{2}$
Example:

"02"

status
enum<string>
required

ACTIVE takes remittances; INACTIVE refuses them and keeps generating returns of the titles already in.

Available options:
ACTIVE,
INACTIVE
Example:

"ACTIVE"

updatedAt
string<date-time>
required

When the agreement last changed, RFC 3339 in UTC.

Example:

"2026-11-16T09:00:00Z"

version
integer<int64>
required

Optimistic version; send it on updateCnabAgreement.

Required range: x >= 1
Example:

3