Lean Technologies Credit Assessments (New) API

The Credit Assessments (New) API from Lean Technologies — 1 operation(s) for credit assessments (new).

OpenAPI Specification

lean-technologies-credit-assessments-new-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Consents Account On File Account Controls (New) Account Controls (New) Credit Assessments (New) API
  version: v0.2.3
servers:
- url: https://sandbox.leantech.me
  description: Sandbox
- url: https://api2.leantech.me
  description: Production
security:
- bearerAuth: []
tags:
- name: Credit Assessments (New)
paths:
  /insights/v3/credit-assessments:
    servers: []
    get:
      operationId: getCreditAssessments
      summary: Get Credit Assessments
      description: "Aggregates income, expenses, and balance into pre-computed credit indicators for DBR, affordability ratio, \nnet cashflow, and max installment capacity. This endpoint offers configuration capabilities in order to fit and calibrate to your credit policy."
      parameters:
      - name: entity_id
        in: query
        description: The `entity_id` you're querying for.
        required: true
        schema:
          type: string
          format: uuid
      - name: start_date
        in: query
        description: The start date in UTC (in the format YYYY-MM-DD) of the analysis window. When omitted, defaults to the earliest transaction available for the entity.
        required: false
        schema:
          type: string
          format: date
        x-field-extra-annotation: '@jakarta.validation.constraints.PastOrPresent'
      - name: end_date
        in: query
        description: The end date in UTC (in the format YYYY-MM-DD) of the analysis window (inclusive — transactions on this date are included). When omitted, defaults to the current time.
        required: false
        schema:
          type: string
          format: date
        x-field-extra-annotation: '@jakarta.validation.constraints.PastOrPresent'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                allOf:
                - properties:
                    insights:
                      $ref: '#/components/schemas/CreditAssessmentPayload'
                    type:
                      $ref: '#/components/schemas/InsightsResultType'
                  type: object
              examples:
                GetCreditAssessments:
                  summary: Successful credit assessment response
                  value:
                    status: OK
                    results_id: b2c3d4e5-f6a7-8901-bcde-f12345678901
                    message: Data successfully retrieved
                    timestamp: '2026-03-01T12:00:00Z'
                    type: credit-assessments
                    insights:
                      credit_assessments:
                        income:
                          employment_income:
                            total_amount:
                              currency: AED
                              amount: 31200
                            average_monthly_amount:
                              currency: AED
                              amount: 5200
                            contribution_factor: 1
                            contributed_average_monthly_income:
                              currency: AED
                              amount: 5200
                          other_income:
                            breakdown:
                            - source: GIG_ECONOMY
                              total_amount:
                                currency: AED
                                amount: 3000
                              average_monthly_amount:
                                currency: AED
                                amount: 500
                              contribution_factor: 0.5
                              contributed_average_monthly_income:
                                currency: AED
                                amount: 250
                          total_contributed_average_monthly_income:
                            currency: AED
                            amount: 5450
                        expenses:
                          average_monthly_credit_repayments:
                            currency: AED
                            amount: 900
                          average_monthly_essential_expenses:
                            currency: AED
                            amount: 2200
                          average_monthly_discretionary_expenses:
                            currency: AED
                            amount: 1300
                          average_monthly_total_expenses:
                            currency: AED
                            amount: 4400
                          defined_essential_categories:
                          - RENT
                          - TRANSPORTATION
                        balance:
                          average_balance:
                            currency: AED
                            amount: 4200
                          minimum_balance:
                            currency: AED
                            amount: 800
                          maximum_balance:
                            currency: AED
                            amount: 7200
                        computed_indicators:
                          average_monthly_net_cashflow:
                            currency: AED
                            amount: 1050
                          dbr:
                            rate: 0.165
                            ceiling: 0.5
                            maximum_monthly_installment:
                              currency: AED
                              amount: 1825
                          affordability:
                            rate: 0.569
                            ceiling: 0.7
                            maximum_monthly_installment:
                              currency: AED
                              amount: 2349
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightsResult'
              examples:
                InvalidParametersExample:
                  $ref: '#/components/examples/InsightsInvalidParametersExample'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightsResult'
              examples:
                UserPermissionsNotGrantedExample:
                  $ref: '#/components/examples/InsightsUserPermissionsNotGrantedExample'
                ConsentExpiredExample:
                  $ref: '#/components/examples/InsightsConsentExpiredExample'
                TransactionRangeNotGrantedExample:
                  $ref: '#/components/examples/InsightsTransactionRangeNotGrantedExample'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightsResult'
              examples:
                UnknownEntityExample:
                  $ref: '#/components/examples/InsightsUnknownEntityExample'
                DataNotFoundExample:
                  $ref: '#/components/examples/InsightsDataNotFoundExample'
        '408':
          description: Request Timeout
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightsResult'
              examples:
                TimeoutExample:
                  $ref: '#/components/examples/InsightsTimeoutExample'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsightsResult'
              examples:
                InternalServerErrorExample:
                  $ref: '#/components/examples/InsightsInternalServerErrorExample'
      tags:
      - Credit Assessments (New)
      x-spring-response-entity: true
