components:
  schemas:
    AccountingPostingLegBody:
      additionalProperties: false
      properties:
        account:
          description: GL account for this leg.
          examples:
            - 1100.10.001
          type: string
        component:
          description: Open withholding component code (set XOR role).
          examples:
            - iof
          type: string
        optional:
          description: Whether the component amount may be absent or zero for a generated posting.
          type: boolean
        perOperation:
          description: Whether this leg books into a per-operation account (borrower position) rather than one aggregated per product.
          type: boolean
        role:
          description: Reserved economic role of this leg (set XOR component).
          enum:
            - principal
            - interest
            - iof
            - tax
            - cash
            - unapplied_cash
            - counterparty
            - suspense
          examples:
            - principal
          type: string
        side:
          description: Whether this leg debits or credits the account.
          enum:
            - debit
            - credit
          examples:
            - debit
          type: string
      required:
        - account
        - side
        - optional
        - perOperation
      type: object
    AccountingPostingRuleHumaBody:
      additionalProperties: false
      properties:
        eventType:
          description: Accounting event type, one of the values the request body admits.
          examples:
            - disbursement
          type: string
        legs:
          description: Persisted ordered posting legs.
          items:
            $ref: "#/components/schemas/AccountingPostingLegBody"
          type: array
        metadata:
          additionalProperties:
            type: string
          description: Optional metadata carried with the rule.
          type: object
      required:
        - eventType
        - legs
        - metadata
      type: object
    AccountingProfileHumaBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: Accounting recognition mode (accrual|cash).
          examples:
            - accrual
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        effectiveFrom:
          description: First civil day (YYYY-MM-DD) this chart of accounts governs, always a month start. A posting is booked against the chart in force for the competência it belongs to, never the day the run happened. A version configured before dated configuration reads 1900-01-01, because it was the only chart that version ever had.
          examples:
            - "1900-01-01"
          type: string
        id:
          description: Server-assigned accounting profile identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        loanProductVersionId:
          description: Loan product version this profile is configured for (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        postingRules:
          description: Persisted GL account mappings, one per accounting event.
          items:
            $ref: "#/components/schemas/AccountingPostingRuleHumaBody"
          type:
            - array
            - "null"
      required:
        - id
        - loanProductVersionId
        - accountingMode
        - postingRules
        - effectiveFrom
        - createdAt
      type: object
    AccountingProfileListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of posting configurations, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/AccountingProfileReadHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AccountingProfileReadHumaBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: Whether the product recognizes on an accrual or a cash basis.
          examples:
            - accrual
          type: string
        createdAt:
          description: "Creation timestamp (RFC3339, UTC). NOT the day the chart takes force: a chart created in March to govern from July is created before, and governs after, one created in May that governs from June."
          examples:
            - "2026-06-14T03:00:00Z"
          type: string
        effectiveFrom:
          description: First civil day (YYYY-MM-DD) this chart governs, always a month start. The chart in force on a day is the one with the greatest effectiveFrom at or below it; a posting is booked against the chart in force for the competência it belongs to, never the day the run happened. Charts predating dated configuration read 1900-01-01, because each was the only chart its version ever had.
          examples:
            - "2026-07-01"
          type: string
        eventTypes:
          description: The business events this profile has a posting rule for, in rule order; always present, empty when none. A product version missing the event you expect is configured but will not post it.
          items:
            type: string
          type:
            - array
            - "null"
        id:
          description: Accounting profile identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440004
          type: string
        loanProductVersionId:
          description: Loan product version (uuid) this chart configures. A version owns a chain of charts ordered by effectiveFrom.
          examples:
            - 550e8400-e29b-41d4-a716-446655440005
          type: string
        missingEventTypes:
          description: "The REQUIRED business events this profile has no posting rule for; always present, empty when the profile is complete. Creation refuses an incomplete profile today, so a non-empty list means a profile predating that rule: it will silently skip the ledger postings for the events named here. Optional events (provision, tax, assignment, refinance) are never listed."
          items:
            type: string
          type:
            - array
            - "null"
        postingRuleCount:
          description: How many posting rules the profile holds. Zero means the profile exists but posts nothing.
          examples:
            - 2
          format: int64
          type: integer
      required:
        - id
        - loanProductVersionId
        - accountingMode
        - postingRuleCount
        - eventTypes
        - missingEventTypes
        - effectiveFrom
        - createdAt
      type: object
    AccrualRetryUnpostableHumaBody:
      additionalProperties: false
      properties:
        itemId:
          description: UUID of the accrual run item that was not re-sent.
          examples:
            - 550e8400-e29b-41d4-a716-446655440006
          type: string
        reason:
          description: "Why it was not re-sent. \"already_delivered\": the posting reached the broker and the ledger's acknowledgement is what is missing, so chase the acknowledgement rather than the posting. \"quarantined\": the posting intent is terminal on the outbox and no retry re-drives it. \"contract_not_found\": the contract carries no loan application, so the currency and product version the posting needs cannot be read. \"product_misconfigured\": the product version has no accounting profile, no rule for this event, or an amount its leg template refuses."
          enum:
            - already_delivered
            - quarantined
            - contract_not_found
            - product_misconfigured
          examples:
            - quarantined
          type: string
      required:
        - itemId
        - reason
      type: object
    AccrualRunHumaBody:
      additionalProperties: false
      properties:
        businessDate:
          description: Business date (YYYY-MM-DD, UTC) the run was queued for.
          examples:
            - "2026-06-14"
          type: string
        correlationId:
          description: Correlation identifier linking the run to its journal/outbox lineage and downstream events.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        id:
          description: Server-assigned UUID of the queued accrual run.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        journalReferenceId:
          description: UUID of the journal reference recording this run's posting lineage.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        outboxEventId:
          description: UUID of the emitted outbox event; omitted when no outbox event was recorded.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        status:
          description: Lifecycle status of the queued run (e.g. queued).
          examples:
            - queued
          type: string
      required:
        - id
        - businessDate
        - status
        - journalReferenceId
        - correlationId
      type: object
    AccrualRunItemListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of the run's recognitions, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/AccrualRunItemReadHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AccrualRunItemReadHumaBody:
      additionalProperties: false
      properties:
        businessDate:
          description: Business date of the run that produced the recognition (YYYY-MM-DD, UTC). Absent on a withheld month.
          examples:
            - "2026-06-14"
          type: string
        competencia:
          description: Accounting month the decision belongs to (YYYY-MM).
          examples:
            - 2026-05
          type: string
        createdAt:
          description: When the decision was recorded (RFC3339, UTC).
          examples:
            - "2026-06-14T03:00:00Z"
          type: string
        id:
          description: Accrual run item identifier (uuid). Absent when the month was withheld, because no recognition exists.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        interestAmount:
          description: Recognized amount, as a fixed two-decimal string. A string, never a number, so no consumer can round it through a float. ABSENT, not zero, on a withheld month.
          examples:
            - "102895.88"
          type: string
        kind:
          description: "What was recognized: interest, or the per-competência revenue tax. Absent on a withheld month."
          examples:
            - interest
          type: string
        loanAccountId:
          description: Loan account (uuid) the decision was taken on.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        loanProductId:
          description: Loan product (uuid); omitted when the run did not record one.
          type: string
        loanProductVersionId:
          description: Loan product version (uuid); omitted when the run did not record one.
          type: string
        outboxEventId:
          description: Outbox event (uuid) this recognition enqueued; omitted when none was recorded.
          type: string
        outcome:
          description: "Where this month's income went: recognized into P&L, or suspended and withheld (Res. CMN 4.966 art. 17)."
          enum:
            - recognized
            - suspended
          examples:
            - recognized
          type: string
        postingStatus:
          description: State of this item's downstream ledger posting. Absent on a withheld month.
          examples:
            - pending
          type: string
        runId:
          description: "Identifier (uuid) of the run that CLAIMED this competência. On a re-run it differs from the run in the path: the month was closed by an earlier run."
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        suspendedAccruedAmount:
          description: Income accrued but withheld for this contract, as a fixed two-decimal string. Present only when a suspended balance exists.
          examples:
            - "950.00"
          type: string
        suspendedRecognizedAmount:
          description: Previously withheld income since recognized, as a fixed two-decimal string. Present only when a suspended balance exists.
          examples:
            - "0.00"
          type: string
      required:
        - outcome
        - runId
        - loanAccountId
        - competencia
        - createdAt
      type: object
    AccrualRunListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of accrual runs, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/AccrualRunReadHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AccrualRunReadHumaBody:
      additionalProperties: false
      properties:
        businessDate:
          description: Business date the run was executed for (YYYY-MM-DD, UTC).
          examples:
            - "2026-06-14"
          type: string
        correlationId:
          description: "Correlation identifier linking the run to its journal lineage and downstream events. Not unique: several runs can share one."
          examples:
            - accrual-run-2026-05-31
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T03:00:00Z"
          type: string
        externalJournalReferenceId:
          description: "Always omitted on a run: a run emits one posting per contract per competência per kind, so no single ledger transaction identifies it. The ledger's identifier is per posting — resolve one through GET /api/v1/journal-references with that posting's correlation identifier."
          type: string
        id:
          description: Accrual run identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        journalReferenceId:
          description: Journal reference (uuid) recording this run's posting lineage.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        postingStatus:
          description: State of the downstream ledger posting. "pending" means the ledger has not confirmed it, "posted" means it accepted it, "no_items" means the run recognized nothing so nothing was sent.
          examples:
            - pending
          type: string
        status:
          description: Lifecycle status of the run.
          examples:
            - queued
          type: string
        updatedAt:
          description: Last update timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T03:05:00Z"
          type: string
      required:
        - id
        - businessDate
        - status
        - correlationId
        - journalReferenceId
        - postingStatus
        - createdAt
        - updatedAt
      type: object
    AccrualRunRetryHumaBody:
      additionalProperties: false
      properties:
        id:
          description: UUID of the accrual run this retry acted on. A retry is a new attempt on that run, not a new run, so it equals retriedRunId.
          examples:
            - 550e8400-e29b-41d4-a716-446655440005
          type: string
        itemIds:
          description: "UUIDs of the accrual run items actually re-sent. This is never an echo of the request: items already acknowledged by the ledger are excluded, and so is any item this retry could not send — those appear in unpostableItems."
          items:
            type: string
          type:
            - array
            - "null"
        retriedRunId:
          description: UUID of the accrual run whose recognitions were retried.
          examples:
            - 550e8400-e29b-41d4-a716-446655440005
          type: string
        status:
          description: "\"queued\" when at least one recognition was re-sent and is waiting for the ledger; \"nothing_to_retry\" when the ledger had already acknowledged every selected recognition, which is a success and not an error; \"blocked\" when recognitions the ledger has NOT acknowledged exist and none of them could be re-sent — money is still outside the ledger and unpostableItems says why."
          examples:
            - queued
          type: string
        unpostableItems:
          description: Accrual run items the ledger has not acknowledged and this retry could NOT send, with the reason for each. A non-empty list means money is still outside the ledger and pressing retry again will not change it on its own.
          items:
            $ref: "#/components/schemas/AccrualRetryUnpostableHumaBody"
          type:
            - array
            - "null"
      required:
        - id
        - retriedRunId
        - status
        - itemIds
      type: object
    ActivateLoanProductHumaInputBody:
      additionalProperties: false
      properties:
        versionId:
          description: Loan product version to pin on activation.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
      required:
        - versionId
      type: object
    ActiveLoanAccountHumaBody:
      additionalProperties: false
      properties:
        assignedOfficerId:
          description: "Identifier of the loan officer assigned to service this account, or empty on a system-originated contract, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID."
          examples:
            - officer-xyz
          type: string
        borrowerId:
          description: Identifier (UUID) of the borrower who holds this account.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          format: uuid
          type: string
        disbursementDate:
          description: ISO-8601 date of fund disbursement; omitted until disbursed.
          examples:
            - "2026-06-14"
          type: string
        jurisdictionCode:
          description: ISO 3166-1 jurisdiction code the account operates under (e.g. BR).
          examples:
            - BR
          type: string
        lifecycleState:
          description: "Where the contract stands, as a durable recorded fact. active: no terminal fact closes the account — including one that was closed and later reopened by a repurchase or by undoing a refinance. settled: the borrower discharged the debt. ceded: the receivable was sold and left this balance sheet. ported: the contract moved to another institution. reversed: a refinance the rail undid inside its regret window. renegotiated: a substantial renegotiation replaced this contract and the debt is carried on the new account it opened. Only settled means the borrower discharged the debt — do not label any of the other four as one, and do not read any of them as a statement about whether payments were made on time, which is paymentHealth. Always present."
          enum:
            - active
            - settled
            - ceded
            - ported
            - reversed
            - renegotiated
          examples:
            - active
          type: string
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        loanApplicationId:
          description: Originating loan application UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        openBalance:
          description: "Total balance THIS institution carries on the contract, including fees and penalties (2 d.p. string). Governed by the same rule as principalBalance and paymentHealth: zero once the credit risk has left this book."
          examples:
            - "1450.00"
          type: string
        paymentHealth:
          $ref: "#/components/schemas/LoanAccountPaymentHealthHumaBody"
          description: "How the borrower is paying, derived when this response is built and stored nowhere. Assessed ONLY while lifecycleState is active: a live contract can be months overdue, and on a closed one state is 'unknown' rather than 'current', because the schedule copy a closed contract leaves behind is not a debt this book still carries."
        principalBalance:
          description: "Outstanding principal THIS institution carries on the contract (2 d.p. string). Zero once the credit risk has left this book — see paymentHealth for the rule — and zero is the number there rather than a placeholder: what this book carries on a receivable it sold is nothing. The contract's own history is unaffected; the schedule, transactions and charges still answer it."
          examples:
            - "1234.56"
          type: string
        profileVersion:
          description: Product profile version applied to this account.
          examples:
            - 1.0.0
          type: string
        status:
          description: Account lifecycle status (e.g. active, closed, in_arrears).
          examples:
            - active
          type: string
      required:
        - loanAccountId
        - loanApplicationId
        - status
        - principalBalance
        - openBalance
        - profileVersion
        - jurisdictionCode
        - borrowerId
        - assignedOfficerId
        - lifecycleState
        - paymentHealth
      type: object
    ActiveLoanChargeHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Charge amount (2 d.p. string).
          examples:
            - "25.00"
          type: string
        assessedAt:
          description: RFC 3339 timestamp when the charge was assessed.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        chargeId:
          description: Unique identifier of this assessed charge.
          examples:
            - 550e8400-e29b-41d4-a716-446655440020
          type: string
        chargeType:
          description: Type of charge (e.g. late_fee, origination_fee).
          examples:
            - late_fee
          type: string
        status:
          description: Charge status (e.g. assessed, waived).
          examples:
            - assessed
          type: string
      required:
        - chargeId
        - chargeType
        - amount
        - status
        - assessedAt
      type: object
    ActiveLoanChargesHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Assessed loan charges.
          items:
            $ref: "#/components/schemas/ActiveLoanChargeHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    ActiveLoanScheduleEntryHumaBody:
      additionalProperties: false
      properties:
        dueDate:
          description: ISO-8601 installment due date.
          examples:
            - "2026-06-14"
          type: string
        feesAmount:
          description: Fees component (2 d.p. string).
          examples:
            - "1.50"
          type: string
        installmentNumber:
          description: 1-based installment sequence number.
          examples:
            - 3
          format: int64
          type: integer
        interestAmount:
          description: Interest component (2 d.p. string).
          examples:
            - "12.34"
          type: string
        penaltiesAmount:
          description: Penalties component (2 d.p. string).
          examples:
            - "0.00"
          type: string
        principalAmount:
          description: Principal component (2 d.p. string).
          examples:
            - "100.00"
          type: string
        status:
          description: Installment status (e.g. upcoming, due, paid).
          examples:
            - upcoming
          type: string
        totalAmount:
          description: Total installment amount (2 d.p. string).
          examples:
            - "113.84"
          type: string
      required:
        - installmentNumber
        - dueDate
        - principalAmount
        - interestAmount
        - feesAmount
        - penaltiesAmount
        - totalAmount
        - status
      type: object
    ActiveLoanScheduleHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Installment schedule entries ordered by installment number.
          items:
            $ref: "#/components/schemas/ActiveLoanScheduleEntryHumaBody"
          type:
            - array
            - "null"
        jurisdictionCode:
          description: ISO 3166-1 jurisdiction code the account operates under (e.g. BR).
          examples:
            - BR
          type: string
        profileVersion:
          description: Product profile version applied to this account.
          examples:
            - 1.0.0
          type: string
      required:
        - data
        - profileVersion
        - jurisdictionCode
      type: object
    ActiveLoanTransactionHumaBody:
      additionalProperties: false
      properties:
        allocationLines:
          description: Per-installment allocation breakdown.
          items:
            $ref: "#/components/schemas/RepaymentAllocationHumaEntry"
          type:
            - array
            - "null"
        createdAt:
          description: RFC 3339 creation timestamp.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        effectiveDate:
          description: ISO-8601 effective date.
          examples:
            - "2026-06-14"
          type: string
        originalTransactionId:
          description: Identifier of the transaction being reversed; present only when transactionType is reversal.
          examples:
            - 550e8400-e29b-41d4-a716-446655440012
          type: string
        overpaymentAmount:
          description: Excess amount above total outstanding (2 d.p. string).
          examples:
            - "0.00"
          type: string
        paidAmount:
          description: Amount applied to the loan (2 d.p. string).
          examples:
            - "113.84"
          type: string
        requestId:
          description: Caller-supplied idempotency key; omitted when none was provided.
          examples:
            - 550e8400-e29b-41d4-a716-446655440011
          type: string
        transactionId:
          description: Unique identifier of this repayment transaction.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        transactionType:
          description: Type of transaction (e.g. repayment, reversal).
          examples:
            - repayment
          type: string
      required:
        - transactionId
        - transactionType
        - paidAmount
        - overpaymentAmount
        - effectiveDate
        - createdAt
        - allocationLines
      type: object
    ActiveLoanTransactionsHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Recorded repayment transactions.
          items:
            $ref: "#/components/schemas/ActiveLoanTransactionHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AppendRateTablePeriodHumaInputBody:
      additionalProperties: false
      properties:
        annualRateBps:
          description: Reference annual rate for the period, basis points.
          examples:
            - 1075
          format: int64
          minimum: 0
          type: integer
        effectiveDate:
          description: "Date this rate takes effect, inclusive (RFC3339 or YYYY-MM-DD, UTC). Must be strictly after every period already on the curve: a curve is append-only in time and never restates a rate that was already in force."
          examples:
            - "2026-03-01"
          type: string
      required:
        - effectiveDate
        - annualRateBps
      type: object
    ApplyLoanChargeHumaInputBody:
      additionalProperties: false
      properties:
        accountCreatedAt:
          description: "Loan account creation instant (RFC 3339). A bare calendar date is refused with LENDER-0103: this value is compared for exact equality against the stored account fact."
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        chargeEffectiveAt:
          description: "RFC 3339 instant the charge was levied. A bare calendar date is refused with LENDER-0103: this value is the moment a fee was assessed and it also decides which charge template was in force."
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        chargeTemplateId:
          description: Charge template identifier.
          type: string
        loanAccountId:
          description: Loan account identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440005
          format: uuid
          type: string
        productVersionId:
          description: Product version identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
      required:
        - loanAccountId
        - productVersionId
        - chargeTemplateId
        - chargeEffectiveAt
      type: object
    ApplyPDDStageTransitionHumaBody:
      additionalProperties: false
      properties:
        businessDate:
          description: Business date (YYYY-MM-DD or RFC3339).
          examples:
            - "2026-06-14"
          type: string
        effectiveAt:
          description: Effective timestamp (RFC3339 or YYYY-MM-DD).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        idempotencyKey:
          description: Client-supplied idempotency key; deduplicated at the persistence layer.
          maxLength: 128
          type: string
        jurisdictionCode:
          description: Jurisdiction code.
          examples:
            - BR
          maxLength: 8
          type: string
        profileVersion:
          description: Jurisdiction profile version.
          examples:
            - 1.0.0
          maxLength: 64
          type: string
        reason:
          description: Reason for the transition or cure.
          maxLength: 512
          type: string
        toStage:
          description: Target PDD stage.
          enum:
            - current
            - stage_1
            - stage_2
            - stage_3
          examples:
            - stage_1
          type: string
        triggeredBy:
          description: Actor or system that triggered the transition.
          maxLength: 128
          type: string
      required:
        - toStage
        - effectiveAt
        - businessDate
      type: object
    ApprovalDecisionHumaBody:
      additionalProperties: false
      properties:
        approvedAmount:
          description: Approved amount as a decimal string, minor-unit precision scale 2 (e.g. "48000.00").
          examples:
            - "48000.00"
          type: string
        decidedBy:
          description: Authenticated subject who approved the application.
          type: string
        decisionAt:
          description: Approval decision timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Approval decision identifier (UUID).
          examples:
            - 9f1c2d3e-4b5a-6789-abcd-ef0123456789
          type: string
        note:
          description: Optional approval note supplied by the deciding officer.
          type: string
      required:
        - id
        - approvedAmount
        - decisionAt
        - decidedBy
      type: object
    ApproveLoanApplicationHumaRequest:
      additionalProperties: false
      properties:
        approvedAmount:
          description: Approved amount as a decimal string (e.g. "48000.00").
          examples:
            - "48000.00"
          type: string
        decisionAt:
          description: Decision timestamp (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        note:
          description: Optional approval note.
          type: string
      required:
        - approvedAmount
        - decisionAt
      type: object
    AssignContractDivergenceHumaRequest:
      additionalProperties: false
      properties:
        assignee:
          description: Operator now responsible for the item.
          maxLength: 255
          minLength: 1
          type: string
        expectedVersion:
          description: "Compare-and-swap guard: the version this request was read against."
          format: int64
          minimum: 1
          type: integer
      required:
        - assignee
        - expectedVersion
      type: object
    AssignmentAcceptanceHumaBody:
      additionalProperties: false
      properties:
        acceptedAt:
          description: "When the administrator says the acceptance happened (RFC3339). It is EVIDENCE, not the lifecycle clock: the fact's own instant stays the moment the confirmation reached us, so nothing a counterparty sends can backdate a write-off."
          format: date-time
          type: string
        acceptedBy:
          description: The ADMINISTRATOR's own identity for whoever accepted. It never substitutes for our validated actor, which is recorded beside it.
          maxLength: 256
          type: string
        assignmentSetId:
          description: The set the administrator accepted. Must match the set on the route.
          format: uuid
          type: string
        receivableRefs:
          description: "The receivables the administrator accepted. An acatamento always names them: 'the whole set' is a convenience our own operators may use, never a claim inferred on an administrator's behalf."
          items:
            type: string
          maxItems: 5000
          minItems: 1
          type:
            - array
            - "null"
        transferReference:
          description: "The ADMINISTRATOR's own reference for this acatamento — its batch protocol, its file id, whatever it can be quoted back by. One reference for the whole document under both regimes: an administrator does not move titles at a registradora and has no per-title protocol to give. Where a registradora governs, each receivable's fact row also carries OUR confirmed per-title protocol beside this one."
          maxLength: 256
          type: string
      required:
        - assignmentSetId
        - receivableRefs
        - acceptedBy
        - acceptedAt
        - transferReference
      type: object
    AssignmentCandidateHumaBody:
      additionalProperties: false
      properties:
        borrowerRef:
          description: Opaque debtor key the invariable 20% cap aggregates by. Never a document number.
          type: string
        currency:
          description: ISO currency code of exposureAmount.
          type: string
        cutCount:
          description: How many times THIS fund has already cut this receivable in its remessa.
          format: int64
          type: integer
        eligible:
          description: Whether this receivable may enter an assignment set for this fund.
          type: boolean
        exposureAmount:
          description: Outstanding exposure (latest canonical debt-balance revision), decimal string, scale 2.
          type: string
        paymentSourceRef:
          description: Opaque key of the receivable's payment source — the party the instalment is collected through — that the fund's payment-source limit aggregates by. Which party that is belongs to the jurisdiction, and this contract never names it.
          type: string
        reason:
          description: Empty when eligible. Otherwise exactly one of the core reasons — borrower_concentration_cap, payment_source_limit, assignor_limit, overdue, custody_incomplete, registration_not_active, already_in_active_set, repeated_cut_brake.
          type: string
        receivableRef:
          description: Receivable reference (the rail contract number).
          type: string
        requiresExceptionReview:
          description: True when the repeated-cut brake diverted this receivable to the exception queue instead of returning it to the pool.
          type: boolean
      required:
        - receivableRef
        - borrowerRef
        - paymentSourceRef
        - exposureAmount
        - currency
        - eligible
        - reason
        - cutCount
        - requiresExceptionReview
      type: object
    AssignmentCandidatesHumaBody:
      additionalProperties: false
      properties:
        borrowerConcentrationCap:
          description: The invariable per-debtor cap, as a decimal fraction string, scale 8. It is never configuration.
          type: string
        concentrationBase:
          description: "Denominator the surviving composition was measured against: the fund's accepted stock plus the admitted set."
          type: string
        currency:
          description: ISO currency code every amount in this response is denominated in.
          type: string
        data:
          description: One verdict per candidate, in receivable-reference order. Always present, empty slice when the pool is empty.
          items:
            $ref: "#/components/schemas/AssignmentCandidateHumaBody"
          type:
            - array
            - "null"
        dimensionsNotEvaluated:
          description: Concentration dimensions this scoring could not measure. sector has no data source at all (the payment-source aggregate carries none); assignor is listed when the pool carries no per-receivable assignor.
          items:
            type: string
          type:
            - array
            - "null"
        eligibilityMode:
          description: full (our verification is authoritative) or prefilter (the administrator verifies; this runs ahead of the offer file). The same engine either way.
          type: string
        eligibleCount:
          description: How many receivables survived every rule.
          format: int64
          type: integer
        eligibleExposure:
          description: Total exposure of the surviving composition, decimal string, scale 2.
          type: string
        fundId:
          description: Fund registration the pool was scored for.
          type: string
        observedAt:
          description: Instant the pool was read (RFC3339, UTC).
          type: string
        poolStateObserved:
          description: False when the fund's accepted stock, in-flight set membership and repeated-cut tally could not be read. In that state the caps were measured against the proposed set alone and the exclusivity and repeated-cut fences were NOT evaluated.
          type: boolean
        ruleVersion:
          description: Identifier of the eligibility/concentration rule that produced these verdicts.
          type: string
        truncated:
          description: True when more assignable receivables exist than the requested window. Verdicts are computed OVER the returned window as the proposed set.
          type: boolean
      required:
        - fundId
        - eligibilityMode
        - ruleVersion
        - observedAt
        - truncated
        - currency
        - eligibleCount
        - eligibleExposure
        - concentrationBase
        - borrowerConcentrationCap
        - poolStateObserved
        - dimensionsNotEvaluated
        - data
      type: object
    AssignmentExceptionHumaBody:
      additionalProperties: false
      properties:
        assignmentFundId:
          description: The fund it was offered to.
          type: string
        assignmentSetId:
          description: The set this case happened to.
          type: string
        caseType:
          description: "What happened: repeated_cut, remessa_conflict, remessa_divergence, derecognition_unpostable (the receivable's product carries no write-off posting rule), derecognition_unvaluable (the receivable's carried figure cannot be read or cannot be trusted), derecognition_already_sold (another assignment set has already sold this receivable), derecognition_unsellable (the receivable is not this tenant's to sell: suspended, excluded, ported or already discharged), transfer_absent (the administrator accepted a receivable whose title movement no registradora ever confirmed), registry_command_unconfirmed (a title transfer commanded at the registradora that never came back settled), assigned_contract_passthrough, or one of the lifecycle orphans."
          type: string
        detail:
          description: "A JSON object with what a desk needs to act: the cut tally that tripped the brake, the two conflicting digests, the references that failed to reconcile."
          type: string
        disposition:
          description: What they decided; resolved cases only.
          type: string
        id:
          description: Case identifier (uuid).
          type: string
        openedAt:
          description: UTC instant the case was opened (RFC3339).
          type: string
        receivableRef:
          description: The one receivable this case is about; empty when the case is about a whole file.
          type: string
        resolvedAt:
          description: UTC instant it was disposed of (RFC3339); resolved cases only.
          type: string
        resolvedBy:
          description: Validated identity that disposed of it; resolved cases only.
          type: string
        state:
          description: open or resolved.
          type: string
      required:
        - id
        - caseType
        - assignmentSetId
        - assignmentFundId
        - receivableRef
        - state
        - detail
        - openedAt
      type: object
    AssignmentExceptionListOutputBody:
      additionalProperties: false
      properties:
        items:
          items:
            $ref: "#/components/schemas/AssignmentExceptionHumaBody"
          type:
            - array
            - "null"
      required:
        - items
      type: object
    AssignmentFundHumaBody:
      additionalProperties: false
      properties:
        administratorName:
          description: Fund administrator name.
          type: string
        administratorTaxId:
          description: Fund administrator registration identifier.
          type: string
        assignmentRate:
          description: Monthly effective cession rate as a decimal fraction string, scale 8 (e.g. "0.01750000").
          type: string
        assignorConcentrationLimit:
          description: Regulation concentration limit per assignor, as a decimal fraction string, scale 8.
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          type: string
        eligibilityMode:
          description: full (our verification is authoritative) or prefilter (the administrator verifies; the same engine runs ahead of the offer file).
          type: string
        fundName:
          description: Fund name.
          type: string
        fundTaxId:
          description: Fund registration identifier; the natural key of the registration within a tenant.
          type: string
        id:
          description: Fund registration identifier (uuid). Stable across configuration changes.
          type: string
        offerFileLayoutRef:
          description: Versioned reference to the custodian export layout.
          type: string
        paidToTransferredWindowSeconds:
          description: Orphan-detector window for "paid without transferred", in seconds.
          format: int64
          type: integer
        paymentSourceConcentrationLimit:
          description: Regulation concentration limit per payment source, as a decimal fraction string, scale 8 (e.g. "0.15000000").
          type: string
        proposedRetainedFraction:
          description: "The retained fraction (share of the expected loss kept after the sale, 0 to 1) this fund PROPOSES for the cessions assembled against it, decimal string, scale 8. Only a proposal: each cession freezes its own fraction at assembly, so re-declaring the fund never re-classifies a sale already composed."
          type: string
        proposedRiskRetention:
          description: "PROPOSED, not frozen: the regime a cession taking this fund's proposal would derive against the institution's CURRENT threshold. substantial when proposedRetainedFraction is at or above it (such a cession is refused today, LENDER-0504), none below it. A composed cession's regime is on the set and never read from here."
          type: string
        proposesSellerRetainsControl:
          description: Whether this fund PROPOSES that the seller keeps control of what it sells (Res. CMN 4.966 art. 26 III). Only a proposal; a cession that ends up with true is refused (LENDER-0505).
          type: boolean
        registryProvider:
          description: Which registry governs this fund's cession. none means no registry governs it; any other value is a registry declared by one of this deployment's jurisdictions.
          type: string
        repeatedCutLimit:
          description: How many times this fund may cut the same receivable before it stops returning to the pool automatically.
          format: int64
          type: integer
        termMode:
          description: "Who generates the endorsement term: lender_emitted or administrator_generated."
          type: string
        transferredToAcceptedWindowSeconds:
          description: Orphan-detector window for "transferred without accepted", in seconds.
          format: int64
          type: integer
        updatedAt:
          description: Last-update timestamp (RFC3339, UTC).
          type: string
      required:
        - id
        - administratorName
        - administratorTaxId
        - fundName
        - fundTaxId
        - termMode
        - eligibilityMode
        - paymentSourceConcentrationLimit
        - assignorConcentrationLimit
        - assignmentRate
        - repeatedCutLimit
        - offerFileLayoutRef
        - registryProvider
        - proposedRetainedFraction
        - proposesSellerRetainsControl
        - proposedRiskRetention
        - paidToTransferredWindowSeconds
        - transferredToAcceptedWindowSeconds
        - createdAt
        - updatedAt
      type: object
    AssignmentFundListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Registered funds ordered by name; always present, empty slice when none exist.
          items:
            $ref: "#/components/schemas/AssignmentFundHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AssignmentFundingPayoffHumaBody:
      additionalProperties: false
      properties:
        assignmentSetId:
          description: The cession whose obligation was ended.
          type: string
        borrowerPayoff:
          description: What the borrower paid to get out, decimal string, scale 2, echoed as the third reference.
          type: string
        currency:
          description: ISO-4217 code the obligation is denominated in.
          type: string
        expense:
          description: The agreed amount ABOVE the obligation, decimal string, scale 2. Financing cost taken in the period the cession ends in.
          type: string
        face:
          description: Sum of the instalments still owed, decimal string, scale 2. The ceiling the agreed amount may not cross.
          type: string
        fromState:
          description: The cession's state before this payoff.
          type: string
        gain:
          description: The agreed amount BELOW the obligation, decimal string, scale 2. Desagio that stops being appropriable. Exactly one of expense and gain is ever positive.
          type: string
        obligation:
          description: What the liability stood at on this date (Res. CMN 4.966 art. 29 para 1), decimal string, scale 2. After the payoff it is exactly zero.
          type: string
        periodsEnded:
          description: How many open periods of this receivable's ladder the payoff closed at once.
          format: int64
          type: integer
        receivableRef:
          description: The receivable that ended.
          type: string
        settlement:
          description: What the fund is owed at once, decimal string, scale 2. Credited to what this institution owes the fund, never to cash.
          type: string
        toState:
          description: The cession's state after it. It reaches 'settled' only when this was its last open obligation, so a cession of many receivables usually stays where it was.
          type: string
      required:
        - assignmentSetId
        - receivableRef
        - currency
        - obligation
        - face
        - borrowerPayoff
        - settlement
        - expense
        - gain
        - periodsEnded
        - fromState
        - toState
      type: object
    AssignmentRegistryCommandHumaBody:
      additionalProperties: false
      properties:
        commandReference:
          description: Our deterministic idempotency key for this command. Quoting it back reaches the same command, never a second one.
          type: string
        providerReference:
          description: The registry's own protocol number for this command.
          type: string
        receivableRef:
          description: The receivable the command is about.
          type: string
        replayed:
          description: True when the registry was NOT reached because this exact command had already been acknowledged.
          type: boolean
        state:
          description: requested (issued and acknowledged, waiting on the registry's acceptance), confirmed, or failed.
          type: string
      required:
        - receivableRef
        - commandReference
        - providerReference
        - state
        - replayed
      type: object
    AssignmentRemessaHumaBody:
      additionalProperties: false
      properties:
        approvalDigest:
          description: The immutable approval this file answered.
          type: string
        approvedCount:
          description: Receivables the fund took.
          format: int64
          type: integer
        assignmentFundId:
          description: The fund whose administrator sent it.
          type: string
        assignmentSetId:
          description: The set this file answered.
          type: string
        brakedReceivables:
          description: References whose per-fund cut tally reached this fund's limit. They stopped returning to the pool automatically and each has an open exception case.
          items:
            type: string
          type:
            - array
            - "null"
        contentDigest:
          description: sha-256 of exactly the ingested bytes — the identity a re-upload is recognised by.
          type: string
        cutCount:
          description: Receivables the fund refused.
          format: int64
          type: integer
        cutReceivables:
          description: References the fund refused. Each left the composition and is assignable again.
          items:
            type: string
          type:
            - array
            - "null"
        fromState:
          description: The lifecycle state the set was in.
          type: string
        id:
          description: Acceptance record identifier (uuid).
          type: string
        itemCount:
          description: Receivables answered for.
          format: int64
          type: integer
        layoutVersion:
          description: The layout the bytes were parsed under, recorded on the acceptance.
          type: string
        receivedAt:
          description: UTC ingestion instant (RFC3339).
          type: string
        receivedBy:
          description: Validated actor identity that ingested the file.
          type: string
        replayed:
          description: True when this exact file had already been accepted and nothing was written. A remessa reprocessed never cedes twice.
          type: boolean
        sizeBytes:
          description: Byte count of the ingested file.
          format: int64
          type: integer
        toState:
          description: The lifecycle state the acceptance moved it to.
          type: string
      required:
        - id
        - assignmentSetId
        - assignmentFundId
        - layoutVersion
        - contentDigest
        - approvalDigest
        - sizeBytes
        - itemCount
        - approvedCount
        - cutCount
        - cutReceivables
        - brakedReceivables
        - fromState
        - toState
        - receivedBy
        - receivedAt
        - replayed
      type: object
    AssignmentSetApprovalHumaBody:
      additionalProperties: false
      properties:
        approvedAt:
          description: Approval instant (RFC3339, UTC).
          type: string
        approvedBy:
          description: Validated actor identity that approved.
          type: string
        contentDigest:
          description: sha-256 over the canonical bytes of the approved composition. Re-derivable from those bytes, so a reader can prove the composition was not edited afterwards.
          type: string
        currency:
          description: ISO currency code of totalAssignmentPrice.
          type: string
        fundId:
          description: Fund registration the composition was approved for.
          type: string
        id:
          description: Approval identifier (uuid).
          type: string
        itemCount:
          description: How many receivables the approval covers.
          format: int64
          type: integer
        setId:
          description: Assignment set this approval covers.
          type: string
        totalAssignmentPrice:
          description: Total the fund pays for the approved composition, decimal string, scale 2.
          type: string
        trailObservedAt:
          description: Instant the rail state behind this composition was read (RFC3339, UTC). The approval covers exactly that reading.
          type: string
        valuationVersion:
          description: Pricing ruler the approved prices came out of.
          type: string
      required:
        - id
        - setId
        - fundId
        - approvedBy
        - approvedAt
        - contentDigest
        - trailObservedAt
        - valuationVersion
        - currency
        - itemCount
        - totalAssignmentPrice
      type: object
    AssignmentSetApprovalResultHumaBody:
      additionalProperties: false
      properties:
        approval:
          $ref: "#/components/schemas/AssignmentSetApprovalHumaBody"
          description: The approval fact now standing over this composition.
        replayed:
          description: True when the set was ALREADY approved over exactly this composition and the stored approval was returned unchanged. No second authority was created.
          type: boolean
      required:
        - approval
        - replayed
      type: object
    AssignmentSetDetailHumaBody:
      additionalProperties: false
      properties:
        approval:
          $ref: "#/components/schemas/AssignmentSetApprovalHumaBody"
          description: The immutable approval fact. Absent while the composition has not been approved.
        items:
          description: Every receivable ever admitted to this set, survivors and departures alike, in the order the composition was read. Always present, empty slice when none.
          items:
            $ref: "#/components/schemas/AssignmentSetItemHumaBody"
          type:
            - array
            - "null"
        set:
          $ref: "#/components/schemas/AssignmentSetHumaBody"
          description: The set and the aggregates of its surviving composition.
      required:
        - set
        - items
      type: object
    AssignmentSetDiscardResultHumaBody:
      additionalProperties: false
      properties:
        fromState:
          description: Where the set stood when the decision landed, or the state it was already in on a replay.
          type: string
        replayed:
          description: True when this set was ALREADY discarded and nothing was written. No second audit row was appended and no second decision was recorded.
          type: boolean
        setId:
          description: The composition that was called off.
          type: string
        state:
          description: "Always cancelled: the terminal state a discarded composition rests in. Nothing is deleted — the items, the transitions, the approval and the custodied evidence all stand."
          type: string
      required:
        - setId
        - fromState
        - state
        - replayed
      type: object
    AssignmentSetEligibilityHumaBody:
      additionalProperties: false
      properties:
        concentrationBase:
          description: "Denominator the surviving composition was measured against: the fund's accepted stock plus the admitted set, decimal string, scale 2."
          type: string
        currency:
          description: ISO currency code every amount above is denominated in.
          type: string
        dimensionsNotEvaluated:
          description: Concentration dimensions this scoring could not measure. sector has no data source at all; assignor is listed when the composition carries no per-receivable assignor.
          items:
            type: string
          type:
            - array
            - "null"
        eligibleCount:
          description: How many receivables survived every rule.
          format: int64
          type: integer
        items:
          description: Every receivable of the composition with its verdict.
          items:
            $ref: "#/components/schemas/AssignmentSetItemHumaBody"
          type:
            - array
            - "null"
        ruleVersion:
          description: Identifier of the eligibility/concentration rule that produced these verdicts.
          type: string
        set:
          $ref: "#/components/schemas/AssignmentSetHumaBody"
          description: The set after the scoring, in its new state.
      required:
        - set
        - items
        - ruleVersion
        - eligibleCount
        - concentrationBase
        - currency
        - dimensionsNotEvaluated
      type: object
    AssignmentSetFactHumaBody:
      additionalProperties: false
      properties:
        assignmentSetId:
          description: The set the fact was recorded against.
          type: string
        derecognizedRefs:
          description: "The receivables this call wrote off the balance sheet: contracts that left this portfolio with their write-off enqueued in the same transaction."
          items:
            type: string
          type:
            - array
            - "null"
        factType:
          description: The fact that was confirmed.
          type: string
        fromState:
          description: The lifecycle state the set was in.
          type: string
        provenance:
          description: Where the fact came from, echoed back for the audit trail.
          type: string
        recordedBy:
          description: Validated actor identity that confirmed the fact.
          type: string
        recordedRefs:
          description: The receivables this call actually recorded the fact for, excluding the ones that already carried it.
          items:
            type: string
          type:
            - array
            - "null"
        replayed:
          description: "True when nothing was written: the set was already in the resulting state, or every receivable named already carried the fact. A repeated confirmation never records a second send and never enqueues a second write-off."
          type: boolean
        toState:
          description: The lifecycle state the fact moved it to. It advances only once EVERY surviving receivable carries the fact.
          type: string
      required:
        - assignmentSetId
        - factType
        - fromState
        - toState
        - recordedBy
        - replayed
      type: object
    AssignmentSetHumaBody:
      additionalProperties: false
      properties:
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          type: string
        createdBy:
          description: Validated actor identity that assembled the composition.
          type: string
        currency:
          description: ISO currency code every amount of this set is denominated in.
          type: string
        eligibilityCheckedAt:
          description: Instant the composition was scored (RFC3339, UTC). Empty on a draft.
          type: string
        fundId:
          description: Fund registration this composition is offered to.
          type: string
        id:
          description: Assignment set identifier (uuid).
          type: string
        inSetItemCount:
          description: How many receivables are still in the composition.
          format: int64
          type: integer
        registryProvider:
          description: Registradora regime this cession runs under, frozen from the fund when the composition was assembled. The fund's registration governs the NEXT set, never this one.
          type: string
        retainedFraction:
          description: Share of the expected loss this institution keeps after the sale, frozen when the composition was assembled (the sale's own fraction, or the fund's proposal when the sale stated none), decimal string from 0 to 1, scale 8. Re-declaring the fund never changes it.
          type: string
        retentionThreshold:
          description: The institution's substantial-retention threshold in force when the composition was assembled, frozen next to the fraction, decimal string, scale 8. A later change of the threshold never re-classifies this cession.
          type: string
        riskRetention:
          description: "Res. CMN 4.966 art. 26 regime this cession is booked under, DERIVED from the two frozen numbers, never declared: substantial when retainedFraction is at or above retentionThreshold (the asset stays on this balance sheet against a liability, art. 29), none below it (the receivables leave on acceptance, art. 28)."
          type: string
        ruleVersion:
          description: Eligibility/concentration ruler that scored this composition. Empty on a draft nobody has measured yet.
          type: string
        sellerRetainsControl:
          description: "Whether the seller keeps control of what it sold (Res. CMN 4.966 art. 26 III), frozen at assembly. Always false on a composition that exists: true is refused (LENDER-0505)."
          type: boolean
        state:
          description: "Lifecycle state: draft, eligibility_checked, pending_approval, approved, offer_sent, remessa_received, term_signed, paid, transferred, accepted — plus cancelled, the terminal state a DISCARDED composition rests in. cancelled is a sideways exit, not a step of the forward walk: its receivables are released back to the assignable pool and nothing advances it."
          type: string
        totalAssignmentPrice:
          description: Assignment price of the SURVIVING composition, decimal string, scale 2.
          type: string
        totalFaceValue:
          description: Face value of the SURVIVING composition, decimal string, scale 2.
          type: string
        updatedAt:
          description: Last-update timestamp (RFC3339, UTC).
          type: string
        valuationVersion:
          description: Deterministic pricing ruler every item price came out of.
          type: string
      required:
        - id
        - fundId
        - registryProvider
        - retainedFraction
        - retentionThreshold
        - sellerRetainsControl
        - riskRetention
        - state
        - currency
        - valuationVersion
        - ruleVersion
        - eligibilityCheckedAt
        - createdBy
        - createdAt
        - updatedAt
        - inSetItemCount
        - totalFaceValue
        - totalAssignmentPrice
      type: object
    AssignmentSetItemHumaBody:
      additionalProperties: false
      properties:
        assignmentPrice:
          description: Present value at the fund's cession rate — what the fund pays, decimal string, scale 2.
          type: string
        assignmentRate:
          description: Monthly effective cession rate applied, decimal fraction string, scale 8.
          type: string
        assignorRef:
          description: Opaque assignor key the fund's assignor limit aggregates by.
          type: string
        borrowerRef:
          description: Opaque debtor key the invariable 20% cap aggregates by. Never a document number.
          type: string
        currency:
          description: ISO currency code of every amount on this item.
          type: string
        custodyComplete:
          description: Whether the signature evidence was complete when the receivable entered the set.
          type: boolean
        discountAmount:
          description: faceValue minus assignmentPrice, decimal string, scale 2.
          type: string
        dossierDigest:
          description: Digest of the materialized evidence bundle. Empty when no dossier has been produced yet — the endorsement term is what refuses to be signed over that.
          type: string
        exitReason:
          description: Why it was removed, in the remover's own vocabulary. Empty while in_set.
          type: string
        exitSource:
          description: "Who removed it: eligibility (our engine), remessa (the fund's return file) or trail (the rail re-read). Empty while in_set."
          type: string
        faceValue:
          description: Face value of the remaining flow, decimal string, scale 2.
          type: string
        hasOpenOverdue:
          description: Whether the receivable carried open arrears when it entered the set.
          type: boolean
        installmentCount:
          description: Installments remaining as frozen at entry.
          format: int64
          type: integer
        itemState:
          description: in_set, cut (a verdict removed it) or removed_trail (the pre-approval rail re-read no longer found it).
          type: string
        outstandingBalance:
          description: Outstanding balance as frozen at entry, decimal string, scale 2.
          type: string
        paymentSourceRef:
          description: Opaque key of the receivable's payment source — the party the instalment is collected through — that the fund's payment-source limit aggregates by. Which party that is belongs to the jurisdiction, and this contract never names it.
          type: string
        principalAmount:
          description: Booked principal as frozen at entry, decimal string, scale 2.
          type: string
        receivableRef:
          description: Receivable reference (the rail contract number).
          type: string
        registrationActive:
          description: Whether the rail registration was in force when the receivable entered the set.
          type: boolean
        repriced:
          description: True when the pre-approval rail re-read found this receivable altered and the same ruler repriced it (Q-P6-5).
          type: boolean
        snapshotObservedAt:
          description: Instant the frozen facts above were read (RFC3339, UTC).
          type: string
        trailInstallmentsRemaining:
          description: Remaining installments the RAIL reported at the last pre-approval re-read. Absent before the first one.
          format: int64
          type: integer
        valuationBaseDate:
          description: Base date the present value was discounted to (RFC3339, UTC).
          type: string
        valuationVersion:
          description: Pricing ruler this price came out of.
          type: string
      required:
        - receivableRef
        - itemState
        - exitSource
        - exitReason
        - repriced
        - borrowerRef
        - paymentSourceRef
        - assignorRef
        - outstandingBalance
        - principalAmount
        - installmentCount
        - currency
        - registrationActive
        - custodyComplete
        - hasOpenOverdue
        - dossierDigest
        - faceValue
        - assignmentPrice
        - discountAmount
        - valuationVersion
        - assignmentRate
        - valuationBaseDate
        - snapshotObservedAt
      type: object
    AssignmentSetListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: One row per set, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/AssignmentSetHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    AssignmentTermHumaBody:
      additionalProperties: false
      properties:
        assignmentFundId:
          description: The fund whose configured mode decided the origin (uuid).
          type: string
        assignmentSetId:
          description: The approved set this term covers (uuid).
          type: string
        coObligation:
          description: "Whether this term binds the assignor to answer for the receivable it sold (coobrigação). Always false on a term this service recorded: the retained-risk treatment TRUE implies does not exist yet. NULL on a term recorded before the declaration existed — that is a gap in the record, not a statement that the instrument carries no recourse, and it must not be read as false."
          type:
            - boolean
            - "null"
        contentDigest:
          description: sha-256 of the term document.
          type: string
        digestMethod:
          description: "What contentDigest was computed over: the normalized form of our own render, or the raw bytes exactly as received."
          enum:
            - sha256_pdf_normalized
            - sha256_raw
          type: string
        documentTemplateVersionId:
          description: Template version rendered from; present only for a lender-emitted term.
          type: string
        externalReference:
          description: The administrator's own document identifier; administrator-generated only.
          type: string
        externalSource:
          description: The administrator on record for the fund; resolved server-side, administrator-generated only.
          type: string
        id:
          description: Term record identifier (uuid).
          type: string
        idempotencyKey:
          description: Caller's idempotency key.
          type: string
        inputFingerprint:
          description: sha-256 of the caller-controlled comparison payload.
          type: string
        origin:
          description: Which path produced this term, resolved from the fund's configuration.
          enum:
            - lender_emitted
            - administrator_generated
          type: string
        pageGeometryRef:
          description: Versioned page geometry; lender-emitted only.
          type: string
        recordedAt:
          description: UTC registration instant (RFC3339).
          type: string
        recordedBy:
          description: Validated actor identity that recorded the term.
          type: string
        rendererVersion:
          description: Render engine identity; lender-emitted only.
          type: string
        replayed:
          description: True when this call replayed an existing term under the same idempotency key rather than recording a new one.
          type: boolean
        setSnapshotDigest:
          description: sha-256 of the frozen approved composition this term covers.
          type: string
        sizeBytes:
          description: Byte count custody actually stored.
          format: int64
          type: integer
        specVersion:
          description: Field-assembly rules version; lender-emitted only.
          type: string
      required:
        - id
        - assignmentSetId
        - assignmentFundId
        - idempotencyKey
        - origin
        - setSnapshotDigest
        - inputFingerprint
        - contentDigest
        - digestMethod
        - sizeBytes
        - coObligation
        - recordedAt
        - recordedBy
        - replayed
      type: object
    CETDisclosureResponse:
      additionalProperties: false
      properties:
        cetAnnualPct:
          description: Custo Efetivo Total, annualized, as a percentage decimal string with scale 8 (e.g. "12.34567890").
          examples:
            - "12.34567890"
          type: string
        cetMonthlyPct:
          description: Custo Efetivo Total, monthly, as a percentage decimal string with scale 8 (e.g. "1.23456789").
          examples:
            - "1.23456789"
          type: string
        createdAt:
          description: RFC3339 UTC timestamp at which the disclosure record was created.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        frozenAt:
          description: RFC3339 UTC timestamp at which the disclosure was frozen and made immutable.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Unique identifier (UUID) of the frozen CET disclosure record.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        jurisdictionCode:
          description: ISO jurisdiction code governing the disclosure (e.g. "BR").
          examples:
            - BR
          type: string
        loanAccountId:
          description: UUID of the loan account the disclosure is bound to.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        loanApplicationId:
          description: UUID of the loan application this CET disclosure was computed for.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        memoryOfCalculation:
          description: "Memoria de calculo: structured breakdown of the cash flows and steps producing the CET."
        profileVersion:
          description: Jurisdiction profile version used to compute the CET, captured for auditability.
          examples:
            - 1.0.0
          type: string
        rateTableSnapshot:
          description: Frozen snapshot of the rate/fee table inputs used in the CET calculation.
      required:
        - id
        - loanApplicationId
        - loanAccountId
        - jurisdictionCode
        - profileVersion
        - cetAnnualPct
        - cetMonthlyPct
        - rateTableSnapshot
        - memoryOfCalculation
        - frozenAt
        - createdAt
      type: object
    CapitalizationClauseConsentArtifactResponse:
      additionalProperties: false
      properties:
        acceptedAt:
          description: RFC3339 UTC timestamp when the borrower accepted the clause.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        acceptedByActor:
          description: Authenticated actor identity (resolved from request context) that accepted the clause.
          type: string
        clauseTextHash:
          description: Server-recomputed SHA-256 hex digest of the canonicalized clause text (64 lowercase hex chars).
          examples:
            - e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
          type: string
        consentEvidence:
          description: Opaque evidence reference proving the borrower accepted the clause.
          type: string
        createdAt:
          description: RFC3339 UTC timestamp when the artifact was persisted.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Server-generated UUID of the persisted consent artifact.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        jurisdictionCode:
          description: ISO 3166-1 alpha-2 jurisdiction code (e.g. "BR").
          examples:
            - BR
          type: string
        loanApplicationId:
          description: UUID of the loan application this consent is attached to.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        profileVersion:
          description: Jurisdiction profile version in effect when the disclosure was presented (e.g. "1.0.0").
          examples:
            - 1.0.0
          type: string
      required:
        - id
        - loanApplicationId
        - clauseTextHash
        - consentEvidence
        - acceptedAt
        - acceptedByActor
        - profileVersion
        - jurisdictionCode
        - createdAt
      type: object
    ChargeTemplateHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Flat amount, decimal string.
          examples:
            - "25.00"
          type: string
        chargeCode:
          description: Charge code.
          examples:
            - SERVICING_FEE
          type: string
        chargeTemplateId:
          description: Operator-chosen key for this charge model.
          examples:
            - SERVICING_FEE
          type: string
        chargeType:
          description: Charge type.
          examples:
            - fee
          type: string
        currency:
          description: ISO 4217 currency code.
          examples:
            - BRL
          type: string
        effectiveFrom:
          description: Date this revision takes effect (RFC3339, UTC).
          examples:
            - "2026-04-01T00:00:00Z"
          type: string
        productVersionId:
          description: Product version this model belongs to (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        rate:
          description: Rate component, decimal string.
          examples:
            - "0"
          type: string
        refundable:
          description: Whether early payoff gives this charge back pro-rata.
          examples:
            - false
          type: boolean
      required:
        - chargeTemplateId
        - productVersionId
        - chargeCode
        - chargeType
        - amount
        - rate
        - currency
        - effectiveFrom
        - refundable
      type: object
    ChartPositionMoveHumaBody:
      additionalProperties: false
      properties:
        amountCode:
          description: The position that moved, in the vocabulary the posting legs use.
          examples:
            - principal
          type: string
        fromAccount:
          description: The account it is booked at under the outgoing chart.
          examples:
            - 1.1.1.01
          type: string
        toAccount:
          description: The account it is booked at under the incoming chart.
          examples:
            - 1.1.2.01
          type: string
      required:
        - amountCode
        - fromAccount
        - toAccount
      type: object
    CollectReturnedPaymentReceivableHumaRequest:
      additionalProperties: false
      properties:
        collectedAt:
          description: RFC 3339 instant the money arrived. Defaults to now when absent.
          examples:
            - "2026-07-01T12:00:00Z"
          format: date-time
          type: string
      type: object
    CollectionAgentChannelAppointHumaInputBody:
      additionalProperties: false
      properties:
        active:
          description: Defaults to true. False turns the channel OFF without deleting the agent's identity, returning issuance to the park; an instrument already issued still names the agent that received it.
          type: boolean
        agentAccountId:
          description: "The collection agent's own receiving account, held at the agent and never an account of the lender's: the agent receives the borrower's cash and the lender ingests the settlement file. It becomes the payment identity of every settlement of the instructions it stamps, so it admits no colon, whitespace or control character — \"conta byx 001\" is refused here, where a 422 costs nothing, instead of stranding a paid borrower's money later."
          maxLength: 255
          minLength: 1
          pattern: ^[^\s:\x00-\x1f\x7f]+$
          type: string
        agentName:
          description: The collection agent, lowercase authority shape. It is stamped VERBATIM on every instruction and the baixa file quotes it back byte-exactly, so mixed case would issue instructions no file could answer.
          maxLength: 100
          minLength: 1
          pattern: ^[a-z0-9][a-z0-9._-]{0,99}$
          type: string
      required:
        - agentName
        - agentAccountId
      type: object
    CollectionAgentChannelHumaBody:
      additionalProperties: false
      properties:
        active:
          description: True while the channel instructs; false parks issuance.
          type: boolean
        agentAccountId:
          description: The agent's receiving account.
          type: string
        agentName:
          description: The appointed collection agent.
          type: string
      required:
        - agentName
        - agentAccountId
        - active
      type: object
    CollectionInstructionHumaBody:
      additionalProperties: false
      properties:
        agentAccountId:
          description: The agent account the money is received into. Never an account of ours.
          type: string
        agentName:
          description: The collection agent this instruction was issued to.
          type: string
        amount:
          description: Amount to collect, cent scale, decimal string; never a float. For a payoff this is the FROZEN number and it does not change inside the window.
          type: string
        competencia:
          description: YYYYMM payroll period the instruction answers for. Absent when the instruction answers for the whole debt rather than one period.
          type: string
        currency:
          description: ISO 4217 currency code.
          type: string
        instructionRef:
          description: The reference the baixa file must quote back for this instruction. Byte-exact.
          type: string
        instrumentId:
          description: Collection instrument identifier (uuid).
          type: string
        issuedAt:
          description: UTC instant this instruction was issued (RFC3339).
          type: string
        kind:
          description: "What to collect: an overdue payroll instalment residual, a frozen full-payoff amount the worker pays, a frozen full-payoff amount the institution TAKING THE CONTRACT OVER pays, or the early settlement owed to a fund. The four literals are the closed vocabulary the durable instruction CHECK admits (BR migrations 000039 and 000044)."
          enum:
            - arrear
            - payoff
            - payoff_portability
            - fund_settlement
          type: string
        loanAccountId:
          description: Servicing account the collection belongs to (uuid).
          type: string
        numeroContrato:
          description: Contract identity on the payroll rail.
          type: string
        validUntil:
          description: "UTC instant this instruction leaves the agent's work queue (RFC3339). It bounds when the borrower may PAY, never when you may declare it: a receipt the agent collected inside the window is accepted whenever the file arrives. What differs by kind is the payment instant itself. A payoff amount is FROZEN, so it stops being the amount owed — a payment the borrower made at or after this instant is refused and the payoff must be re-quoted. An arrear residual does not go stale: the instruction stays valid, so even a late payment is accepted."
          type: string
      required:
        - instrumentId
        - loanAccountId
        - instructionRef
        - agentName
        - agentAccountId
        - kind
        - numeroContrato
        - amount
        - currency
        - issuedAt
        - validUntil
      type: object
    CollectionInstructionListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Open instructions, oldest first.
          items:
            $ref: "#/components/schemas/CollectionInstructionHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    CollectionSettlementIngestHumaBody:
      additionalProperties: false
      properties:
        agentName:
          description: "The collection agent the file came from. Checked before anything was stored: it has to be this tenant's active channel, or the agent an instruction still open was issued to."
          type: string
        currency:
          description: ISO 4217 currency code.
          type: string
        fileDigest:
          description: sha-256 of exactly the ingested bytes — the identity a re-upload is recognised by.
          type: string
        layoutVersion:
          description: The layout the bytes were parsed under, recorded on every line.
          type: string
        lineCount:
          description: Settlements the file carries.
          format: int64
          type: integer
        replayed:
          description: True when every line of this file was already known and nothing was written.
          type: boolean
        storedCount:
          description: "Settlements this upload durably added. Zero on a re-upload: every line was already known and nothing was applied a second time."
          format: int64
          type: integer
        totalPaid:
          description: Total the file declares, cent scale, decimal string; never a float.
          type: string
      required:
        - fileDigest
        - layoutVersion
        - agentName
        - lineCount
        - storedCount
        - totalPaid
        - currency
        - replayed
      type: object
    CollectionSettlementQuarantineHumaBody:
      additionalProperties: false
      properties:
        agentAccountId:
          description: The agent account the money was received into. Never an account of ours.
          type: string
        agentName:
          description: The collection agent that declared the receipt.
          type: string
        amount:
          description: Amount the agent DECLARED it received, cent scale, decimal string; never a float.
          type: string
        attemptCount:
          description: Attempts spent before the line was parked.
          format: int64
          type: integer
        currency:
          description: ISO 4217 currency code.
          type: string
        fileDigest:
          description: SHA-256 of the uploaded file the line came from, hex. Identity of the delivery, never of the payment.
          type: string
        id:
          description: Inbox line identifier (uuid). This is the id the requeue route takes.
          type: string
        instructionRef:
          description: The instruction the line answers, byte-exact.
          type: string
        paidAt:
          description: UTC instant the agent says the borrower paid (RFC3339).
          type: string
        paymentReference:
          description: "The agent's own payment reference for the receipt. Evidence to quote back to the agent, never an identity: it is not required to be unique and nothing is matched on it."
          type: string
        quarantinedAt:
          description: UTC instant the line was parked (RFC3339).
          type: string
        reason:
          description: "Why it is parked: the drainer's label plus the underlying cause."
          type: string
        receivedAt:
          description: UTC instant the file was ingested (RFC3339).
          type: string
        requeueCount:
          description: How many times an operator has already released this line.
          format: int64
          type: integer
        sequence:
          description: The line's position in that file.
          format: int64
          type: integer
      required:
        - id
        - fileDigest
        - sequence
        - agentName
        - agentAccountId
        - instructionRef
        - amount
        - currency
        - paidAt
        - paymentReference
        - attemptCount
        - requeueCount
        - reason
        - receivedAt
        - quarantinedAt
      type: object
    CollectionSettlementQuarantineListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Parked settlement lines, oldest parked first.
          items:
            $ref: "#/components/schemas/CollectionSettlementQuarantineHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    CollectionSettlementRefusedHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Amount this line declared, cent scale, decimal string; never a float.
          type: string
        currency:
          description: ISO 4217 currency code this line declared.
          type: string
        fileDigest:
          description: SHA-256 of the file this line arrived in, hex. The same digest the upload answered with.
          type: string
        instructionRef:
          description: The instruction reference this line quoted. Byte-exact, as delivered.
          type: string
        paidAt:
          description: UTC instant this line declared the receipt was taken (RFC3339).
          type: string
        paymentReference:
          description: The payment reference this line carried.
          type: string
        reason:
          description: "The same refusal in a sentence, for a human reading the list. Prose: it may be reworded between releases."
          type: string
        reasonCode:
          description: "Why the line was refused. This token is the contract: branch on it, never on the sentence. 'unprocessable' means the refusal is not one this surface can attribute to the line, and the line is held for operator review."
          enum:
            - unknown_instruction
            - not_an_agent_instruction
            - partial_amount
            - currency_mismatch
            - predates_instruction
            - future_receipt
            - payoff_window_closed
            - already_settled
            - payment_refused
            - invalid_line
            - unprocessable
          type: string
        refusedAt:
          description: UTC instant the line was refused (RFC3339).
          type: string
        sequence:
          description: Position of this line inside that file, as the file itself numbers it.
          format: int64
          type: integer
      required:
        - fileDigest
        - sequence
        - instructionRef
        - amount
        - currency
        - paidAt
        - paymentReference
        - refusedAt
        - reasonCode
        - reason
      type: object
    CollectionSettlementRefusedListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Refused lines, NEWEST refusal first.
          items:
            $ref: "#/components/schemas/CollectionSettlementRefusedHumaBody"
          type:
            - array
            - "null"
        nextCursor:
          description: Pass back as the cursor query parameter to read the next (older) page. Absent when this page is the end of the feed.
          type: string
      required:
        - data
      type: object
    CompensatingAdjustmentEvidenceHumaBody:
      additionalProperties: false
      properties:
        adjustmentId:
          description: Compensating adjustment operation this evidence is attached to.
          type: string
        createdAt:
          description: RFC3339 UTC.
          type: string
        existing:
          description: True when this call replayed an already-stored upload (same adjustment, same digest), never a duplicate.
          type: boolean
        id:
          description: Evidence record identifier.
          type: string
        mimeType:
          description: application/pdf, image/jpeg or image/png.
          type: string
        sizeBytes:
          description: Uploaded size in bytes.
          format: int64
          type: integer
      required:
        - id
        - adjustmentId
        - mimeType
        - sizeBytes
        - createdAt
        - existing
      type: object
    CompensatingAdjustmentHumaBody:
      additionalProperties: false
      properties:
        adjustmentAmount:
          description: Signed compensating entry magnitude, exact two-decimal string.
          type: string
        correctionEventId:
          description: Landed correction event this adjustment resolves, when set.
          type: string
        createdAt:
          description: RFC3339 UTC.
          type: string
        createdBy:
          description: Validated actor identity that created this operation.
          type: string
        currency:
          description: ISO-4217 currency code.
          type: string
        debtAmountAfter:
          description: CCB debt after, when this adjustment changes the debt.
          type: string
        debtAmountBefore:
          description: CCB debt before, when this adjustment changes the debt.
          type: string
        divergenceId:
          description: Divergence this adjustment resolves, when set.
          type: string
        existing:
          description: True when this call replayed an already-committed operation for the same idempotency key, never a duplicate.
          type: boolean
        id:
          description: Compensating adjustment operation identifier.
          type: string
        idempotencyKey:
          description: Idempotency key this operation was created (or replayed) under.
          type: string
        justification:
          description: Operator's structured justification.
          type: string
        numeroContrato:
          description: Canonical rail contract number.
          type: string
        reason:
          description: Closed reason catalog.
          type: string
        resolvedGlAccount:
          description: Suspense GL account this operation was authorized against. Empty when the currency had no configured suspense account at create time — the posting intent could not be recorded yet.
          type: string
      required:
        - id
        - numeroContrato
        - reason
        - justification
        - currency
        - adjustmentAmount
        - idempotencyKey
        - createdBy
        - createdAt
        - existing
      type: object
    CompensatingAdjustmentHumaRequest:
      additionalProperties: false
      properties:
        adjustmentAmount:
          description: "Signed compensating entry magnitude, exact two-decimal string. Sign convention: payment_shortfall must be negative, payment_excess must be positive."
          type: string
        correctionEventId:
          description: Landed correction event this adjustment resolves. At most one of divergenceId/correctionEventId may be set.
          maxLength: 255
          type: string
        currency:
          description: ISO-4217 currency code.
          maxLength: 3
          minLength: 3
          type: string
        debtAmountAfter:
          description: CCB debt after this adjustment. Both-or-neither with debtAmountBefore.
          type: string
        debtAmountBefore:
          description: CCB debt before this adjustment. Both-or-neither with debtAmountAfter.
          type: string
        divergenceId:
          description: Divergence this adjustment resolves. At most one of divergenceId/correctionEventId may be set.
          format: uuid
          type: string
        justification:
          description: Operator's structured justification.
          maxLength: 4000
          minLength: 1
          type: string
        numeroContrato:
          description: Canonical rail contract number.
          maxLength: 15
          minLength: 2
          type: string
        reason:
          description: Closed reason catalog; no free-form 'other'.
          enum:
            - payment_shortfall
            - payment_excess
            - immutable_client_correction
            - internal_ccb_residual
          type: string
      required:
        - numeroContrato
        - reason
        - justification
        - currency
        - adjustmentAmount
      type: object
    ConfigureAccountingProfileHumaInputBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: Accounting recognition mode.
          enum:
            - accrual
            - cash
          examples:
            - accrual
          type: string
        loanProductVersionId:
          description: Loan product version identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
        midazLedgerId:
          description: Optional per-product Midaz ledger the profile's postings route into; both-or-neither with midazOrganizationId. Required under multi-tenant mode; empty single-tenant profiles fall back to the env default.
          examples:
            - ledger-def
          maxLength: 128
          type: string
        midazOrganizationId:
          description: Optional per-product Midaz organization the profile's postings route into; both-or-neither with midazLedgerId. Required under multi-tenant mode; empty single-tenant profiles fall back to the env default.
          examples:
            - org-abc
          maxLength: 128
          type: string
        postingRules:
          description: "Non-null GL account mappings per accounting event. New profiles require disbursement, repayment, prepayment, accrual, collection_unapplied, collection_reapply, and collection_refund; accrual_tax, accrual_fee_amortization, assignment_derecognition, assignment_retained_settlement, assignment_secured_borrowing, assignment_funding_amortization, assignment_funding_payoff, assignment_repurchase, refinance_payoff, refinance_payoff_reversal, provision_constitution, provision_reversal, renegotiation_gain, renegotiation_loss, renegotiation_derecognition, renegotiation_recognition, returned_payment_recognition, returned_payment_provision_constitution, returned_payment_provision_reversal and returned_payment_write_off are optional. A product whose receivables are ever assigned to a fund MUST carry assignment_derecognition: the cession flip and its write-off are both-or-nothing, so an acceptance over a product without it refuses and queues an exception case. It MUST also carry assignment_retained_settlement to be sellable mid-cycle: an instalment that fell due before the cession cut stays with the assignor, and this rule names the account it is reclassified into at acceptance and liquidated out of when its payroll repasse lands. Without it an acceptance over a receivable that retains one refuses instead of selling flow the fund did not buy. A product whose receivables are ever assigned WITH the assignor answering for them (coobrigação) MUST carry assignment_secured_borrowing: Res. CMN 4.966 art. 29 keeps such a receivable on the balance sheet and turns the price received into an obligation measured at amortized cost, appropriated over the remaining term, so this rule names the liability account the consideration is credited to. It is a different posting and not a variant of the write-off — it credits no receivable and books no gain or loss on the sale date — and a cession declared with retained risk over a product that lacks it is REFUSED rather than booked down the write-off path, which would take off the balance sheet the one asset regulation requires to stay on it. Such a product MUST carry assignment_funding_amortization beside it: the sale raises an obligation carried for the whole remaining term and the repasse posting is the only thing that ends it, so a chart with the sale rule alone can open a liability it can never close. The two are accepted together — a retained-risk cession over a product missing assignment_funding_amortization is refused AT ACCEPTANCE, before any obligation exists, rather than months later at the first repasse. assignment_funding_payoff ends a cession early and is not required yet; it becomes required on the same terms once the early-end payoff is issuable. Both stay optional to every product that does not sell with retained risk. A product whose sold receivables can be settled early by the bancarizador (a refinance) MUST carry assignment_repurchase: without it the fund-settlement receipt is refused, because flipping the contract back onto this book with nothing to recognize the asset against is the failure the both-or-nothing rule exists to stop. A product that is refinanced MUST also carry refinance_payoff and refinance_payoff_reversal, which discharge the old contract against the bancarizador warehouse advance and restore it if the rail undoes the swap inside its regret window. A product that retains an origination fee at disbursement MUST carry accrual_fee_amortization, and its disbursement rule MUST carry the optional origination_fee component credit leg: the fee is withheld from the borrower's cash at t0 and earned back as yield over the life, so without them the fee has no account to be deferred in and none to be earned out of, and every centavo of it is refused rather than falling back onto the borrower's interest receivable. A product booked under Brazilian credit-loss rules MUST carry provision_constitution and provision_reversal: the engine measures every contract's provision on every business date and posts the movement against the previous measurement, so a product without them accrues a measured provision that never reaches the ledger. A product whose contracts are renegotiated under Res. CMN 4.966/2021 art. 22 MUST carry renegotiation_gain and renegotiation_loss: a NON-substantial modification settles the difference between the modified payments and the carrying amount immediately, and a product with neither computes an adjustment with nowhere to book it. It MUST carry renegotiation_derecognition and renegotiation_recognition to be renegotiated SUBSTANTIALLY: that modification ends the old contract and mints a new one, so the two halves post separately against a bridge account, and a product missing either would derecognise a contract with nothing recognised in its place. A product whose final payments can be given back after the payroll mandate is already gone MUST carry returned_payment_recognition together with returned_payment_provision_constitution, returned_payment_provision_reversal and returned_payment_write_off: the diverted payment becomes a debt of the borrower's own that is due from day 1 and provisions by age on this product's own ladder, so a chart that can open one and cannot provision it is refused here rather than at 05:00 on the nightly sweep, where the debt would sit at face value for ever with nothing flagging it."
          items:
            $ref: "#/components/schemas/PostingRuleHumaInputBody"
          maxItems: 27
          minItems: 7
          type: array
      required:
        - loanProductVersionId
        - accountingMode
        - postingRules
      type: object
    ContractDivergenceDetailHumaBody:
      additionalProperties: false
      properties:
        divergence:
          $ref: "#/components/schemas/ContractDivergenceHumaBody"
        events:
          description: Full append-only history, newest first.
          items:
            $ref: "#/components/schemas/ContractDivergenceEventHumaBody"
          type:
            - array
            - "null"
        gatewayEvidence:
          description: Raw gateway-observed evidence. Secondary to the structured fields.
        lenderEvidence:
          description: Raw Lender-produced evidence. Secondary to the structured fields.
      required:
        - divergence
        - gatewayEvidence
        - lenderEvidence
        - events
      type: object
    ContractDivergenceEventHumaBody:
      additionalProperties: false
      properties:
        actor:
          description: Identity or system source that performed the transition.
          type: string
        createdAt:
          description: Instant history durably captured it (RFC3339 UTC).
          type: string
        detail:
          description: Transition-specific structured detail.
        id:
          description: History entry identifier.
          type: string
        occurredAt:
          description: Business instant of the transition (RFC3339 UTC).
          type: string
        sequence:
          description: Monotonic sequence within the item.
          format: int64
          type: integer
        type:
          description: opened|assigned|requeued|adjustment_requested|adjustment_posted|disposed.
          type: string
      required:
        - id
        - sequence
        - type
        - actor
        - occurredAt
        - createdAt
      type: object
    ContractDivergenceHumaBody:
      additionalProperties: false
      properties:
        adjustmentStatus:
          description: not_required|required|requested|posted.
          type: string
        amountCurrency:
          description: ISO-4217 currency of the contested amounts.
          type: string
        assignedAt:
          description: Instant of the current assignment (RFC3339 UTC).
          type: string
        assignee:
          description: Operator currently responsible, when assigned.
          type: string
        authority:
          description: "Source of truth for the contested value: client|dataprev|gateway|lender."
          type: string
        calculatedAt:
          description: Instant the Lender calculation was produced (RFC3339 UTC).
          type: string
        category:
          description: "Bounded category: cash|rate|terms|margin|registration|technical."
          type: string
        classification:
          description: Specific durable exception inside the category.
          type: string
        clientDeclaredAmount:
          description: Authoritative value the client declared, when a comparison exists.
          type: string
        contractId:
          description: Contract the divergence belongs to.
          type: string
        createdAt:
          description: RFC3339 UTC.
          type: string
        disposedAt:
          description: Instant of disposition (RFC3339 UTC), present once disposed.
          type: string
        dispositionActor:
          description: Identity that disposed the item, present once disposed.
          type: string
        dispositionJustification:
          description: Free-text justification, present once disposed.
          type: string
        dispositionResult:
          description: Structured outcome, present once disposed.
          type: string
        dispositionState:
          description: open|disposed.
          type: string
        effect:
          description: "What the item does to the flow: audit_only|posting_pending|adjustment_required|booking_blocked."
          type: string
        firstObservedAt:
          description: First durable persist (RFC3339 UTC); the SLA clock start.
          type: string
        id:
          description: Contract divergence identifier.
          type: string
        latestObservedAt:
          description: Most recent observation (RFC3339 UTC).
          type: string
        lenderCalculatedAmount:
          description: Lender calculation. Audit evidence only, never authoritative.
          type: string
        occurrenceKey:
          description: Replay-fencing key for the observed occurrence.
          type: string
        railAcceptedAt:
          description: Instant the rail accepted the underlying fact (RFC3339 UTC).
          type: string
        ruleVersion:
          description: Version of the rule that produced the Lender calculation.
          type: string
        slaDueAt:
          description: Resolution deadline (RFC3339 UTC).
          type: string
        updatedAt:
          description: RFC3339 UTC.
          type: string
        version:
          description: "Compare-and-swap guard: every mutation supplies this as expectedVersion."
          format: int64
          type: integer
      required:
        - id
        - contractId
        - category
        - classification
        - effect
        - authority
        - occurrenceKey
        - railAcceptedAt
        - firstObservedAt
        - latestObservedAt
        - slaDueAt
        - dispositionState
        - adjustmentStatus
        - version
        - createdAt
        - updatedAt
      type: object
    ContractDivergenceListHumaBody:
      additionalProperties: false
      properties:
        asOf:
          description: RFC3339 UTC cutoff this page used for SLA-breached display ordering only. Resend as asOf on the next page.
          type: string
        data:
          description: Page of divergences; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/ContractDivergenceHumaBody"
          type:
            - array
            - "null"
        hasMore:
          description: True when at least one more item exists beyond this page.
          type: boolean
      required:
        - data
        - hasMore
        - asOf
      type: object
    CreateAccrualRunHumaInputBody:
      additionalProperties: false
      properties:
        businessDate:
          description: "Business date (YYYY-MM-DD) the run is executed on. The run recognizes the last CIVIL MONTH that fully elapsed before this date — a run dated anywhere in July closes June — for the WHOLE book, pro rata temporis by calendar days, with the loan's contracting month apportioned within that month. Any date works: no account is skipped for the day of the month it was disbursed on. Re-running the same competência is a no-op, so this is also the backfill lever: to close a month that was missed, post a date inside the following month."
          examples:
            - "2026-06-14"
          format: date
          type: string
        loanProductIds:
          description: Optional loan product identifiers to scope the run.
          items:
            format: uuid
            type: string
          maxItems: 100
          type:
            - array
            - "null"
        mode:
          description: Label recorded on the run for correlation and logs. It does not change the cadence or select which accounts are recognized. The label is part of the run's correlation id, so "heartbeat" is reserved for the scheduled driver and is refused here.
          examples:
            - daily
          maxLength: 32
          minLength: 1
          type: string
      required:
        - businessDate
        - mode
      type: object
    CreateAssignmentSetHumaInputBody:
      additionalProperties: false
      properties:
        fundId:
          description: Fund registration this composition is offered to. Its cession rate prices every receivable and its regulation supplies the concentration limits.
          format: uuid
          type: string
        receivableRefs:
          description: The receivables the desk chose, by rail contract reference. A reference the tenant's assignable pool does not carry is refused by name — never dropped from the set silently.
          items:
            type: string
          maxItems: 500
          minItems: 1
          type:
            - array
            - "null"
        retainedFraction:
          description: "The share of the expected loss this institution keeps after THIS sale, a decimal string from 0 to 1 with at most 8 decimal places (0 keeps nothing, 0.1 keeps 10%). Omit it to take the fraction the fund proposes. Whichever results is frozen onto the cession next to the institution's substantial-retention threshold of that day, and the regime is derived from those two frozen values, never re-read from the fund. Refusals: null or blank LENDER-0503; not a decimal, below 0, above 1 or more than 8 decimal places LENDER-0506; a fraction at or above the threshold (substantial retention) LENDER-0504, not bookable yet."
          examples:
            - "0"
          type: string
        sellerRetainsControl:
          description: "Whether the seller keeps control of what THIS sale transfers, the middle band of Res. CMN 4.966 art. 26 III that a fraction cannot express. Omit it to take what the fund proposes. Refusals: null LENDER-0503; true LENDER-0505, a band this product does not book and never will."
          examples:
            - false
          type: boolean
      required:
        - fundId
        - receivableRefs
      type: object
    CreateChargeTemplateHumaInputBody:
      additionalProperties: false
      properties:
        amount:
          description: Flat amount, decimal string, non-negative.
          examples:
            - "25.00"
          type: string
        chargeCode:
          description: Charge code carried onto every charge assessed from this model.
          examples:
            - SERVICING_FEE
          minLength: 1
          type: string
        chargeTemplateId:
          description: Operator-chosen key for this charge model. Charges are applied by naming it.
          examples:
            - SERVICING_FEE
          maxLength: 128
          minLength: 1
          type: string
        chargeType:
          description: "Charge type. Not a label: the Brazilian consumer-credit cap applies to late_fee and default_interest only, so a wrong type escapes its own ceiling."
          enum:
            - late_fee
            - default_interest
            - origination_fee
            - fee
          examples:
            - fee
          type: string
        currency:
          description: ISO 4217 currency code.
          examples:
            - BRL
          maxLength: 3
          minLength: 3
          type: string
        effectiveFrom:
          description: "Date this revision takes effect (RFC3339 or YYYY-MM-DD, UTC). Must be strictly after the newest revision of the same model on this version: a revision never reaches backwards into days already priced."
          examples:
            - "2026-04-01"
          type: string
        rate:
          description: Rate component, decimal string, non-negative. Defaults to 0.
          examples:
            - "0"
          type: string
        refundable:
          description: "Whether early payoff gives this charge back pro-rata (CDC art. 52 par. 2), measured from the day it was assessed to the contract's final scheduled due date. ABSENT MEANS NOT REFUNDABLE: a charge earned when it was levied, such as a flat origination fee, must be left false. The assessed charge freezes this declaration, so revising the model never changes what is owed on a charge already levied."
          examples:
            - false
          type: boolean
      required:
        - chargeTemplateId
        - chargeCode
        - chargeType
        - amount
        - currency
        - effectiveFrom
      type: object
    CreateDocumentTemplateHumaInputBody:
      additionalProperties: false
      properties:
        kind:
          description: "Document kind. A loan product owns the CCB clausulado and nothing else: the registry's kind and scope form one closed domain, and the assignment endorsement term is published per fund under /api/v1/assignment/funds/{fundId}/document-templates."
          enum:
            - ccb
          type: string
        requiredFields:
          description: Placeholder field names this template declares it needs; unioned with the jurisdiction's own minimum catalog at render time.
          items:
            type: string
          type:
            - array
            - "null"
        sections:
          description: Ordered clauses.
          items:
            $ref: "#/components/schemas/DocumentTemplateSectionHumaBody"
          minItems: 1
          type:
            - array
            - "null"
        signatureBlock:
          description: Signature block text.
          type: string
        title:
          description: Template title.
          type: string
      required:
        - kind
        - title
        - sections
        - signatureBlock
      type: object
    CreateFundDocumentTemplateHumaInputBody:
      additionalProperties: false
      properties:
        kind:
          description: Document kind; a fund owns the endorsement-term clausulado and nothing else.
          enum:
            - assignment_term
          type: string
        requiredFields:
          description: Placeholder field names this template declares it needs; the term recorder supplies them from the approved set's frozen snapshot.
          items:
            type: string
          type:
            - array
            - "null"
        sections:
          description: Ordered clauses.
          items:
            $ref: "#/components/schemas/DocumentTemplateSectionHumaBody"
          minItems: 1
          type:
            - array
            - "null"
        signatureBlock:
          description: Signature block text.
          type: string
        title:
          description: Template title.
          type: string
      required:
        - kind
        - title
        - sections
        - signatureBlock
      type: object
    CreateLoanApplicationHumaRequest:
      additionalProperties: false
      properties:
        borrowerId:
          description: Borrower identifier (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          format: uuid
          type: string
        borrowerKind:
          description: "Whose credit this is: the taxpayer kind of the borrower, as established by the KYC the client performed. REQUIRED. Brazil charges a different daily IOF aliquota per kind (Decreto 6.306/2007, art. 7o, I, \"b\"), so the withholding cannot be computed without it and the service will not guess. The pinned product version must admit the kind named here, or the application is refused with 422 LENDER-0228; a version that declared no kinds admits none."
          enum:
            - pessoaFisica
            - pessoaJuridica
          examples:
            - pessoaFisica
          type: string
        expectedDisbursementDate:
          description: Expected disbursement date (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        loanProductVersionId:
          description: Loan product version identifier (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        previewScheduleSnapshotId:
          description: "Schedule offer this application cites: the scheduleOfferSnapshotId a schedule preview returned. OPTIONAL — an application does not have to be simulated first. When supplied it must name an offer on file, or the application is refused with LENDER-0236; its terms are never compared with the application's."
          examples:
            - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          format: uuid
          type: string
        requestedInstallments:
          description: Number of installments.
          examples:
            - 24
          format: int64
          maximum: 600
          minimum: 1
          type: integer
        requestedInterestRate:
          description: Requested monthly interest rate as a decimal string, scale 8 (e.g. "0.00000100").
          examples:
            - "0.00000100"
          type: string
        requestedPrincipalAmount:
          description: Requested principal amount as a decimal string (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
      required:
        - loanProductVersionId
        - borrowerId
        - requestedPrincipalAmount
        - requestedInterestRate
        - requestedInstallments
        - borrowerKind
        - expectedDisbursementDate
      type: object
    CreateLoanProductHumaRequest:
      additionalProperties: false
      properties:
        jurisdictionCode:
          description: Jurisdiction profile code (e.g. BR).
          examples:
            - BR
          type: string
        jurisdictionExtensions:
          additionalProperties: true
          description: Opaque per-jurisdiction product fields.
          type: object
        loanType:
          description: Loan product type.
          examples:
            - personal
          type: string
        name:
          description: Loan product display name.
          type: string
      required:
        - name
        - loanType
        - jurisdictionCode
      type: object
    CreateLoanProductVersionHumaInputBody:
      additionalProperties: false
      properties:
        admittedBorrowerKinds:
          description: Kinds of borrower this version will originate for. Omitting it, or sending an empty list, declares NOTHING and admits NOBODY — it does not mean "both". Brazil taxes the two kinds at different IOF rates (Decreto 6.306/2007, art. 7o, I, "b"), so a product that has not said whose credit it grants cannot be priced. Duplicates are collapsed and the set is stored sorted; any other value is refused with 422.
          examples:
            -   - pessoaFisica
          items:
            enum:
              - pessoaFisica
              - pessoaJuridica
            type: string
          maxItems: 2
          type:
            - array
            - "null"
        changeReason:
          description: Reason for the new version.
          type: string
        currency:
          description: ISO 4217 currency code the product version denominates (3 uppercase letters); the loan's currency source of truth.
          examples:
            - BRL
          maxLength: 3
          minLength: 3
          type: string
        firstDueDateWindow:
          $ref: "#/components/schemas/FirstDueDateWindowHumaBody"
          description: "Span of days after the money date in which this version admits a CHOSEN first instalment date. OPTIONAL, unlike the price band: omit it and the version bounds no chosen date, which is how every product that takes the generator's monthly grid behaves. Omitted is not a window of zero."
        fixedAnnualRateBps:
          description: Fixed annual rate in basis points.
          examples:
            - 1850
          format: int64
          type: integer
        floatingRateTableId:
          description: Floating-rate table identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        floatingSpreadBps:
          description: Floating spread in basis points.
          examples:
            - 1850
          format: int64
          type: integer
        jurisdictionCode:
          description: Jurisdiction profile code.
          examples:
            - BR
          type: string
        jurisdictionExtensions:
          additionalProperties: true
          description: Opaque per-jurisdiction version fields.
          type: object
        rateBand:
          $ref: "#/components/schemas/RateBandHumaBody"
          description: "Price band this version authorizes, in annual basis points. Required: a version declaring no band originates nothing. A pointer so an omitted band is refused instead of defaulting to a zero-to-zero band that authorizes only a 0% rate."
        rateMode:
          description: Rate mode (fixed|floating).
          examples:
            - fixed
          type: string
        requiresFloatingRate:
          description: Whether a floating-rate table is required.
          type: boolean
      required:
        - jurisdictionCode
        - changeReason
        - currency
        - rateBand
      type: object
    CreateRateTableHumaInputBody:
      additionalProperties: false
      properties:
        name:
          description: "Reference rate table name. Unique per tenant, case-insensitively: the name is how the curve is picked, so two curves cannot share one."
          examples:
            - CDI Diario
          maxLength: 200
          minLength: 1
          type: string
      required:
        - name
      type: object
    CreditInstrumentHumaBody:
      additionalProperties: false
      properties:
        contentDigest:
          description: sha-256 hex digest of the rendered PDF bytes.
          type: string
        createdAt:
          description: Row creation timestamp (RFC3339, UTC).
          type: string
        documentTemplateVersionId:
          description: Exact template version rendered (uuid).
          type: string
        emittedAt:
          description: Emission instant (RFC3339, UTC).
          type: string
        emittedBy:
          description: Validated actor identity that requested emission.
          type: string
        id:
          description: Instrument identifier (uuid).
          type: string
        idempotencyKey:
          description: Caller's idempotency key.
          type: string
        loanApplicationId:
          description: Owning loan application identifier (uuid).
          type: string
        sizeBytes:
          description: Size of the rendered document in bytes.
          format: int64
          type: integer
        supersededByInstrumentId:
          description: Identifier (uuid) of the later instrument, for the same loan application, that superseded this one. Set only on the list endpoint; absent means this is the current instrument for its application.
          type: string
      required:
        - id
        - loanApplicationId
        - documentTemplateVersionId
        - idempotencyKey
        - contentDigest
        - sizeBytes
        - emittedAt
        - emittedBy
        - createdAt
      type: object
    CreditInstrumentListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Emission history, newest first; always present, empty slice when none exist.
          items:
            $ref: "#/components/schemas/CreditInstrumentHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    CreditOperationDescriptorResponse:
      additionalProperties: false
      properties:
        accrualState:
          description: "Interest accrual state: accruing or suspended; omitted when not set."
          examples:
            - accruing
          type: string
        annualRate:
          description: Contractual nominal annual interest rate as a percentage decimal string.
          examples:
            - "24.50"
          type: string
        asOfDate:
          description: Valuation date the financial figures are reconstructed as of (YYYY-MM-DD, UTC).
          examples:
            - "2026-06-14"
          type: string
        borrowerKind:
          description: "Whose credit this operation is: pessoaFisica or pessoaJuridica, as declared on the loan application. Brazil taxes and reports the two apart, so a contract whose application declared no kind is refused with 422 LENDER-0230 instead of being described under an assumed one."
          examples:
            - pessoaFisica
          type: string
        cetAnnualPct:
          description: Custo Efetivo Total, annualized, as a percentage decimal string.
          examples:
            - "28.40"
          type: string
        cetMonthlyPct:
          description: Custo Efetivo Total, monthly, as a percentage decimal string.
          examples:
            - "2.11"
          type: string
        consumerProtectionRegime:
          description: Applicable consumer-protection regime label; omitted when not classified.
          type: string
        createdAt:
          description: RFC3339 UTC timestamp when the descriptor record was created.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        descriptorDate:
          description: Date the descriptor snapshot was generated (YYYY-MM-DD, UTC).
          examples:
            - "2026-06-14"
          type: string
        id:
          description: Unique identifier (UUID) of the credit operation descriptor snapshot.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        installmentCount:
          description: Total number of installments in the amortization schedule.
          examples:
            - 24
          format: int64
          type: integer
        iofAmount:
          description: IOF (Imposto sobre Operacoes Financeiras) amount as a decimal string, scale 2; omitted when not applicable.
          examples:
            - "50.34"
          type: string
        jurisdictionCode:
          description: ISO jurisdiction code governing the descriptor (e.g. "BR").
          examples:
            - BR
          type: string
        lastPaymentDate:
          description: Date of the most recent payment received (YYYY-MM-DD, UTC); omitted if no payment recorded.
          examples:
            - "2026-06-14"
          type: string
        loanAccountId:
          description: UUID of the loan account the descriptor summarizes.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        loanApplicationId:
          description: UUID of the originating loan application.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        monthlyRate:
          description: Contractual nominal monthly interest rate as a percentage decimal string.
          examples:
            - "1.85"
          type: string
        nextDueDate:
          description: Due date of the next scheduled installment (YYYY-MM-DD, UTC); omitted if none pending.
          examples:
            - "2026-06-14"
          type: string
        originalTerm:
          description: Original contracted term of the loan in number of installments.
          examples:
            - 24
          format: int64
          type: integer
        outstandingBalance:
          description: Total outstanding balance (principal plus accrued charges) as a decimal string, scale 2.
          examples:
            - "43250.75"
          type: string
        overdueInstallmentCount:
          description: Number of installments currently past due.
          examples:
            - 1
          format: int64
          type: integer
        paidInstallmentCount:
          description: Number of installments fully paid to date.
          examples:
            - 6
          format: int64
          type: integer
        pddStage:
          description: "Current PDD delinquency staging: one of current, stage_1, stage_2, stage_3; omitted when unstaged."
          examples:
            - stage_1
          type: string
        prepaymentSettlementId:
          description: UUID of the prepayment settlement that closed the operation; omitted unless settled via prepayment.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        principalOutstanding:
          description: Outstanding principal as a decimal string in major currency units, scale 2.
          examples:
            - "42000.00"
          type: string
        profileVersion:
          description: Jurisdiction profile version used to compute the descriptor.
          examples:
            - 1.0.0
          type: string
        refreshedAt:
          description: RFC3339 UTC timestamp when the descriptor figures were last refreshed.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        status:
          description: Lifecycle status of the credit operation (e.g. active, settled).
          examples:
            - active
          type: string
        totalCharges:
          description: Cumulative fees and charges as a decimal string in major currency units, scale 2.
          examples:
            - "320.00"
          type: string
        totalTaxes:
          description: Cumulative taxes as a decimal string in major currency units, scale 2.
          examples:
            - "86.84"
          type: string
      required:
        - id
        - loanAccountId
        - loanApplicationId
        - descriptorDate
        - asOfDate
        - profileVersion
        - jurisdictionCode
        - borrowerKind
        - status
        - principalOutstanding
        - outstandingBalance
        - annualRate
        - monthlyRate
        - cetAnnualPct
        - cetMonthlyPct
        - originalTerm
        - installmentCount
        - paidInstallmentCount
        - overdueInstallmentCount
        - totalCharges
        - totalTaxes
        - refreshedAt
        - createdAt
      type: object
    DashboardBucketHumaBody:
      additionalProperties: false
      properties:
        bucketCode:
          description: Delinquency bucket code (one of current, 1_30, 31_60, 61_90, 91_plus, par30, par60, par90).
          examples:
            - "1_30"
          type: string
        bucketLabel:
          description: Human-readable label for the bucket (e.g. "1-30 days").
          type: string
        exposureAmount:
          description: Outstanding exposure aggregated for this bucket (decimal string, two-decimal scale).
          examples:
            - "75000.00"
          type: string
        loanCount:
          description: Number of active loans falling into this bucket.
          examples:
            - 42
          format: int64
          type: integer
      required:
        - bucketCode
        - bucketLabel
        - loanCount
        - exposureAmount
      type: object
    DashboardDrillDownRow:
      additionalProperties: false
      properties:
        assignedOfficerId:
          description: "Authenticated subject of the loan officer assigned to the loan, or empty on a system-originated contract, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID."
          examples:
            - officer-xyz
          type: string
        assignedOfficerName:
          description: Display name of the assigned loan officer.
          type: string
        borrowerId:
          description: Borrower identifier (UUID) who holds the loan.
          examples:
            - 550e8400-e29b-41d4-a716-446655440011
          format: uuid
          type: string
        bucketCode:
          description: Delinquency bucket the loan falls into (one of current, 1_30, 31_60, 61_90, 91_plus, par30, par60, par90).
          examples:
            - "31_60"
          type: string
        daysOverdue:
          description: Number of days past the earliest unpaid due date as of the business date.
          examples:
            - 45
          format: int64
          type: integer
        earliestUnpaidDueDate:
          description: Due date of the oldest unpaid installment driving the delinquency (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        exposureAmount:
          description: Outstanding exposure on this loan (decimal string, two-decimal scale).
          examples:
            - "12500.00"
          type: string
        loanId:
          description: Loan account identifier (UUID) for this delinquent row.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        productId:
          description: Loan product identifier (UUID) the loan was originated under.
          examples:
            - 550e8400-e29b-41d4-a716-446655440013
          type: string
        productVersionId:
          description: Loan product version identifier (UUID) governing this loan's terms.
          examples:
            - 550e8400-e29b-41d4-a716-446655440014
          type: string
      required:
        - loanId
        - borrowerId
        - assignedOfficerId
        - assignedOfficerName
        - productId
        - productVersionId
        - bucketCode
        - daysOverdue
        - earliestUnpaidDueDate
        - exposureAmount
      type: object
    DashboardFreshnessHuma:
      additionalProperties: false
      properties:
        generatedAt:
          description: Timestamp when the snapshot was generated (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        isStale:
          description: True when the snapshot is older than the freshness policy allows.
          type: boolean
        policyCode:
          description: Code of the freshness policy applied to evaluate staleness.
          type: string
        policyPersistedAt:
          description: Timestamp when the active freshness policy was last persisted (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        snapshotAsOfDate:
          description: Business date the source snapshot was computed for (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        snapshotId:
          description: Identifier (UUID) of the snapshot the metrics were read from.
          examples:
            - 550e8400-e29b-41d4-a716-446655440020
          type: string
        source:
          description: Origin of the metrics; always "snapshot", because a business date the producer has not measured is refused with 503 rather than answered with zeros.
          type: string
        stalenessReason:
          description: Explanation of why the data is considered stale; omitted when fresh.
          type: string
      required:
        - snapshotId
        - snapshotAsOfDate
        - generatedAt
        - source
        - isStale
        - policyCode
        - policyPersistedAt
      type: object
    DashboardSummaryHumaBody:
      additionalProperties: false
      properties:
        activeLoanCount:
          description: Number of active (non-closed) loans in the portfolio.
          examples:
            - 1240
          format: int64
          type: integer
        currentExposure:
          description: Outstanding exposure on non-delinquent (current) loans (decimal string, two-decimal scale).
          examples:
            - "1100000.00"
          type: string
        delinquentExposure:
          description: Outstanding exposure on delinquent loans (decimal string, two-decimal scale).
          examples:
            - "134567.89"
          type: string
        delinquentLoanCount:
          description: Number of active loans currently in a delinquent bucket.
          examples:
            - 86
          format: int64
          type: integer
        disbursementVolume:
          description: Principal disbursed over the period (decimal string, two-decimal scale).
          examples:
            - "250000.00"
          type: string
        outstandingExposure:
          description: Total outstanding principal balance across active loans (decimal string, two-decimal scale).
          examples:
            - "1234567.89"
          type: string
        par30:
          description: Portfolio-at-risk ratio for 30+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.05"
          type: string
        par60:
          description: Portfolio-at-risk ratio for 60+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.03"
          type: string
        par90:
          description: Portfolio-at-risk ratio for 90+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.02"
          type: string
        repaymentVolume:
          description: Principal repaid over the period (decimal string, two-decimal scale).
          examples:
            - "180000.00"
          type: string
      required:
        - outstandingExposure
        - currentExposure
        - delinquentExposure
        - disbursementVolume
        - repaymentVolume
        - par30
        - par60
        - par90
        - activeLoanCount
        - delinquentLoanCount
      type: object
    DashboardTrendPointHuma:
      additionalProperties: false
      properties:
        asOfDate:
          description: Business date the trend point was computed for (RFC3339, UTC midnight).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        delinquentExposure:
          description: Outstanding exposure on delinquent loans for the month (decimal string, two-decimal scale).
          examples:
            - "134567.89"
          type: string
        delinquentLoanCount:
          description: Number of active loans in a delinquent bucket during the month.
          examples:
            - 86
          format: int64
          type: integer
        disbursementVolume:
          description: Principal disbursed during the month (decimal string, two-decimal scale).
          examples:
            - "250000.00"
          type: string
        month:
          description: Calendar month of the trend point in YYYY-MM format.
          examples:
            - 2026-06
          type: string
        outstandingExposure:
          description: Total outstanding principal balance for the month (decimal string, two-decimal scale).
          examples:
            - "1234567.89"
          type: string
        par30:
          description: Portfolio-at-risk ratio for 30+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.05"
          type: string
        par60:
          description: Portfolio-at-risk ratio for 60+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.03"
          type: string
        par90:
          description: Portfolio-at-risk ratio for 90+ days overdue, as a decimal fraction string (e.g. 0.05 = 5%, two-decimal scale).
          examples:
            - "0.02"
          type: string
        repaymentVolume:
          description: Principal repaid during the month (decimal string, two-decimal scale).
          examples:
            - "180000.00"
          type: string
      required:
        - month
        - asOfDate
        - outstandingExposure
        - delinquentExposure
        - disbursementVolume
        - repaymentVolume
        - par30
        - par60
        - par90
        - delinquentLoanCount
      type: object
    DeclareNormClassificationBody:
      additionalProperties: false
      properties:
        normModality:
          description: "Optional refinement the norm keys a rate on beyond the carteira. 'consignado' selects the art. 78 §6º carve-out (Res. BCB 397/2024): payroll-deducted personal credit at up to fourteen days provisions at 0,5% instead of C5's 1,9%."
          enum:
            - consignado
          examples:
            - consignado
          type: string
        normPortfolioClass:
          description: Carteira the credit booked under this version belongs to (Res. BCB 352/2023 art. 81). Consignado, CDC and cartão rotativo sem garantia are C5 (art. 81, V, a); PJ capital de giro sem garantia is C4 (art. 81, IV, a). Where more than one carteira fits, art. 81 §1º takes the one giving the lower provision for an asset defaulted less than one month.
          enum:
            - C1
            - C2
            - C3
            - C4
            - C5
          examples:
            - C5
          type: string
      required:
        - normPortfolioClass
      type: object
    DeclareNormClassificationResponse:
      additionalProperties: false
      properties:
        loanProductVersionId:
          type: string
        normModality:
          type: string
        normPortfolioClass:
          type: string
      required:
        - loanProductVersionId
        - normPortfolioClass
      type: object
    DeclareProblemAssetAssessmentHumaBody:
      additionalProperties: false
      properties:
        characterizesProblemAsset:
          description: The verdict. False records that the trigger was evaluated and did NOT characterise the asset — which is how a prior characterisation is withdrawn, and is not the same as never having looked.
          type: boolean
        declaredBy:
          description: Declaring subject, used ONLY on a deployment with authentication disabled. When the request carries a validated identity, that subject is recorded and this field is ignored.
          maxLength: 256
          type: string
        evaluatedOn:
          description: "The business day the assessment was made (YYYY-MM-DD). A day and not an instant: it is compared against a competencia, which is a civil day."
          examples:
            - "2026-09-30"
          type: string
        evidenceNotes:
          description: "The assessor's own notes. Optional: the reference is what makes the declaration checkable, the prose is what makes it readable."
          maxLength: 4096
          type: string
        evidenceReference:
          description: "Mandatory pointer to the evidence: a document id, a case number, a URL. Required because this declaration suspends the contract's income recognition and raises its provision, and one that cites nothing cannot be reviewed."
          examples:
            - proc-0801234-56.2026.8.26.0100
          maxLength: 512
          type: string
        source:
          description: "Where the characterisation came from: the credit committee, the bureau feed, the court notice."
          examples:
            - Comite de credito 2026-09-30
          maxLength: 256
          type: string
        trigger:
          description: "The norm article the assessment invokes. Free text because art. 3 par. 2 is an open list (\"entre outros\"): the console offers the incisos as presets and accepts any other article an assessor names. Stored trimmed and lower-cased, because the article is the identity a later withdrawal has to match: sent as ART_3_P2_III it is stored, returned and withdrawn as art_3_p2_iii. Examples: art_3_p1, art_3_p2_i, art_3_p2_iii, art_3_p2_iv, art_3_p2_vi."
          examples:
            - art_3_p2_iii
          maxLength: 128
          type: string
      required:
        - trigger
        - source
        - evidenceReference
        - evaluatedOn
        - characterizesProblemAsset
      type: object
    DeferredFeeFiguresHumaBody:
      additionalProperties: false
      properties:
        deferred:
          description: Credited to the fee accounts at disbursement.
          examples:
            - "150.00"
          type: string
        difference:
          description: "Present only when DIVERGENT: deferred - retainedFee, or the negative remaining when the deferral agrees."
          examples:
            - "-150.00"
          type: string
        recognised:
          description: Amortised to income so far, including the full release an early exit runs through the monthly amortization.
          examples:
            - "25.00"
          type: string
        released:
          description: Moved out by a substantial renegotiation clearing the contract.
          examples:
            - "125.00"
          type: string
        remaining:
          description: deferred - recognised - released.
          examples:
            - "0.00"
          type: string
      required:
        - deferred
        - recognised
        - released
        - remaining
      type: object
    DeferredFeeReconciliationHumaBody:
      additionalProperties: false
      properties:
        accounts:
          description: The contract's own deferred-fee accounts the figures were read from, one per chart the contract lived under, oldest first; always present, empty when the contract's charts defer no fee.
          items:
            type: string
          type:
            - array
            - "null"
        currency:
          description: Asset the fee is held in.
          examples:
            - BRL
          type: string
        figures:
          $ref: "#/components/schemas/DeferredFeeFiguresHumaBody"
          description: What the ledger holds on the fee accounts. Present on MATCH and DIVERGENT, absent on UNAVAILABLE.
        loanAccountId:
          description: Loan account (uuid) of the contract reconciled.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          type: string
        retainedFee:
          description: Fee the contract record says was withheld at disbursement, summed over every tranche, as a fixed two-decimal string.
          examples:
            - "150.00"
          type: string
        status:
          description: "MATCH: the ledger deferred exactly the fee the contract retained. DIVERGENT: the two differ, or remaining is negative (the fee was earned more than once); figures.difference says by how much. UNAVAILABLE: the ledger did not answer, so figures is absent."
          enum:
            - MATCH
            - DIVERGENT
            - UNAVAILABLE
          type: string
      required:
        - loanAccountId
        - currency
        - status
        - accounts
        - retainedFee
      type: object
    DelinquentLoanRowHuma:
      additionalProperties: false
      properties:
        asOfDate:
          description: Business date the row was computed for (RFC3339, UTC midnight).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        assignedOfficerId:
          description: "Authenticated subject of the loan officer assigned to the loan, or empty on a system-originated contract, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID."
          examples:
            - officer-xyz
          type: string
        assignedOfficerName:
          description: Display name of the assigned loan officer.
          type: string
        borrowerId:
          description: Borrower identifier (UUID) who holds the loan.
          examples:
            - 550e8400-e29b-41d4-a716-446655440011
          format: uuid
          type: string
        bucketCode:
          description: Delinquency bucket the loan falls into (one of current, 1_30, 31_60, 61_90, 91_plus, par30, par60, par90).
          examples:
            - "31_60"
          type: string
        daysOverdue:
          description: Number of days past the oldest unpaid due date as of the business date.
          examples:
            - 45
          format: int64
          type: integer
        loanAccountId:
          description: Loan account identifier (UUID) for this delinquent loan.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        oldestDueDate:
          description: Due date of the oldest unpaid installment driving the delinquency (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        outstandingAmount:
          description: Total outstanding principal balance on the loan (decimal string, two-decimal scale).
          examples:
            - "12500.00"
          type: string
        overdueAmount:
          description: Total past-due amount on the loan (decimal string, two-decimal scale).
          examples:
            - "3200.00"
          type: string
        productId:
          description: Loan product identifier (UUID) the loan was originated under.
          examples:
            - 550e8400-e29b-41d4-a716-446655440013
          type: string
        productVersionId:
          description: Loan product version identifier (UUID) governing this loan's terms.
          examples:
            - 550e8400-e29b-41d4-a716-446655440014
          type: string
      required:
        - loanAccountId
        - borrowerId
        - assignedOfficerId
        - assignedOfficerName
        - productId
        - productVersionId
        - bucketCode
        - daysOverdue
        - overdueAmount
        - outstandingAmount
        - oldestDueDate
        - asOfDate
      type: object
    DelinquentLoansHumaBody:
      additionalProperties: false
      properties:
        asOfDate:
          description: Business date the rows were computed for (RFC3339, UTC midnight).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        freshness:
          $ref: "#/components/schemas/DashboardFreshnessHuma"
          description: "Provenance of the rows: snapshot identity, staleness, and freshness policy."
        limit:
          description: Page size echoed back from the request (max rows in this response).
          examples:
            - 25
          format: int64
          type: integer
        loans:
          description: Delinquent loan drill-down rows for the page; always a JSON array (never null).
          items:
            $ref: "#/components/schemas/DelinquentLoanRowHuma"
          type:
            - array
            - "null"
        offset:
          description: Zero-based row offset echoed back from the request.
          examples:
            - 0
          format: int64
          type: integer
      required:
        - loans
        - freshness
        - asOfDate
        - limit
        - offset
      type: object
    Detail:
      additionalProperties: true
      properties:
        code:
          description: "Stable, machine-readable domain error code scoped to the emitting service (format: <SERVICE>-NNNN)."
          type: string
        detail:
          description: A human-readable explanation specific to this occurrence of the problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: "#/components/schemas/ErrorDetail"
          type:
            - array
            - "null"
        instance:
          description: A URI reference that identifies the specific occurrence of the problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: A short, human-readable summary of the problem type. This value should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
        upstream:
          $ref: "#/components/schemas/Upstream"
          description: "RFC 9457 extension member: the error a proxied third-party provider reported. Absent unless the emitting service explicitly surfaced one."
      type: object
    DisburseLoanApplicationHumaRequest:
      additionalProperties: false
      properties:
        currency:
          description: Optional ISO-4217 currency assertion (3 uppercase letters). When present it MUST equal the loan application's currency (a double-entry guard); a divergence is rejected with 422. When omitted, the loan's own currency is used.
          examples:
            - BRL
          maxLength: 3
          minLength: 3
          pattern: ^[A-Z]{3}$
          type: string
        disbursedAt:
          description: Disbursement timestamp (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        firstDueDate:
          description: "Day the first instalment falls due (YYYY-MM-DD or RFC3339), read exactly as the schedule preview and the tax quote read it: an RFC3339 instant names the Brazilian civil day it falls on, so 2026-03-09T22:00:00-03:00 is 9 March. OPTIONAL: omit it and the contract takes the generator's own grid, one month after the money moves. Supply it on the FIRST tranche and the ladder is struck on it, bounded by the loan product version's admitted window (LENDER-0235); a later tranche naming one is refused, because a top-up re-anchors on the original grid."
          examples:
            - "2026-03-10"
          type: string
        grossRequestedAmount:
          description: Gross requested disbursement amount as a decimal string (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
        jurisdictionExtensions:
          additionalProperties: true
          description: Opaque per-jurisdiction disbursement payload, validated at the use-case layer.
          type: object
        loanAccountId:
          description: Loan account identifier (UUID).
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          type: string
        netDeliveredAmount:
          description: Net delivered disbursement amount as a decimal string (e.g. "49500.00").
          examples:
            - "49500.00"
          type: string
        originationFeeAmount:
          description: "Optional per-disbursement origination fee as a decimal string (e.g. \"150.00\"). RETAINED from the borrower's cash at disbursement and credited to the product's deferred-income account, from which it is amortized back as yield over the contract's life (Res. CMN 4.966 art. 18). It is part of the disburse invariant: netDeliveredAmount MUST equal grossRequestedAmount minus the jurisdiction withholdings minus this fee. It is NOT a withholding (no third party is owed it) and it is never billed to the borrower on a schedule line. Omitted or empty defaults to \"0\"."
          examples:
            - "150.00"
          type: string
        trancheNumber:
          description: "Optional tranche position for a multi-tranche release: 1 for the first, 2 for the second, and so on. It must be exactly one more than the number of disbursements this application already carries. Omit it only for an application's SINGLE disbursement, which must then release the approved amount exactly — a second disbursement that declares no tranche is refused 409 LENDER-0201, and a wrong position or a total above the approved amount is refused 422 LENDER-0202."
          examples:
            - 2
          format: int64
          minimum: 1
          type: integer
      required:
        - loanAccountId
        - grossRequestedAmount
        - netDeliveredAmount
        - disbursedAt
      type: object
    DisbursementEventHumaBody:
      additionalProperties: false
      properties:
        disbursedAt:
          description: Disbursement timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        grossRequestedAmount:
          description: Gross requested disbursement amount as a decimal string, minor-unit precision scale 2 (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
        id:
          description: Disbursement event identifier (UUID).
          examples:
            - c3d4e5f6-a7b8-4901-acde-f01234567890
          type: string
        loanAccountId:
          description: Loan account credited by this disbursement (UUID).
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          type: string
        netDeliveredAmount:
          description: Net delivered disbursement amount as a decimal string, minor-unit precision scale 2 (e.g. "49500.00").
          examples:
            - "49500.00"
          type: string
        profileVersion:
          description: Jurisdiction profile version applied by the disbursement pipeline.
          examples:
            - 1.0.0
          type: string
      required:
        - id
        - loanAccountId
        - grossRequestedAmount
        - netDeliveredAmount
        - disbursedAt
        - profileVersion
      type: object
    DiscardAssignmentSetHumaInputBody:
      additionalProperties: false
      properties:
        note:
          description: The particulars, in the operator's own words. Optional; omitted rather than blanked on the audit row when there is nothing to add.
          maxLength: 512
          type: string
        reason:
          description: "Why the composition was called off. abandoned: nobody is going to finish it. member_ineligible: a line in it can never be sold and was holding every other line with it. counterparty_declined: the fund or its administrator walked away outside the remessa. superseded: replaced by another composition. Required — free text is a disposition nobody can count."
          enum:
            - abandoned
            - member_ineligible
            - counterparty_declined
            - superseded
          type: string
      required:
        - reason
      type: object
    DiscardRecordHumaBody:
      additionalProperties: false
      properties:
        causeKind:
          description: "Which gate quarantined the record: codec, handler, source_mismatch or unhandled_key."
          examples:
            - handler
          type: string
        envelopeError:
          description: Why the CloudEvents envelope could not be read. Present means the tenant and event type above are unknown rather than absent.
          type: string
        errorClass:
          description: The transport's classification of the cause. Forensic metadata, never a routing decision.
          type: string
        errorMessage:
          description: The underlying error, sanitised and bounded before it was recorded.
          type: string
        errorMessageOriginalBytes:
          description: Length of the original error when it was cut.
          format: int64
          type: integer
        errorMessageTruncated:
          description: True when errorMessage is a CUT message, so a short message is never mistaken for a complete one.
          type: boolean
        eventId:
          description: "CloudEvents id of the quarantined record. Not an identity for this row: a replay can quarantine the same event twice."
          type: string
        eventSource:
          description: The application that PRODUCED the record. Never the one that quarantined it.
          examples:
            - consignado-gw
          type: string
        eventType:
          description: The event key of the quarantined record.
          examples:
            - contract.registered
          type: string
        firstFailureAt:
          description: When the quarantine verdict was stamped (RFC3339, UTC). Absent when the record carried no readable stamp.
          type: string
        firstSeenAt:
          description: When the record was first recorded (RFC3339, UTC).
          type: string
        headerError:
          description: Why a forensic header could not be read.
          type: string
        id:
          description: Identifier of this forensic record (uuid).
          type: string
        lastSeenAt:
          description: When it was most recently delivered again (RFC3339, UTC).
          type: string
        originUnknown:
          description: "True when the record carried no usable origin: a producer-side quarantine, or coordinates the library refused rather than half-parsed. The record cannot be retrieved from its source."
          type: boolean
        payloadBytes:
          description: Size of the payload that was dropped, when one was.
          format: int64
          type: integer
        payloadOmitted:
          description: True when the quarantine copy was published without its payload because it would not fit.
          type: boolean
        producerId:
          description: The consumer group that quarantined the record.
          type: string
        retryCount:
          description: Transient retries consumed before the terminal verdict.
          format: int64
          type: integer
        seenCount:
          description: How many times this quarantine has been delivered to the reader. Above one means redelivery, never a second failure.
          format: int64
          type: integer
        sourceOffset:
          description: Offset it came from — with the topic and partition, the route back to the record itself, which this service never copies.
          format: int64
          type: integer
        sourcePartition:
          description: Partition it came from. Meaningless unless sourceTopic is present.
          format: int32
          type: integer
        sourceTopic:
          description: Topic the quarantined record came from. Absent when the record carried no usable origin.
          type: string
        tenantId:
          description: The tenant that owned the quarantined record.
          type: string
      required:
        - id
        - causeKind
        - tenantId
        - eventSource
        - eventType
        - eventId
        - sourcePartition
        - sourceOffset
        - originUnknown
        - errorClass
        - errorMessage
        - errorMessageTruncated
        - retryCount
        - producerId
        - payloadOmitted
        - seenCount
        - firstSeenAt
        - lastSeenAt
      type: object
    DisposeContractDivergenceHumaRequest:
      additionalProperties: false
      properties:
        expectedVersion:
          description: "Compare-and-swap guard: the version this request was read against."
          format: int64
          minimum: 1
          type: integer
        justification:
          description: Optional free-text justification.
          maxLength: 4000
          type: string
        result:
          description: Bounded, category-specific structured outcome.
          maxLength: 128
          minLength: 1
          type: string
      required:
        - result
        - expectedVersion
      type: object
    DisposeOverDeductionRefundHumaInputBody:
      additionalProperties: false
      properties:
        executionSource:
          description: Where the execution fact came from. The client's treasury moves the money; the lender registers it.
          enum:
            - client_treasury
          type: string
        occurredAt:
          description: UTC instant the money was returned (RFC3339). Defaults to now.
          format: date-time
          type: string
        reference:
          description: The reference the money was returned under.
          maxLength: 256
          minLength: 1
          type: string
      required:
        - reference
        - executionSource
      type: object
    DocumentTemplateHumaBody:
      additionalProperties: false
      properties:
        active:
          description: Whether this is the currently active published version.
          type: boolean
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          type: string
        id:
          description: Template version identifier (uuid).
          type: string
        kind:
          description: Document kind.
          type: string
        loanProductId:
          description: Owning loan product identifier (uuid); absent on a fund-scoped template.
          type: string
        publishedAt:
          description: Publication timestamp (RFC3339, UTC); absent while draft.
          type: string
        requiredFields:
          description: Declared placeholder field names.
          items:
            type: string
          type:
            - array
            - "null"
        scopeId:
          description: "Owner identifier (uuid): the loan product or the assignment fund."
          type: string
        scopeKind:
          description: Owner kind this template hangs off (loan_product|assignment_fund).
          type: string
        sections:
          description: Ordered clauses.
          items:
            $ref: "#/components/schemas/DocumentTemplateSectionHumaBody"
          type:
            - array
            - "null"
        signatureBlock:
          description: Signature block text.
          type: string
        status:
          description: Lifecycle status (draft|published).
          type: string
        title:
          description: Template title.
          type: string
        updatedAt:
          description: Last-update timestamp (RFC3339, UTC).
          type: string
        versionNumber:
          description: Sequential version number within (tenant, product, kind).
          format: int64
          type: integer
      required:
        - id
        - scopeKind
        - scopeId
        - kind
        - versionNumber
        - status
        - active
        - title
        - sections
        - signatureBlock
        - requiredFields
        - createdAt
        - updatedAt
      type: object
    DocumentTemplateListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Version history, newest first; always present, empty slice when none exist.
          items:
            $ref: "#/components/schemas/DocumentTemplateHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    DocumentTemplateSectionHumaBody:
      additionalProperties: false
      properties:
        body:
          description: Clause body; may carry text/template placeholders (e.g. "{{.PrincipalAmount}}") the render engine interprets.
          type: string
        heading:
          description: Clause heading.
          type: string
      required:
        - heading
        - body
      type: object
    EndAssignmentFundingEarlyHumaInputBody:
      additionalProperties: false
      properties:
        agreedAmount:
          description: What the fund agreed to take, decimal string. Omit it entirely to pass the borrower's payoff through; an informed amount must be above zero and never above the face of the instalments still owed.
          type: string
        borrowerPayoff:
          description: "What the borrower actually paid to end his own contract, decimal string. Required: it is the default the fund is offered when no amount is agreed, and a pass-through of nothing would book the whole obligation as a gain."
          type: string
        receivableRef:
          description: The receivable whose funding obligation ends. The obligation is carried per receivable, so one borrower prepaying ends one obligation and not the cession's others.
          maxLength: 128
          type: string
      required:
        - receivableRef
        - borrowerPayoff
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: Where the error occurred, e.g. 'body.items[3].tags' or 'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    FirstDueDateWindowHumaBody:
      additionalProperties: false
      properties:
        maxDays:
          description: Latest admitted first instalment, inclusive; never below the floor.
          examples:
            - 45
          format: int64
          minimum: 1
          type: integer
        minDays:
          description: "Earliest admitted first instalment, inclusive, in days after the money date. At least one: a first instalment on the day the money moves is no period at all."
          examples:
            - 15
          format: int64
          minimum: 1
          type: integer
      required:
        - minDays
        - maxDays
      type: object
    FloatingRatePeriodHumaBody:
      additionalProperties: false
      properties:
        annualRateBps:
          description: Annual rate for the period in basis points (1 bps = 0.01%).
          examples:
            - 1850
          format: int64
          type: integer
        effectiveDate:
          description: Date the period becomes effective (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        endDate:
          description: Date the period stops applying (RFC3339, UTC); absent when open-ended.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Rate period identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440006
          type: string
      required:
        - id
        - effectiveDate
        - annualRateBps
      type: object
    FloatingRateTableHumaBody:
      additionalProperties: false
      properties:
        period:
          $ref: "#/components/schemas/FloatingRatePeriodHumaBody"
          description: Effective period for the requested as-of date; present when one applies.
        rateMode:
          description: Resolved product-version rate mode (fixed|floating).
          examples:
            - floating
          type: string
        table:
          $ref: "#/components/schemas/FloatingRateTableInnerHumaBody"
          description: Linked floating-rate table with its periods; present in floating mode.
        terms:
          $ref: "#/components/schemas/FloatingRateTermsHumaBody"
          description: Product-version rate linkage terms; present when resolved.
      required:
        - rateMode
      type: object
    FloatingRateTableInnerHumaBody:
      additionalProperties: false
      properties:
        id:
          description: Floating-rate table identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        name:
          description: Floating-rate table display name.
          type: string
        periods:
          description: Effective-dated rate periods, ordered by effective date.
          items:
            $ref: "#/components/schemas/FloatingRatePeriodHumaBody"
          type:
            - array
            - "null"
      required:
        - id
        - name
        - periods
      type: object
    FloatingRateTermsHumaBody:
      additionalProperties: false
      properties:
        fixedAnnualRateBps:
          description: Fixed annual rate in basis points (1 bps = 0.01%).
          examples:
            - 1850
          format: int64
          type: integer
        floatingRateTableId:
          description: Linked floating-rate table identifier (uuid); empty in fixed mode.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        floatingSpreadBps:
          description: Floating spread in basis points (1 bps = 0.01%).
          examples:
            - 1850
          format: int64
          type: integer
        rateMode:
          description: Rate mode for the version (fixed|floating).
          examples:
            - floating
          type: string
        requiresFloatingRate:
          description: Whether a floating-rate table is required for this version.
          type: boolean
        versionId:
          description: Loan product version these terms belong to (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
      required:
        - versionId
        - rateMode
        - floatingSpreadBps
        - fixedAnnualRateBps
        - requiresFloatingRate
      type: object
    FullSettlementPrepaymentQuoteRequest:
      additionalProperties: false
      properties:
        businessDate:
          description: Optional valuation date (RFC3339 or YYYY-MM-DD); defaults to now (UTC).
          examples:
            - "2026-06-14"
          type: string
        instrumentType:
          description: Borrower payment rail.
          enum:
            - pix
            - boleto
          type: string
        overridePdd:
          description: When true, overrides the PDD stage gate during quote generation.
          type: boolean
        payoffPurpose:
          description: "Who pays this payoff: the borrower prepaying, or the institution taking the contract over by portability."
          enum:
            - borrower_prepayment
            - portability
          examples:
            - portability
          type: string
        quoteType:
          description: "Discriminator: full settlement of the outstanding balance."
          enum:
            - full_settlement
          type: string
      required:
        - quoteType
        - instrumentType
      type: object
    GetJurisdictionResponse:
      additionalProperties: false
      properties:
        data:
          $ref: "#/components/schemas/JurisdictionDTO"
          description: The single registered jurisdiction profile matching the requested code.
      required:
        - data
      type: object
    IngestAssignmentRemessaHumaInputBody:
      additionalProperties: false
      properties:
        content:
          description: "The fund administrator's return file, base64-encoded, exactly as received. Its sha-256 is the file's identity: the same file re-uploaded changes nothing, and a different file over a set that already accepted one is refused."
          format: byte
          minLength: 1
          type: string
      required:
        - content
      type: object
    IngestCapitalizationConsentBody:
      additionalProperties: false
      properties:
        acceptedAt:
          description: RFC3339 timestamp the borrower accepted the clause.
          format: date-time
          type: string
        clauseText:
          description: Raw capitalization clause text presented to the borrower.
          type: string
        clauseTextHash:
          description: Client-computed SHA-256 hex digest of the canonicalized clause text.
          examples:
            - a3b1c2d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718293a4b5c6d7e8f90
          maxLength: 64
          minLength: 64
          pattern: ^[a-f0-9]{64}$
          type: string
        consentEvidence:
          description: Opaque evidence reference proving the borrower accepted the clause.
          type: string
      required:
        - clauseText
        - clauseTextHash
        - consentEvidence
        - acceptedAt
      type: object
    IngestCollectionSettlementHumaInputBody:
      additionalProperties: false
      properties:
        content:
          description: "The collection agent's Arquivo de Baixa Extraordinária, base64-encoded, exactly as received. Its sha-256 is the file's identity: the same file re-uploaded changes nothing and reduces no debt twice."
          format: byte
          minLength: 1
          type: string
      required:
        - content
      type: object
    IssueCreditInstrumentHumaInputBody:
      additionalProperties: false
      properties:
        idempotencyKey:
          description: Caller idempotency key. The same key replays the same instrument; the same key with a different parties block is refused.
          minLength: 1
          type: string
        parties:
          additionalProperties:
            type: string
          description: Caller-supplied parties block (issuer/creditor names and documents, place of issuance/payment, and any other field the resolved template or the jurisdiction's legal catalog declares). Frozen into the instrument's snapshot; the core stores no borrower PII beyond it.
          type: object
      required:
        - idempotencyKey
      type: object
    JournalReferenceHumaBody:
      additionalProperties: false
      properties:
        correlationId:
          description: Correlation identifier the reference was resolved by. For an accrual run it links the reference to the originating run; for a single acknowledged posting it is that posting's key, which is the same value the ledger carries in the transaction's correlationId metadata.
          examples:
            - 550e8400-e29b-41d4-a716-446655440007
          type: string
        externalJournalReferenceId:
          description: "The external ledger's own identifier for the transaction this posting became — the reconciliation key, usable to look the transaction up in the ledger directly. Omitted until the posting has been acknowledged, and always omitted on an accrual RUN reference, whose grain is many postings rather than one. A 404 on this endpoint is not proof the posting never happened: it also covers a posting intent that has not been relayed successfully yet, which is then either still in flight or quarantined on its outbox event."
          type: string
        id:
          description: UUID of the journal reference record.
          examples:
            - 550e8400-e29b-41d4-a716-446655440006
          type: string
        outboxEventId:
          description: UUID of the emitted outbox event; omitted when no outbox event was recorded.
          examples:
            - 550e8400-e29b-41d4-a716-446655440008
          type: string
        postingStatus:
          description: Status of the downstream ledger posting for this reference. "pending" means the ledger has not confirmed it yet, "posted" means the ledger accepted it, and "no_items" means the run recorded no recognition, so no posting was sent.
          examples:
            - posted
          type: string
      required:
        - id
        - correlationId
        - postingStatus
      type: object
    JurisdictionDTO:
      additionalProperties: false
      properties:
        booksCredit:
          description: "Whether credit may be booked under this jurisdiction. False marks a development base: listing, reference reads and schedule preview work, but every operation that books credit is refused — proposing, approving and disbursing a loan application; creating a loan product or product version; activating a product; issuing a credit instrument; and booking or posting the disbursement of a payroll contract."
          examples:
            - true
          type: boolean
        code:
          description: ISO 3166-1 alpha-2 jurisdiction identifier (e.g. BR, XX).
          examples:
            - BR
          type: string
        displayName:
          description: Human-readable profile name (e.g. Brazil).
          type: string
        profileVersion:
          description: Semver version string of the compiled profile definition, stamped onto schedule_versions and cet_disclosures for audit replay.
          examples:
            - 1.0.0
          type: string
        status:
          description: "Profile lifecycle status: one of active, preview, or disabled. Registered profiles default to active in the MVP."
          examples:
            - active
          type: string
      required:
        - code
        - displayName
        - status
        - profileVersion
        - booksCredit
      type: object
    ListJurisdictionsResponse:
      additionalProperties: false
      properties:
        data:
          description: Array of jurisdiction profiles compiled into the running service; empty array (never null) when none are registered.
          items:
            $ref: "#/components/schemas/JurisdictionDTO"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    ListReturnedPaymentReceivablesHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Returned-payment receivables, newest first.
          items:
            $ref: "#/components/schemas/ReturnedPaymentReceivableHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    LoanAccountListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of loan accounts, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/LoanAccountSummaryHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    LoanAccountPaymentHealthHumaBody:
      additionalProperties: false
      properties:
        daysOverdue:
          description: Whole calendar days from the oldest still-unpaid installment's due date to today, counted in the contract's own civil calendar. 0 when nothing is past due. OMITTED when state is unknown — against an unminted schedule the count would describe a billing plan the borrower will never be billed against, and on a closed contract it would state as this institution's delinquency a debt it no longer carries.
          examples:
            - 0
          format: int64
          type: integer
        regulatoryStage:
          description: "The jurisdiction's own recorded characterisation of this contract — for Brazil, the PDD stage Res. CMN 4.966 requires ('current', 'stage_1', 'stage_2', 'stage_3'). OMITTED when the jurisdiction holds no record, which is the ordinary answer where no regulator demands one and for a contract nothing has yet been recorded against. Absent is NOT the same as 'current': 'current' is a decision the book made, absent means no one has decided anything. The values are jurisdiction-defined identifiers, so do not assume this enumeration."
          examples:
            - stage_1
          type: string
        regulatoryStageAsOf:
          description: RFC 3339 UTC instant the recorded stage took effect, so a characterisation made this morning can be told from one that has stood for a quarter. Present exactly when regulatoryStage is.
          examples:
            - "2026-09-01T03:00:00Z"
          type: string
        state:
          description: "current: nothing is past due — both a contract paying on time and one with nothing left to pay. overdue: at least one installment's due date has passed unpaid, and daysOverdue says by how much. unknown: arrears are not assessable, which is NOT a synonym for current. Two things produce it: the contract has no minted schedule yet, so there is no billing plan to be late against; or the credit risk no longer sits on this book, which today means any lifecycleState other than active — settled means it was discharged, ceded and ported mean the receivable belongs to the fund or the new holder, renegotiated means the successor contract carries it, and reversed means the disbursement was undone."
          enum:
            - current
            - overdue
            - unknown
          examples:
            - current
          type: string
      required:
        - state
      type: object
    LoanAccountSummaryHumaBody:
      additionalProperties: false
      properties:
        assignedOfficerId:
          description: "Identifier of the loan officer assigned to service this account, or empty on a system-originated contract, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID."
          examples:
            - officer-xyz
          type: string
        borrowerId:
          description: Identifier (UUID) of the borrower who holds this account.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          format: uuid
          type: string
        createdAt:
          description: RFC 3339 UTC timestamp the originating application was created.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        currency:
          description: ISO-4217 denomination of the contract.
          examples:
            - BRL
          type: string
        disbursedAt:
          description: ISO-8601 date the funds left; omitted while the account carries no disbursement timestamp.
          examples:
            - "2026-06-15"
          type: string
        lifecycleStatus:
          description: "How this account was closed; absent for a live account, and only ever present when includeClosed is true. settled: the borrower discharged the debt. ceded: the receivable was sold. ported: the contract moved to another institution. reversed: a refinance the rail undid inside its regret window. renegotiated: a substantial renegotiation replaced this contract, and the debt is carried on the new account it opened. Only settled means the borrower discharged the debt — do not label any of the other four as one."
          enum:
            - settled
            - ceded
            - ported
            - reversed
            - renegotiated
          examples:
            - settled
          type: string
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        loanProductVersionId:
          description: Loan product version the contract was booked under.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        principalAmount:
          description: Contracted/disbursed principal (2 d.p. string). This is the amount lent, NOT the outstanding balance.
          examples:
            - "1234.56"
          type: string
        status:
          description: Originating application status (disbursed or active). Not a balance state.
          examples:
            - active
          type: string
      required:
        - loanAccountId
        - borrowerId
        - assignedOfficerId
        - loanProductVersionId
        - status
        - currency
        - principalAmount
        - createdAt
      type: object
    LoanApplicationHumaBody:
      additionalProperties: false
      properties:
        approvalDecision:
          $ref: "#/components/schemas/ApprovalDecisionHumaBody"
          description: Approval facts; present only when the application is approved or disbursed.
        assignedOfficerId:
          description: "Authenticated officer who created the application (request subject), or empty on a system-originated application, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID, at most 255 characters."
          examples:
            - officer-xyz
          type: string
        borrowerId:
          description: Borrower identifier (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          format: uuid
          type: string
        borrowerKind:
          description: "Whose credit this is, as declared at creation. ABSENT on an application created before the declaration existed: such an application cannot be taxed or described, and the paths that need the kind refuse it with LENDER-0230 rather than assuming one."
          examples:
            - pessoaFisica
          type: string
        disbursementEvent:
          $ref: "#/components/schemas/DisbursementEventHumaBody"
          description: Disbursement facts; present only when the application is disbursed.
        expectedDisbursementDate:
          description: Expected disbursement date (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Loan application identifier (UUID).
          examples:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: string
        loanProductVersionId:
          description: Loan product version this application was created against (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        previewJurisdictionCode:
          description: ISO-2 jurisdiction code resolved at preview time.
          examples:
            - BR
          type: string
        previewProfileVersion:
          description: Jurisdiction profile version resolved at preview time.
          examples:
            - 1.0.0
          type: string
        previewScheduleSnapshotId:
          description: "Schedule offer this application cites (UUID). ABSENT when it cites none, which is allowed: simulating first is optional."
          examples:
            - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          type: string
        rejectionDecision:
          $ref: "#/components/schemas/ReasonedDecisionHumaBody"
          description: Rejection facts; present only when the application is rejected.
        requestedInstallments:
          description: Number of installments requested.
          examples:
            - 24
          format: int64
          type: integer
        requestedInterestRate:
          description: Requested monthly interest rate as a decimal string, scale 8 (e.g. "0.00000100").
          examples:
            - "0.00000100"
          type: string
        requestedPrincipalAmount:
          description: Requested principal amount as a decimal string, minor-unit precision scale 2 (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
        status:
          description: "Lifecycle status: one of pending_approval, approved, rejected, withdrawn, disbursed."
          examples:
            - pending_approval
          type: string
        withdrawalDecision:
          $ref: "#/components/schemas/ReasonedDecisionHumaBody"
          description: Withdrawal facts; present only when the application is withdrawn.
      required:
        - id
        - loanProductVersionId
        - borrowerId
        - assignedOfficerId
        - status
        - requestedPrincipalAmount
        - requestedInterestRate
        - requestedInstallments
        - expectedDisbursementDate
        - previewProfileVersion
        - previewJurisdictionCode
      type: object
    LoanApplicationReadHumaBody:
      additionalProperties: false
      properties:
        approvalDecision:
          $ref: "#/components/schemas/ApprovalDecisionHumaBody"
          description: Approval facts; present only when the application is approved or disbursed.
        assignedOfficerId:
          description: "Authenticated officer who created the application (request subject), or empty on a system-originated application, which has no human officer. Whatever the identity provider issues as the subject: not necessarily a UUID, at most 255 characters."
          examples:
            - officer-xyz
          type: string
        borrowerId:
          description: Borrower identifier (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          format: uuid
          type: string
        borrowerKind:
          description: "Whose credit this is, as declared at creation. ABSENT on an application created before the declaration existed: such an application cannot be taxed or described, and the paths that need the kind refuse it with LENDER-0230 rather than assuming one."
          examples:
            - pessoaFisica
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        currency:
          description: ISO-4217 alpha currency the loan is denominated in.
          examples:
            - BRL
          type: string
        disbursementEvent:
          $ref: "#/components/schemas/DisbursementEventHumaBody"
          description: Disbursement facts; present only when the application is disbursed.
        expectedDisbursementDate:
          description: Expected disbursement date (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Loan application identifier (UUID).
          examples:
            - 3fa85f64-5717-4562-b3fc-2c963f66afa6
          type: string
        loanAccountId:
          description: Loan account this application produced; present only once disbursed.
          examples:
            - 7c9e6679-7425-40de-944b-e07fc1f90ae7
          type: string
        loanProductVersionId:
          description: Loan product version this application was created against (UUID).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        originationFront:
          description: "Trusted channel that created the application: one of gateway_clt, lender_direct, unknown_legacy."
          examples:
            - lender_direct
          type: string
        previewJurisdictionCode:
          description: ISO-2 jurisdiction code resolved at preview time.
          examples:
            - BR
          type: string
        previewProfileVersion:
          description: Jurisdiction profile version resolved at preview time.
          examples:
            - 1.0.0
          type: string
        previewScheduleSnapshotId:
          description: "Schedule offer this application cites (UUID). ABSENT when it cites none, which is allowed: simulating first is optional."
          examples:
            - 6ba7b810-9dad-11d1-80b4-00c04fd430c8
          type: string
        rejectionDecision:
          $ref: "#/components/schemas/ReasonedDecisionHumaBody"
          description: Rejection facts; present only when the application is rejected.
        requestedInstallments:
          description: Number of installments requested.
          examples:
            - 24
          format: int64
          type: integer
        requestedInterestRate:
          description: Requested monthly interest rate as a decimal string, scale 8 (e.g. "0.00000100").
          examples:
            - "0.00000100"
          type: string
        requestedPrincipalAmount:
          description: Requested principal amount as a decimal string, minor-unit precision scale 2 (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
        status:
          description: "Lifecycle status: one of pending_approval, approved, rejected, withdrawn, disbursed."
          examples:
            - pending_approval
          type: string
        updatedAt:
          description: Last-update timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        withdrawalDecision:
          $ref: "#/components/schemas/ReasonedDecisionHumaBody"
          description: Withdrawal facts; present only when the application is withdrawn.
      required:
        - currency
        - originationFront
        - createdAt
        - updatedAt
        - id
        - loanProductVersionId
        - borrowerId
        - assignedOfficerId
        - status
        - requestedPrincipalAmount
        - requestedInterestRate
        - requestedInstallments
        - expectedDisbursementDate
        - previewProfileVersion
        - previewJurisdictionCode
      type: object
    LoanApplicationReadListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of loan applications, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/LoanApplicationReadHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    LoanAuditEventHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Event amount (2 d.p. string).
          examples:
            - "113.84"
          type: string
        eventType:
          description: Audit event kind (e.g. original_repayment, reversal).
          examples:
            - original_repayment
          type: string
        lineage:
          description: Ordered lineage links for this event.
          items:
            $ref: "#/components/schemas/LoanAuditLineageHumaBody"
          type:
            - array
            - "null"
        occurredAt:
          description: RFC 3339 UTC timestamp of the event.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        operatorNote:
          description: Human-readable note explaining this event for operators.
          type: string
        scheduleVersionId:
          description: Identifier of the schedule version in effect for this event; omitted when not applicable.
          examples:
            - 550e8400-e29b-41d4-a716-446655440030
          type: string
        sequence:
          description: Monotonic per-account ordering position of this event in the audit history.
          examples:
            - 1
          format: int64
          type: integer
        transactionId:
          description: Identifier of the transaction this event relates to; omitted for events with no transaction.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
      required:
        - sequence
        - eventType
        - amount
        - occurredAt
        - lineage
        - operatorNote
      type: object
    LoanAuditHistoryHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Ordered immutable audit history events.
          items:
            $ref: "#/components/schemas/LoanAuditEventHumaBody"
          type:
            - array
            - "null"
        operatorSummary:
          description: Human-readable operator summary of the audit history.
          type: string
      required:
        - data
        - operatorSummary
      type: object
    LoanAuditLineageHumaBody:
      additionalProperties: false
      properties:
        relation:
          description: Lineage relation type (e.g. reverses, replays_after_reversal).
          examples:
            - reverses
          type: string
        transactionId:
          description: Identifier of the transaction this lineage link points to.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
      required:
        - relation
        - transactionId
      type: object
    LoanChargeHumaBody:
      additionalProperties: false
      properties:
        accountCreatedAt:
          description: Loan account creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        amount:
          description: Charge amount as a decimal string in major currency units, fixed scale of 2 decimal places.
          examples:
            - "1234.56"
          type: string
        assessedAt:
          description: Timestamp the charge was assessed (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        chargeCode:
          description: Charge code resolved from the template.
          examples:
            - LATE_FEE
          type: string
        chargeTemplateId:
          description: Charge template the fact was derived from.
          type: string
        chargeType:
          description: Charge type resolved from the template.
          type: string
        currency:
          description: ISO 4217 currency code of the amount.
          examples:
            - BRL
          type: string
        loanAccountId:
          description: Loan account the charge was applied to (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440005
          type: string
        rate:
          description: Charge rate as a decimal string (fractional, e.g. "0.015" for 1.5%).
          examples:
            - "0.015"
          type: string
        regulatoryWarnings:
          description: Non-blocking regulatory warnings raised while assessing the charge.
          items:
            type: string
          type:
            - array
            - "null"
        sourceProductVersionId:
          description: Product version whose template produced this charge (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
      required:
        - loanAccountId
        - sourceProductVersionId
        - chargeTemplateId
        - chargeCode
        - chargeType
        - amount
        - rate
        - currency
        - accountCreatedAt
        - assessedAt
      type: object
    LoanProductHumaBody:
      additionalProperties: false
      properties:
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        currentVersionId:
          description: Identifier (uuid) of the pinned active version; empty until activation.
          examples:
            - 550e8400-e29b-41d4-a716-44665544000a
          type: string
        id:
          description: Server-assigned loan product identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440009
          type: string
        jurisdictionCode:
          description: Jurisdiction profile code (e.g. BR).
          examples:
            - BR
          type: string
        loanType:
          description: Loan product type.
          examples:
            - personal
          type: string
        name:
          description: Loan product display name.
          type: string
        status:
          description: Lifecycle status (e.g. draft|active).
          examples:
            - active
          type: string
      required:
        - id
        - name
        - loanType
        - status
        - jurisdictionCode
        - createdAt
      type: object
    LoanProductListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of loan products; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/LoanProductHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    LoanProductVersionHumaBody:
      additionalProperties: false
      properties:
        accrualBasis:
          description: Interest recognition method the servicing accrual engine applies (effective_interest|linear).
          examples:
            - effective_interest
          type: string
        admittedBorrowerKinds:
          description: Kinds of borrower this version will originate for, de-duplicated and sorted. An EMPTY list means the version declares nothing and admits nobody; it never means "both".
          examples:
            -   - pessoaFisica
          items:
            type: string
          type: array
        changeReason:
          description: Reason recorded for creating this version.
          type: string
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        currency:
          description: ISO 4217 currency code the product version denominates (3 uppercase letters).
          examples:
            - BRL
          type: string
        firstDueDateWindow:
          $ref: "#/components/schemas/FirstDueDateWindowHumaBody"
          description: Span of days after the money date in which this version admits a chosen first instalment date. Absent means the version bounds no chosen date, which is the ordinary case.
        fixedAnnualRateBps:
          description: Fixed annual rate in basis points (1 bps = 0.01%).
          examples:
            - 1850
          format: int64
          type: integer
        floatingRateTableId:
          description: Linked floating-rate table identifier (uuid); empty in fixed mode.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        floatingSpreadBps:
          description: Floating spread in basis points (1 bps = 0.01%).
          examples:
            - 1850
          format: int64
          type: integer
        id:
          description: Server-assigned version identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        jurisdictionCode:
          description: Jurisdiction profile code (e.g. BR).
          examples:
            - BR
          type: string
        jurisdictionExtensions:
          additionalProperties: true
          description: Opaque per-jurisdiction version fields, echoed from the request for traceability.
          type: object
        productId:
          description: Owning loan product identifier (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        rateBand:
          $ref: "#/components/schemas/RateBandHumaBody"
          description: Price band this version authorizes, in annual basis points. Absent only on a stored version that predates the band; such a version originates nothing.
        rateMode:
          description: Rate mode (fixed|floating).
          examples:
            - fixed
          type: string
        requiresFloatingRate:
          description: Whether a floating-rate table is required for this version.
          type: boolean
      required:
        - id
        - productId
        - jurisdictionCode
        - currency
        - accrualBasis
        - rateMode
        - floatingSpreadBps
        - fixedAnnualRateBps
        - requiresFloatingRate
        - admittedBorrowerKinds
        - changeReason
        - createdAt
      type: object
    LoanProductVersionListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of product version snapshots, newest first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/LoanProductVersionHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    OverDeductionRefundHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Owed back to the worker, cent scale, decimal string; never a float.
          type: string
        competencia:
          description: YYYYMM the worker was over-deducted in.
          type: string
        currency:
          description: ISO 4217 currency code.
          type: string
        detectingRunId:
          description: Reconciliation run that first observed it. Provenance, never identity.
          type: string
        disposedAt:
          description: UTC instant the money was returned (RFC3339). Absent while the obligation is open.
          type: string
        dispositionActor:
          description: Validated identity that recorded the return.
          type: string
        dispositionReference:
          description: The reference the money was returned under.
          type: string
        executionSource:
          description: Where the execution fact came from.
          type: string
        id:
          description: Case identifier (uuid).
          type: string
        loanAccountId:
          description: Servicing account the over-deduction hit (uuid).
          type: string
        numeroContrato:
          description: Contract identity on the payroll rail.
          type: string
        recordedAt:
          description: UTC instant the obligation was recorded (RFC3339).
          type: string
        reversalSourceReference:
          description: The reversal posting-intent this case is the counterpart of.
          type: string
        status:
          description: recorded is an OPEN obligation; disposed carries the execution fact.
          enum:
            - recorded
            - disposed
          type: string
      required:
        - id
        - numeroContrato
        - competencia
        - detectingRunId
        - loanAccountId
        - amount
        - currency
        - reversalSourceReference
        - status
        - recordedAt
      type: object
    OverDeductionRefundListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Refund cases, oldest obligation first.
          items:
            $ref: "#/components/schemas/OverDeductionRefundHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    PDDStageLadderBandResponse:
      additionalProperties: false
      properties:
        carteira:
          description: "Norm portfolio class C1..C5, or empty for the catch-all scope. Scope is chosen before any day bound: a contract whose carteira has ANY band here is decided only by that carteira's bands and never sees the catch-all, so a carteira scope may be more lenient as well as stricter. Every carteira it names needs its own band at 0 days overdue."
          type: string
        minDaysOverdue:
          description: Inclusive lower bound of the band, in days overdue.
          format: int64
          type: integer
        regime:
          description: arrears (the day count of Res. CMN 4.966 art. 3 I) or problem_asset (the floor a declared characterisation imposes).
          type: string
        stage:
          description: PDD bucket a contract inside the band belongs to.
          type: string
      required:
        - carteira
        - regime
        - minDaysOverdue
        - stage
      type: object
    PDDStageLadderResponse:
      additionalProperties: false
      properties:
        bands:
          description: The carteira x days-overdue x regime rows.
          items:
            $ref: "#/components/schemas/PDDStageLadderBandResponse"
          type:
            - array
            - "null"
        effectiveFrom:
          description: First business date this ladder decides (YYYY-MM-DD).
          type: string
        ladderVersionId:
          description: Identifier a stage transition records as the policy that decided it.
          type: string
        scope:
          description: tenant when this tenant published the ladder, default when it is the shipped norm ladder.
          type: string
        sourceReference:
          description: Where the numbers came from.
          type: string
      required:
        - ladderVersionId
        - scope
        - effectiveFrom
        - sourceReference
        - bands
      type: object
    PDDStageResponse:
      additionalProperties: false
      properties:
        accrualState:
          description: "Interest accrual state implied by the current stage: accruing or suspended."
          examples:
            - accruing
          type: string
        businessDate:
          description: Business date the current stage applies to (YYYY-MM-DD, UTC).
          examples:
            - "2026-06-14"
          type: string
        currentStage:
          description: "Current PDD delinquency stage: one of current, stage_1, stage_2, stage_3."
          examples:
            - stage_1
          type: string
        effectiveAt:
          description: RFC3339 UTC timestamp at which the current stage became effective.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        jurisdictionCode:
          description: ISO jurisdiction code governing the staging (e.g. "BR").
          examples:
            - BR
          type: string
        latestTransition:
          $ref: "#/components/schemas/PDDStageTransitionDTO"
          description: Detail of the most recent stage transition; omitted when no transition exists.
        latestTransitionId:
          description: UUID of the most recent PDD stage transition applied to the account.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        loanAccountId:
          description: UUID of the loan account whose PDD staging state is reported.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        profileVersion:
          description: Jurisdiction profile version in effect for the staging rules.
          examples:
            - 1.0.0
          type: string
        reason:
          description: Reason recorded for entering the current stage.
          type: string
        triggeredBy:
          description: Actor or system that triggered the current stage.
          type: string
        updatedAt:
          description: RFC3339 UTC timestamp when the staging state was last updated.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
      required:
        - loanAccountId
        - currentStage
        - accrualState
        - latestTransitionId
        - reason
        - effectiveAt
        - businessDate
        - triggeredBy
        - profileVersion
        - jurisdictionCode
        - updatedAt
      type: object
    PDDStageTransitionDTO:
      additionalProperties: false
      properties:
        accrualState:
          description: "Interest accrual state resulting from the transition: accruing or suspended."
          examples:
            - accruing
          type: string
        businessDate:
          description: Business date the transition applies to (YYYY-MM-DD, UTC).
          examples:
            - "2026-06-14"
          type: string
        createdAt:
          description: RFC3339 UTC timestamp when the transition record was created.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        effectiveAt:
          description: RFC3339 UTC timestamp at which the transition became effective.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        fromStage:
          description: "PDD stage before the transition: one of current, stage_1, stage_2, stage_3."
          examples:
            - current
          type: string
        id:
          description: Unique identifier (UUID) of the PDD stage transition record.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        jurisdictionCode:
          description: ISO jurisdiction code governing the transition (e.g. "BR").
          examples:
            - BR
          type: string
        profileVersion:
          description: Jurisdiction profile version in effect when the transition was applied.
          examples:
            - 1.0.0
          type: string
        reason:
          description: Reason recorded for the transition or cure.
          type: string
        toStage:
          description: "PDD stage after the transition: one of current, stage_1, stage_2, stage_3."
          examples:
            - stage_1
          type: string
        triggeredBy:
          description: Actor or system that triggered the transition.
          type: string
      required:
        - id
        - fromStage
        - toStage
        - accrualState
        - reason
        - effectiveAt
        - businessDate
        - triggeredBy
        - profileVersion
        - jurisdictionCode
        - createdAt
      type: object
    PartialPrepaymentQuoteRequest:
      additionalProperties: false
      properties:
        amount:
          description: Prepayment amount in major currency units (e.g. "100.00").
          examples:
            - "42000.00"
          type: string
        businessDate:
          description: Optional valuation date (RFC3339 or YYYY-MM-DD); defaults to now (UTC).
          examples:
            - "2026-06-14"
          type: string
        quoteType:
          description: "Discriminator: partial principal prepayment."
          enum:
            - partial
          type: string
      required:
        - quoteType
        - amount
      type: object
    PayoffBoletoInstructions:
      additionalProperties: false
      properties:
        barcode:
          type: string
        digitableLine:
          type: string
        documentUrl:
          format: uri
          type: string
      type: object
    PayoffInstrumentResponse:
      additionalProperties: false
      properties:
        boleto:
          $ref: "#/components/schemas/PayoffBoletoInstructions"
        id:
          format: uuid
          type: string
        issuedAt:
          format: date-time
          type: string
        pix:
          $ref: "#/components/schemas/PayoffPIXInstructions"
        requestedAt:
          format: date-time
          type: string
        status:
          enum:
            - requested
            - issued
            - paid
            - expired
            - cancelled
            - failed
          type: string
        type:
          enum:
            - pix
            - boleto
          type: string
      required:
        - id
        - type
        - status
        - requestedAt
      type: object
    PayoffPIXInstructions:
      additionalProperties: false
      properties:
        copyPasteCode:
          type: string
        qrCodeUrl:
          format: uri
          type: string
      type: object
    PayoffStatementResponse:
      additionalProperties: false
      properties:
        chargeDiscount:
          type: string
        currency:
          type: string
        expiresAt:
          format: date-time
          type: string
        grossAmount:
          type: string
        instrument:
          $ref: "#/components/schemas/PayoffInstrumentResponse"
        interestDiscount:
          type: string
        iofReconciliation:
          type: string
        loanAccountId:
          format: uuid
          type: string
        netAmount:
          type: string
        principalOutstanding:
          type: string
        quoteId:
          format: uuid
          type: string
        slaDueAt:
          format: date-time
          type: string
        slaStatus:
          enum:
            - pending
            - met
            - breached
          type: string
        statementAvailableAt:
          format: date-time
          type: string
      required:
        - quoteId
        - loanAccountId
        - principalOutstanding
        - interestDiscount
        - chargeDiscount
        - iofReconciliation
        - grossAmount
        - netAmount
        - currency
        - statementAvailableAt
        - slaDueAt
        - slaStatus
        - expiresAt
        - instrument
      type: object
    PortabilityInboundLineageHumaBody:
      additionalProperties: false
      properties:
        currency:
          description: ISO 4217 currency code.
          type: string
        effectiveAt:
          description: UTC instant the portability took effect at the ORIGIN (RFC3339, sub-second precision preserved to the microsecond the row stores). Not the instant we booked.
          type: string
        externalOperationRef:
          description: The operation reference at the origin institution. Opaque, preserved verbatim; this is what a dispute is quoted against.
          type: string
        numeroContrato:
          description: The rail contract number.
          type: string
        originInstitution:
          description: The institution the contract came FROM. Opaque counterparty identifier, preserved verbatim.
          type: string
        transferredPrincipal:
          description: "What the worker owed at the ORIGIN when the debt moved, cent scale. The booked principal equals it by construction: a fact whose two numbers disagree is refused at ingestion."
          type: string
      required:
        - numeroContrato
        - originInstitution
        - externalOperationRef
        - transferredPrincipal
        - currency
        - effectiveAt
      type: object
    PortfolioDashboardHumaBody:
      additionalProperties: false
      properties:
        asOfDate:
          description: Business date the metrics were computed for (RFC3339, UTC midnight).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        delinquencyDistribution:
          description: Loan count and exposure broken down by delinquency bucket.
          items:
            $ref: "#/components/schemas/DashboardBucketHumaBody"
          type:
            - array
            - "null"
        drillDown:
          description: Per-loan delinquency rows for the requested bucket (empty when none).
          items:
            $ref: "#/components/schemas/DashboardDrillDownRow"
          type:
            - array
            - "null"
        freshness:
          $ref: "#/components/schemas/DashboardFreshnessHuma"
          description: "Provenance of the metrics: snapshot identity, staleness, and freshness policy."
        summary:
          $ref: "#/components/schemas/DashboardSummaryHumaBody"
          description: Portfolio-level exposure, volume, and PAR roll-up for the business date.
        trend:
          description: Month-by-month historical series leading up to the business date.
          items:
            $ref: "#/components/schemas/DashboardTrendPointHuma"
          type:
            - array
            - "null"
      required:
        - asOfDate
        - summary
        - delinquencyDistribution
        - drillDown
        - freshness
        - trend
      type: object
    PostingLegHumaInputBody:
      additionalProperties: false
      properties:
        account:
          description: GL account for this leg.
          examples:
            - 1100.10.001
          maxLength: 128
          type: string
        component:
          description: Open withholding component code (e.g. "iof"); set this XOR role.
          examples:
            - iof
          maxLength: 64
          type: string
        optional:
          description: Whether a component amount may be omitted or zero at posting time. Permitted only on component legs; omitted defaults to false.
          type: boolean
        perOperation:
          description: Whether this leg books into a per-operation account (borrower position) instead of one aggregated per product. When true, "account" is a prefix limited to 17 characters of letters, digits, '_', '.' and '-'; omitted defaults to false (aggregated).
          type: boolean
        role:
          description: Reserved economic role of this leg; set this XOR component.
          enum:
            - principal
            - interest
            - iof
            - tax
            - cash
            - unapplied_cash
            - counterparty
            - suspense
          examples:
            - principal
          type: string
        side:
          description: Whether this leg debits or credits the account.
          enum:
            - debit
            - credit
          examples:
            - debit
          type: string
      required:
        - account
        - side
      type: object
    PostingRuleHumaInputBody:
      additionalProperties: false
      properties:
        eventType:
          description: Accounting event type.
          enum:
            - disbursement
            - repayment
            - prepayment
            - accrual
            - accrual_tax
            - accrual_fee_amortization
            - collection_unapplied
            - collection_reapply
            - collection_refund
            - assignment_derecognition
            - assignment_retained_settlement
            - assignment_secured_borrowing
            - assignment_funding_amortization
            - assignment_funding_payoff
            - assignment_repurchase
            - refinance_payoff
            - refinance_payoff_reversal
            - provision_constitution
            - provision_reversal
            - renegotiation_gain
            - renegotiation_loss
            - renegotiation_derecognition
            - renegotiation_recognition
            - returned_payment_recognition
            - returned_payment_provision_constitution
            - returned_payment_provision_reversal
            - returned_payment_write_off
          examples:
            - disbursement
          type: string
        legs:
          description: "Non-null ordered posting legs. Prepayment requires exactly five legs in this component order: cash, charge_rebate, iof_refund, principal, iof_due; cash is a required debit, principal is a required credit, and the three component legs are optional with the corresponding sides. Assignment_derecognition requires exactly five legs in this component order: cash, assignment_loss, principal, assignment_interest, assignment_gain; cash is a required debit, principal is a required credit, and the assignment_interest credit and the two result legs are optional with the corresponding sides. The assignment_interest leg names the account the accrual rule debits: a sold receivable leaves at its amortized cost, which is principal plus the interest already recognized as income and not yet received, so both positions are relieved by the write-off. Assignment_retained_settlement requires exactly two legs in this order: a required cash debit and a required assignment_retained credit. Assignment_repurchase mirrors assignment_derecognition and requires exactly four legs in this order: a required principal debit, an optional assignment_loss debit, a required counterparty credit and an optional assignment_gain credit. Refinance_payoff requires exactly two legs in this order: a required counterparty debit and a required principal credit; refinance_payoff_reversal requires the mirror, a required principal debit and a required counterparty credit. Accrual_fee_amortization requires exactly two legs in this order: a required origination_fee component debit and a required interest role credit, neither optional. The debit account MUST be the same account the disbursement rule credits under its optional origination_fee component leg, because that is where the retained fee was parked at t0 and the only account releasing it can close. Assignment_funding_amortization requires exactly three legs in this component order: assignment_funding, assignment_funding_expense, assignment_funding_repasse; the assignment_funding debit and the assignment_funding_repasse credit are required and the assignment_funding_expense debit is optional, because a cession priced AT face has a zero effective rate and honestly posts two. The repasse leg is a PAYABLE to the fund and never cash: the borrower's deduction lands on the assignor's own rail account and a human repasses it days later, so crediting cash here would show money leaving before it leaves. Assignment_funding_payoff is that shape plus a fourth leg, an optional assignment_funding_gain credit, in this component order: assignment_funding, assignment_funding_expense, assignment_funding_repasse, assignment_funding_gain. What ends a cession early is the amount the fund AGREED to take, so unlike a monthly repasse it can land BELOW the obligation, and the deságio that stops being appropriable over a term that has just ended is credited there. Exactly one of the expense and gain legs ever carries an amount, and at an agreed amount equal to the obligation neither does. A monthly repasse cannot produce a gain and is refused for declaring one. The assignment_funding debit account MUST be the same account assignment_secured_borrowing credits under its own assignment_funding leg, for the reason the deferred origination fee names one account at both ends: an obligation raised in one account and discharged from another posts balanced entries for the life of the cession while the first never closes and the second goes negative by the whole price. Renegotiation_gain requires exactly two legs in this order: a required principal debit and a required renegotiation_gain credit; renegotiation_loss requires the mirror, a required renegotiation_loss debit and a required principal credit. Renegotiation_derecognition requires exactly three legs in this component order: counterparty, renegotiation_loss, renegotiation_gain; the counterparty debit is required and the two result legs are optional with the corresponding sides. It names NO asset leg, deliberately: which accounts a contract stops holding when it leaves the book is read from the ledger on the day, one leg per account that holds anything, so it cannot be declared here. The counterparty leg carries what moves to the replacement contract; on a contract a non-substantial renegotiation has already re-carried, the ledger holds more than the borrower owes and the result legs carry the difference, which is why a product cannot map this event without naming both result accounts. Every position a borrower can carry must be mapped to a per-operation account, or this event is refused at posting time because the ledger cannot say what one contract holds; renegotiation_recognition requires exactly two legs in this order: a required principal debit and a required counterparty credit. Other events require at least one debit and one credit."
          items:
            $ref: "#/components/schemas/PostingLegHumaInputBody"
          maxItems: 16
          minItems: 2
          type: array
        metadata:
          additionalProperties:
            type: string
          description: Optional metadata.
          type: object
      required:
        - eventType
        - legs
      type: object
    PrepayLoanAccountHumaRequest:
      additionalProperties: false
      properties:
        amount:
          description: Prepayment amount (2 d.p. string). Amount-only prepayment is available only for non-BR accounts; BR accounts require quoteId.
          examples:
            - "100.00"
          type: string
        businessDate:
          description: YYYY-MM-DD business date applied to the prepayment.
          examples:
            - "2026-06-14"
          type: string
        effectiveDate:
          description: The moment the settlement money moved, as a full RFC 3339 instant with a time and an offset. A bare YYYY-MM-DD calendar date is refused with LENDER-0348.
          examples:
            - "2026-06-14T17:30:00Z"
          type: string
        quoteId:
          description: Settlement quote identifier. Required when amount is empty.
          examples:
            - 550e8400-e29b-41d4-a716-446655440020
          type: string
        transactionId:
          description: Operator-supplied prepayment transaction identifier.
          maxLength: 128
          type: string
      required:
        - transactionId
        - effectiveDate
        - businessDate
      type: object
    PrepaymentQuoteResponse:
      additionalProperties: false
      properties:
        acceptedAt:
          description: RFC3339 UTC timestamp when the quote was accepted; empty while still pending.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        acceptedTransactionId:
          description: Identifier of the settlement transaction that accepted the quote; empty while still pending.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        chargeRebate:
          description: Rebate of unaccrued charges and fees credited on prepayment, as a decimal string, scale 2.
          examples:
            - "120.00"
          type: string
        consumerProtectionRegime:
          description: Consumer-protection regime label applied to the prepayment terms.
          type: string
        createdAt:
          description: RFC3339 UTC timestamp when the quote was created.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        currency:
          description: ISO 4217 currency code of the loan and quote.
          examples:
            - BRL
          type: string
        expiresAt:
          description: RFC3339 UTC timestamp after which the quote is no longer valid.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        grossAmount:
          description: Retired settlement principal being paid off (equals the outstanding principal for a full settlement), as a decimal string, scale 2.
          examples:
            - "42000.00"
          type: string
        id:
          description: Unique identifier (UUID) of the prepayment quote.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        interestRebate:
          description: Mandatory interest rebate (juros nao incorridos) credited on prepayment, as a decimal string, scale 2.
          examples:
            - "1250.75"
          type: string
        iofReconciliation:
          description: IOF adjustment as a decimal string, scale 2. Defined-principal loans report zero because IOF is not refunded on early payoff.
          examples:
            - "0.00"
          type: string
        jurisdictionCode:
          description: ISO jurisdiction code governing the quote (e.g. "BR").
          examples:
            - BR
          type: string
        loanAccountId:
          description: UUID of the loan account the quote was generated for.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        netSettlementAmount:
          description: "Net cash payable to settle: gross settlement principal minus charge rebate plus any IOF due, as a decimal string, scale 2. Interest rebate is disclosure-only; defined-principal loans report zero IOF reconciliation because IOF is not refunded."
          examples:
            - "41880.00"
          type: string
        payoffPurpose:
          description: "Who pays this frozen payoff: borrower_prepayment or portability. Omitted when the quote does not state one."
          examples:
            - portability
          type: string
        principalOutstanding:
          description: Outstanding principal at quote time as a decimal string in major currency units, scale 2.
          examples:
            - "42000.00"
          type: string
        profileVersion:
          description: Jurisdiction profile version used to compute the quote.
          examples:
            - 1.0.0
          type: string
        quoteType:
          description: "Quote variant: partial (principal prepayment) or full_settlement."
          examples:
            - partial
          type: string
        rebateMandatory:
          description: True when regulation mandates applying the interest rebate to this quote.
          type: boolean
        slaDueAt:
          description: RFC3339 UTC full-settlement SLA deadline; omitted for partial quotes.
          examples:
            - "2026-06-19T12:00:00Z"
          type: string
      required:
        - id
        - loanAccountId
        - quoteType
        - principalOutstanding
        - interestRebate
        - chargeRebate
        - iofReconciliation
        - grossAmount
        - netSettlementAmount
        - rebateMandatory
        - expiresAt
        - currency
        - profileVersion
        - jurisdictionCode
        - consumerProtectionRegime
        - createdAt
      type: object
    PreviewCompensatingAdjustmentHumaBody:
      additionalProperties: false
      properties:
        adjustmentAmount:
          description: Normalized signed amount, exact two-decimal string.
          type: string
        currency:
          description: ISO-4217 currency code.
          type: string
        debtAmountAfter:
          description: CCB debt after, when this adjustment changes the debt.
          type: string
        debtAmountBefore:
          description: CCB debt before, when this adjustment changes the debt.
          type: string
        numeroContrato:
          description: Canonical rail contract number.
          type: string
        principalSide:
          description: "debit|credit: the direction the eventual posting intent moves the contract's principal (receivable) account. Always opposite suspenseSide."
          type: string
        reason:
          description: Closed reason catalog.
          type: string
        suspenseSide:
          description: "debit|credit: the direction the eventual posting intent moves the tenant's suspense account."
          type: string
      required:
        - numeroContrato
        - reason
        - currency
        - adjustmentAmount
        - suspenseSide
        - principalSide
      type: object
    ProblemAssetAssessmentHistoryResponse:
      additionalProperties: false
      properties:
        assessments:
          description: "Declarations, newest first. Withdrawals are listed beside the characterisations they withdraw rather than replacing them: a declaration is never edited or deleted, so the history IS the record."
          items:
            $ref: "#/components/schemas/ProblemAssetAssessmentResponse"
          type:
            - array
            - "null"
        loanAccountId:
          description: Contract the history belongs to.
          type: string
      required:
        - loanAccountId
        - assessments
      type: object
    ProblemAssetAssessmentResponse:
      additionalProperties: false
      properties:
        assessmentId:
          description: Identity of this declaration.
          type: string
        characterizesProblemAsset:
          description: The verdict recorded.
          type: boolean
        createdAt:
          description: When the declaration was recorded (RFC 3339, UTC).
          type: string
        declaredBy:
          description: Authenticated subject that declared it, as free text.
          type: string
        evaluatedOn:
          description: Business day the assessment was made (YYYY-MM-DD).
          type: string
        evidenceNotes:
          description: The assessor's own notes, empty when none were written.
          type: string
        evidenceReference:
          description: Pointer to the evidence behind the declaration.
          type: string
        loanAccountId:
          description: Contract the declaration is about.
          type: string
        source:
          description: Where the characterisation came from.
          type: string
        trigger:
          description: The norm article invoked, trimmed and lower-cased. This is the form a withdrawal of this declaration must use.
          type: string
      required:
        - assessmentId
        - loanAccountId
        - trigger
        - source
        - evidenceReference
        - evidenceNotes
        - evaluatedOn
        - characterizesProblemAsset
        - declaredBy
        - createdAt
      type: object
    ProblemAssetReassessmentOverdueListResponse:
      additionalProperties: false
      properties:
        businessDate:
          description: "Business date the rows belong to: the one asked for, or the latest the sweep recorded. Empty only when no sweep has ever run for this tenant."
          type: string
        hasMore:
          description: True when the backlog runs past the rows returned. Ask again with a larger limit to see the rest.
          type: boolean
        overdue:
          description: Contracts whose standing qualitative characterisation has outlived its re-assessment horizon, ordered by contract.
          items:
            $ref: "#/components/schemas/ProblemAssetReassessmentOverdueResponse"
          type:
            - array
            - "null"
        totalCount:
          description: How many contracts are overdue on this business date in total, not how many this page carries. On a compliance surface the size of the backlog is the number that matters, and a full page with no total reads exactly like a backlog the size of the page.
          format: int64
          type: integer
      required:
        - businessDate
        - overdue
        - totalCount
        - hasMore
      type: object
    ProblemAssetReassessmentOverdueResponse:
      additionalProperties: false
      properties:
        businessDate:
          description: Business date this row was raised for (YYYY-MM-DD).
          type: string
        daysOverdueForReassessment:
          description: "Days past the horizon on this business date. One on the first overdue day: a contract at exactly the horizon is still inside its deadline and is not listed."
          format: int64
          type: integer
        horizonDays:
          description: The re-assessment interval the contract's product version declares, in days.
          format: int64
          type: integer
        lastAssessedOn:
          description: "The day somebody last looked at this contract at all (YYYY-MM-DD): the newest evaluation date across every live declaration, characterising or withdrawn."
          type: string
        loanAccountId:
          description: Contract whose characterisation is due for review.
          type: string
        trigger:
          description: The norm article of the characterisation still standing, trimmed and lower-cased — the same form a withdrawal of it must use.
          type: string
      required:
        - loanAccountId
        - businessDate
        - trigger
        - lastAssessedOn
        - horizonDays
        - daysOverdueForReassessment
      type: object
    PromoteLoanProductVersionHumaInputBody:
      additionalProperties: false
      properties:
        versionId:
          description: Loan product version that new applications should originate on from now on. It must be a version of this product.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          format: uuid
          type: string
      required:
        - versionId
      type: object
    PublishPDDStageLadderBand:
      additionalProperties: false
      properties:
        carteira:
          description: Norm portfolio class this band is written for. Omit for a band that applies to every carteira.
          enum:
            - ""
            - C1
            - C2
            - C3
            - C4
            - C5
          type: string
        minDaysOverdue:
          description: Inclusive lower bound of the band, in days overdue.
          examples:
            - 15
          format: int64
          minimum: 0
          type: integer
        regime:
          description: arrears is the day count; problem_asset is the floor a declared characterisation imposes and must open at 0 days.
          enum:
            - arrears
            - problem_asset
          examples:
            - arrears
          type: string
        stage:
          description: PDD bucket a contract inside the band belongs to.
          enum:
            - current
            - stage_1
            - stage_2
            - stage_3
          examples:
            - stage_1
          type: string
      required:
        - regime
        - minDaysOverdue
        - stage
      type: object
    PublishPDDStageLadderHumaBody:
      additionalProperties: false
      properties:
        bands:
          description: "The bands of the ladder. Every scope needs a floor: an arrears band AND a problem_asset band at 0 days with no carteira, plus a band at 0 days for each carteira the ladder names — a carteira scope is resolved alone and never falls back to the catch-all."
          items:
            $ref: "#/components/schemas/PublishPDDStageLadderBand"
          maxItems: 200
          minItems: 1
          type:
            - array
            - "null"
        effectiveFrom:
          description: "First business date the new ladder decides (YYYY-MM-DD). Must be in the future: configuration never reclassifies history."
          examples:
            - "2026-10-01"
          type: string
        sourceReference:
          description: Where the numbers came from — the norm article, the committee decision.
          examples:
            - Credit committee 2026-09-30
          maxLength: 512
          type: string
      required:
        - effectiveFrom
        - sourceReference
        - bands
      type: object
    RateBandHumaBody:
      additionalProperties: false
      properties:
        maxAnnualRateBps:
          description: Band ceiling in annual basis points, inclusive; never below the floor.
          examples:
            - 4800
          format: int64
          minimum: 0
          type: integer
        minAnnualRateBps:
          description: Band floor in annual basis points, inclusive (1 bps = 0.01%). Zero is a legitimate floor.
          examples:
            - 1200
          format: int64
          minimum: 0
          type: integer
      required:
        - minAnnualRateBps
        - maxAnnualRateBps
      type: object
    RateTableDetailHumaBody:
      additionalProperties: false
      properties:
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Floating-rate table identifier (uuid).
          examples:
            - 66666666-6666-6666-6666-666666666666
          type: string
        name:
          description: Reference rate table name.
          examples:
            - Selic
          type: string
        periods:
          description: Effective-dated curve, oldest first; always present, empty slice when the table carries no period yet.
          items:
            $ref: "#/components/schemas/RateTablePeriodHumaBody"
          type:
            - array
            - "null"
      required:
        - id
        - name
        - createdAt
        - periods
      type: object
    RateTableHumaBody:
      additionalProperties: false
      properties:
        createdAt:
          description: Creation timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Floating-rate table identifier (uuid).
          examples:
            - 66666666-6666-6666-6666-666666666666
          type: string
        name:
          description: Reference rate table name.
          examples:
            - Selic
          type: string
      required:
        - id
        - name
        - createdAt
      type: object
    RateTableListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Page of floating-rate table headers, newest first; always present, empty slice when none exist.
          items:
            $ref: "#/components/schemas/RateTableHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    RateTablePeriodHumaBody:
      additionalProperties: false
      properties:
        annualRateBps:
          description: Reference annual rate for the period, basis points.
          examples:
            - 1075
          format: int64
          type: integer
        effectiveDate:
          description: Date this rate takes effect, inclusive (RFC3339, UTC).
          examples:
            - "2026-01-01T00:00:00Z"
          type: string
        endDate:
          description: Date this rate stops applying, inclusive (RFC3339, UTC); absent while the period is open-ended.
          examples:
            - "2026-06-30T00:00:00Z"
          type: string
        id:
          description: Rate period identifier (uuid).
          examples:
            - 77777777-7777-7777-7777-777777777777
          type: string
      required:
        - id
        - effectiveDate
        - annualRateBps
      type: object
    ReasonedDecisionHumaBody:
      additionalProperties: false
      properties:
        decidedBy:
          description: Authenticated subject who recorded the decision.
          type: string
        decisionAt:
          description: Decision timestamp (RFC3339, UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Decision identifier (UUID) for the rejection or withdrawal.
          examples:
            - b2c3d4e5-f6a7-4890-9bcd-ef0123456789
          type: string
        reason:
          description: Free-text reason for the rejection or withdrawal.
          type: string
      required:
        - id
        - decisionAt
        - decidedBy
        - reason
      type: object
    ReconcileCompensatingAdjustmentHumaBody:
      additionalProperties: false
      properties:
        confirmed:
          description: True when the ledger already carries a transaction for this operation's correlation identity.
          type: boolean
        id:
          description: Compensating adjustment operation identifier.
          type: string
        status:
          description: "The latest append-only history status after this call: posted|reconciliation_unknown."
          type: string
      required:
        - id
        - confirmed
        - status
      type: object
    RecordAssignmentSetFactHumaInputBody:
      additionalProperties: false
      properties:
        acceptance:
          $ref: "#/components/schemas/AssignmentAcceptanceHumaBody"
          description: The administrator's acceptance document, in the pinned shape. Required when factType is accepted and provenance is administrator_file.
        factType:
          description: "The externally-observed fact being confirmed. offer_sent is the operator confirming the authorized offer file was delivered to the fund's administrator, and requires an authorized file to exist. paid, transferred and accepted are per-receivable progress facts and follow one another in that order; accepted is the administrator accepting the title transfer, which takes the receivable out of this portfolio and writes it off. term_signed is NOT here: it is derived from the signed endorsement instrument itself."
          enum:
            - offer_sent
            - paid
            - transferred
            - accepted
          type: string
        provenance:
          description: "Where the fact came from. REQUIRED for paid, transferred and accepted; ignored for offer_sent, which is by construction an operator's own confirmation about a file we generated. On a transferred fact it also decides whether the registradora's title-transfer command is settled: only registry_provider does that, because the acceptance guard treats a settled command as proof the title moved, and a desk's or an administrator's own statement is not the registradora's acatamento. Where the fund reaches no registradora the guard does not apply at all."
          enum:
            - administrator_file
            - registry_provider
            - operator
          type: string
        receivableRefs:
          description: "Narrows a per-receivable fact to exactly these receivables. Omit it to mean the WHOLE surviving composition — the honest reading of an administrator stating that a portfolio was paid. A reference the set does not carry, or carries as cut or removed, is refused. It must be EMPTY when an acceptance document is present: the document already names what was accepted, and two lists are two answers."
          items:
            type: string
          maxItems: 5000
          type:
            - array
            - "null"
      required:
        - factType
      type: object
    RecordAssignmentTermHumaInputBody:
      additionalProperties: false
      properties:
        artifact:
          description: The administrator's own signed endorsement term, base64-encoded. Required if and only if this fund's administrator generates the term; refused for a fund the Lender emits for.
          format: byte
          type: string
        artifactReference:
          description: The administrator's own identifier for that document (its term/protocol number). Required alongside artifact.
          maxLength: 256
          type: string
        coObligation:
          description: "Whether this term binds the assignor to answer for the receivable it sold (coobrigação). REQUIRED, and the only accepted value is false. An omitted field is refused rather than read as false: silence about a signed instrument is not a statement about its clauses, and this table is append-only, so a term recorded under an assumption cannot be corrected afterwards. Same reason proposedRetainedFraction is required on the fund route. A term WITH co-obligation is a retained-risk assignment under Res. CMN 4.966: the receivable stays on the balance sheet, the price is recorded as a liability and the result is appropriated over the remaining term. That treatment does not exist yet, so the clause is refused rather than recorded and then booked as an outright sale. Declared here as a structured fact and never read out of the document's wording."
          type: boolean
        idempotencyKey:
          description: Caller idempotency key. The same key replays the same term; the same key over a different approved composition, a different template version or different artifact bytes is refused.
          maxLength: 256
          minLength: 1
          type: string
      required:
        - idempotencyKey
        - coObligation
      type: object
    RegisterReceivableInstrumentHumaInputBody:
      additionalProperties: false
      properties:
        fundId:
          description: The fund whose registry configuration governs this registration.
          format: uuid
          type: string
      required:
        - fundId
      type: object
    RejectLoanApplicationHumaRequest:
      additionalProperties: false
      properties:
        decisionAt:
          description: Decision timestamp (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        reason:
          description: Rejection reason.
          type: string
      required:
        - decisionAt
        - reason
      type: object
    RepaymentAllocationHumaBody:
      additionalProperties: false
      properties:
        dueDate:
          description: ISO-8601 installment due date.
          examples:
            - "2026-06-14"
          type: string
        feesAmount:
          description: Fees component (2 d.p. string).
          examples:
            - "3.50"
          type: string
        fullyPaid:
          description: True if this installment is fully settled.
          type: boolean
        installmentNumber:
          description: 1-based installment sequence number.
          examples:
            - 3
          format: int64
          type: integer
        interestAmount:
          description: Interest component (2 d.p. string).
          examples:
            - "20.00"
          type: string
        penaltiesAmount:
          description: Penalties component (2 d.p. string).
          examples:
            - "1.50"
          type: string
        principalAmount:
          description: Principal component (2 d.p. string).
          examples:
            - "100.00"
          type: string
        totalAmount:
          description: Total installment amount (2 d.p. string).
          examples:
            - "125.00"
          type: string
      required:
        - installmentNumber
        - dueDate
        - principalAmount
        - interestAmount
        - feesAmount
        - penaltiesAmount
        - totalAmount
        - fullyPaid
      type: object
    RepaymentAllocationHumaEntry:
      additionalProperties: false
      properties:
        dueDate:
          description: ISO-8601 installment due date.
          examples:
            - "2026-06-14"
          type: string
        feesAmount:
          description: Fees applied (2 d.p. string).
          examples:
            - "1.50"
          type: string
        fullyPaid:
          description: True if this installment is fully settled.
          type: boolean
        installmentNumber:
          description: 1-based installment sequence number.
          examples:
            - 3
          format: int64
          type: integer
        interestAmount:
          description: Interest applied (2 d.p. string).
          examples:
            - "12.34"
          type: string
        penaltiesAmount:
          description: Penalties applied (2 d.p. string).
          examples:
            - "0.00"
          type: string
        principalAmount:
          description: Principal applied (2 d.p. string).
          examples:
            - "100.00"
          type: string
        totalAmount:
          description: Total applied to this installment (2 d.p. string).
          examples:
            - "113.84"
          type: string
      required:
        - installmentNumber
        - dueDate
        - principalAmount
        - interestAmount
        - feesAmount
        - penaltiesAmount
        - totalAmount
        - fullyPaid
      type: object
    RepaymentPreviewHumaBody:
      additionalProperties: false
      properties:
        allocations:
          description: Per-installment allocation breakdown.
          items:
            $ref: "#/components/schemas/RepaymentAllocationHumaBody"
          type:
            - array
            - "null"
        appliedAmount:
          description: Amount applied to the loan (2 d.p. string).
          examples:
            - "125.00"
          type: string
        backdated:
          description: True if the repayment effective date is before the business date.
          type: boolean
        effectiveDate:
          description: "RFC 3339 instant the money moved, used for this preview. A bare calendar date is refused (LENDER-0103 is the charge equivalent; this route answers LENDER-0348): the day a payment belongs to is derived from the moment, so the moment is what the caller declares."
          examples:
            - "2026-06-14T21:00:00Z"
          type: string
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        overpaymentAmount:
          description: Excess amount above total outstanding (2 d.p. string).
          examples:
            - "0.00"
          type: string
      required:
        - loanAccountId
        - effectiveDate
        - allocations
        - appliedAmount
        - overpaymentAmount
        - backdated
      type: object
    RepaymentRecordHumaBody:
      additionalProperties: false
      properties:
        allocations:
          description: Per-installment allocation breakdown.
          items:
            $ref: "#/components/schemas/RepaymentAllocationHumaBody"
          type:
            - array
            - "null"
        appliedAmount:
          description: Amount applied to the loan (2 d.p. string).
          examples:
            - "125.00"
          type: string
        backdated:
          description: True if the repayment effective date is before the business date.
          type: boolean
        effectiveDate:
          description: "RFC 3339 instant the money moved. A bare calendar date is refused with LENDER-0348: the day a payment belongs to - its competencia, its business date, its IOF window - is derived from the moment, so the moment is what the caller declares. A payer who knows only the day names an instant on that day."
          examples:
            - "2026-06-14T21:00:00Z"
          type: string
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        overpaymentAmount:
          description: Excess amount above total outstanding (2 d.p. string).
          examples:
            - "0.00"
          type: string
        requestId:
          description: Idempotency request ID echoed from the request.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        transactionId:
          description: Recorded repayment transaction UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
      required:
        - transactionId
        - loanAccountId
        - effectiveDate
        - allocations
        - appliedAmount
        - overpaymentAmount
        - backdated
      type: object
    RepaymentRequestHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Repayment amount in major currency units (e.g. "125.00"). Must be positive with at most 2 fractional digits.
          examples:
            - "125.00"
          type: string
        effectiveDate:
          description: The moment the money moved, as a full RFC 3339 instant with a time and an offset. A bare YYYY-MM-DD calendar date is refused with LENDER-0348.
          examples:
            - "2026-06-14T17:30:00Z"
          type: string
        transactionDate:
          description: The moment the money moved, as a full RFC 3339 instant, read when effectiveDate is absent. A bare YYYY-MM-DD calendar date is refused with LENDER-0348.
          examples:
            - "2026-06-14T17:30:00Z"
          type: string
      required:
        - amount
      type: object
    RequeueConsignadoInboxHumaBody:
      additionalProperties: false
      properties:
        id:
          description: The item's identifier.
          type: string
        inbox:
          description: The inbox the item belongs to.
          type: string
        requeued:
          description: True when the item was quarantined and is now back on the queue.
          type: boolean
        requeuedAt:
          description: UTC instant of the requeue (RFC3339).
          type: string
      required:
        - inbox
        - id
        - requeued
        - requeuedAt
      type: object
    RequeueContractDivergenceHumaRequest:
      additionalProperties: false
      properties:
        expectedVersion:
          description: "Compare-and-swap guard: the version this request was read against."
          format: int64
          minimum: 1
          type: integer
        reason:
          description: Optional free-text reason for the retry.
          maxLength: 4000
          type: string
      required:
        - expectedVersion
      type: object
    RescheduleLoanAccountHumaRequest:
      additionalProperties: false
      properties:
        businessDate:
          description: YYYY-MM-DD business date applied to the reschedule.
          examples:
            - "2026-06-14"
          type: string
        effectiveDate:
          description: YYYY-MM-DD effective date of the reschedule.
          examples:
            - "2026-06-14"
          type: string
        firstRescheduledDueDate:
          description: YYYY-MM-DD first due date of the rescheduled plan.
          examples:
            - "2026-06-14"
          type: string
        indexChanged:
          description: "RENEGOTIATION. Declare that the modification changed the contract's index. A SUBSTANTIAL trigger under art. 22. It is DECLARED and never inferred: an index is not a concept this core models, so no reading of the stored schedule could tell one change from another. Declaration beats calculation, and a declared change is substantial however small its effect on present value."
          type: boolean
        newCurrency:
          description: RENEGOTIATION. ISO-4217 currency when the modification changes the contract's currency. A currency change is a SUBSTANTIAL modification under art. 22, and it is the one qualitative trigger the system computes for itself rather than taking on the operator's word.
          examples:
            - USD
          maxLength: 3
          type: string
        newMonthlyInterestRate:
          description: RENEGOTIATION. Monthly interest rate as a decimal FRACTION (0.025 is 2.5% a month) to price the new schedule at, in place of the rate the contract was written at. Omit to re-time at the contract's own rate. Supplying it makes this a renegotiation under Res. CMN 4.966/2021 art. 22, which is judged and, until the renegotiation posting exists, refused with 422 naming the verdict and the amount.
          examples:
            - "0.025"
          type: string
        newTermMonths:
          description: New loan term in months.
          examples:
            - 24
          format: int64
          minimum: 1
          type: integer
        rateTypeChanged:
          description: RENEGOTIATION. Declare that the modification changed the contract's rate type, for instance fixed to floating. A SUBSTANTIAL trigger under art. 22, declared for the same reason as indexChanged.
          type: boolean
        reason:
          description: Operator-supplied reschedule reason.
          maxLength: 128
          type: string
        transactionId:
          description: Operator-supplied reschedule transaction identifier.
          maxLength: 128
          type: string
      required:
        - transactionId
        - newTermMonths
        - firstRescheduledDueDate
        - effectiveDate
        - businessDate
        - reason
      type: object
    ResolveAssignmentExceptionHumaInputBody:
      additionalProperties: false
      properties:
        disposition:
          description: What was decided about this case, in the operator's own words. Required — the queue exists because software could not decide, so closing one with nothing recorded discards the question.
          maxLength: 512
          minLength: 1
          type: string
      required:
        - disposition
      type: object
    RetryAccrualRunHumaInputBody:
      additionalProperties: false
      properties:
        itemIds:
          description: "Accrual run item identifiers to retry. Selecting an item the ledger has already acknowledged is not an error — it is skipped, and the response says which items were actually re-sent. An id that is not an item of this run IS an error: the whole request is refused with 422 and the unknown ids are named."
          items:
            format: uuid
            type: string
          maxItems: 500
          minItems: 1
          type:
            - array
            - "null"
      required:
        - itemIds
      type: object
    ReturnedPaymentReceivableHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Amount owed (2 d.p. string).
          examples:
            - "125.00"
          type: string
        borrowerId:
          description: Party who owes the returned money.
          examples:
            - 550e8400-e29b-41d4-a716-446655440020
          format: uuid
          type: string
        collectedAt:
          description: RFC 3339 UTC instant of the collection; absent while open.
          examples:
            - "2026-07-01T12:00:00Z"
          type: string
        collectedBy:
          description: Authenticated subject that recorded the collection; empty when the collection was recorded by the system.
          type: string
        collectedOn:
          description: Civil day of the collection; absent while open.
          examples:
            - "2026-07-01"
          type: string
        currency:
          description: ISO-4217 currency of the debt.
          examples:
            - BRL
          type: string
        id:
          description: Returned-payment receivable identifier.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          format: uuid
          type: string
        loanAccountId:
          description: Loan account whose returned payment opened this debt. The contract itself stays discharged.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          format: uuid
          type: string
        openedAt:
          description: RFC 3339 UTC instant the debt was opened.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        openedOn:
          description: Civil day the debt was opened on.
          examples:
            - "2026-06-14"
          type: string
        originalTransactionId:
          description: Payment that was given back.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        provisionAmount:
          description: Credit-loss allowance the ledger holds against this debt right now (2 d.p. string). Zero on a collected debt, which released it, and on a written-off one, which consumed it.
          examples:
            - "4.38"
          type: string
        reversalTransactionId:
          description: Compensating reversal that opened this debt.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        stage:
          description: Where the origin credit product's stage ladder put the debt at its last aging. The vocabulary belongs to the jurisdiction publishing the ladder; absent until the first nightly sweep reaches the row.
          examples:
            - stage_1
          type: string
        status:
          description: "'open' while the borrower still owes it, 'collected' once it was paid by other means, 'written_off' once the ladder charged it off to loss."
          enum:
            - open
            - collected
            - written_off
          examples:
            - open
          type: string
        writtenOffAt:
          description: RFC 3339 UTC instant of the charge-off; absent unless written off.
          examples:
            - "2026-09-01T05:00:00Z"
          type: string
        writtenOffOn:
          description: Civil day of the charge-off; absent unless written off.
          examples:
            - "2026-09-01"
          type: string
      required:
        - id
        - loanAccountId
        - borrowerId
        - originalTransactionId
        - reversalTransactionId
        - currency
        - amount
        - status
        - openedAt
        - openedOn
        - provisionAmount
      type: object
    ReverseRepaymentHumaBody:
      additionalProperties: false
      properties:
        amount:
          description: Reversed amount (2 d.p. string).
          examples:
            - "125.00"
          type: string
        destination:
          description: "Where the reversed money went: 'revived' (the debt returned to this contract, its schedule is back) or 'returned_payment_receivable' (the contract stayed discharged and the money opened a separate debt of the borrower, outside the credit operation and with no payroll deduction behind it)."
          enum:
            - revived
            - returned_payment_receivable
          examples:
            - revived
          type: string
        effectiveDate:
          description: ISO-8601 effective date of the reversal.
          examples:
            - "2026-06-14"
          type: string
        jurisdictionCode:
          description: Jurisdiction code applied to the reversal.
          examples:
            - BR
          type: string
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        originalTransactionId:
          description: Reversed original transaction UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440001
          type: string
        profileVersion:
          description: Product profile version applied to the reversal.
          examples:
            - 1.0.0
          type: string
        reason:
          description: Operator-supplied reversal reason.
          type: string
        requestId:
          description: Idempotency request ID echoed from the request.
          examples:
            - 550e8400-e29b-41d4-a716-446655440010
          type: string
        returnedPaymentReceivableId:
          description: Identifier of the returned-payment receivable this reversal opened. Present only when destination is 'returned_payment_receivable'.
          examples:
            - 550e8400-e29b-41d4-a716-446655440003
          format: uuid
          type: string
        transactionId:
          description: Compensating reversal transaction UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
      required:
        - transactionId
        - originalTransactionId
        - loanAccountId
        - reason
        - profileVersion
        - effectiveDate
        - amount
        - destination
      type: object
    ReverseRepaymentHumaRequest:
      additionalProperties: false
      properties:
        jurisdictionCode:
          description: Optional jurisdiction code.
          examples:
            - BR
          type: string
        profileVersion:
          description: Product profile version applied to the reversal.
          examples:
            - 1.0.0
          type: string
        reason:
          description: Operator-supplied reversal reason.
          minLength: 1
          type: string
      required:
        - reason
      type: object
    SchedulePreviewHumaBody:
      additionalProperties: false
      properties:
        calendarReference:
          description: Identifier of the business calendar used to resolve due dates.
          type: string
        dayCountConvention:
          description: Day count convention applied to interest accrual.
          examples:
            - ACT/365
          type: string
        effectiveCostPreview:
          $ref: "#/components/schemas/SchedulePreviewHumaEffectiveCost"
          description: Effective-cost breakdown; present only when the jurisdiction profile computes one.
        installments:
          description: Ordered amortisation schedule, one entry per installment.
          items:
            $ref: "#/components/schemas/SchedulePreviewHumaInstallmentLine"
          type:
            - array
            - "null"
        jurisdictionCode:
          description: ISO-2 jurisdiction code resolved for this preview.
          examples:
            - BR
          type: string
        jurisdictionExtensions:
          $ref: "#/components/schemas/SchedulePreviewHumaJurisdictionExtensions"
          description: Per-jurisdiction overlay payload; present only when the profile emits one.
        profileVersion:
          description: Jurisdiction profile version used to compute the schedule.
          examples:
            - 1.0.0
          type: string
        scheduleOfferSnapshotId:
          description: Identifier of the offer this preview recorded; derived from the frozen inputs, so an identical preview returns the same value. Absent whenever no offer was recorded — the request carries no tenant identity, the offer store was unavailable, or the service is misconfigured — and the schedule is returned in every one of those cases.
          examples:
            - 6f2b9a41-0c3d-5e7f-9a12-4b8c6d0e1f37
          type: string
        totalInterest:
          description: Sum of interest across all installments as a decimal string, minor-unit precision scale 2 (e.g. "4321.00").
          examples:
            - "4321.00"
          type: string
        totalPrincipal:
          description: Sum of principal across all installments as a decimal string, minor-unit precision scale 2 (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
      required:
        - installments
        - totalInterest
        - totalPrincipal
        - jurisdictionCode
        - profileVersion
        - dayCountConvention
        - calendarReference
      type: object
    SchedulePreviewHumaEffectiveCost:
      additionalProperties: false
      properties:
        effectiveCostAnnualPct:
          description: Effective annual cost as a decimal-string percentage, scale 8 (e.g. "12.00000000").
          examples:
            - "12.00000000"
          type: string
        effectiveCostMonthlyPct:
          description: Effective monthly cost as a decimal-string percentage, scale 8 (e.g. "0.94888100").
          examples:
            - "0.94888100"
          type: string
        memoryOfCalculation:
          additionalProperties: {}
          description: Opaque step-by-step record of the effective-cost calculation (audit trail).
          type: object
        methodId:
          description: Identifier of the effective-cost calculation method applied by the jurisdiction profile.
          type: string
        rateTableSnapshot:
          additionalProperties: {}
          description: Opaque snapshot of the rate table inputs used in the calculation.
          type: object
      required:
        - methodId
        - effectiveCostAnnualPct
        - effectiveCostMonthlyPct
        - rateTableSnapshot
        - memoryOfCalculation
      type: object
    SchedulePreviewHumaInstallmentLine:
      additionalProperties: false
      properties:
        dueDate:
          description: Installment due date (date-only, YYYY-MM-DD).
          examples:
            - "2026-06-14"
          type: string
        interestAmount:
          description: Interest portion of the installment as a decimal string, minor-unit precision scale 2 (e.g. "234.56").
          examples:
            - "234.56"
          type: string
        number:
          description: 1-based installment sequence number.
          examples:
            - 1
          format: int64
          type: integer
        principalAmount:
          description: Principal portion of the installment as a decimal string, minor-unit precision scale 2 (e.g. "1000.00").
          examples:
            - "1000.00"
          type: string
        remainingBalance:
          description: Outstanding principal balance after this installment as a decimal string, minor-unit precision scale 2 (e.g. "49000.00").
          examples:
            - "49000.00"
          type: string
        totalAmount:
          description: Total installment amount (principal + interest) as a decimal string, minor-unit precision scale 2 (e.g. "1234.56").
          examples:
            - "1234.56"
          type: string
      required:
        - number
        - dueDate
        - totalAmount
        - principalAmount
        - interestAmount
        - remainingBalance
      type: object
    SchedulePreviewHumaJurisdictionExtensions:
      additionalProperties: false
      properties:
        body:
          additionalProperties: {}
          description: Opaque per-jurisdiction overlay payload decoded from the use-case result.
          type: object
        overlayKey:
          description: Identifier of the jurisdiction overlay that produced this extension payload.
          type: string
      required:
        - overlayKey
        - body
      type: object
    SchedulePreviewHumaRequest:
      additionalProperties: false
      properties:
        annualInterestRate:
          description: Annual interest rate as a decimal string (e.g. "0.12000000").
          examples:
            - "0.12000000"
          type: string
        dayCountConvention:
          description: Day count convention identifier.
          examples:
            - ACT/365
          type: string
        firstDueDate:
          description: "Day the first instalment falls due (RFC3339 or YYYY-MM-DD). Omit it and the first instalment falls one month after the start date, clamped to the month's last day, which is the ordinary grid. Supply it and it becomes the grid: every later instalment falls on that day of the month, clamped to each month's last day so a ladder anchored on the 31st falls on the 30th in April and never spills into May, and the first period runs from the start date to this day — longer or shorter than a month, and charged by its real days. Naming the day the ordinary grid was going to fall on anyway is the same as omitting it, and prices the same ladder; naming any other day re-anchors the whole ladder on it, so two requests one day apart can move the SECOND instalment by more than one day. Refused when it is worth zero or fewer days from the start date by this day-count convention, when its first period would cost the whole instalment in interest so the first payment repays no principal, or when gracePeriodDays is also set."
          examples:
            - "2026-03-10"
          type: string
        gracePeriodDays:
          description: "Grace period in days: the first instalment falls this many days after the start date instead of one month. Mutually exclusive with firstDueDate, which says the same thing by naming the day; sending both is refused."
          examples:
            - 30
          format: int64
          maximum: 365
          minimum: 0
          type: integer
        jurisdictionCode:
          description: ISO-2 jurisdiction code.
          examples:
            - BR
          maxLength: 2
          minLength: 2
          type: string
        loanProductVersionId:
          description: "Loan product version whose admitted first-due-date window this preview should be bounded by. Optional: omit it and the preview prices whatever the arithmetic allows, which is what a quote made before a product is picked needs. Supply it together with firstDueDate and the preview answers the same refusal booking will, rather than quoting a ladder the door will not take."
          examples:
            - 018f4e4e-7a3f-7c2e-9a1b-2c3d4e5f6071
          format: uuid
          type: string
        principalAmount:
          description: Principal amount as a decimal string (e.g. "50000.00").
          examples:
            - "50000.00"
          type: string
        startDate:
          description: Schedule start date (RFC3339 or YYYY-MM-DD).
          examples:
            - "2026-06-14T00:00:00Z"
          type: string
        termMonths:
          description: Number of months.
          examples:
            - 24
          format: int64
          maximum: 600
          minimum: 1
          type: integer
      required:
        - principalAmount
        - annualInterestRate
        - termMonths
        - dayCountConvention
        - jurisdictionCode
        - startDate
      type: object
    ScheduleVersionCommandHumaBody:
      additionalProperties: false
      properties:
        previousScheduleVersionId:
          description: Predecessor schedule version UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440031
          type: string
        scheduleVersion:
          $ref: "#/components/schemas/ScheduleVersionHumaBody"
          description: The newly appended immutable schedule version.
      required:
        - previousScheduleVersionId
        - scheduleVersion
      type: object
    ScheduleVersionHumaBody:
      additionalProperties: false
      properties:
        createdAt:
          description: ISO-8601 creation timestamp (UTC).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        id:
          description: Schedule version UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440030
          type: string
        installments:
          description: Recalculated installment schedule.
          items:
            $ref: "#/components/schemas/ScheduleVersionInstallmentHumaBody"
          type:
            - array
            - "null"
        loanAccountId:
          description: Loan account UUID.
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        predecessorVersionId:
          description: Predecessor schedule version UUID, if any.
          examples:
            - 550e8400-e29b-41d4-a716-446655440031
          type: string
        pricedAtMonthlyRate:
          description: Monthly interest rate as a decimal fraction that the product's schedule generator actually priced this version at. Omitted when unrecorded.
          examples:
            - "0.025"
          type: string
        reason:
          description: Reason the version was appended.
          type: string
        triggerTransactionId:
          description: Transaction that triggered the recalculation.
          type: string
        versionNumber:
          description: Monotonic schedule version number.
          examples:
            - 2
          format: int64
          type: integer
      required:
        - id
        - loanAccountId
        - versionNumber
        - reason
        - triggerTransactionId
        - createdAt
        - installments
      type: object
    ScheduleVersionInstallmentHumaBody:
      additionalProperties: false
      properties:
        dueDate:
          description: ISO-8601 due date.
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        feesAmount:
          description: Fees due (2 d.p. string).
          examples:
            - "3.50"
          type: string
        interestAmount:
          description: Interest due (2 d.p. string).
          examples:
            - "20.00"
          type: string
        number:
          description: Installment ordinal (1-based).
          examples:
            - 3
          format: int64
          type: integer
        penaltiesAmount:
          description: Penalties due (2 d.p. string).
          examples:
            - "1.50"
          type: string
        principalAmount:
          description: Principal due (2 d.p. string).
          examples:
            - "100.00"
          type: string
        principalRemaining:
          description: Unpaid principal for THIS installment (per-installment, 2 d.p. string) — not the whole-loan declining balance.
          examples:
            - "100.00"
          type: string
        totalAmount:
          description: Total due (2 d.p. string).
          examples:
            - "125.00"
          type: string
      required:
        - number
        - dueDate
        - principalAmount
        - principalRemaining
        - interestAmount
        - feesAmount
        - penaltiesAmount
        - totalAmount
      type: object
    SessionBody:
      additionalProperties: false
      properties:
        authMode:
          description: "Whether this deployment enforces authentication. 'disabled' carries no session: subject and permissions are null."
          enum:
            - enabled
            - disabled
          examples:
            - enabled
          type: string
        permissions:
          description: Effective permissions as 'resource:action', sorted. Null when the grant is UNKNOWN — the token carries no RBAC claims, or every role name it carries is unknown to this service — in which case server-side authorization remains the only gate. An empty array is a known grant of nothing.
          examples:
            -   - loan_product:read
                - loan_accounts:repayment:record
          items:
            type: string
          type:
            - array
            - "null"
        subject:
          description: Validated subject of the bearer token, for display only. Null when auth is disabled.
          examples:
            - lerian/6f2b1c2e
          type:
            - string
            - "null"
      required:
        - authMode
        - subject
        - permissions
      type: object
    SetProblemAssetReassessmentHorizonBody:
      additionalProperties: false
      properties:
        reassessmentHorizonDays:
          description: "Days a qualitative problem-asset characterisation (Res. CMN 4.966 art. 3 paragraphs 1 and 2) may stand on a contract of this version before somebody must re-assess it. Omit the field to clear the horizon, which restores 'never re-assessed'. Must be positive: zero would mark every characterisation overdue on the day it is made."
          examples:
            - 365
          format: int64
          minimum: 1
          type: integer
      type: object
    SetProblemAssetReassessmentHorizonResponse:
      additionalProperties: false
      properties:
        loanProductVersionId:
          type: string
        reassessmentHorizonDays:
          description: The horizon now in force, absent when the version sets none.
          format: int64
          type: integer
      required:
        - loanProductVersionId
      type: object
    StreamingDiscardListHumaBody:
      additionalProperties: false
      properties:
        data:
          description: Quarantined records, most recently seen first; always present, empty slice when none match.
          items:
            $ref: "#/components/schemas/DiscardRecordHumaBody"
          type:
            - array
            - "null"
      required:
        - data
      type: object
    SupersedeAccountingProfileHumaBody:
      additionalProperties: false
      properties:
        charts:
          description: The new chart written for every affected version, one per version.
          items:
            $ref: "#/components/schemas/AccountingProfileHumaBody"
          type: array
        effectiveFrom:
          description: First civil day (YYYY-MM-DD) the new chart governs.
          examples:
            - "2026-08-01"
          type: string
        loanProductId:
          description: The product whose chart changed (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        movedPositions:
          description: Every per-operation position that changes account. Each one produces a balance-transfer posting on the effective date, on every live contract of every affected version, so no contract ends with its balance split across two accounts. Empty means the change files nothing anywhere new.
          items:
            $ref: "#/components/schemas/ChartPositionMoveHumaBody"
          type: array
      required:
        - loanProductId
        - effectiveFrom
        - charts
        - movedPositions
      type: object
    SupersedeAccountingProfileHumaInputBody:
      additionalProperties: false
      properties:
        accountingMode:
          description: "Accounting recognition mode. It must match what the product already books under: the accrual basis is contract economics, frozen on the product version at origination, and only the chart of accounts is datable."
          enum:
            - accrual
            - cash
          examples:
            - accrual
          type: string
        effectiveFrom:
          description: "First civil day (YYYY-MM-DD) the new chart governs. Always a month start, and always a month that has not opened yet: a chart landing inside the open competência would change the accounts of a month already partly accrued, and one landing on a posted month could never be corrected — the ledger dedupes a replayed month on a key that does not carry which chart produced the posting, so the correction is built, sent, and dropped in silence."
          examples:
            - "2026-08-01"
          format: date
          type: string
        midazLedgerId:
          description: Optional per-product Midaz ledger the new chart's postings route into; both-or-neither with midazOrganizationId.
          examples:
            - ledger-def
          maxLength: 128
          type: string
        midazOrganizationId:
          description: Optional per-product Midaz organization the new chart's postings route into; both-or-neither with midazLedgerId.
          examples:
            - org-abc
          maxLength: 128
          type: string
        postingRules:
          description: "The complete new chart, in the same shape the configure route admits. It must keep every borrower position booked per operation, and must keep every per-operation position the outgoing chart had: a position the new chart stops booking leaves the balance already sitting there with nowhere to go, and the double entry would never complain."
          items:
            $ref: "#/components/schemas/PostingRuleHumaInputBody"
          maxItems: 27
          minItems: 7
          type: array
      required:
        - effectiveFrom
        - accountingMode
        - postingRules
      type: object
    SweepChartBalanceTransfersHumaBody:
      additionalProperties: false
      properties:
        contractsVisited:
          description: Every contract the pass read the book for.
          examples:
            - 1200
          format: int64
          type: integer
        effectiveFrom:
          description: The civil day (YYYY-MM-DD) of the chart change settled by this pass.
          examples:
            - "2026-08-01"
          type: string
        loanProductId:
          description: The product whose contracts were swept (uuid).
          examples:
            - 550e8400-e29b-41d4-a716-446655440000
          type: string
        transfersRecorded:
          description: How many of them had a balance to move. Zero on a rerun of a finished change.
          examples:
            - 318
          format: int64
          type: integer
      required:
        - loanProductId
        - effectiveFrom
        - contractsVisited
        - transfersRecorded
      type: object
    SweepChartBalanceTransfersHumaInputBody:
      additionalProperties: false
      properties:
        effectiveFrom:
          description: "The civil day (YYYY-MM-DD) the chart being settled took force. The sweep refuses to run before that day has arrived: the balance it moves is the one the account holds ON that day, and until then the old chart is still in force and still filing postings there."
          examples:
            - "2026-08-01"
          format: date
          type: string
      required:
        - effectiveFrom
      type: object
    TaxPreviewEnvelopeResponse:
      additionalProperties: false
      properties:
        data:
          $ref: "#/components/schemas/TaxPreviewResponse"
          description: The computed tax-preview result (IOF, PIS, COFINS, and net delivered amount) for the requested disbursement.
      required:
        - data
      type: object
    TaxPreviewHumaBody:
      additionalProperties: false
      properties:
        borrowerKind:
          description: Kind of taxpayer the credit is granted to. Brazil sets a different daily IOF aliquota per kind (Decreto 6.306/2007, art. 7, I, "b"), so the preview quotes the rate priced for the kind named here. The deployment ships pricing pessoaFisica, which is also what an omitted value previews; pessoaJuridica and any further kind (Simples Nacional, MEI) are priced by seeding a rate-table row, with no schema change, which is why this is not a closed list. A kind the deployment does not price is refused 422 LENDER-0900 rather than previewed at another kind's rate.
          examples:
            - pessoaFisica
          type: string
        disbursementDate:
          description: Disbursement date (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        finalDueDate:
          description: Final due date (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          format: date-time
          type: string
        firstDueDate:
          description: "Day the first instalment falls due (RFC3339 or YYYY-MM-DD). Omit it and the ladder falls on the day the schedule generator strikes by itself, one month after the disbursement date clamped to the month's last day. Supply it and it becomes the ladder's anchor: the first period runs from the disbursement date to this day, longer or shorter than a month and charged by its real days, so the IOF quoted here moves with it. Ignored without requestedInstallments and requestedInterestRate, because there is no ladder to anchor."
          examples:
            - "2026-03-10"
          type: string
        grossAmount:
          description: Gross disbursement amount in major currency units (e.g. "100000.00").
          examples:
            - "100000.00"
          type: string
        jurisdictionCode:
          description: ISO 3166-1 alpha-2 jurisdiction code (e.g. "BR").
          examples:
            - BR
          maxLength: 2
          minLength: 2
          type: string
        loanProductVersionId:
          description: "Loan product version whose admitted first-due-date window this quote should be bounded by. Optional: omit it and the quote prices whatever the arithmetic allows, which is what a quote made before a product is picked needs. Supply it together with firstDueDate, requestedInstallments and requestedInterestRate and the quote answers the same refusal booking will, rather than quoting a tax on a ladder the door will not take. The window is read only on a quote that strikes a ladder: without both ladder inputs there is no first due date to bound, so this version is not consulted and no window refusal can come back."
          examples:
            - 018f4e4e-7a3f-7c2e-9a1b-2c3d4e5f6071
          format: uuid
          type: string
        netDeliveredAmount:
          description: Optional net delivered amount in major currency units.
          examples:
            - "99949.66"
          type: string
        requestedInstallments:
          description: Number of monthly instalments the contract amortises over. Supply it together with requestedInterestRate and the quote is computed on the instalment ladder the schedule generator strikes, which is the ladder the disbursement door withholds against. Omit either and the quote values the operation as a single window from the disbursement date to the final due date, which is what a bullet operation is.
          examples:
            - 12
          format: int64
          maximum: 600
          minimum: 0
          type: integer
        requestedInterestRate:
          description: "Monthly interest rate as a decimal FRACTION, not a percentage: \"0.02\" is 2% a month. Required together with requestedInstallments to quote on the instalment ladder."
          examples:
            - "0.02"
          type: string
        taxRegime:
          description: Tax regime selector understood by the jurisdiction tax engine.
          type: string
      required:
        - grossAmount
        - disbursementDate
        - finalDueDate
        - taxRegime
        - jurisdictionCode
      type: object
    TaxPreviewResponse:
      additionalProperties: false
      properties:
        cofins:
          description: COFINS contribution amount, decimal string in major currency units (scale 2).
          examples:
            - "0.00"
          type: string
        grossAmount:
          description: Gross disbursement amount before tax, decimal string in major currency units (scale 2).
          examples:
            - "100000.00"
          type: string
        iofAdditional:
          description: Additional fixed-rate IOF component, decimal string in major currency units (scale 2).
          examples:
            - "38.00"
          type: string
        iofDaily:
          description: Daily IOF component, decimal string in major currency units (scale 2).
          examples:
            - "12.34"
          type: string
        jurisdictionCode:
          description: ISO 3166-1 alpha-2 jurisdiction code (e.g. "BR").
          examples:
            - BR
          type: string
        netDeliveredAmount:
          description: Net amount delivered to the borrower after tax deduction, decimal string in major currency units (scale 2).
          examples:
            - "99949.66"
          type: string
        pis:
          description: PIS contribution amount, decimal string in major currency units (scale 2).
          examples:
            - "0.00"
          type: string
        profileVersion:
          description: Compiled jurisdiction profile version used to compute the preview (e.g. "1.0.0").
          examples:
            - 1.0.0
          type: string
        rateTableSnapshotId:
          description: Identifier of the rate-table snapshot whose rates produced these amounts.
          examples:
            - 550e8400-e29b-41d4-a716-446655440002
          type: string
        taxRegime:
          description: Tax regime selector applied by the jurisdiction tax engine.
          type: string
        totalIof:
          description: Sum of daily and additional IOF, decimal string in major currency units (scale 2).
          examples:
            - "50.34"
          type: string
        totalTax:
          description: Total tax (IOF + PIS + COFINS), decimal string in major currency units (scale 2).
          examples:
            - "50.34"
          type: string
      required:
        - iofDaily
        - iofAdditional
        - totalIof
        - pis
        - cofins
        - totalTax
        - grossAmount
        - netDeliveredAmount
        - taxRegime
        - jurisdictionCode
        - profileVersion
        - rateTableSnapshotId
      type: object
    UpsertAssignmentFundHumaInputBody:
      additionalProperties: false
      properties:
        administratorName:
          description: Fund administrator name.
          maxLength: 256
          minLength: 1
          type: string
        administratorTaxId:
          description: Fund administrator registration identifier (opaque; no jurisdiction format is assumed).
          maxLength: 64
          minLength: 1
          type: string
        assignmentRate:
          description: Monthly effective cession rate as a decimal fraction string in [0, 1] with at most 8 decimals (0.0175 = 1.75% per month). Zero means assignment at par.
          examples:
            - "0.0175"
          type: string
        assignorConcentrationLimit:
          description: Regulation concentration limit per assignor as a decimal fraction string in (0, 1] with at most 8 decimals.
          examples:
            - "0.30"
          type: string
        eligibilityMode:
          description: Whether our eligibility verification is authoritative (full) or runs as a pre-filter before the administrator's own (prefilter).
          enum:
            - full
            - prefilter
          type: string
        fundName:
          description: Fund name.
          maxLength: 256
          minLength: 1
          type: string
        fundTaxId:
          description: Fund registration identifier. Re-posting the same value REPLACES that fund's configuration and keeps its identifier. Bounded at 32 bytes because this is the one value carried into the fixed-width offer file, which refuses rather than truncates.
          maxLength: 32
          minLength: 1
          type: string
        offerFileLayoutRef:
          description: "Versioned reference to the custodian export layout. Letters, digits and -_.: only."
          examples:
            - custodian-cnab240.v1
          maxLength: 128
          minLength: 1
          type: string
        paidToTransferredWindowSeconds:
          description: Orphan-detector window for "paid without transferred", in whole seconds.
          examples:
            - 172800
          format: int64
          maximum: 31536000
          minimum: 1
          type: integer
        paymentSourceConcentrationLimit:
          description: Regulation concentration limit per payment source as a decimal fraction string in (0, 1] with at most 8 decimals (e.g. "0.15").
          examples:
            - "0.15"
          type: string
        proposedRetainedFraction:
          description: "The retained fraction this fund PROPOSES for the cessions assembled against it: the share of the expected loss this institution keeps after the sale, a decimal string from 0 to 1 with at most 8 decimal places (0 keeps nothing). REQUIRED and never inferred: this call REPLACES the stored registration. A cession may state its own fraction and freezes whichever it ends up with, next to the institution's threshold; a fraction at or above the threshold derives substantial retention, which a cession cannot be booked under yet (LENDER-0504). Not a decimal, below 0, above 1 or more than 8 decimal places: LENDER-0506."
          examples:
            - "0"
          type: string
        proposesSellerRetainsControl:
          description: Whether this fund PROPOSES that the seller keeps control of what it sells, the middle band of Res. CMN 4.966 art. 26 III. REQUIRED. A cession may state its own; one that ends up with true is refused (LENDER-0505).
          examples:
            - false
          type: boolean
        registryProvider:
          description: "Which registry governs this fund's cession. REQUIRED, and none must be stated rather than omitted: this call REPLACES the stored registration, so a save that stayed silent would turn a fund whose acceptance is fenced by a confirmed title movement into one that is not. none means registration at a registry is dispensable for this fund and its absence never blocks a cession. Any other value must be a registry one of this deployment's jurisdictions declares — deliberately NOT an enum here, because the set is open per jurisdiction and a fixed list would pin the contract to one country. A value nobody declared is refused, and the refusal names what is declared."
          examples:
            - none
          type: string
        repeatedCutLimit:
          description: How many times this fund may cut the same receivable in its remessa before the receivable stops returning to the pool automatically. Omit to take the default of 2.
          format: int64
          minimum: 1
          type: integer
        termMode:
          description: Who generates the endorsement term.
          enum:
            - lender_emitted
            - administrator_generated
          type: string
        transferredToAcceptedWindowSeconds:
          description: Orphan-detector window for "transferred without accepted", in whole seconds.
          examples:
            - 86400
          format: int64
          maximum: 31536000
          minimum: 1
          type: integer
      required:
        - administratorName
        - administratorTaxId
        - fundName
        - fundTaxId
        - termMode
        - eligibilityMode
        - paymentSourceConcentrationLimit
        - assignorConcentrationLimit
        - assignmentRate
        - offerFileLayoutRef
        - registryProvider
        - proposedRetainedFraction
        - proposesSellerRetainsControl
        - paidToTransferredWindowSeconds
        - transferredToAcceptedWindowSeconds
      type: object
    Upstream:
      additionalProperties: false
      properties:
        code:
          description: The upstream provider's own error code, verbatim.
          examples:
            - E4001
          type: string
        message:
          description: The upstream provider's own error message, verbatim (bounded, never its raw response body).
          examples:
            - account not found at provider
          type: string
      type: object
    WithdrawLoanApplicationHumaRequest:
      additionalProperties: false
      properties:
        decisionAt:
          description: Decision timestamp (RFC3339).
          examples:
            - "2026-06-14T12:00:00Z"
          type: string
        reason:
          description: Withdrawal reason.
          type: string
      required:
        - decisionAt
        - reason
      type: object
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http
info:
  contact:
    email: contact@lerian.studio
    name: Lerian Studio
    url: https://lerian.studio
  description: "Code-first OpenAPI 3.1 surface for the Lender service. Routes that move money are at-most-once per X-Idempotency: when one answers 5xx, the X-Idempotency-Fenced response header says whether that key is now refusing resends (true) or free to retry (false or absent)."
  license:
    name: Lerian Studio General License
  title: Lender API
  version: 1.0.0
openapi: 3.1.0
paths:
  /api/v1/accounting-profiles:
    get:
      description: Returns a page of the posting configurations attached to loan product versions, newest first, each with how many posting rules it holds and which business events those rules cover.
      operationId: listAccountingProfiles
      parameters:
        - description: Narrow to the charts of one loan product version. A version owns a chain of charts, each with the day it takes force; combine with asOf for the one governing a given day.
          explode: false
          in: query
          name: loanProductVersionId
          schema:
            description: Narrow to the charts of one loan product version. A version owns a chain of charts, each with the day it takes force; combine with asOf for the one governing a given day.
            format: uuid
            type: string
        - description: Narrow to one accounting mode.
          explode: false
          in: query
          name: accountingMode
          schema:
            description: Narrow to one accounting mode.
            enum:
              - accrual
              - cash
            type: string
        - description: "Narrow to the chart IN FORCE on this civil day (YYYY-MM-DD), one per loan product version: the one with the greatest effectiveFrom at or below it. Omit to list the whole chain, which is what an audit of how the configuration changed needs. A future day answers what the product will book into once a scheduled chart takes force."
          explode: false
          in: query
          name: asOf
          schema:
            description: "Narrow to the chart IN FORCE on this civil day (YYYY-MM-DD), one per loan product version: the one with the greatest effectiveFrom at or below it. Omit to list the whole chain, which is what an audit of how the configuration changed needs. A future day answers what the product will book into once a scheduled chart takes force."
            format: date
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountingProfileListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List accounting profiles
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/list-accounting-profiles
  /api/v1/accrual-runs:
    get:
      description: Returns a page of the accrual runs executed for this tenant, newest first. Filtering by correlationId returns EVERY run sharing that identifier, which is how the full lineage behind one correlation is read.
      operationId: listAccrualRuns
      parameters:
        - description: Narrow to the runs executed on one business date.
          explode: false
          in: query
          name: businessDate
          schema:
            description: Narrow to the runs executed on one business date.
            examples:
              - "2026-06-14"
            format: date
            type: string
        - description: Narrow to one run lifecycle status.
          explode: false
          in: query
          name: status
          schema:
            description: Narrow to one run lifecycle status.
            examples:
              - queued
            maxLength: 32
            type: string
        - description: "Narrow by the state of the downstream ledger posting. pending: the ledger has not confirmed it. posted: the ledger accepted it. no_items: the run recognized nothing, so nothing was sent."
          explode: false
          in: query
          name: postingStatus
          schema:
            description: "Narrow by the state of the downstream ledger posting. pending: the ledger has not confirmed it. posted: the ledger accepted it. no_items: the run recognized nothing, so nothing was sent."
            enum:
              - pending
              - posted
              - no_items
            type: string
        - description: Narrow to every run sharing one correlation identifier. Several runs can share one, so this returns a page, not a single row.
          explode: false
          in: query
          name: correlationId
          schema:
            description: Narrow to every run sharing one correlation identifier. Several runs can share one, so this returns a page, not a single row.
            maxLength: 256
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccrualRunListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List accrual runs
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/list-accrual-runs
    post:
      description: Queues an accrual batch for a business date and returns available journal/outbox reference data.
      operationId: createAccrualRun
      parameters:
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAccrualRunHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccrualRunHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create accrual run
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/create-accrual-run
  /api/v1/accrual-runs/{id}:
    get:
      description: Returns one accrual run header by id.
      operationId: getAccrualRun
      parameters:
        - description: Accrual run identifier.
          in: path
          name: id
          required: true
          schema:
            description: Accrual run identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccrualRunReadHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get accrual run
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/get-accrual-run
  /api/v1/accrual-runs/{id}/items:
    get:
      description: "Returns what the engine decided for every contract in the accounting month this run closes. One row is one contract-competência, NOT one row the run inserted: `runId` names the run that CLAIMED the month, so on a re-run it differs from the identifier in the path and the page still shows the month's decisions instead of coming back empty. An empty page therefore means the month has no decisions at all, never that a re-run did nothing. `outcome` says where the income went: recognized into P&L, or suspended and withheld under Res. CMN 4.966 art. 17. The recognition fields are ABSENT, not zero, on a withheld month. An unknown run identifier is 404."
      operationId: listAccrualRunItems
      parameters:
        - description: Accrual run identifier.
          in: path
          name: id
          required: true
          schema:
            description: Accrual run identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Narrow to one recognition kind, e.g. interest or pis_cofins.
          explode: false
          in: query
          name: kind
          schema:
            description: Narrow to one recognition kind, e.g. interest or pis_cofins.
            examples:
              - interest
            maxLength: 32
            type: string
        - description: Narrow by the state of the item's downstream ledger posting.
          explode: false
          in: query
          name: postingStatus
          schema:
            description: Narrow by the state of the item's downstream ledger posting.
            enum:
              - pending
              - posted
            type: string
        - description: Narrow to one accounting month (YYYY-MM).
          explode: false
          in: query
          name: competencia
          schema:
            description: Narrow to one accounting month (YYYY-MM).
            examples:
              - 2026-05
            pattern: ^\d{4}-\d{2}$
            type: string
        - description: Narrow to one loan account's recognitions within this run.
          explode: false
          in: query
          name: loanAccountId
          schema:
            description: Narrow to one loan account's recognitions within this run.
            format: uuid
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccrualRunItemListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List accrual run decisions
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/list-accrual-run-decisions
  /api/v1/accrual-runs/{id}/retry:
    post:
      description: "Re-sends to the ledger the recognitions of a run that it has not acknowledged. Of the items selected, only those still unposted are re-sent; an acknowledged recognition is never sent twice, and each re-send carries the same deterministic key as the original attempt, so a recognition already in the ledger is deduplicated there rather than booked again. The response lists the items actually re-sent, which may be fewer than those asked for; whatever it could not send is listed in unpostableItems with a reason. Status is \"queued\" when at least one recognition went out, \"nothing_to_retry\" only when the ledger had already acknowledged everything selected, and \"blocked\" when unacknowledged recognitions exist and none of them could be re-sent. An id that belongs to no item of this run is refused with 422 (LENDER-0407) before any of that is decided, and nothing is re-sent — so \"nothing_to_retry\" can only ever mean the ledger has everything selected. That refusal names AT MOST TEN unknown ids, one per errors[] member at body.itemIds; the detail always states how many there are in total, so a selection with more than ten unknown ids reports the true count and lists the first ten. Safe to repeat: pressing retry twice enqueues one posting per recognition."
      operationId: retryAccrualRun
      parameters:
        - description: Accrual run identifier.
          in: path
          name: id
          required: true
          schema:
            description: Accrual run identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RetryAccrualRunHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccrualRunRetryHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Retry accrual run items
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/retry-accrual-run-items
  /api/v1/assignment/exceptions:
    get:
      description: "Returns the tenant's exception cases, newest first. A case is opened when the cession flow must not decide by itself: a receivable this fund has now cut as many times as its configuration allows (repeated_cut), a second and different return file over a set that already accepted one (remessa_conflict), or verdicts that do not reconcile against the composition (remessa_divergence). Every filter is optional and narrows."
      operationId: listAssignmentExceptions
      parameters:
        - description: Narrow to open or resolved cases. Omit for both.
          explode: false
          in: query
          name: state
          schema:
            description: Narrow to open or resolved cases. Omit for both.
            enum:
              - open
              - resolved
            type: string
        - description: Narrow to one case type. Omit for all.
          explode: false
          in: query
          name: caseType
          schema:
            description: Narrow to one case type. Omit for all.
            enum:
              - repeated_cut
              - remessa_conflict
              - remessa_divergence
              - paid_without_transferred
              - transferred_without_accepted
              - signed_without_acceptable
              - derecognition_unpostable
              - derecognition_unvaluable
              - derecognition_already_sold
              - derecognition_unsellable
              - transfer_absent
              - registry_command_unconfirmed
              - assigned_contract_passthrough
            type: string
        - description: Narrow to one fund (uuid). Omit for all.
          explode: false
          in: query
          name: fundId
          schema:
            description: Narrow to one fund (uuid). Omit for all.
            type: string
        - description: Narrow to one assignment set (uuid). Omit for all.
          explode: false
          in: query
          name: setId
          schema:
            description: Narrow to one assignment set (uuid). Omit for all.
            type: string
        - description: Page size. Defaults to 50.
          explode: false
          in: query
          name: limit
          schema:
            description: Page size. Defaults to 50.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - description: Rows to skip.
          explode: false
          in: query
          name: offset
          schema:
            description: Rows to skip.
            format: int64
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentExceptionListOutputBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List the assignment exception queue
      tags:
        - AssignmentExceptions
      x-mint:
        href: /pt/reference/products/lender/list-the-assignment-exception-queue
  /api/v1/assignment/exceptions/{caseId}/resolve:
    post:
      description: Closes one OPEN case with what a named operator decided about it. Resolving a case somebody else already disposed of is refused rather than overwriting their disposition, and a resolution with nothing recorded is refused outright.
      operationId: resolveAssignmentException
      parameters:
        - description: Exception case identifier.
          in: path
          name: caseId
          required: true
          schema:
            description: Exception case identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResolveAssignmentExceptionHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentExceptionHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Record a disposition against one exception case
      tags:
        - AssignmentExceptions
      x-mint:
        href: /pt/reference/products/lender/record-a-disposition-against-one-exception-case
  /api/v1/assignment/funds:
    get:
      description: Returns the tenant's registered funds ordered by name.
      operationId: listAssignmentFunds
      parameters:
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentFundListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List assignment funds
      tags:
        - AssignmentFunds
      x-mint:
        href: /pt/reference/products/lender/list-assignment-funds
    post:
      description: Creates or replaces the registration of one fund and its administrator, keyed by fundTaxId within the validated tenant. Identifier and creation instant of an existing registration are preserved, so this is the update path as well as the create path.
      operationId: upsertAssignmentFund
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpsertAssignmentFundHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentFundHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Register or update an assignment fund
      tags:
        - AssignmentFunds
      x-mint:
        href: /pt/reference/products/lender/register-or-update-an-assignment-fund
  /api/v1/assignment/funds/{fundId}:
    get:
      description: Returns one fund registration by identifier; 404 when the validated tenant has none with that identifier.
      operationId: getAssignmentFund
      parameters:
        - description: Fund registration identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Fund registration identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentFundHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get assignment fund
      tags:
        - AssignmentFunds
      x-mint:
        href: /pt/reference/products/lender/get-assignment-fund
  /api/v1/assignment/funds/{fundId}/candidates:
    get:
      description: "Scores the tenant's assignable pool against ONE fund's configuration and returns a verdict per receivable: eligible, or cut with exactly one reason. The 20% per-debtor cap is invariable and never configuration; the payment-source and assignor limits come from the fund's regulation. Concentration is measured against the fund's accepted stock plus the admitted set, and the response states that base."
      operationId: listAssignmentFundCandidates
      parameters:
        - description: Fund registration identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Fund registration identifier.
            format: uuid
            type: string
        - description: Pool window size. Verdicts are computed over the returned window as the proposed set.
          explode: false
          in: query
          name: limit
          schema:
            default: 100
            description: Pool window size. Verdicts are computed over the returned window as the proposed set.
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentCandidatesHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List assignment candidates with eligibility verdicts
      tags:
        - AssignmentFunds
      x-mint:
        href: /pt/reference/products/lender/list-assignment-candidates-with-eligibility-verdicts
  /api/v1/assignment/funds/{fundId}/document-templates:
    get:
      description: Returns this fund's version history for the given kind, newest first.
      operationId: listAssignmentFundDocumentTemplates
      parameters:
        - description: Owning assignment fund identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Owning assignment fund identifier.
            format: uuid
            type: string
        - description: Document kind.
          explode: false
          in: query
          name: kind
          required: true
          schema:
            description: Document kind.
            enum:
              - assignment_term
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List assignment fund document template versions
      tags:
        - AssignmentFundDocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/list-assignment-fund-document-template-versions
    post:
      description: Creates a new DRAFT endorsement-term template version for one assignment fund. The clausulado is legal content of that fund's own regulation, which is why it is versioned per fund rather than per loan product.
      operationId: createAssignmentFundDocumentTemplate
      parameters:
        - description: Owning assignment fund identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Owning assignment fund identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateFundDocumentTemplateHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create assignment fund document template draft
      tags:
        - AssignmentFundDocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/create-assignment-fund-document-template-draft
  /api/v1/assignment/funds/{fundId}/document-templates/active:
    get:
      description: Returns the currently active published version for the given kind; 404 when the fund has none — which is also what makes the term recorder refuse emission for that fund.
      operationId: getActiveAssignmentFundDocumentTemplate
      parameters:
        - description: Owning assignment fund identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Owning assignment fund identifier.
            format: uuid
            type: string
        - description: Document kind.
          explode: false
          in: query
          name: kind
          required: true
          schema:
            description: Document kind.
            enum:
              - assignment_term
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get active assignment fund document template
      tags:
        - AssignmentFundDocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/get-active-assignment-fund-document-template
  /api/v1/assignment/funds/{fundId}/document-templates/{templateId}:
    get:
      description: Returns one of this fund's template versions by id.
      operationId: getAssignmentFundDocumentTemplate
      parameters:
        - description: Owning assignment fund identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Owning assignment fund identifier.
            format: uuid
            type: string
        - description: Template version identifier.
          in: path
          name: templateId
          required: true
          schema:
            description: Template version identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get assignment fund document template version
      tags:
        - AssignmentFundDocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/get-assignment-fund-document-template-version
  /api/v1/assignment/funds/{fundId}/document-templates/{templateId}/publish:
    post:
      description: Publishes a draft version, atomically superseding whatever version was previously active for this fund. A published version is immutable.
      operationId: publishAssignmentFundDocumentTemplate
      parameters:
        - description: Owning assignment fund identifier.
          in: path
          name: fundId
          required: true
          schema:
            description: Owning assignment fund identifier.
            format: uuid
            type: string
        - description: Template version identifier to publish.
          in: path
          name: templateId
          required: true
          schema:
            description: Template version identifier to publish.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Publish assignment fund document template
      tags:
        - AssignmentFundDocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/publish-assignment-fund-document-template
  /api/v1/assignment/receivables/{receivableRef}/dossier:
    get:
      description: Streams the receivable's evidence dossier (PDF). The first call freezes the receivable's facts into an immutable snapshot, renders the artifact and custodies it; every later call replays that snapshot and re-verifies that it still reproduces the recorded normalized-form digest. The response headers carry the whole determinism record, plus the declared strength of the lastro. The dossier never asserts byte-level correspondence with an emitted original.
      operationId: getReceivableDossier
      parameters:
        - description: The receivable this call is about, as an opaque identifier. Which format it carries belongs to the jurisdiction that booked it; nothing here parses it.
          in: path
          name: receivableRef
          required: true
          schema:
            description: The receivable this call is about, as an opaque identifier. Which format it carries belongs to the jurisdiction that booked it; nothing here parses it.
            maxLength: 128
            minLength: 1
            type: string
      responses:
        "200":
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get receivable assignment dossier
      tags:
        - AssignmentDocuments
      x-mint:
        href: /pt/reference/products/lender/get-receivable-assignment-dossier
  /api/v1/assignment/receivables/{receivableRef}/registry-registration:
    post:
      description: "Commands the registration of the receivable's credit instrument at the registradora the named fund is configured with, through the CLIENT's own participation. The command is idempotent by a deterministic reference that names the instrument alone: a second call returns the same protocol, and a registration the registry already accepted is refused rather than issued twice. A fund configured with no registradora is refused by name — registration is legally dispensable in the general case, and its absence never blocks a cession, but a caller who asked for one is never answered with silence."
      operationId: registerReceivableInstrumentAtRegistry
      parameters:
        - description: The receivable this call is about, as an opaque identifier. Which format it carries belongs to the jurisdiction that booked it; nothing here parses it.
          in: path
          name: receivableRef
          required: true
          schema:
            description: The receivable this call is about, as an opaque identifier. Which format it carries belongs to the jurisdiction that booked it; nothing here parses it.
            maxLength: 128
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegisterReceivableInstrumentHumaInputBody"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentRegistryCommandHumaBody"
          description: Accepted
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Register a receivable's credit instrument at the registradora
      tags:
        - AssignmentRegistry
      x-mint:
        href: /pt/reference/products/lender/register-a-receivable-s-credit-instrument-at-the-registradora
  /api/v1/assignment/sets:
    get:
      description: Returns one page of the validated tenant's sets, newest first, each with the item count and the totals of its SURVIVING composition. Optionally narrowed to one fund or one lifecycle state.
      operationId: listAssignmentSets
      parameters:
        - description: Narrow to the sets offered to one fund.
          explode: false
          in: query
          name: fundId
          schema:
            description: Narrow to the sets offered to one fund.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Narrow to one step of the lifecycle, to cancelled for the compositions that were discarded, or to settled for the art. 29 cessions whose funding obligation is extinguished.
          explode: false
          in: query
          name: state
          schema:
            description: Narrow to one step of the lifecycle, to cancelled for the compositions that were discarded, or to settled for the art. 29 cessions whose funding obligation is extinguished.
            enum:
              - draft
              - eligibility_checked
              - pending_approval
              - approved
              - offer_sent
              - remessa_received
              - term_signed
              - paid
              - transferred
              - accepted
              - cancelled
              - settled
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List assignment sets
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/list-assignment-sets
    post:
      description: "Composes a DRAFT set from the chosen receivables: freezes each one's facts and prices it with the fund's own cession rate, so the composition a manager later approves is the composition that was measured. A receivable already travelling inside another set is refused, never silently dropped."
      operationId: createAssignmentSet
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAssignmentSetHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetDetailHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Assemble an assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/assemble-an-assignment-set
  /api/v1/assignment/sets/{setId}:
    get:
      description: Returns one set with its whole composition — survivors and departures alike, each carrying the verdict that removed it and the price it was valued at — plus the immutable approval fact when there is one. 404 when the validated tenant has no set with that identifier.
      operationId: getAssignmentSet
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetDetailHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/get-assignment-set
  /api/v1/assignment/sets/{setId}/approve:
    post:
      description: "Re-reads the rail state behind the composition and approves exactly what that reading covers: a receivable the rail no longer carries leaves the set, an altered one is repriced by the same ruler and stays. The approval is immutable, and a retry over the same composition replays it rather than creating a second authority."
      operationId: approveAssignmentSet
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetApprovalResultHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Approve an assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/approve-an-assignment-set
  /api/v1/assignment/sets/{setId}/discard:
    post:
      description: "Calls a composition off and RELEASES its receivables back to the assignable pool. Allowed from every state except accepted, whose receivables were sold and written off, and refused for any composition that already sold part of itself: a line already accepted and written off, or a title already moved to the fund at the registry. Nothing is deleted: the set rests in the terminal cancelled state with its items, its transitions, its approval and its custodied signature evidence intact, and one append-only audit row names who called it off and why. Discarding a set that is already cancelled is inert."
      operationId: discardAssignmentSet
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DiscardAssignmentSetHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetDiscardResultHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Discard an assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/discard-an-assignment-set
  /api/v1/assignment/sets/{setId}/eligibility:
    post:
      description: Measures the composition's FROZEN entry snapshots against the fund's eligibility and concentration limits and records the verdicts. A set waiting for the manager may be re-scored; an approved one never is.
      operationId: checkAssignmentSetEligibility
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetEligibilityHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Score an assignment set against its fund's rule
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/score-an-assignment-set-against-its-fund-s-rule
  /api/v1/assignment/sets/{setId}/facts:
    post:
      description: "Records a fact the operator confirms and moves the set accordingly. offer_sent confirms the authorized offer file was delivered to the fund's administrator, and requires an authorized file to exist. paid, transferred and accepted are per-receivable and follow one another in that order over a set whose endorsement term is already signed; each names where it came from, and each applies either to named receivables or to the whole surviving composition. accepted is the flip: the contract leaves this portfolio and its write-off is enqueued in the SAME transaction, or neither happens. A repeated confirmation is inert and reported as replayed rather than recording a second send or a second write-off. Re-stating paid is also the way to re-issue a title transfer the registradora refused: the fact writes nothing the second time, while the registry command is reached again through its own deterministic reference. Only a transferred fact whose provenance is registry_provider settles that command — the acceptance's proof of a moved title is the registradora's own statement and nobody else's."
      operationId: recordAssignmentSetFact
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RecordAssignmentSetFactHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentSetFactHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Record an externally-observed fact about an assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/record-an-externally-observed-fact-about-an-assignment-set
  /api/v1/assignment/sets/{setId}/funding-payoff:
    post:
      description: Ends the obligation raised by a cession booked with the risk retained (Res. CMN 4.966 art. 29) for one of its receivables, at the amount agreed with the fund. The operator informs that amount and what the borrower paid to get out; this service prices the obligation at amortised cost, refuses anything above the face of the instalments still owed, and books the difference as financing expense above the obligation or as released desagio below it. Omitting the agreed amount passes the borrower's payoff straight through; informing zero or less is refused, because a fund settling for nothing is a statement and not an absence. The cession itself reaches 'settled' only when this was the last of its receivables still owing the fund.
      operationId: endAssignmentFundingEarly
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request extinguishes a liability, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request extinguishes a liability, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EndAssignmentFundingEarlyHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentFundingPayoffHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: End one receivable's funding obligation before its term
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/end-one-receivable-s-funding-obligation-before-its-term
  /api/v1/assignment/sets/{setId}/offer-file:
    get:
      description: Serializes the set's IMMUTABLE approval into the layout its fund's custodian ingests. The first call authorizes the file and records its digest; every later call re-derives the same bytes and re-verifies them against that digest, so re-generation is byte-identical and the D+1 rollover re-serves the SAME file with no re-emission. A set that was never approved is refused. Downloading does NOT mark the offer as sent — that is a separate confirmed fact.
      operationId: getAssignmentOfferFile
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      responses:
        "200":
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Download the offer file of an approved assignment set
      tags:
        - AssignmentDocuments
      x-mint:
        href: /pt/reference/products/lender/download-the-offer-file-of-an-approved-assignment-set
  /api/v1/assignment/sets/{setId}/remessa:
    post:
      description: "Reads the administrator's Arquivo Remessa and reconciles its verdicts against the composition that was offered. Identity is the file's CONTENT: the same file re-uploaded is inert, and a different file over a set that already accepted one is refused terminally and opens an exception case — a remessa reprocessed never cedes twice. Reconciliation is all-or-nothing: the verdicts must cover exactly the receivables the set still carries, at exactly the approved prices, or the whole file is refused as a divergence. A receivable the fund cuts leaves the composition with its reason and becomes assignable again; once this fund's repeated-cut limit is reached it stops returning automatically and lands in the exception queue instead."
      operationId: ingestAssignmentRemessa
      parameters:
        - description: Assignment set identifier.
          in: path
          name: setId
          required: true
          schema:
            description: Assignment set identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IngestAssignmentRemessaHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentRemessaHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Ingest the fund administrator's return file for an assignment set
      tags:
        - AssignmentSets
      x-mint:
        href: /pt/reference/products/lender/ingest-the-fund-administrator-s-return-file-for-an-assignment-set
  /api/v1/assignment/sets/{setId}/term:
    post:
      description: "Records the endorsement/assignment term of one APPROVED set. Which of two paths runs is resolved from the fund's own configured term mode, never from this request: for a fund the Lender emits for, the term is rendered from that fund's own published endorsement-term template (a fund with no published template is refused — there is no generic layout); for a fund whose administrator generates the term, nothing is emitted and the administrator's own artifact is registered, digested exactly as received. The row is append-only: the same idempotency key replays, a new key supersedes by order without erasing, and the set state term_signed is reachable only once a term exists."
      operationId: recordAssignmentTerm
      parameters:
        - description: Approved assignment set identifier (uuid).
          in: path
          name: setId
          required: true
          schema:
            description: Approved assignment set identifier (uuid).
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RecordAssignmentTermHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AssignmentTermHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Record the assignment set's endorsement term
      tags:
        - AssignmentDocuments
      x-mint:
        href: /pt/reference/products/lender/record-the-assignment-set-s-endorsement-term
  /api/v1/br/consignado/collection-instructions:
    get:
      description: "Returns the instructions the client's collection agent still has to act on, oldest first. Only issued instructions still inside their own validity window appear, and only those issued to the agent this tenant currently has appointed. Leaving the window means different things by kind: a payoff amount is frozen, so a payment made at or after the window closes is no longer the amount owed and must be re-quoted, never collected — though a payment made INSIDE the window is credited whenever the file declaring it arrives. This is identical whether the worker pays it (payoff) or the institution taking the contract over pays it (payoff_portability): the frozen amount, the window and the stale-receipt refusal do not care who pays, and the kind exists so the agent knows from WHOM it collects. An arrear residual does not go stale, so it merely leaves this queue and a payment collected inside the window is still accepted when the agent declares it late. The response carries no digitable line and no barcode — the agent registers the boleto in its own account and the borrower-facing code is never ours to state."
      operationId: listConsignadoCollectionInstructions
      parameters:
        - description: Maximum instructions to return. Defaults to 50.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum instructions to return. Defaults to 50.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionInstructionListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List open extraordinary-collection instructions
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/list-open-extraordinary-collection-instructions
  /api/v1/br/consignado/collection-settlements:
    post:
      description: "Accepts the file in which the client's collection agent declares what it received into its own account, against the instructions the lender issued. Identity is the file's CONTENT: the same file re-uploaded is inert and reduces no debt twice. The file's own header names the agent, and a file this tenant cannot attribute to anybody — neither its active channel nor an agent still holding an open instruction — is refused before a single line is stored. Accepting the file applies nothing: each line becomes durable work, applied independently, so one unrecognised instruction is quarantined for an operator instead of blocking every other borrower's payment in the same upload. A line declaring a receipt the agent cannot have taken yet — a paid instant more than a few minutes ahead of the moment we receive the file — is refused too, and refuses the whole file: that instant is the ACCOUNTING instant of the settlement, so a skewed clock or a broken date formatter would book a repayment in the future."
      operationId: ingestConsignadoCollectionSettlements
      parameters:
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IngestCollectionSettlementHumaInputBody"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionSettlementIngestHumaBody"
          description: Accepted
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Ingest the collection agent's Arquivo de Baixa Extraordinária
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/ingest-the-collection-agent-s-arquivo-de-baixa-extraordinaria
  /api/v1/br/consignado/collection-settlements/refused:
    get:
      description: "Returns the lines of the Arquivo de Baixa Extraordinária this tenant's currently appointed collection agent delivered and the lender could not apply, NEWEST refusal first. Page with the opaque `cursor` from a response's `nextCursor`; the feed never drains, so paging from the oldest end would pin a long-lived client to the same first page forever. A line appears here only once it is terminal: a line still being retried may yet apply and is not refused. Only the appointed agent's own deliveries are visible — the listing is fenced on the active agent channel by name AND receiving account, so appointing a new agent does not hand it the previous agent's lines. `reasonCode` is the contract to branch on; `reason` is the same fact in prose and may be reworded. A refusal this surface cannot attribute to the line itself is reported as `unprocessable` rather than described: the line is held for operator review and the file is not the thing to correct."
      operationId: listConsignadoRefusedCollectionSettlements
      parameters:
        - description: Maximum refused lines to return.
          explode: false
          in: query
          name: limit
          schema:
            default: 50
            description: Maximum refused lines to return.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
        - description: "Opaque page cursor from a previous response's nextCursor. Omit for the first (newest) page. A malformed cursor is refused (422) rather than ignored, because silently restarting at the newest page would skip every line in between. A well-formed cursor is applied as given: it is not signed, so it can only move your own position inside your own feed."
          explode: false
          in: query
          name: cursor
          schema:
            description: "Opaque page cursor from a previous response's nextCursor. Omit for the first (newest) page. A malformed cursor is refused (422) rather than ignored, because silently restarting at the newest page would skip every line in between. A well-formed cursor is applied as given: it is not signed, so it can only move your own position inside your own feed."
            maxLength: 512
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionSettlementRefusedListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List refused lines of the collection agent's own settlement files
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/list-refused-lines-of-the-collection-agent-s-own-settlement-files
  /api/v1/br/dashboard/delinquent-loans:
    get:
      description: "Returns delinquent loan drill-down rows for the validated tenant at a requested business date, filterable by loan product, loan product version and by the regulatory carteira C1..C5 of Res. BCB 352/2023 art. 81. The carteira is derived from the product: it narrows to the loan product versions that declare it, so a carteira no product declares returns an empty page."
      operationId: listDelinquentLoansBR
      parameters:
        - description: Regulatory carteira (Res. BCB 352/2023 art. 81). Narrows to the loan product versions that declare it.
          explode: false
          in: query
          name: carteira
          schema:
            description: Regulatory carteira (Res. BCB 352/2023 art. 81). Narrows to the loan product versions that declare it.
            enum:
              - C1
              - C2
              - C3
              - C4
              - C5
            examples:
              - C5
            type: string
        - description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
          explode: false
          in: query
          name: asOf
          schema:
            description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
            examples:
              - "2026-06-14"
            format: date
            type: string
        - description: Filter by loan product identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productIds
          schema:
            description: Filter by loan product identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440001
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Filter by loan product version identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productVersionIds
          schema:
            description: Filter by loan product version identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440002
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Delinquency bucket code.
          explode: false
          in: query
          name: bucketCode
          schema:
            description: Delinquency bucket code.
            enum:
              - current
              - "1_30"
              - "31_60"
              - "61_90"
              - 91_plus
              - par30
              - par60
              - par90
            examples:
              - par30
            type: string
        - description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
          explode: false
          in: query
          name: assignedOfficerId
          schema:
            description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
            examples:
              - officer-xyz
            maxLength: 255
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            examples:
              - 25
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            examples:
              - 0
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DelinquentLoansHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List delinquent loans (Brazil)
      tags:
        - Dashboard
      x-mint:
        href: /pt/reference/products/lender/list-delinquent-loans-brazil
  /api/v1/br/loan-accounts/{id}/cet-disclosure:
    get:
      description: Returns the latest immutable CET disclosure artifact frozen for the active loan account.
      operationId: getLoanAccountCETDisclosure
      parameters:
        - description: Loan account identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CETDisclosureResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get loan account CET disclosure
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-loan-account-cet-disclosure
  /api/v1/br/loan-accounts/{id}/credit-descriptor:
    get:
      description: Returns the Res. CMN 5.004/2022 credit operation descriptor, optionally reconstructed as of a business date.
      operationId: getLoanAccountCreditOperationDescriptor
      parameters:
        - description: Loan account identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier.
            format: uuid
            type: string
        - description: Optional as-of date (YYYY-MM-DD) to reconstruct the descriptor.
          explode: false
          in: query
          name: asOfDate
          schema:
            description: Optional as-of date (YYYY-MM-DD) to reconstruct the descriptor.
            format: date
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditOperationDescriptorResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get credit operation descriptor
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-loan-account-credit-operation-descriptor
  /api/v1/br/loan-accounts/{id}/payoff-statements/{quote_id}:
    get:
      operationId: getPayoffStatement
      parameters:
        - in: path
          name: id
          required: true
          schema:
            format: uuid
            type: string
        - in: path
          name: quote_id
          required: true
          schema:
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PayoffStatementResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get payoff statement
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-payoff-statement
  /api/v1/br/loan-accounts/{id}/pdd-stage:
    get:
      description: Returns the current Brazilian PDD delinquency stage and accrual eligibility state.
      operationId: getLoanAccountPDDStage
      parameters:
        - description: Loan account identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PDDStageResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get loan account PDD stage
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-loan-account-pdd-stage
  /api/v1/br/loan-accounts/{id}/pdd-stage/transitions:
    post:
      description: Records a PDD transition or cure and updates prospective accrual eligibility.
      operationId: applyLoanAccountPDDStageTransition
      parameters:
        - description: Loan account identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApplyPDDStageTransitionHumaBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PDDStageResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Apply loan account PDD stage transition
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/apply-loan-account-pdd-stage-transition
  /api/v1/br/loan-accounts/{id}/prepayment-quote:
    post:
      description: Creates a time-limited, auditable prepayment quote with settlement and rebate breakdown.
      operationId: createPrepaymentQuote
      parameters:
        - description: Loan account identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: a full-settlement quote issues a payment demand to the borrower, so without a key a retry cannot be told apart from a second demand."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: a full-settlement quote issues a payment demand to the borrower, so without a key a retry cannot be told apart from a second demand."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              discriminator:
                mapping:
                  full_settlement: "#/components/schemas/FullSettlementPrepaymentQuoteRequest"
                  partial: "#/components/schemas/PartialPrepaymentQuoteRequest"
                propertyName: quoteType
              oneOf:
                - $ref: "#/components/schemas/PartialPrepaymentQuoteRequest"
                - $ref: "#/components/schemas/FullSettlementPrepaymentQuoteRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PrepaymentQuoteResponse"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create prepayment quote
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/create-prepayment-quote
  /api/v1/br/loan-accounts/{id}/prepayments:
    post:
      description: "BR-aliased path for prepaying a loan account. Resolves to the same handler as the core endpoint, with the jurisdiction resolver inserted into the chain. BR accounts require quoteId; when amount is also provided, it must equal the quote's net settlement amount. Idempotency is enforced by the lib-commons idempotency middleware via the X-Idempotency header; a reused key with different facts yields 409. A missing quote, malformed UUID, or invalid amount yields 422. Deduplication is by key ALONE, and the one-shot quote bounds it: a new key carrying an already-accepted quoteId is refused and writes nothing, while a new key carrying a new quote is a newly priced settlement and is meant to book."
      operationId: prepayLoanAccountBR
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PrepayLoanAccountHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduleVersionCommandHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Prepay loan account (BR alias)
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/prepay-loan-account-br
  /api/v1/br/loan-accounts/{id}/problem-asset-assessments:
    get:
      description: "Returns the contract's qualitative problem-asset declarations, newest first: what was invoked, by whom, on what evidence, and whether it characterised the asset. Withdrawals appear beside the characterisations they withdraw."
      operationId: listLoanAccountProblemAssetAssessments
      parameters:
        - description: Loan account (contract) identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account (contract) identifier.
            format: uuid
            type: string
        - description: Maximum declarations to return, newest first. Defaults to 50.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum declarations to return, newest first. Defaults to 50.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemAssetAssessmentHistoryResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List qualitative problem-asset assessments
      tags:
        - Problem Asset Assessments
      x-mint:
        href: /pt/reference/products/lender/list-qualitative-problem-asset-assessments
    post:
      description: "Records an operator's declaration that a contract is, or is not, a problem asset for a qualitative reason under Res. CMN 4.966 art. 3 paragraphs 1 and 2 — the situations that characterise an asset as problematic with no arrears at all. The declaration carries a MANDATORY evidence reference and is immutable: a prior characterisation is withdrawn by declaring the same trigger again with characterizesProblemAsset false and its own evidence, never by deleting. The nightly stage sweep reads the live declarations."
      operationId: declareLoanAccountProblemAssetAssessment
      parameters:
        - description: Loan account (contract) identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan account (contract) identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: a declaration changes what the contract is provisioned at, so without a key a retry cannot be told apart from a second characterisation."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: a declaration changes what the contract is provisioned at, so without a key a retry cannot be told apart from a second characterisation."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeclareProblemAssetAssessmentHumaBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemAssetAssessmentResponse"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Declare a qualitative problem-asset assessment
      tags:
        - Problem Asset Assessments
      x-mint:
        href: /pt/reference/products/lender/declare-a-qualitative-problem-asset-assessment
  /api/v1/br/loan-applications/{id}/capitalization-consents:
    post:
      description: Hashes clause text server-side and stores an append-only consent artifact for BR-profile disbursement guards.
      operationId: ingestCapitalizationClauseConsent
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IngestCapitalizationConsentBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CapitalizationClauseConsentArtifactResponse"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Ingest BR capitalization clause consent
      tags:
        - Loan Applications
      x-mint:
        href: /pt/reference/products/lender/ingest-capitalization-clause-consent
  /api/v1/br/loan-product-versions/{id}/norm-classification:
    put:
      description: "Records the carteira (Res. BCB 352/2023 art. 81) the credit booked under this product version belongs to, and optionally the modality the norm keys a rate on beyond it. Works on a version that is already active: the contracts booked on it were always in that carteira under the norm, the system simply could not name it, and until it is declared the provision engine counts and names every contract it cannot price rather than measuring it at zero. There is no automatic backfill, because guessing a carteira is guessing how much capital the institution must hold. A version may be declared ONCE: a second call is refused with 409 naming the carteira on the record, because replacing one reprices every contract ever booked under the version and posts the difference against results in a single movement. Changing a carteira means creating a new product version."
      operationId: declareLoanProductVersionNormClassification
      parameters:
        - description: Loan product version identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product version identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeclareNormClassificationBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeclareNormClassificationResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Declare the BR norm classification of a loan product version
      tags:
        - Loan Products
      x-mint:
        href: /pt/reference/products/lender/declare-the-br-norm-classification-of-a-loan-product-version
  /api/v1/br/loan-product-versions/{id}/problem-asset-reassessment-horizon:
    put:
      description: "Records how long a qualitative problem-asset characterisation (Res. CMN 4.966 art. 3 paragraphs 1 and 2) may stand on a contract of this version before somebody must look at the evidence again. Such a characterisation never expires on its own: declared once it stands until a second declaration withdraws it, so a judicial reorganisation declared in 2026 can keep a contract provisioned and income-suspended in 2029 on evidence nobody has re-read. Passing the horizon RELEASES NOTHING — the stage, the provision and the income-recognition decision continue exactly as they were, because a review nobody performed is not evidence that a borrower recovered. What it does is put the contract on a review worklist and publish a fact, once per contract per business date, until somebody declares again with either verdict. The call is idempotent and replaces whatever was set: this is an operating policy, not a regulatory classification. Omit the field to clear the horizon; existing versions that never set one are unaffected."
      operationId: setLoanProductVersionProblemAssetReassessmentHorizon
      parameters:
        - description: Loan product version identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product version identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetProblemAssetReassessmentHorizonBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetProblemAssetReassessmentHorizonResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Set the problem-asset re-assessment horizon of a loan product version
      tags:
        - Loan Products
      x-mint:
        href: /pt/reference/products/lender/set-the-problem-asset-re-assessment-horizon-of-a-loan-product-version
  /api/v1/br/loan-products:
    get:
      description: BR-aliased path for listing loan products. Resolves to the same handler as the core endpoint.
      operationId: listLoanProductsBR
      parameters:
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List loan products (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/list-loan-products-br
    post:
      description: BR-aliased path for creating a loan product. Resolves to the same handler as the core endpoint.
      operationId: createLoanProductBR
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLoanProductHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create loan product (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product-br
  /api/v1/br/loan-products/{id}:
    get:
      description: BR-aliased path for retrieving a loan product. Resolves to the same handler as the core endpoint.
      operationId: getLoanProductBR
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get loan product (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/get-loan-product-br
  /api/v1/br/loan-products/{id}/activate:
    post:
      description: BR-aliased path for activating a loan product. Resolves to the same handler as the core endpoint.
      operationId: activateLoanProductBR
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ActivateLoanProductHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Activate loan product (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/activate-loan-product-br
  /api/v1/br/loan-products/{id}/promote:
    post:
      description: BR-aliased path for promoting a loan product version. Resolves to the same handler as the core endpoint.
      operationId: promoteLoanProductVersionBR
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PromoteLoanProductVersionHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Promote a loan product version to current (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/promote-a-loan-product-version-to-current-br-alias
  /api/v1/br/loan-products/{id}/versions:
    post:
      description: BR-aliased path for creating a loan product version. Resolves to the same handler as the core endpoint.
      operationId: createLoanProductVersionBR
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLoanProductVersionHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductVersionHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create loan product version (BR alias)
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product-version-br
  /api/v1/br/pdd-stage-ladders:
    post:
      description: "Publishes a new dated delinquency-stage policy for this tenant, re-tuning the bands without a release. The effective date must be in the future: a ladder never re-answers a business date that has already been staged, and a published version is immutable."
      operationId: publishPDDStageLadder
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PublishPDDStageLadderHumaBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PDDStageLadderResponse"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Publish a PDD stage ladder version
      tags:
        - PDD Stage Ladder
      x-mint:
        href: /pt/reference/products/lender/publish-a-pdd-stage-ladder-version
  /api/v1/br/pdd-stage-ladders/in-force:
    get:
      description: "Returns the dated delinquency-stage policy deciding the requested business date for this tenant: the version identifier every automated stage transition records, and its carteira x days-overdue x regime bands."
      operationId: getPDDStageLadderInForce
      parameters:
        - description: Business date to resolve the ladder for (YYYY-MM-DD). Defaults to today.
          explode: false
          in: query
          name: asOf
          schema:
            description: Business date to resolve the ladder for (YYYY-MM-DD). Defaults to today.
            examples:
              - "2026-09-17"
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PDDStageLadderResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get the PDD stage ladder in force
      tags:
        - PDD Stage Ladder
      x-mint:
        href: /pt/reference/products/lender/get-the-pdd-stage-ladder-in-force
  /api/v1/br/problem-asset-reassessment-overdue:
    get:
      description: "Returns the contracts whose standing qualitative problem-asset characterisation (Res. CMN 4.966 art. 3 paragraphs 1 and 2) has outlived the re-assessment horizon their product version declares, with no newer declaration of any verdict behind it. It is a WORKLIST and not a verdict: every contract listed keeps exactly the stage, provision and income-recognition decision it already had, because a review nobody performed is not evidence that a borrower recovered. A contract leaves the list when somebody declares again — either verdict, because either one means a person read the evidence. Rows are kept per business date so a past day can be answered as it stood; omit businessDate to read the latest."
      operationId: listProblemAssetReassessmentOverdue
      parameters:
        - description: Business date to read (YYYY-MM-DD). Omitted, the newest day a sweep finished is returned, which is what a console opening the screen wants. A day no completed sweep covers is refused rather than answered with its partial rows.
          explode: false
          in: query
          name: businessDate
          schema:
            description: Business date to read (YYYY-MM-DD). Omitted, the newest day a sweep finished is returned, which is what a console opening the screen wants. A day no completed sweep covers is refused rather than answered with its partial rows.
            examples:
              - "2026-09-20"
            type: string
        - description: Maximum contracts to return. Defaults to 100.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum contracts to return. Defaults to 100.
            format: int64
            maximum: 500
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ProblemAssetReassessmentOverdueListResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List contracts overdue for problem-asset re-assessment
      tags:
        - Problem Asset Assessments
      x-mint:
        href: /pt/reference/products/lender/list-contracts-overdue-for-problem-asset-re-assessment
  /api/v1/br/tax/preview:
    post:
      description: Computes disbursement IOF tax amounts using the active compiled jurisdiction profile without persisting data.
      operationId: previewTax
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TaxPreviewHumaBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TaxPreviewEnvelopeResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Preview jurisdiction tax amounts
      tags:
        - Tax
      x-mint:
        href: /pt/reference/products/lender/preview-tax
  /api/v1/dashboard/delinquent-loans:
    get:
      description: Returns delinquent loan drill-down rows for a bucket at a requested business date. The freshness anchor is book-wide, so the same unmeasured business date that refuses the metrics refuses this register too, with 503.
      operationId: listDelinquentLoans
      parameters:
        - description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
          explode: false
          in: query
          name: asOf
          schema:
            description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
            examples:
              - "2026-06-14"
            format: date
            type: string
        - description: Filter by loan product identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productIds
          schema:
            description: Filter by loan product identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440001
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Filter by loan product version identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productVersionIds
          schema:
            description: Filter by loan product version identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440002
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Delinquency bucket code.
          explode: false
          in: query
          name: bucketCode
          schema:
            description: Delinquency bucket code.
            enum:
              - current
              - "1_30"
              - "31_60"
              - "61_90"
              - 91_plus
              - par30
              - par60
              - par90
            examples:
              - par30
            type: string
        - description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
          explode: false
          in: query
          name: assignedOfficerId
          schema:
            description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
            examples:
              - officer-xyz
            maxLength: 255
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            examples:
              - 25
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            examples:
              - 0
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DelinquentLoansHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List delinquent loans
      tags:
        - Dashboard
      x-mint:
        href: /pt/reference/products/lender/list-delinquent-loans
  /api/v1/dashboard/portfolio:
    get:
      description: "Returns portfolio-level risk, delinquency, and freshness metrics for the requested business date. A business date the snapshot producer has not measured is refused with 503, never answered with a zeroed page: the caller should retry, not conclude the book is empty."
      operationId: getPortfolioDashboard
      parameters:
        - description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
          explode: false
          in: query
          name: asOf
          schema:
            description: Business date (YYYY-MM-DD); defaults to the current business day in Brazil (UTC-3).
            examples:
              - "2026-06-14"
            format: date
            type: string
        - description: Filter by loan product identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productIds
          schema:
            description: Filter by loan product identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440001
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Filter by loan product version identifiers (repeat to pass multiple).
          explode: true
          in: query
          name: productVersionIds
          schema:
            description: Filter by loan product version identifiers (repeat to pass multiple).
            examples:
              -   - 550e8400-e29b-41d4-a716-446655440002
            items:
              format: uuid
              type: string
            maxItems: 100
            type:
              - array
              - "null"
        - description: Delinquency bucket code.
          explode: false
          in: query
          name: bucketCode
          schema:
            description: Delinquency bucket code.
            enum:
              - current
              - "1_30"
              - "31_60"
              - "61_90"
              - 91_plus
              - par30
              - par60
              - par90
            examples:
              - par30
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortfolioDashboardHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get portfolio dashboard
      tags:
        - Dashboard
      x-mint:
        href: /pt/reference/products/lender/get-portfolio-dashboard
  /api/v1/internal/br/consignado/collection-agent-channel:
    put:
      description: "Points this tenant at the collection agent it instructs, or switches the channel off. It is the act every other behaviour of the channel depends on: with no active agent, borrower collections stay PARKED in `requested` and are only counted. The agent name and account are stamped verbatim on every instruction and the Arquivo de Baixa Extraordinária quotes them back byte-exactly, so the shapes are refused here by name rather than by a database constraint. Re-appointing the same agent is inert; `active: false` parks issuance again WITHOUT deleting the identity an already issued instruction names. Because the identity travels in the SAME call as the on/off switch, a CHANGED name or account is refused with 409 while the current agent still has open instructions: it would abandon them, since the work queue matches the active channel byte-exactly against what each instrument was stamped with. Turn those instructions over first, then the switch goes through. Idempotent via the X-Idempotency header enforced by the platform middleware."
      operationId: appointConsignadoCollectionAgentChannel
      parameters:
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CollectionAgentChannelAppointHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionAgentChannelHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Appoint the tenant's extraordinary-collection agent
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/appoint-the-tenant-s-extraordinary-collection-agent
  /api/v1/internal/br/consignado/collection-settlements/quarantined:
    get:
      description: "Returns the baixa lines the lender could not act on, oldest parked first. Each one is money a borrower ALREADY paid to the client's collection agent and nobody has credited, so the ordering is the borrower who has waited longest. The `id` is what the requeue route takes: without this listing, releasing a parked line meant hand-written SQL against a production tenant schema."
      operationId: listConsignadoQuarantinedCollectionSettlements
      parameters:
        - description: Maximum parked lines to return. Defaults to 50.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum parked lines to return. Defaults to 50.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CollectionSettlementQuarantineListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List quarantined extraordinary-collection settlement lines
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/list-quarantined-extraordinary-collection-settlement-lines
  /api/v1/internal/br/consignado/compensating-adjustments:
    post:
      description: "Commits a new compensating adjustment operation, its opening history entry and — when the currency has a configured suspense account — the durable posting-intent outbox event, atomically. A 202 response means accepted durably, never posted: the ledger relay posts it separately. Idempotent via the X-Idempotency header enforced by the platform middleware."
      operationId: createConsignadoCompensatingAdjustment
      parameters:
        - description: Canonical idempotency request ID (lib-commons enforcer reads this). Reusing the same key on a retry returns the SAME durably accepted operation, never a duplicate.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this). Reusing the same key on a retry returns the SAME durably accepted operation, never a duplicate.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompensatingAdjustmentHumaRequest"
        required: true
      responses:
        "202":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompensatingAdjustmentHumaBody"
          description: Accepted
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create a consignado compensating adjustment
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/create-consignado-compensating-adjustment
  /api/v1/internal/br/consignado/compensating-adjustments/preview:
    post:
      description: Validates a prospective compensating adjustment against the same domain invariants Create enforces and reports the eventual posting direction, with no database write, object storage call or outbox event.
      operationId: previewConsignadoCompensatingAdjustment
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompensatingAdjustmentHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PreviewCompensatingAdjustmentHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Preview a consignado compensating adjustment
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/preview-consignado-compensating-adjustment
  /api/v1/internal/br/consignado/compensating-adjustments/{id}/evidence:
    post:
      description: Streams one operator-supplied evidence file (PDF, JPEG or PNG, up to 20 MiB) to the Lender's own object storage and persists its metadata. Without a configured object store, this fails closed. Idempotent via the X-Idempotency header enforced by the platform middleware; re-uploading the SAME bytes for the same operation is inert.
      operationId: attachConsignadoCompensatingAdjustmentEvidence
      parameters:
        - description: Compensating adjustment operation identifier.
          in: path
          name: id
          required: true
          schema:
            description: Compensating adjustment operation identifier.
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      requestBody:
        content:
          application/pdf:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
          image/jpeg:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
          image/png:
            schema:
              contentMediaType: application/octet-stream
              format: binary
              type: string
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompensatingAdjustmentEvidenceHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Attach evidence to a consignado compensating adjustment
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/attach-consignado-compensating-adjustment-evidence
  /api/v1/internal/br/consignado/compensating-adjustments/{id}/reconcile:
    post:
      description: Resolves an operation stuck at posting_intent_recorded by asking the ledger, once, whether a transaction for its correlation identity already exists. Never resubmits the posting. Idempotent via the X-Idempotency header enforced by the platform middleware.
      operationId: reconcileConsignadoCompensatingAdjustment
      parameters:
        - description: Compensating adjustment operation identifier.
          in: path
          name: id
          required: true
          schema:
            description: Compensating adjustment operation identifier.
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReconcileCompensatingAdjustmentHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Reconcile a consignado compensating adjustment
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/reconcile-consignado-compensating-adjustment
  /api/v1/internal/br/consignado/contracts/{numeroContrato}/portability-inbound:
    get:
      description: "Answers whether this contract ARRIVED by portability and, if so, which institution it came from, under which operation reference there, for how much, and as of when. A 404 is the ordinary answer for a contract this lender originated: the lineage row EXISTS only for transferred stock, which is what distinguishes it from new production in portfolio and regulatory reporting. The transferred balance is the principal the contract was booked with — a registered fact whose two numbers disagree is refused at ingestion rather than reconciled — and the record is immutable: a correction is a new fact elsewhere, never a rewrite of where a debt came from."
      operationId: getConsignadoPortabilityInboundLineage
      parameters:
        - description: The rail contract number, byte-exact.
          in: path
          name: numeroContrato
          required: true
          schema:
            description: The rail contract number, byte-exact.
            maxLength: 128
            minLength: 1
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PortabilityInboundLineageHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Read the inbound-portability lineage of a contract
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/read-the-inbound-portability-lineage-of-a-contract
  /api/v1/internal/br/consignado/divergences:
    get:
      description: "Returns a tenant-scoped, deterministically ordered page of the operational divergence queue. Default order: flow-blocking effect first (booking_blocked, then adjustment_required, then posting_pending, then audit_only), then overdue, then largest absolute client-vs-lender difference, then oldest observation."
      operationId: listConsignadoContractDivergences
      parameters:
        - description: Filter by category (cash|rate|terms|margin|registration|technical).
          explode: false
          in: query
          name: category
          schema:
            description: Filter by category (cash|rate|terms|margin|registration|technical).
            type: string
        - description: "Filter by flow effect (audit_only|posting_pending|adjustment_required|booking_blocked). Also the primary triage ordering key: booking_blocked sorts first, audit_only last."
          explode: false
          in: query
          name: effect
          schema:
            description: "Filter by flow effect (audit_only|posting_pending|adjustment_required|booking_blocked). Also the primary triage ordering key: booking_blocked sorts first, audit_only last."
            type: string
        - description: Filter by disposition state (open|disposed).
          explode: false
          in: query
          name: status
          schema:
            description: Filter by disposition state (open|disposed).
            type: string
        - description: Filter by assignee identity, or the reserved value 'unassigned' for items with no assignee.
          explode: false
          in: query
          name: assignee
          schema:
            description: Filter by assignee identity, or the reserved value 'unassigned' for items with no assignee.
            type: string
        - description: Restrict to open items whose SLA deadline has already passed.
          explode: false
          in: query
          name: slaBreachedOnly
          schema:
            description: Restrict to open items whose SLA deadline has already passed.
            type: boolean
        - description: RFC3339 UTC cutoff for the SLA-breached display ordering only; resend the previous page's response AsOf, omit only on the first page. Must not be in the future or older than the pagination window.
          explode: false
          in: query
          name: asOf
          schema:
            description: RFC3339 UTC cutoff for the SLA-breached display ordering only; resend the previous page's response AsOf, omit only on the first page. Must not be in the future or older than the pagination window.
            format: date-time
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 20
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractDivergenceListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List consignado contract divergences
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/list-consignado-contract-divergences
  /api/v1/internal/br/consignado/divergences/{id}:
    get:
      description: Returns the comparative detail (structured fields plus raw secondary evidence) and the full append-only history for one item.
      operationId: getConsignadoContractDivergence
      parameters:
        - description: Contract divergence identifier.
          in: path
          name: id
          required: true
          schema:
            description: Contract divergence identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractDivergenceDetailHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get consignado contract divergence detail
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/get-consignado-contract-divergence
  /api/v1/internal/br/consignado/divergences/{id}/assign:
    post:
      description: Claims an open item for an operator. Compare-and-swap guarded by expectedVersion; idempotent via the X-Idempotency header enforced by the platform middleware.
      operationId: assignConsignadoContractDivergence
      parameters:
        - description: Contract divergence identifier.
          in: path
          name: id
          required: true
          schema:
            description: Contract divergence identifier.
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AssignContractDivergenceHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractDivergenceHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Assign consignado contract divergence
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/assign-consignado-contract-divergence
  /api/v1/internal/br/consignado/divergences/{id}/dispose:
    post:
      description: Records the operator's structured result and closes the item. Compare-and-swap guarded by expectedVersion; idempotent via the X-Idempotency header enforced by the platform middleware.
      operationId: disposeConsignadoContractDivergence
      parameters:
        - description: Contract divergence identifier.
          in: path
          name: id
          required: true
          schema:
            description: Contract divergence identifier.
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisposeContractDivergenceHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractDivergenceHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Dispose consignado contract divergence
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/dispose-consignado-contract-divergence
  /api/v1/internal/br/consignado/divergences/{id}/requeue:
    post:
      description: Records an explicit retry signal over the same immutable command. Never reopens a disposed item. Compare-and-swap guarded by expectedVersion; idempotent via the X-Idempotency header enforced by the platform middleware.
      operationId: requeueConsignadoContractDivergence
      parameters:
        - description: Contract divergence identifier.
          in: path
          name: id
          required: true
          schema:
            description: Contract divergence identifier.
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RequeueContractDivergenceHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ContractDivergenceHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Requeue consignado contract divergence
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/requeue-consignado-contract-divergence
  /api/v1/internal/br/consignado/inboxes/{inbox}/{id}/requeue:
    post:
      description: "Returns one quarantined item of one durable inbox to work, under operator authority. It resets the attempt budget and clears the failure reason, and it NEVER touches the item's identity, its canonical payload, or any declared money value — a requeue re-runs the fact the inbox already holds, which is why the request carries no body. Lanes: collection_settlement, correction, disbursement, disbursement_posting, portability, refinance, registration. The disbursement inbox's ingestion and posting lanes are separate members on purpose: restarting a posting-stage fact from ingestion could recompute a posting intent that no longer matches what the ledger already holds under the same idempotency key. Idempotent via the X-Idempotency header enforced by the platform middleware."
      operationId: requeueConsignadoInboxItem
      parameters:
        - description: Which durable inbox the item belongs to.
          in: path
          name: inbox
          required: true
          schema:
            description: Which durable inbox the item belongs to.
            type: string
        - description: The quarantined item's identifier.
          in: path
          name: id
          required: true
          schema:
            description: The quarantined item's identifier.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RequeueConsignadoInboxHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Requeue a quarantined consignado inbox item
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/requeue-a-quarantined-consignado-inbox-item
  /api/v1/internal/br/consignado/overdeduction-refunds:
    get:
      description: Returns the tenant's over-deduction refund cases, oldest obligation first — payroll deducted MORE than a competência was worth and the residual is owed back to the worker. `recorded` is an open obligation and `disposed` carries the execution fact of who returned it, when, and under which reference.
      operationId: listConsignadoOverDeductionRefunds
      parameters:
        - description: Restrict to open obligations or to returned ones. Omit for both.
          explode: false
          in: query
          name: status
          schema:
            description: Restrict to open obligations or to returned ones. Omit for both.
            enum:
              - recorded
              - disposed
            type: string
        - description: Maximum cases to return. Defaults to 50.
          explode: false
          in: query
          name: limit
          schema:
            description: Maximum cases to return. Defaults to 50.
            format: int64
            maximum: 200
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OverDeductionRefundListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List over-deduction refunds owed to workers
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/list-over-deduction-refunds-owed-to-workers
  /api/v1/internal/br/consignado/overdeduction-refunds/{id}/dispose:
    post:
      description: "Closes one open refund case with the execution fact. The lender registers the obligation and the client's treasury moves the money, so this records a return that already happened and never pays anybody. The disposing actor is the caller's validated identity, never a body field, and a case is closed exactly once: a second disposition is refused rather than overwriting authorship. Idempotent via the X-Idempotency header enforced by the platform middleware."
      operationId: disposeConsignadoOverDeductionRefund
      parameters:
        - description: The refund case to close.
          in: path
          name: id
          required: true
          schema:
            description: The refund case to close.
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request moves money, and without a key a retry cannot be told apart from a second instruction."
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisposeOverDeductionRefundHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OverDeductionRefundHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Record that an over-deduction refund was returned
      tags:
        - Consignado
      x-mint:
        href: /pt/reference/products/lender/record-that-an-over-deduction-refund-was-returned
  /api/v1/internal/streaming/discards:
    get:
      description: "The records this service's inbound consumers could not process and quarantined to its dead-letter topic: what died, for which tenant, why, and where it came from. Scoped to the caller's validated tenant. The quarantined payload is deliberately not served — the origin topic, partition and offset are the route back to it."
      operationId: listStreamingDiscards
      parameters:
        - description: "Narrow to one quarantine cause. codec: the record's CloudEvents headers would not decode, so the producer's wire format is the suspect. handler: a consumer returned a terminal error, so the business rejection is. source_mismatch: the record came from an unexpected producer. unhandled_key: no handler is registered for that event, so this service's registrations drifted behind the producer's catalog."
          explode: false
          in: query
          name: causeKind
          schema:
            description: "Narrow to one quarantine cause. codec: the record's CloudEvents headers would not decode, so the producer's wire format is the suspect. handler: a consumer returned a terminal error, so the business rejection is. source_mismatch: the record came from an unexpected producer. unhandled_key: no handler is registered for that event, so this service's registrations drifted behind the producer's catalog."
            enum:
              - codec
              - handler
              - source_mismatch
              - unhandled_key
            type: string
        - description: Narrow to one event key, spelled "<resourceType>.<eventType>" as the producing catalog spells it.
          explode: false
          in: query
          name: eventType
          schema:
            description: Narrow to one event key, spelled "<resourceType>.<eventType>" as the producing catalog spells it.
            examples:
              - contract.registered
            maxLength: 256
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StreamingDiscardListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List quarantined inbound records
      tags:
        - Streaming
      x-mint:
        href: /pt/reference/products/lender/list-quarantined-inbound-records
  /api/v1/journal-references:
    get:
      description: Returns journal/outbox reference data resolved by correlation ID.
      operationId: getJournalReference
      parameters:
        - description: Correlation identifier to resolve a journal/outbox reference.
          explode: false
          in: query
          name: correlation_id
          schema:
            description: Correlation identifier to resolve a journal/outbox reference.
            maxLength: 256
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JournalReferenceHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get journal reference by correlation id
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/get-journal-reference
  /api/v1/journal-references/{id}:
    get:
      description: Returns journal/outbox reference data by journal reference ID.
      operationId: getJournalReferenceById
      parameters:
        - description: Journal reference identifier.
          in: path
          name: id
          required: true
          schema:
            description: Journal reference identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/JournalReferenceHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get journal reference by id
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/get-journal-reference-by-id
  /api/v1/jurisdictions:
    get:
      description: Returns the set of jurisdiction profiles compiled into the running service. Public (no tenant scope).
      operationId: listJurisdictions
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListJurisdictionsResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security: []
      summary: List registered jurisdictions
      tags:
        - Jurisdictions
      x-mint:
        href: /pt/reference/products/lender/list-jurisdictions
  /api/v1/jurisdictions/{code}:
    get:
      description: Returns the descriptor for a single registered jurisdiction profile. Public (no tenant scope).
      operationId: getJurisdiction
      parameters:
        - description: ISO 3166-1 alpha-2 jurisdiction code (e.g. BR, XX).
          in: path
          name: code
          required: true
          schema:
            description: ISO 3166-1 alpha-2 jurisdiction code (e.g. BR, XX).
            pattern: ^[A-Za-z]{2}$
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetJurisdictionResponse"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      security: []
      summary: Get jurisdiction by code
      tags:
        - Jurisdictions
      x-mint:
        href: /pt/reference/products/lender/get-jurisdiction
  /api/v1/loan-accounts:
    get:
      description: Returns one page of the loan book, newest first, for an operator holding no account identifier. Filters narrow the page; omitting one does not narrow. By default only live accounts are returned — set includeClosed to also see the ones a terminal lifecycle fact closed, each carrying the lifecycleStatus that says whether it was settled, ceded, ported, reversed or renegotiated. An operator restricted to their own book sees only the accounts they borrow or service; a request carrying no authenticated identity is refused rather than served the whole book.
      operationId: listLoanAccounts
      parameters:
        - description: Narrow to one originating application status. Only these two statuses ever carry a loan account.
          explode: false
          in: query
          name: status
          schema:
            description: Narrow to one originating application status. Only these two statuses ever carry a loan account.
            enum:
              - disbursed
              - active
            examples:
              - active
            type: string
        - description: Narrow to one borrower's book. The borrower identifier is a UUID — the same identity origination stored on the contract.
          explode: false
          in: query
          name: borrowerId
          schema:
            description: Narrow to one borrower's book. The borrower identifier is a UUID — the same identity origination stored on the contract.
            examples:
              - 550e8400-e29b-41d4-a716-446655440002
            format: uuid
            type: string
        - description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
          explode: false
          in: query
          name: assignedOfficerId
          schema:
            description: Narrow to one loan officer's book. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated contract carries the empty officer.
            examples:
              - officer-xyz
            maxLength: 255
            type: string
        - description: Narrow to the contracts booked under one loan product version.
          explode: false
          in: query
          name: loanProductVersionId
          schema:
            description: Narrow to the contracts booked under one loan product version.
            examples:
              - 550e8400-e29b-41d4-a716-446655440001
            type: string
        - description: Narrow to one ISO-4217 denomination.
          explode: false
          in: query
          name: currency
          schema:
            description: Narrow to one ISO-4217 denomination.
            examples:
              - BRL
            pattern: ^[A-Z]{3}$
            type: string
        - description: "Include accounts a terminal lifecycle fact closed — settled, ceded, ported, reversed or renegotiated. Default false: the live book only. Included rows carry lifecycleStatus saying which of the five closed them."
          explode: false
          in: query
          name: includeClosed
          schema:
            default: false
            description: "Include accounts a terminal lifecycle fact closed — settled, ceded, ported, reversed or renegotiated. Default false: the live book only. Included rows carry lifecycleStatus saying which of the five closed them."
            type: boolean
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanAccountListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List loan accounts
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/list-loan-accounts
  /api/v1/loan-accounts/{id}:
    get:
      description: Returns the active loan account detail read model. A malformed UUID yields 422 (schema error), distinct from 404 when the account does not exist.
      operationId: getActiveLoanAccount
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActiveLoanAccountHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get active loan account
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-active-loan-account
  /api/v1/loan-accounts/{id}/audit-events:
    get:
      description: Returns immutable correction, replay, and operator-visible audit history for a loan account. Schema-bounded limit (1–100, default 50); out-of-range values yield 422. A malformed UUID yields 422 (schema error).
      operationId: listLoanAccountAuditEventsHuma
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Maximum audit events to return (1–100, default 50).
          explode: false
          in: query
          name: limit
          schema:
            default: 50
            description: Maximum audit events to return (1–100, default 50).
            examples:
              - 50
            format: int64
            maximum: 100
            minimum: 1
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanAuditHistoryHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List loan account audit events
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/list-loan-account-audit-events-huma
  /api/v1/loan-accounts/{id}/charges:
    get:
      description: Returns assessed charges for an active loan account. A malformed UUID yields 422, distinct from 404.
      operationId: listActiveLoanCharges
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActiveLoanChargesHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List active loan charges
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/list-active-loan-charges
  /api/v1/loan-accounts/{id}/deferred-fee-reconciliation:
    get:
      description: "Reads the ledger lines of the contract's own deferred-fee accounts, across every chart it lived under, into deferred, recognised, released and remaining, and holds the deferred figure against the fee the contract record says was retained. The contract is named by its loan account alone: product version, disbursement day, currency and retained fee come from the tenant's contract record. A ledger that does not answer is status UNAVAILABLE, not an error."
      operationId: getDeferredFeeReconciliation
      parameters:
        - description: Loan account identifier of the contract.
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier of the contract.
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DeferredFeeReconciliationHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Reconcile a contract's deferred origination fee
      tags:
        - Accounting
      x-mint:
        href: /pt/reference/products/lender/reconcile-a-contract-s-deferred-origination-fee
  /api/v1/loan-accounts/{id}/prepayments:
    post:
      description: "Appends an immutable prepayment schedule version and recalculation trigger. BR accounts require quoteId; amount-only prepayment is available only for non-BR accounts. When both are provided, amount must equal the quote's net settlement amount. Idempotency is enforced by the lib-commons idempotency middleware via the X-Idempotency header; a reused key with different facts yields 409. A missing required BR quote, malformed UUID, or invalid amount yields 422. Deduplication is by key ALONE: an amount-only settlement resent under a NEW key books a SECOND settlement, so retry under the ORIGINAL key. A BR quote is one-shot and bounds this by itself — a new key carrying an already-accepted quoteId is refused and writes nothing, while a new key carrying a new quote is a newly priced settlement and is meant to book."
      operationId: prepayLoanAccount
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PrepayLoanAccountHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduleVersionCommandHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Prepay loan account
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/prepay-loan-account
  /api/v1/loan-accounts/{id}/preview-repayment:
    post:
      description: Returns a deterministic repayment allocation preview without recording a transaction. Not idempotency-gated. A malformed UUID yields 422 (schema error). A malformed amount string yields 422.
      operationId: previewRepayment
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RepaymentRequestHumaBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepaymentPreviewHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Preview repayment allocation
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/preview-repayment
  /api/v1/loan-accounts/{id}/repayments:
    post:
      description: "Records a repayment allocation for an active loan account. Idempotency is enforced in the use case via the X-Request-ID header (X-Idempotency fallback): a reused request ID with different facts yields 409. A malformed UUID or amount yields 422. Deduplication is by request ID ALONE: the same amount, on the same account, on the same effective date, resent under a NEW request ID books a SECOND payment and answers 201. A borrower may legitimately pay the same amount twice, and no field in the request separates that from an accidental resend, so this route carries no business-fact fence — unlike disbursement, which does. Retry under the ORIGINAL request ID, which replays the original answer and moves nothing; a double that did book is undone on POST /api/v1/loan-accounts/{id}/transactions/{transactionId}/reverse, newest payment first."
      operationId: recordRepayment
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
          in: header
          name: X-Request-ID
          schema:
            description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440010
            type: string
        - description: Fallback idempotency request ID used when X-Request-ID is absent.
          in: header
          name: X-Idempotency
          schema:
            description: Fallback idempotency request ID used when X-Request-ID is absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RepaymentRequestHumaBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RepaymentRecordHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              schema:
                description: Set to "true" when this response replays an earlier request with the same idempotency key; absent on a first execution.
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Record repayment
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/record-repayment
  /api/v1/loan-accounts/{id}/reschedules:
    post:
      description: Appends an immutable rescheduled schedule version and recalculation trigger. Idempotency is enforced by the lib-commons idempotency middleware via the X-Idempotency header; a reused key with different facts yields 409. A malformed UUID yields 422.
      operationId: rescheduleLoanAccount
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID. Enforced by the lib-commons idempotency middleware.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RescheduleLoanAccountHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ScheduleVersionCommandHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Reschedule loan account
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/reschedule-loan-account
  /api/v1/loan-accounts/{id}/schedule:
    get:
      description: Returns ordered active loan installment schedule entries. A malformed UUID yields 422, distinct from 404.
      operationId: getActiveLoanSchedule
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActiveLoanScheduleHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get active loan schedule
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/get-active-loan-schedule
  /api/v1/loan-accounts/{id}/transactions:
    get:
      description: Returns recorded repayment transactions for an active loan account. A malformed UUID yields 422, distinct from 404.
      operationId: listActiveLoanTransactions
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ActiveLoanTransactionsHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List active loan transactions
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/list-active-loan-transactions
  /api/v1/loan-accounts/{id}/transactions/{transactionId}/reverse:
    post:
      description: "Creates an immutable compensating transaction and preserves reversal lineage. The reversal's effective date is DERIVED from the payment being reversed and is not accepted in the request; a body carrying `effectiveDate` is refused 422. Idempotency is enforced in the use case via the X-Request-ID header (X-Idempotency fallback): a reused request ID with different facts yields 409. A malformed UUID yields 422; an unknown transaction yields 404; a payment already reversed yields 409. A reversal is REFUSED 422 when the loan account carries a payment or a schedule version whose effective timestamp is strictly later than the reversed payment's. The problem document names which fact blocks, in `errors[0].message`: `REVERSAL_REFUSED_LATER_PAYMENT` (the borrower paid again — use the compensating-adjustment path), `REVERSAL_REFUSED_LATER_SCHEDULE_VERSION` (the schedule was re-agreed — the remedy is a new schedule version), or `REVERSAL_REFUSED_LATER_FACTS_EXIST` (both)."
      operationId: reverseLoanAccountTransaction
      parameters:
        - description: Loan account identifier (UUID).
          in: path
          name: id
          required: true
          schema:
            description: Loan account identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Original repayment transaction identifier (UUID).
          in: path
          name: transactionId
          required: true
          schema:
            description: Original repayment transaction identifier (UUID).
            examples:
              - 550e8400-e29b-41d4-a716-446655440001
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
          in: header
          name: X-Request-ID
          schema:
            description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440010
            type: string
        - description: Fallback idempotency request ID used when X-Request-ID is absent.
          in: header
          name: X-Idempotency
          schema:
            description: Fallback idempotency request ID used when X-Request-ID is absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReverseRepaymentHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReverseRepaymentHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              schema:
                description: Set to "true" when this response replays an earlier request with the same idempotency key; absent on a first execution.
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Reverse loan account transaction
      tags:
        - Loan Accounts
      x-mint:
        href: /pt/reference/products/lender/reverse-loan-account-transaction
  /api/v1/loan-applications:
    get:
      description: Returns a page of loan applications for the caller's tenant, newest first, optionally narrowed by status, loan product version, borrower, assigned officer or origination channel.
      operationId: listLoanApplications
      parameters:
        - description: Narrow to one lifecycle status. Omit to include every status.
          explode: false
          in: query
          name: status
          schema:
            description: Narrow to one lifecycle status. Omit to include every status.
            enum:
              - pending_approval
              - approved
              - rejected
              - withdrawn
              - disbursed
            type: string
        - description: Narrow to applications created against one loan product version.
          explode: false
          in: query
          name: loanProductVersionId
          schema:
            description: Narrow to applications created against one loan product version.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Narrow to one borrower. The borrower identifier is a UUID — the same identity the create route stored.
          explode: false
          in: query
          name: borrowerId
          schema:
            description: Narrow to one borrower. The borrower identifier is a UUID — the same identity the create route stored.
            examples:
              - 550e8400-e29b-41d4-a716-446655440002
            format: uuid
            type: string
        - description: Narrow to the officer the application is assigned to. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated application carries the empty officer.
          explode: false
          in: query
          name: assignedOfficerId
          schema:
            description: Narrow to the officer the application is assigned to. Free-form authenticated identity subject, not necessarily a UUID, at most 255 characters; a system-originated application carries the empty officer.
            examples:
              - officer-xyz
            maxLength: 255
            type: string
        - description: Narrow to the trusted channel that created the application.
          explode: false
          in: query
          name: originationFront
          schema:
            description: Narrow to the trusted channel that created the application.
            enum:
              - gateway_clt
              - lender_direct
              - unknown_legacy
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationReadListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List loan applications
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/list-loan-applications
    post:
      description: Creates a pending approval loan application from an already-previewed schedule snapshot.
      operationId: createLoanApplication
      parameters:
        - description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLoanApplicationHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/create-loan-application
  /api/v1/loan-applications/preview-schedule:
    post:
      description: Computes a deterministic declining-balance schedule for the supplied loan parameters and records it as the offer, returning the identifier that names it. Re-running an identical preview returns the same identifier and records no second offer.
      operationId: previewLoanSchedule
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SchedulePreviewHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SchedulePreviewHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Preview amortisation schedule
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/preview-loan-schedule
  /api/v1/loan-applications/{applicationId}/credit-instruments:
    get:
      description: Returns the emission history for a loan application, newest first.
      operationId: listCreditInstruments
      parameters:
        - description: Loan application identifier.
          in: path
          name: applicationId
          required: true
          schema:
            description: Loan application identifier.
            format: uuid
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditInstrumentListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List credit instruments
      tags:
        - CreditInstruments
      x-mint:
        href: /pt/reference/products/lender/list-credit-instruments
    post:
      description: Renders and durably custodies a credit-instrument (CCB) PDF for an approved loan application, from the product's active document template. Idempotent by caller-supplied key.
      operationId: issueCreditInstrument
      parameters:
        - description: Loan application identifier.
          in: path
          name: applicationId
          required: true
          schema:
            description: Loan application identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IssueCreditInstrumentHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreditInstrumentHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              schema:
                description: true when this response replays an instrument already durably created under the same idempotency key, rather than a fresh emission.
                type: boolean
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Issue credit instrument
      tags:
        - CreditInstruments
      x-mint:
        href: /pt/reference/products/lender/issue-credit-instrument
  /api/v1/loan-applications/{applicationId}/credit-instruments/{instrumentId}/download:
    get:
      description: "Streams the rendered PDF bytes from the Lender's own custody. Tenant-scoped by construction: an instrument from another tenant, or another application, never resolves."
      operationId: downloadCreditInstrument
      parameters:
        - description: Loan application identifier.
          in: path
          name: applicationId
          required: true
          schema:
            description: Loan application identifier.
            format: uuid
            type: string
        - description: Credit instrument identifier.
          in: path
          name: instrumentId
          required: true
          schema:
            description: Credit instrument identifier.
            format: uuid
            type: string
      responses:
        "200":
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Download credit instrument
      tags:
        - CreditInstruments
      x-mint:
        href: /pt/reference/products/lender/download-credit-instrument
  /api/v1/loan-applications/{id}:
    get:
      description: Returns one loan application by identifier. An application belonging to another tenant is reported as not found.
      operationId: getLoanApplication
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            examples:
              - 3fa85f64-5717-4562-b3fc-2c963f66afa6
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationReadHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/get-loan-application
  /api/v1/loan-applications/{id}/approve:
    post:
      description: Transitions a pending-approval loan application to approved.
      operationId: approveLoanApplication
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            examples:
              - 3fa85f64-5717-4562-b3fc-2c963f66afa6
            format: uuid
            type: string
        - description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApproveLoanApplicationHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Approve loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/approve-loan-application
  /api/v1/loan-applications/{id}/disburse:
    post:
      description: "Validates disbursement eligibility, dispatches the resolving jurisdictional disbursement pipeline inside the parent transaction, and moves an approved application to disbursed. Idempotent: the lib-commons middleware enforces replay detection via X-Idempotency."
      operationId: disburseLoanApplication
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            examples:
              - 3fa85f64-5717-4562-b3fc-2c963f66afa6
            format: uuid
            type: string
        - description: Canonical idempotency request ID (lib-commons enforcer reads this).
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency request ID (lib-commons enforcer reads this).
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisburseLoanApplicationHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Disburse loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/disburse-loan-application
  /api/v1/loan-applications/{id}/reject:
    post:
      description: Transitions a pending-approval loan application to rejected.
      operationId: rejectLoanApplication
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            examples:
              - 3fa85f64-5717-4562-b3fc-2c963f66afa6
            format: uuid
            type: string
        - description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RejectLoanApplicationHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Reject loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/reject-loan-application
  /api/v1/loan-applications/{id}/withdraw:
    post:
      description: Transitions a loan application to withdrawn.
      operationId: withdrawLoanApplication
      parameters:
        - description: Loan application identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan application identifier.
            examples:
              - 3fa85f64-5717-4562-b3fc-2c963f66afa6
            format: uuid
            type: string
        - description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID (lib-commons enforcer reads this). Required: without a key a retry of this request cannot be told apart from a second instruction, and the duplicate it books is undone by hand."
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WithdrawLoanApplicationHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanApplicationHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Withdraw loan application
      tags:
        - LoanApplications
      x-mint:
        href: /pt/reference/products/lender/withdraw-loan-application
  /api/v1/loan-product-versions:
    get:
      description: Returns a page of immutable product version snapshots, newest first, optionally narrowed by product, jurisdiction, pricing mode, currency or accrual basis.
      operationId: listLoanProductVersions
      parameters:
        - description: Narrow to one loan product's versions.
          explode: false
          in: query
          name: productId
          schema:
            description: Narrow to one loan product's versions.
            format: uuid
            type: string
        - description: Narrow to one jurisdiction profile code.
          explode: false
          in: query
          name: jurisdictionCode
          schema:
            description: Narrow to one jurisdiction profile code.
            examples:
              - BR
            maxLength: 2
            minLength: 2
            type: string
        - description: Narrow to one pricing mode.
          explode: false
          in: query
          name: rateMode
          schema:
            description: Narrow to one pricing mode.
            enum:
              - fixed
              - floating
            type: string
        - description: Narrow to one ISO-4217 alpha currency.
          explode: false
          in: query
          name: currency
          schema:
            description: Narrow to one ISO-4217 alpha currency.
            examples:
              - BRL
            pattern: ^[A-Z]{3}$
            type: string
        - description: Narrow to one interest recognition method.
          explode: false
          in: query
          name: accrualBasis
          schema:
            description: Narrow to one interest recognition method.
            enum:
              - effective_interest
              - linear
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductVersionListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List loan product versions
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/list-loan-product-versions
  /api/v1/loan-product-versions/{id}:
    get:
      description: Returns one immutable product version snapshot by its own identifier.
      operationId: getLoanProductVersion
      parameters:
        - description: Product version snapshot identifier.
          in: path
          name: id
          required: true
          schema:
            description: Product version snapshot identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductVersionHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get loan product version
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/get-loan-product-version
  /api/v1/loan-product-versions/{id}/charge-templates:
    post:
      description: "Declares one effective-dated revision of a charge model on a product version. Attaching a model to a version that already carries live contracts is allowed and is the point of the table being dated: the revision takes effect from its own date forward and never rewrites a charge already assessed."
      operationId: createChargeTemplate
      parameters:
        - description: Loan product version identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product version identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateChargeTemplateHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ChargeTemplateHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Declare charge model revision
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/declare-charge-model-revision
  /api/v1/loan-products:
    get:
      description: Returns a paginated list of loan products.
      operationId: listLoanProducts
      parameters:
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List loan products
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/list-loan-products
    post:
      description: Creates a new loan product definition.
      operationId: createLoanProduct
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLoanProductHumaRequest"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create loan product
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product
  /api/v1/loan-products/{id}:
    get:
      description: Returns a loan product by ID.
      operationId: getLoanProduct
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get loan product
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/get-loan-product
  /api/v1/loan-products/{id}/accounting-profiles:
    post:
      description: Configures the accounting profile for a loan product version that belongs to the path loan product.
      operationId: createLoanProductAccountingProfile
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ConfigureAccountingProfileHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AccountingProfileHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create loan product accounting profile
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product-accounting-profile
  /api/v1/loan-products/{id}/accounting-profiles/supersessions:
    post:
      description: "Replaces the chart of accounts every configured version of this loan product books against, from a stated month forward. One action, one effective date, every affected version written together or none. A version with no chart is not touched: giving it a first one is the separate configure action, and this route requires its own permission because replacing a live chart moves balances on every live contract."
      operationId: supersedeLoanProductAccountingProfile
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SupersedeAccountingProfileHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SupersedeAccountingProfileHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Supersede loan product chart of accounts
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/supersede-loan-product-chart-of-accounts
  /api/v1/loan-products/{id}/accounting-profiles/supersessions/sweeps:
    post:
      description: "Moves every live contract's balances onto the accounts the product's new chart names, one posting per contract on the effective date, so no contract ends with its balance split across two accounts. Safe to rerun at any point, including after a crash halfway through: rerunning is the recovery procedure and records nothing the first pass already recorded. It carries the same permission as the supersession itself."
      operationId: sweepLoanProductChartBalanceTransfers
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: "Canonical idempotency request ID. Required: this request enqueues a posting per contract, and without a key a retry cannot be told apart from a second instruction."
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: "Canonical idempotency request ID. Required: this request enqueues a posting per contract, and without a key a retry cannot be told apart from a second instruction."
            examples:
              - 550e8400-e29b-41d4-a716-446655440004
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SweepChartBalanceTransfersHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SweepChartBalanceTransfersHumaBody"
          description: OK
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Settle a chart change onto every contract's balances
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/settle-a-chart-change-onto-every-contract-s-balances
  /api/v1/loan-products/{id}/activate:
    post:
      description: Transitions a loan product to active status and pins the active product version.
      operationId: activateLoanProduct
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ActivateLoanProductHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Activate loan product
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/activate-loan-product
  /api/v1/loan-products/{id}/charges:
    post:
      description: Applies one product-version charge template to a loan account and persists an immutable charge fact.
      operationId: createLoanProductCharges
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Canonical idempotency key for safe retries.
          in: header
          name: X-Idempotency
          required: true
          schema:
            description: Canonical idempotency key for safe retries.
            examples:
              - 550e8400-e29b-41d4-a716-446655440004
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ApplyLoanChargeHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanChargeHumaBody"
          description: Created
          headers:
            X-Idempotency-Replayed:
              description: "\"true\" when this response replays a request already executed under the same X-Idempotency, so nothing ran a second time and no money moved again. Absent on a first execution."
              schema:
                type: string
        "400":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: "The at-most-once contract refused the request before any handler ran: no X-Idempotency header (IDEMPOTENCY_KEY_REQUIRED), a key under a spelling this service does not read (IDEMPOTENCY_KEY_HEADER_UNKNOWN), or a request that could not be scoped to a tenant (IDEMPOTENCY_TENANT_REQUIRED). The code is in the problem document's `code` member."
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Apply inherited loan product charge
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product-charges
  /api/v1/loan-products/{id}/floating-rates:
    get:
      description: Resolves the product-version rate mode and effective floating-rate period for the requested as-of date.
      operationId: listLoanProductFloatingRates
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: Loan product version identifier.
          explode: false
          in: query
          name: productVersionId
          required: true
          schema:
            description: Loan product version identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440001
            format: uuid
            type: string
        - description: As-of date (YYYY-MM-DD).
          explode: false
          in: query
          name: asOf
          required: true
          schema:
            description: As-of date (YYYY-MM-DD).
            examples:
              - "2026-06-14"
            format: date
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/FloatingRateTableHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get loan product floating rate table
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/list-loan-product-floating-rates
  /api/v1/loan-products/{id}/promote:
    post:
      description: Repoints a LIVE loan product at another of its versions. New loan applications originate on the promoted version from this moment; every contract and every application already in flight keeps the version it was born on, and its schedule, pricing and charges go on being read from that version. The product must already be active — activation is the door its first version comes through — and the version must be one of this product's own.
      operationId: promoteLoanProductVersion
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PromoteLoanProductVersionHumaInputBody"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Promote a loan product version to current
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/promote-a-loan-product-version-to-current
  /api/v1/loan-products/{id}/versions:
    post:
      description: Creates a new version snapshot of a loan product with updated regulatory parameters.
      operationId: createLoanProductVersion
      parameters:
        - description: Loan product identifier.
          in: path
          name: id
          required: true
          schema:
            description: Loan product identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLoanProductVersionHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LoanProductVersionHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create loan product version
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-loan-product-version
  /api/v1/loan-products/{productId}/document-templates:
    get:
      description: Returns the version history for the given kind, newest first.
      operationId: listDocumentTemplates
      parameters:
        - description: Owning loan product identifier.
          in: path
          name: productId
          required: true
          schema:
            description: Owning loan product identifier.
            format: uuid
            type: string
        - description: Credit-instrument kind.
          explode: false
          in: query
          name: kind
          required: true
          schema:
            description: Credit-instrument kind.
            enum:
              - ccb
            type: string
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: List document template versions
      tags:
        - DocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/list-document-template-versions
    post:
      description: Creates a new DRAFT credit-instrument document template version for a loan product.
      operationId: createDocumentTemplate
      parameters:
        - description: Owning loan product identifier.
          in: path
          name: productId
          required: true
          schema:
            description: Owning loan product identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateDocumentTemplateHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Create document template draft
      tags:
        - DocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/create-document-template-draft
  /api/v1/loan-products/{productId}/document-templates/active:
    get:
      description: Returns the currently active published template version for the given kind; 404 when the product has none.
      operationId: getActiveDocumentTemplate
      parameters:
        - description: Owning loan product identifier.
          in: path
          name: productId
          required: true
          schema:
            description: Owning loan product identifier.
            format: uuid
            type: string
        - description: Credit-instrument kind.
          explode: false
          in: query
          name: kind
          required: true
          schema:
            description: Credit-instrument kind.
            enum:
              - ccb
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get active document template
      tags:
        - DocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/get-active-document-template
  /api/v1/loan-products/{productId}/document-templates/{templateId}:
    get:
      description: Returns one template version by id.
      operationId: getDocumentTemplate
      parameters:
        - description: Owning loan product identifier.
          in: path
          name: productId
          required: true
          schema:
            description: Owning loan product identifier.
            format: uuid
            type: string
        - description: Template version identifier.
          in: path
          name: templateId
          required: true
          schema:
            description: Template version identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get document template version
      tags:
        - DocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/get-document-template-version
  /api/v1/loan-products/{productId}/document-templates/{templateId}/publish:
    post:
      description: Publishes a draft version, atomically superseding whatever version was previously active.
      operationId: publishDocumentTemplate
      parameters:
        - description: Owning loan product identifier.
          in: path
          name: productId
          required: true
          schema:
            description: Owning loan product identifier.
            format: uuid
            type: string
        - description: Template version identifier to publish.
          in: path
          name: templateId
          required: true
          schema:
            description: Template version identifier to publish.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DocumentTemplateHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Publish document template
      tags:
        - DocumentTemplates
      x-mint:
        href: /pt/reference/products/lender/publish-document-template
  /api/v1/me:
    get:
      description: Returns the validated subject of the bearer token and the caller's effective permissions in 'resource:action' form.
      operationId: getSession
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SessionBody"
          description: OK
          headers:
            Cache-Control:
              schema:
                description: "Always no-store: the session projection is per-caller and must never be cached by an intermediary."
                type: string
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Error
      summary: Get current session
      tags:
        - Session
      x-mint:
        href: /pt/reference/products/lender/get-current-session
  /api/v1/rate-tables:
    get:
      description: Returns a page of floating-rate table headers, newest first. The effective-dated curve is returned only by the detail endpoint.
      operationId: listRateTables
      parameters:
        - description: Page size.
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size.
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateTableListHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List floating-rate tables
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/list-floating-rate-tables
    post:
      description: Registers a floating-rate curve by name. The curve starts empty; periods are appended to it.
      operationId: createRateTable
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateRateTableHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateTableHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Create floating-rate table
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/create-floating-rate-table
  /api/v1/rate-tables/{id}:
    get:
      description: Returns one floating-rate table with its full effective-dated curve, oldest period first.
      operationId: getRateTable
      parameters:
        - description: Floating-rate table identifier.
          in: path
          name: id
          required: true
          schema:
            description: Floating-rate table identifier.
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateTableDetailHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get floating-rate table
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/get-floating-rate-table
  /api/v1/rate-tables/{id}/periods:
    post:
      description: "Adds the next period to a curve and closes the open one at the instant before this one opens. A curve is append-only in time: the effective date must be strictly after every period already on it, nothing is ever edited, and nothing is ever deleted."
      operationId: appendRateTablePeriod
      parameters:
        - description: Floating-rate table identifier.
          in: path
          name: id
          required: true
          schema:
            description: Floating-rate table identifier.
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AppendRateTablePeriodHumaInputBody"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RateTablePeriodHumaBody"
          description: Created
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Append floating-rate period
      tags:
        - LoanProducts
      x-mint:
        href: /pt/reference/products/lender/append-floating-rate-period
  /api/v1/returned-payment-receivables:
    get:
      description: Lists debts opened when a payment was given back on a contract that could not take it back — typically a payroll-deducted loan whose exclusion had been issued to the rail and not rejected. These are collected outside the credit operation and carry no payroll mandate. Narrow by contract, by borrower or by status.
      operationId: listReturnedPaymentReceivables
      parameters:
        - description: List only what one contract left behind.
          explode: false
          in: query
          name: loanAccountId
          schema:
            description: List only what one contract left behind.
            examples:
              - 550e8400-e29b-41d4-a716-446655440000
            format: uuid
            type: string
        - description: List only what one person owes, across contracts.
          explode: false
          in: query
          name: borrowerId
          schema:
            description: List only what one person owes, across contracts.
            examples:
              - 550e8400-e29b-41d4-a716-446655440020
            format: uuid
            type: string
        - description: Narrow to open, collected or written-off debts. All three are returned when absent.
          explode: false
          in: query
          name: status
          schema:
            description: Narrow to open, collected or written-off debts. All three are returned when absent.
            enum:
              - open
              - collected
              - written_off
            type: string
        - description: Page size (1-100, default 25).
          explode: false
          in: query
          name: limit
          schema:
            default: 25
            description: Page size (1-100, default 25).
            format: int64
            maximum: 100
            minimum: 1
            type: integer
        - description: Page offset.
          explode: false
          in: query
          name: offset
          schema:
            default: 0
            description: Page offset.
            format: int64
            maximum: 10000
            minimum: 0
            type: integer
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ListReturnedPaymentReceivablesHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: List returned payment receivables
      tags:
        - Returned Payment Receivables
      x-mint:
        href: /pt/reference/products/lender/list-returned-payment-receivables
  /api/v1/returned-payment-receivables/{id}:
    get:
      description: Returns one returned-payment receivable. A debt the asking identity may not see answers 404.
      operationId: getReturnedPaymentReceivable
      parameters:
        - description: Returned-payment receivable identifier.
          in: path
          name: id
          required: true
          schema:
            description: Returned-payment receivable identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            format: uuid
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReturnedPaymentReceivableHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Get returned payment receivable
      tags:
        - Returned Payment Receivables
      x-mint:
        href: /pt/reference/products/lender/get-returned-payment-receivable
  /api/v1/returned-payment-receivables/{id}/collections:
    post:
      description: Records that the borrower paid the whole debt by other means, closing it and booking the mirror of the entry that opened it. Redelivering the same X-Request-ID answers the collection that already stands; a different request against a collected debt is refused.
      operationId: collectReturnedPaymentReceivable
      parameters:
        - description: Returned-payment receivable identifier.
          in: path
          name: id
          required: true
          schema:
            description: Returned-payment receivable identifier.
            examples:
              - 550e8400-e29b-41d4-a716-446655440003
            format: uuid
            type: string
        - description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
          in: header
          name: X-Request-ID
          schema:
            description: Canonical idempotency request ID. Falls back to X-Idempotency when absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440010
            type: string
        - description: Fallback idempotency request ID used when X-Request-ID is absent.
          in: header
          name: X-Idempotency
          schema:
            description: Fallback idempotency request ID used when X-Request-ID is absent.
            examples:
              - 550e8400-e29b-41d4-a716-446655440011
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CollectReturnedPaymentReceivableHumaRequest"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReturnedPaymentReceivableHumaBody"
          description: OK
        "401":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unauthorized
        "403":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Forbidden
        "404":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Not Found
        "409":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Conflict
        "422":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Unprocessable Entity
        "500":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Internal Server Error
        "503":
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Service Unavailable
        default:
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Detail"
          description: Any other status this operation may carry, rendered as a problem document — including a refusal produced ahead of the service, such as a gateway or ingress answering on its behalf.
      summary: Record a returned payment receivable collection
      tags:
        - Returned Payment Receivables
      x-mint:
        href: /pt/reference/products/lender/record-a-returned-payment-receivable-collection
security:
  - BearerAuth: []
servers:
  - url: https://lender.sandbox.lerian.net
tags:
  - description: "Caller session projection: validated subject and effective permissions for the presented token."
    name: Session
  - description: "Ledger accounting operations: journal entries and accrual postings for loan accounts."
    name: Accounting
  - description: "Loan application intake and lifecycle: submission, decisioning, and status."
    name: LoanApplications
  - description: "Loan product catalog: definition, versioning, and activation of lending products."
    name: LoanProducts
  - description: "Loan account servicing operations: balances, schedules, and account-level actions."
    name: Loan Accounts
  - description: "Portfolio dashboard read operations: aggregated portfolio and performance views."
    name: Dashboard
  - description: "Jurisdiction registry: supported jurisdiction profiles and their capabilities."
    name: Jurisdictions
  - description: Jurisdiction-specific loan application operations (Brazil origination surface).
    name: Loan Applications
  - description: Tax computation operations for jurisdiction-specific lending (e.g. Brazil IOF).
    name: Tax
  - description: "Brazil consignado privado operations: contract lifecycle, exclusion repair, and compensating adjustments."
    name: Consignado
  - description: "Credit-instrument document template registry: versioned drafting and publication of CCB clausulado."
    name: DocumentTemplates
