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

# Calculate Lifetime Expected Credit Loss

> Calculates Lifetime Expected Credit Loss (ECL) for Stage 2 and Stage 3 financial assets under IFRS 9. Uses time-series curves of PD, EAD, and discount rates over the expected life of the instrument. Formula: sum over all periods of (PD_t * LGD * EAD_t * discount_factor_t). Lifetime ECL captures all expected credit losses over the remaining life of the instrument. Use this for Stage 2 (SICR) and Stage 3 (credit-impaired) loan loss provisioning and financial reporting. [Tier: ENTERPRISE, Credits: 10]



## OpenAPI

````yaml api-specs/regulatory.json post /quantlib/regulatory/ifrs9/ecl-lifetime
openapi: 3.1.0
info:
  title: FinceptQuantLib API - Regulatory
  description: >-
    Pro-tier regulatory compliance and capital adequacy endpoints covering Basel
    III capital ratios and RWA calculations, SA-CCR counterparty credit risk
    exposure metrics, IFRS 9 expected credit loss provisioning, liquidity
    coverage ratios (LCR/NSFR), and stress testing capital projections. All
    endpoints require Pro tier access and consume 5 credits per request.
  version: 3.0.0
  contact:
    name: Fincept API Support
    url: https://fincept.in
servers:
  - url: https://api.fincept.in
    description: Fincept API Production Server
security:
  - APIKeyHeader: []
tags:
  - name: quantlib-regulatory
    description: >-
      Regulatory compliance and capital adequacy calculations for Basel III,
      SA-CCR, IFRS 9, liquidity ratios, and stress testing. Pro tier required.
    x-displayName: Regulatory
paths:
  /quantlib/regulatory/ifrs9/ecl-lifetime:
    post:
      tags:
        - quantlib-regulatory
      summary: Calculate Lifetime Expected Credit Loss
      description: >-
        Calculates Lifetime Expected Credit Loss (ECL) for Stage 2 and Stage 3
        financial assets under IFRS 9. Uses time-series curves of PD, EAD, and
        discount rates over the expected life of the instrument. Formula: sum
        over all periods of (PD_t * LGD * EAD_t * discount_factor_t). Lifetime
        ECL captures all expected credit losses over the remaining life of the
        instrument. Use this for Stage 2 (SICR) and Stage 3 (credit-impaired)
        loan loss provisioning and financial reporting. [Tier: ENTERPRISE,
        Credits: 10]
      operationId: ifrs9_ecl_lifetime
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - pd_curve
                - lgd
                - ead_curve
                - discount_rates
              properties:
                pd_curve:
                  type: array
                  description: >-
                    Probability of Default for each period over the life of the
                    instrument (e.g., annual PDs for a 5-year loan)
                  items:
                    type: number
                    minimum: 0
                    maximum: 1
                  example:
                    - 0.015
                    - 0.02
                    - 0.025
                    - 0.03
                    - 0.035
                lgd:
                  type: number
                  description: Loss Given Default (0-1) - assumed constant over life
                  minimum: 0
                  maximum: 1
                  example: 0.45
                ead_curve:
                  type: array
                  description: >-
                    Exposure at Default for each period (may decrease for
                    amortizing loans or increase for revolving facilities)
                  items:
                    type: number
                  example:
                    - 1000000
                    - 800000
                    - 600000
                    - 400000
                    - 200000
                discount_rates:
                  type: array
                  description: >-
                    Discount rates (effective interest rate) for each period for
                    present value calculation
                  items:
                    type: number
                  example:
                    - 0.055
                    - 0.055
                    - 0.055
                    - 0.055
                    - 0.055
            examples:
              stage2_amortizing_loan:
                summary: Stage 2 - Amortizing corporate loan
                value:
                  pd_curve:
                    - 0.015
                    - 0.02
                    - 0.025
                    - 0.03
                    - 0.035
                  lgd: 0.45
                  ead_curve:
                    - 1000000
                    - 800000
                    - 600000
                    - 400000
                    - 200000
                  discount_rates:
                    - 0.055
                    - 0.055
                    - 0.055
                    - 0.055
                    - 0.055
              stage3_deteriorating:
                summary: Stage 3 - Credit impaired with high PD
                value:
                  pd_curve:
                    - 0.25
                    - 0.3
                    - 0.35
                  lgd: 0.6
                  ead_curve:
                    - 500000
                    - 500000
                    - 500000
                  discount_rates:
                    - 0.08
                    - 0.08
                    - 0.08
      responses:
        '200':
          description: Lifetime ECL calculated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      lifetime_ecl:
                        type: number
                        description: Total lifetime Expected Credit Loss (present value)
                        example: 65250
              examples:
                result:
                  summary: Lifetime ECL calculation
                  value:
                    success: true
                    data:
                      lifetime_ecl: 65250
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/InsufficientCreditsError'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  responses:
    UnauthorizedError:
      description: Authentication information is missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Invalid API key
    InsufficientCreditsError:
      description: Insufficient API credits to complete request
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: string
                example: Insufficient credits. This endpoint requires 5 credits.
    ValidationError:
      description: Request validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              detail:
                type: array
                items:
                  type: object
                  properties:
                    loc:
                      type: array
                      items:
                        type: string
                    msg:
                      type: string
                    type:
                      type: string
          example:
            detail:
              - loc:
                  - body
                  - cet1_capital
                msg: field required
                type: value_error.missing
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Get your key at
        https://api.fincept.in/auth/register

````