components:
  schemas:
    CashFlowNet:
      type: object
      properties:
        overall_amount:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        net_cashflow:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
    CashBalanceTotal:
      type: object
      properties:
        average_balance:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        initial_balance:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        current_balance:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        available_balance:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        frequency_of_contributions:
          description: How often deposits are made to the account
          type: string
    CreditObligationsV2:
      description: Lender-oriented view of credit activity, split into repayments and disbursements.
      type: object
      properties:
        repayments:
          description: Aggregated credit repayment activity (e.g. BNPL instalments, loan repayments).
          allOf:
          - $ref: '#/components/schemas/CreditObligationsRepayments'
        disbursements:
          description: Aggregated credit disbursement activity (loans received).
          allOf:
          - $ref: '#/components/schemas/CreditObligationsDisbursements'
      additionalProperties: false
      required:
      - repayments
      - disbursements
    CreditDebitBehaviour:
      type: object
      properties:
        periods:
          type: array
          items:
            $ref: '#/components/schemas/CreditDebitBehaviourPeriod'
      required:
      - periods
    CashflowPatterns:
      description: Cashflow pattern analysis results.
      type: object
      properties:
        cashflow_patterns:
          description: List of identified cashflow patterns.
          type: array
          items:
            $ref: '#/components/schemas/CashflowPattern'
      required:
      - cashflow_patterns
    CreditAssessmentComputedIndicators:
      description: Derived financial indicators used in credit assessment decisions.
      type: object
      properties:
        average_monthly_net_cashflow:
          description: Average monthly net cashflow (weighted income minus total expenses).
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        dbr:
          description: monthly credit obligations ÷ weighted monthly income, with the lender's configurable ceiling (default 0.45) and the maximum new installment affordable before that ceiling
          allOf:
          - $ref: '#/components/schemas/CreditAssessmentRatioIndicator'
        affordability:
          description: (essential expenses + credit obligations) ÷ weighted monthly income over configured essential categories, with the lender's configurable ceiling (default 0.70) and the maximum new installment affordable before that ceiling.
          allOf:
          - $ref: '#/components/schemas/CreditAssessmentRatioIndicator'
      additionalProperties: false
      required:
      - average_monthly_net_cashflow
      - dbr
      - affordability
    CurrencyAmount:
      type: object
      properties:
        currency:
          $ref: '#/components/schemas/Currency'
        amount:
          description: The amount of money in the currency specified.
          type: number
      required:
      - currency
      - amount
    InsightsResultType:
      description: type of insight
      type: string
      enum:
      - income
      - employment
      - cashflow
      - credits-obligations
      - non-credits-obligations
      - expenses
      - cash-balances
      - freelancer-cashflow
      - behaviors
      - cashflow-patterns
      - credit-assessments
      - account-controls
      - credit-obligations
    NonCreditObligationsMonthlyAmount:
      type: object
      properties:
        month:
          description: The month name (e.g., "September", "October")
          type: string
        amount:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
    Result:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/ResultStatus'
        results_id:
          description: The unique identifier for the request
          type: string
          format: uuid
        message:
          description: A message describing the status of the request
          type: string
        meta:
          description: Meta information about the request
          type:
          - object
          - 'null'
          additionalProperties:
            type: string
        timestamp:
          description: The datetime of when the request was made
          type: string
          format: date-time
        status_detail:
          description: Additional information about the status
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/StatusDetail'
      required:
      - status
      - results_id
      - message
      - timestamp
    CashFlowCategoryAmountCount:
      type: object
      properties:
        category:
          description: The category of the cash flow
          type: string
        amount:
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        count:
          description: The count of transactions in this category
          type: integer
    EmploymentDetails:
      type: object
      properties:
        bank_employer_name:
          description: The name of the employer as it appears in bank transaction descriptions. This is the raw employer name extracted directly from salary payment transaction records.
          type:
          - string
          - 'null'
        matched_reference_employer:
          description: Information about the verified employer entity that matched with the bank employer name. Value will be NULL if no matching stored in our database
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/EmployerDetails'
          required:
          - name
          - cr_number
        salary_consistent:
          description: Boolean indicator that determines if the salary payments from this employer follow a consistent pattern. true indicates stable payment patterns, while false indicates irregularity. This is calculated by comparing both date and amount variances against predefined thresholds (typically 5 days for dates and 1000 currency units for amounts).
          type:
          - boolean
          - 'null'
        salary_date_variance:
          description: A statistical measure of the variability in the timing of salary payments, expressed as the standard deviation of intervals (in days) between consecutive salary payments. Lower values indicate more consistent payment timing. A value of 0 means all payments were made at exactly the same interval.
          type:
          - number
          - 'null'
          format: double
          x-java-type: java.math.BigDecimal
        salary_amount_variance:
          description: A statistical measure of the variability in salary payment amounts, expressed as the standard deviation of payment amounts. Lower values indicate more consistent payment amounts. A value of 0 means all payments were exactly the same amount.
          type:
          - number
          - 'null'
          format: double
          x-java-type: java.math.BigDecimal
        first_salary_date:
          description: The timestamp of the earliest detected salary payment from this employer. This indicates when the employment relationship began or when the earliest available transaction record starts.
          type:
          - string
          - 'null'
          format: date-time
          x-java-type: java.time.Instant
      required:
      - bank_employer_name
      - matched_reference_employer
      - salary_consistent
      - salary_date_variance
      - salary_amount_variance
      - first_salary_date
    CreditObligationsRepayments:
      description: Repayment aggregates and breakdown by lender_name, credit_type.
      type: object
      properties:
        overall:
          description: Overall repayment summary across all lenders.
          allOf:
          - $ref: '#/components/schemas/CreditObligationsOverall'
        breakdown:
          description: One entry per lender that received repayments.
          type: array
          items:
            $ref: '#/components/schemas/CreditObligationsRepaymentBreakdown'
      additionalProperties: false
      required:
      - overall
      - breakdown
    CreditAssessmentOtherIncomeBreakdownItem:
      description: A single non-employment income source with its contribution details.
      type: object
      properties:
        source:
          description: The income source type.
          allOf:
          - $ref: '#/components/schemas/IncomeSourceType'
        total_amount:
          description: Total amount from this income source over the analysis period.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_amount:
          description: Average monthly amount from this income source.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        contribution_factor:
          description: Factor applied to weight this income source in the overall income calculation. Range is 0.0 to 1.0.
          type: number
        contributed_average_monthly_income:
          description: Weighted average monthly amount after applying the contribution factor.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
      additionalProperties: false
      required:
      - source
      - total_amount
      - average_monthly_amount
      - contribution_factor
      - contributed_average_monthly_income
    CurrentCreditCardsBalance:
      type: object
      properties:
        amount:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
    BehavioralMerchantBreakdown:
      description: Aggregate stats for one merchant.
      type: object
      properties:
        merchant_name:
          description: Merchant name.
          type: string
        transaction_count:
          description: Number of transactions with this merchant.
          type: integer
        total_amount:
          description: Total spend with this merchant.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_transaction_amount:
          description: Average transaction amount with this merchant.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_transactions:
          description: Average monthly transaction count for this merchant across the full analysis window.
          type: number
          format: double
          x-java-type: java.math.BigDecimal
        average_monthly_transactions_active:
          description: Average monthly transaction count for this merchant across active months only.
          type: number
          format: double
          x-java-type: java.math.BigDecimal
        average_monthly_amount:
          description: Average monthly spend with this merchant across the full analysis window.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_amount_active:
          description: Average monthly spend with this merchant across active months only.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        first_transaction_date:
          description: Timestamp of the first transaction with this merchant.
          type: string
          format: date-time
        last_transaction_date:
          description: Timestamp of the most recent transaction with this merchant.
          type: string
          format: date-time
        active_months:
          description: Number of months with at least one transaction with this merchant.
          type: integer
      required:
      - merchant_name
      - transaction_count
      - total_amount
      - average_transaction_amount
      - average_monthly_transactions
      - average_monthly_transactions_active
      - average_monthly_amount
      - average_monthly_amount_active
      - first_transaction_date
      - last_transaction_date
      - active_months
    IncomeMonthlyTotal:
      type: object
      properties:
        month:
          description: The month of the reporting period
          type: integer
          format: int32
        year:
          description: The year of the reporting period
          type: integer
          format: int32
        amount:
          description: The total amount of transactions in the Month
          type: number
        count:
          description: Number of transactions in the month
          type: integer
          format: int32
        is_month_complete:
          description: Indicates whether the data for this month is complete
          type: boolean
      x-class-extra-annotation: '@lombok.AllArgsConstructor'
      x-toBuilder: true
    CreditAssessmentBalance:
      description: Balance statistics over the analysis period.
      type: object
      properties:
        average_balance:
          description: Average account balance over the analysis period.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        minimum_balance:
          description: Minimum account balance observed during the analysis period.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        maximum_balance:
          description: Maximum account balance observed during the analysis period.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
      additionalProperties: false
      required:
      - average_balance
      - minimum_balance
      - maximum_balance
    IncomeSourceType:
      description: Classification of income source type (combined enum for all income sources)
      type: string
      enum:
      - EMPLOYMENT
      - RETIREMENT
      - HOUSING_BENEFIT
      - GIG_ECONOMY
      - UNEMPLOYMENT
      - RENTAL
      - TRANSFER_FROM_OWN_APPLICATION
      - STUDENT_STIPEND
      - INVESTMENTS
      - CITIZEN_ACCOUNT
      - SOCIAL_SECURITY
      - SIDE_BUSINESS
      - BONUS
      - CASH_DEPOSIT
    BigPayments:
      type: object
      properties:
        periods:
          type: array
          items:
            $ref: '#/components/schemas/BigPaymentsPeriod'
      required:
      - periods
    CreditObligationsV2Payload:
      description: Insights payload wrapper carrying the lender-oriented credit-obligations
      type: object
      properties:
        credit_obligations:
          description: Lender-oriented credit obligations insights.
          allOf:
          - $ref: '#/components/schemas/CreditObligationsV2'
      additionalProperties: false
      required:
      - credit_obligations
    BehaviorsMerchantSection:
      description: Merchant breakdown with detected-merchant count.
      type: object
      properties:
        detected_merchant_count:
          description: Number of distinct merchants detected.
          type: integer
        transaction_count:
          description: Total number of classifiable debit transactions in the analysis window.
          type: integer
        breakdown:
          description: One entry per detected merchant.
          type: array
          items:
            $ref: '#/components/schemas/BehavioralMerchantBreakdown'
      required:
      - detected_merchant_count
      - transaction_count
      - breakdown
    CreditAssessmentRatioIndicator:
      description: A ratio-based credit indicator including the computed rate, regulatory ceiling, and derived maximum installment.
      type: object
      properties:
        rate:
          description: The computed ratio as a decimal between 0 and 1.
          type: number
        ceiling:
          description: The regulatory or policy ceiling for this ratio as a decimal between 0 and 1.
          type: number
        maximum_monthly_installment:
          description: The maximum monthly installment the entity can afford based on this ratio and its ceiling.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
      additionalProperties: false
      required:
      - rate
      - ceiling
      - maximum_monthly_installment
    EmployerDetails:
      type: object
      properties:
        name:
          description: Official name of the employer in English and Arabic.
          allOf:
          - $ref: '#/components/schemas/Translation'
        cr_number:
          description: Employer’s Commercial Registration (CR) number.
          type:
          - integer
          - 'null'
          format: int64
    FreelancerInflowsOutflows:
      type: object
      properties:
        total_amount:
          description: Total amount of inflows/outflows
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        transactions_count:
          description: Total number of transactions
          type: integer
        periods:
          description: Historical data for different periods
          type: array
          items:
            $ref: '#/components/schemas/FreelancerPeriodFactors'
    CreditObligationsMonthlyTotal:
      type: object
      properties:
        month:
          description: The month number (1-12)
          type: integer
          format: int32
        year:
          description: The year
          type: integer
          format: int32
        is_month_complete:
          description: Indicates if the month has complete data
          type: boolean
        loan_repayments:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/AmountCount'
        loan_received:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/AmountCount'
        credit_cards_repayments:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/AmountCount'
        credit_cards_spending:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/AmountCount'
        credit_cards_balance:
          type:
          - object
          - 'null'
          allOf:
          - $ref: '#/components/schemas/BalanceInsights'
    ExpensesMonthlyAmount:
      type: object
      properties:
        month:
          description: 'Number of month within the year (e.g.: January is represented as 1 and December is represented as 12)'
          type: integer
          format: int32
        year:
          description: Year
          type: integer
          format: int32
        amount:
          description: Total expenses for the month
          type: number
          x-java-type: java.math.BigDecimal
      required:
      - amount
    CreditObligationsOverall:
      description: Aggregate totals across all lenders for a credit activity type.
      type: object
      properties:
        transaction_count:
          description: Total number of transactions across all lenders.
          type: integer
        total_amount:
          description: Total amount across all transactions.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_amount:
          description: Total amount divided by the number of months in the full analysis window.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_amount_active:
          description: Total amount divided by the number of months that had at least one transaction.
          allOf:
          - $ref: '#/components/schemas/CurrencyAmount'
        average_monthly_transactions:
          description: Average number of transactions per month across the full analysis window (all months, not just active months).
          type: number
          format: double
          x-java-type: java.math.BigDecimal
        active_months:
          description: Number of months that contained at least one transaction.
          type: integer
        lender_count:
          description: Number of distinct lender organizations detected.
          type: integer
        lender_organizations:
          description: Distinct lender organization names detected.
          type: array
          items:
            type: string
      additionalProperties: false
      required:
      - transaction_count
      - total_amount
      - average_monthly_amount
      - average_monthly_amount_active
      - average_monthly_transactions
      - active_months
      - lender_count
      - lender_organizations
    Expenses:
      type: object
      properties:
        currency:
          description: The 3 Letter ISO code denominating the currency that the salary is provided in. This will be local currency (AED in UAE).
          type: string
        total:
          description: Insights on the expenses since start_date.
          allOf:
          - $ref: '#/components/schemas/ExpensesTotal'
        monthly_totals:
          description: Total expenses for all months from start_date until today.
          type: array
          items:
            $ref: '#/components/schemas/MonthlyTotalExpenses'
        transactions:
          description: List of expense transactions (internal use only, not serialized in API response)
          type: array
          items:
            $ref: '#/components/schemas/ExpensesTransaction'
          x-field-extra-annotation: '@com.fasterxml.jackson.annotation.JsonIgnore'
      additionalProperties: false
      required:
      - currency
      - total
      - monthly_totals
      - transactions
    IncomeTotal:
      type: object
      properties:
        amount:
          description: The total amount of transactions
          type: number
        count:
          description: The total number of transactions within the time period.
          type: integer
          format: int32
        last_date_time:
          description: End date for transactions range
          type: string
          format: date-time
        first_date_time:
          description: Start date for transactions range
          type: string
          format: date-time
        average_monthly_amount:
          description: The average of all transaction amounts per month within the time period.
          type: number
        average_monthly_count:
          description: The average number of transactions per month within the period.
          type: number
        average_monthly_received_value:
          description: The average received value calculated as total amount divided by the count of months that had income (excluding zero months).
          type: number
        maximum_monthly_amount:
          description: Maximum monthly transaction amount within the period.
          allOf:
          - $ref: '#/components/schemas/MonthlyAmount'
        minimum_monthly_amount:
          description: Minimum monthly transaction amount within the period.
          allOf:
          - $ref: '#/components/schemas/MonthlyAmount'
      x-toBuilder: true
    AccountControls:
      description: 'Account Controls assessment of a connected account: config-independent observable signals, configurable threshold-gate flags, and an aggregated eligibility verdict for underwriting decisions.'
      type: object
      properties:
        signals:
          $ref: '#/components/schemas/AccountControlsSignals'
        thresholds:
          $ref: '#/components/schemas/AccountControlsThresholds'
        verdict:
          $ref: '#/components/schemas/AccountControlsVerdict'
      additionalProperties: false
      required:
      - signals
      - thresholds
      - verdict
    IncomeTransaction:
      type: object
      properties:
        account_id:
          description: The account ID associated with the transaction
          type: string
          format: uuid
        transaction_id:
          description: The unique transaction identifier
          type: string
        transaction_information:
          description: Additional information about the transaction
          type: string
        booking_date_time:
          description: The date and time when the transaction was booked
          type: string
          format: date-time
        amount:
          description: The transaction amount
          type: number
        income_source:
          $ref: '#/components/schemas/IncomeSourceDetails'
      required:
      - account_id
      - transaction_id
 

# --- truncated at 32 KB (92 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/lean-technologies/refs/heads/main/openapi/lean-technologies-credit-assessments-new-api-openapi.yml