Create an agreement outside the default template
Creates an agreement outside the default agreement template, on an account whose holder is already enabled for collections. The account and its ledger belong to the Midaz organization in X-Organization-Id.
How it works
- An account has at most one live agreement per product type.
- An account linked to a pooled account has no agreement of its own.
- Two agreements of one holder cannot share the same branch, account and product type at Núclea.
- Each of these three cases is refused with
PBP-0806. - Product types other than 01 and 07, portfolios other than 01 and species 31, 32 and 33 are refused with
PBP-0801. - An accepted agreement answers
202with statePENDING_REGISTRATION. Its inclusion goes to Núclea through the PCR, as an update of the holder’s registration or with the holder’s enablement still in progress. - An agreement without its branch at Núclea is not sent.
registrationBlockedReasonisMISSING_BRANCHuntil the branch is assigned. The assignment waits while another agreement of the holder holds the Núclea key that branch would give. - No notice is sent for the registration outcome. Read it with
GET /v1/collections/agreements/{agreement_id}. - The creation is recorded in the collections audit trail with its
reasonand the identity that made it. - The same
Idempotency-Keyand body under another organization is a different request.
Encabezados
Cuerpo
Respuesta
Accepted. The agreement is PENDING_REGISTRATION. No notice is sent for the registration outcome: follow it with GET /v1/collections/agreements/{agreement_id}.
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.
AFTER_CANCELLATION_WINDOW, AT_SETTLEMENT "AFTER_CANCELLATION_WINDOW"
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.
PENDING_REGISTRATION, ACTIVE, BLOCKED, CLOSING, CLOSED, CLOSURE_FAILED, REGISTRATION_REJECTED "ACTIVE"
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.
MISSING_BRANCH, null "MISSING_BRANCH"

