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

# Preview a repayment schedule

> Calculates a schedule without creating a loan. Same body as Originate a loan.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/lms/loans/calculate-schedule
openapi: 3.1.0
info:
  title: Bridge API
  version: 1.0.0
  description: >-
    Bridge is Banking-as-a-Service: launch wallets, lending, and payment
    collections while a bank/FSP retains custody and compliance. This reference
    covers the production-proven surface. Get a `keyId`/`secret` from the
    Dashboard, exchange them at `/generate-token` for a 1-hour Bearer token,
    then call the product APIs.


    **Auth recovery:** tokens expire after ~1h. On a 401, re-call
    `/generate-token` and retry once.
servers:
  - url: https://{baasHost}/api
    description: BaaS core (KYC, Lending, Wallets)
    variables:
      baasHost:
        default: services.finance.reli.co.tz
  - url: https://{gatewayHost}/api
    description: >-
      Collections gateway (payment collection) — a separate service and key from
      the BaaS core.
    variables:
      gatewayHost:
        default: bridge-fsp.usereli.tech
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Exchange API keys for a Bearer token.
  - name: KYC
    description: Customers and identity. KYC is the authoritative customer store.
  - name: Lending
    description: Loan products, origination, schedules, and repayments.
  - name: Wallets
    description: Stored-value wallets, deposits, and escrow.
  - name: Collections
    description: Mobile (USSD) payment collection. Separate service + key.
paths:
  /v1/lms/loans/calculate-schedule:
    post:
      tags:
        - Lending
      summary: Preview a repayment schedule
      description: >-
        Calculates a schedule without creating a loan. Same body as Originate a
        loan.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateLoanRequest'
      responses:
        '200':
          description: Schedule preview
          content:
            application/json:
              example:
                currency:
                  code: TZS
                  decimalPlaces: 2
                periods:
                  - period: 1
                    dueDate: '2026-04-15'
                    principalDue: 33333.33
                    interestDue: 2500
                    totalDueForPeriod: 35833.33
components:
  schemas:
    CreateLoanRequest:
      type: object
      required:
        - productCode
        - principal
      properties:
        customerId:
          type: string
          format: uuid
        productCode:
          type: string
        principal:
          type: number
          description: Loan principal amount (e.g. 100000).
        numberOfRepayments:
          type: integer
        repaymentEvery:
          type: integer
        repaymentFrequency:
          type: string
          enum:
            - DAYS
            - WEEKS
            - MONTHS
            - YEARS
        interestRatePerPeriod:
          type: number
        expectedDisbursementDate:
          type: string
          description: yyyy-MM-dd
        linkWalletId:
          type: string
          format: uuid
          description: 'Strategy B: attach an existing wallet.'
        createWalletProductCode:
          type: string
          description: >-
            Strategy C: auto-provision a wallet + auto-sweep standing
            instruction. Temporarily unavailable — open a wallet and use
            linkWalletId instead.
        fspFundId:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token from POST /generate-token. Expires ~1h; on 401, re-generate
        and retry once.

````