> ## 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.

# Preview amortisation schedule

> 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.



## OpenAPI

````yaml /pt/openapi/v3-current/lender.yaml post /api/v1/loan-applications/preview-schedule
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.
    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
paths:
  /api/v1/loan-applications/preview-schedule:
    post:
      tags:
        - LoanApplications
      summary: Preview amortisation schedule
      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
components:
  schemas:
    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
    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
    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
    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
    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.