> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Get active loan account

> Returns the active loan account detail read model. A malformed UUID yields 422 (schema error), distinct from 404 when the account does not exist.



## OpenAPI

````yaml /pt/openapi/v3-current/lender.yaml get /api/v1/loan-accounts/{id}
openapi: 3.1.0
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
servers:
  - url: https://lender.sandbox.lerian.net
security:
  - BearerAuth: []
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. Operations under /api/v1/internal are back-office
      operations for the client's operators: they require a person's login, and
      a service credential gets 403.
    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. Operations under /api/v1/internal
      are back-office operations for the client's operators: they require a
      person's login, and a service credential gets 403.
    name: Consignado
  - description: >-
      Inbound record quarantine. Operations under /api/v1/internal are
      back-office operations for the client's operators: they require a person's
      login, and a service credential gets 403.
    name: Streaming
  - description: >-
      Credit-instrument document template registry: versioned drafting and
      publication of CCB clausulado.
    name: DocumentTemplates
paths:
  /api/v1/loan-accounts/{id}:
    get:
      tags:
        - Loan Accounts
      summary: Get active loan account
      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
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Detail'
          description: Gateway Timeout
        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.
components:
  schemas:
    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.
            written_off: the institution wrote the contract off as a credit loss
            (Res. CMN 4.966 art. 49); irreversible. Only settled means the
            borrower discharged the debt — do not label any of the other five 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
            - written_off
          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
        replacementLoanAccountId:
          description: >-
            Present only when lifecycleState is renegotiated: the loan account a
            substantial renegotiation (Res. CMN 4.966 art. 22) opened in place
            of this one, which now carries the debt. Nothing was paid on this
            contract's last schedule; the debt moved to the replacement.
          examples:
            - 550e8400-e29b-41d4-a716-446655440040
          format: uuid
          type: string
        restructuring:
          $ref: '#/components/schemas/RestructuringClassHumaBody'
          description: >-
            The restructuring class recorded with this account's latest
            servicing renegotiation; omitted when none recorded one, which
            includes every renegotiation made before this capture existed. After
            a substantial renegotiation it sits on the account that was
            replaced. A consignado refinance records its class on the refinance
            lineage, not here.
        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
    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
    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,
            reversed means the disbursement was undone, and written_off means it
            was written off as a credit loss.
          enum:
            - current
            - overdue
            - unknown
          examples:
            - current
          type: string
      required:
        - state
      type: object
    RestructuringClassHumaBody:
      additionalProperties: false
      properties:
        defaultIsRestructuring:
          description: The default the Lender computed for this renegotiation.
          type: boolean
        isRestructuring:
          description: >-
            Whether the renegotiation is a restructuring (reestruturação, Res.
            CMN 4.966; forbearance), as recorded.
          type: boolean
        justification:
          description: >-
            The operator's written justification. Present exactly when
            isRestructuring differs from defaultIsRestructuring.
          type: string
        recordedAt:
          description: RFC 3339 UTC instant the class was recorded.
          examples:
            - '2026-06-14T12:00:00Z'
          type: string
        recordedBy:
          description: >-
            Authenticated subject that recorded the renegotiation; empty when
            the deployment runs without authentication.
          examples:
            - officer-xyz
          type: string
      required:
        - isRestructuring
        - defaultIsRestructuring
        - recordedBy
        - recordedAt
      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
    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
  securitySchemes:
    BearerAuth:
      bearerFormat: JWT
      description: JWT bearer token issued by the identity provider.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.