Saltar al contenido principal
POST
Create an agreement outside the default template

Autorizaciones

Authorization
string
header
requerido

JWT bearer token issued by the identity provider.

Encabezados

X-Organization-Id
string

Midaz organization of the account the body names. Required: a request without it, or with a value that is not a canonical UUID, is refused with 400 PBP-0025.

Idempotency-Key
string
requerido

Client-supplied idempotency key, a UUID. Required: a request without it, with a value that is not a UUID, or with the nil UUID (00000000-0000-0000-0000-000000000000) is refused with 400 PBP-0012. The same key and body under another organization is another request.

Cuerpo

application/json
accountId
string<uuid>
requerido

Midaz account of the organization X-Organization-Id names, whose holder is already enabled for collections.

Ejemplo:

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

agreement
object
requerido

Issuing rules of the agreement.

reason
string
requerido

Reason for the creation, recorded in the audit trail. Must not carry personal data.

Required string length: 10 - 500
Ejemplo:

"Boleto agreement for the account of the new branch."

ledgerId
string

Midaz ledger of the account. Required: absent, blank or not a canonical UUID is refused with 400 PBP-0026.

Ejemplo:

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

Respuesta

Accepted. The agreement is PENDING_REGISTRATION. No notice is sent for the registration outcome: follow it with GET /v1/collections/agreements/{agreement_id}.

accountId
string<uuid>
requerido

Midaz account of the agreement.

Ejemplo:

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

beneficiaryId
string<uuid>
requerido

Beneficiary of the account's holder.

Ejemplo:

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

chargebackRiskAcknowledged
boolean
requerido

Whether the client acknowledged that, under AT_SETTLEMENT, a cancellation confirmed after the release is charged back from the account's default balance. Always true under AT_SETTLEMENT and false under AFTER_CANCELLATION_WINDOW.

Ejemplo:

false

createdAt
string<date-time>
requerido

When the agreement was created, RFC 3339 in UTC.

Ejemplo:

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

creditDelayBusinessDays
integer<int64>
requerido

Business days before the agreement's credit is released, counted from the write-off's movement day.

Rango requerido: 0 <= x <= 30
Ejemplo:

0

id
string<uuid>
requerido

Identifier of the agreement.

Ejemplo:

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

ledgerId
string<uuid>
requerido
read-only

Midaz ledger of the account.

Ejemplo:

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

nucleaAgreementCode
string
requerido
read-only

Seven-digit code collections assigned to the agreement, unique in the institution and never reused.

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

"0000042"

numbering
object
requerido

Nosso número range of the agreement and the next value of its counter.

organizationId
string<uuid>
requerido
read-only

Midaz organization of the account.

Ejemplo:

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

origin
enum<string>
requerido

COLLECTIONS for an agreement collections created; IMPORTED for one registered elsewhere and adopted.

Opciones disponibles:
COLLECTIONS,
IMPORTED
Ejemplo:

"COLLECTIONS"

paymentDeadlineDays
integer<int64>
requerido

Calendar days after the due date up to the default payment deadline of the agreement's boletos.

Rango requerido: 1 <= x <= 365
Ejemplo:

30

portfolio
enum<string>
requerido

Portfolio of the agreement.

Opciones disponibles:
01,
02,
03,
04,
05,
06
Ejemplo:

"01"

productType
string
requerido

Product type of the agreement at Núclea, two digits.

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

"01"

releasePolicy
enum<string>
requerido

When the credit of a paid boleto of the agreement is released. AFTER_CANCELLATION_WINDOW waits until the write-off's cancellation deadline, and any margin the platform adds to it, has passed. AT_SETTLEMENT releases it once the payment is settled and the credit date is reached, without waiting for the deadline: a cancellation confirmed after the release is then charged back from the account's default balance. Applies to the boletos issued under the agreement; each boleto keeps the policy it was issued with.

Opciones disponibles:
AFTER_CANCELLATION_WINDOW,
AT_SETTLEMENT
Ejemplo:

"AFTER_CANCELLATION_WINDOW"

speciesCode
string
requerido

Species of the boletos, at two digits.

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

"02"

state
enum<string>
requerido

PENDING_REGISTRATION until Núclea accepts the inclusion; then ACTIVE, or BLOCKED while the beneficiary is refused or unfit. CLOSING once the exclusion is sent, then CLOSED, or CLOSURE_FAILED when Núclea refuses it. REGISTRATION_REJECTED when Núclea refuses the inclusion.

Opciones disponibles:
PENDING_REGISTRATION,
ACTIVE,
BLOCKED,
CLOSING,
CLOSED,
CLOSURE_FAILED,
REGISTRATION_REJECTED
Ejemplo:

"ACTIVE"

updatedAt
string<date-time>
requerido

When the agreement last changed, RFC 3339 in UTC.

Ejemplo:

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

version
integer<int64>
requerido

Version of the agreement; a change sends it back.

Rango requerido: x >= 1
Ejemplo:

3

closedAt
string<date-time> | null

When the agreement was CLOSED, RFC 3339 in UTC; null otherwise.

Ejemplo:

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

importedAgreementCode
string | null
read-only

Code the agreement had in the beneficiary base when it was adopted (origin IMPORTED); null for an agreement collections created.

Maximum string length: 40
Ejemplo:

"AB-1234"

nucleaAccountNumber
string | null
read-only

Agreement's account at Núclea, optional.

Maximum string length: 20
Ejemplo:

"87654321"

nucleaAccountType
string | null
read-only

Type of the agreement's account at Núclea, optional.

Maximum string length: 2
Ejemplo:

"CC"

nucleaBranchNumber
string | null
read-only

Agreement's branch at Núclea. Null until the branch is assigned.

Pattern: ^[0-9]{1,4}$
Ejemplo:

"0001"

nucleaBranchType
enum<string> | null
read-only

Type of the agreement's branch at Núclea: F physical, V virtual, N not informed. Null until the branch is assigned.

Opciones disponibles:
F,
V,
N,
null
Ejemplo:

"F"

nucleaSituation
enum<string> | null
read-only

Situation of the agreement in the beneficiary base: A active, C cancelled, E excluded, I inactive. Null before Núclea accepts it.

Opciones disponibles:
A,
C,
E,
I,
null
Ejemplo:

"A"

registrationBlockedReason
enum<string> | null
read-only

MISSING_BRANCH: the agreement is PENDING_REGISTRATION and was not sent to Núclea because its branch type or number is missing, or because the branch found for it is held back while another agreement of the holder holds the key at Núclea that the branch would give it; the holder's boletos wait meanwhile. Null when nothing holds the inclusion back.

Opciones disponibles:
MISSING_BRANCH,
null
Ejemplo:

"MISSING_BRANCH"