AltScore
Credit Management System (CMS)

Refinancing API

This API allows managing the debt refinancing process in the system. It provides endpoints to simulate and schedule refinancing of existing debts.

Endpoints

Simulate Refinancing

Simulates a refinancing for a specific debt.

POST /v1/refinancing/{debtId}/simulation

Path Parameters:

ParameterDescription
debtIdID of the debt to refinance

Request Body:

The body must contain a RefinancingTerms object with the proposed terms for refinancing.

Example Request:

{
  "principal": {
    "amount": "10000.00",
    "currency": "USD"
  },
  "repayEvery": 30,
  "interestRate": {
    "rate": "12.50",
    "period": 360
  },
  "installments": 12,
  "amortizationType": "equal_total",
  "startDate": "2023-07-01",
  "interestTax": 5.0,
  "penalties": [
    {
      "chargeCode": "late_payment",
      "gracePeriod": 5,
      "rate": {
        "rate": "2.00",
        "period": 30
      },
      "computeEvery": 30,
      "timesToCompute": 3,
      "enabled": true
    }
  ]
}

Successful Response:

The response will be a Flow object representing the refinancing simulation.

Schedule Refinancing

Schedules a refinancing for a specific debt.

POST /v1/refinancing/{debtId}

Path Parameters:

ParameterDescription
debtIdID of the debt to refinance

Request Body:

The body must contain a ScheduleRefinancing object with the details of the scheduled refinancing.

Example Request:

{
  "terms": {
    "principal": {
      "amount": "10000.00",
      "currency": "USD"
    },
    "repayEvery": 30,
    "interestRate": {
      "rate": "12.50",
      "period": 360
    },
    "installments": 12,
    "amortizationType": "equal_total",
    "startDate": "2023-07-01",
    "interestTax": 5.0,
    "penalties": [
      {
        "chargeCode": "late_payment",
        "gracePeriod": 5,
        "rate": {
          "rate": "2.00",
          "period": 30
        },
        "computeEvery": 30,
        "timesToCompute": 3,
        "enabled": true
      }
    ]
  },
  "commitedPaymentDate": "2023-07-15",
  "initialPayment": {
    "amount": "1000.00",
    "currency": "USD"
  },
  "waivers": {
    "amount": {
      "amount": "500.00",
      "currency": "USD"
    },
    "breakdown": {
      "principal": {
        "amount": "300.00",
        "currency": "USD"
      },
      "interest": {
        "amount": "200.00",
        "currency": "USD"
      },
      "fees": {
        "amount": "0.00",
        "currency": "USD"
      },
      "penalties": {
        "amount": "0.00",
        "currency": "USD"
      }
    },
    "notes": "Special refinancing agreement"
  }
}

The ScheduleRefinancing object contains the following elements:

  • terms: The terms of the refinancing (RefinancingTerms object).
  • commitedPaymentDate: The committed date for the initial payment.
  • initialPayment: The initial payment of the refinancing (Money object).
  • waivers: The waivers applied in the refinancing (RefinancingWaivers object).

Successful Response:

Status code 202 (Accepted) when a refinancing is scheduled.

Error Handling

The API may return the following error codes:

CodeDescription
400Invalid request
404Debt not found
412Requirements for refinancing not met

Errors will include a descriptive message in the response body.

Objects

RefinancingTerms

Represents the terms of the refinancing.

AttributeDescriptionType
principalPrincipal amount of the refinancingMoney object
repayEveryNumber of days between paymentsInteger
interestRateInterest rate of the refinancingPeriodicRate object
installmentsNumber of installmentsInteger
amortizationTypeType of amortizationString
startDateStart date of the refinancingString (date)
interestTaxInterest tax rateNumber
penaltiesList of penalty policiesArray of PenaltyPolicy objects

RefinancingWaivers

Represents the waivers applied in a refinancing.

AttributeDescriptionType
amountTotal waiver amountMoney object
breakdownWaiver breakdown by componentComponents object
notesNotes about the waiverString

Money

Represents a monetary amount.

AttributeDescriptionType
amountAmountString
currencyCurrency codeString

PeriodicRate

Represents a periodic rate.

AttributeDescriptionType
rateNominal rateString
periodPeriod in daysInteger

PenaltyPolicy

Represents a penalty policy.

AttributeDescriptionType
chargeCodeCharge codeString
gracePeriodGrace period in daysInteger
ratePenalty ratePeriodicRate object
computeEveryFrequency of calculation in daysInteger
timesToComputeNumber of times to calculateInteger
enabledIndicates if the penalty is activeBoolean

Components

Represents the components of an amount.

AttributeDescriptionType
principalPrincipal amountMoney object
interestInterest amountMoney object
feesFees amountMoney object
penaltiesPenalties amountMoney object

On this page