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.
Path Parameters:
| Parameter | Description |
|---|---|
| debtId | ID of the debt to refinance |
Request Body:
The body must contain a RefinancingTerms object with the proposed terms for refinancing.
Example Request:
Successful Response:
The response will be a Flow object representing the refinancing simulation.
Schedule Refinancing
Schedules a refinancing for a specific debt.
Path Parameters:
| Parameter | Description |
|---|---|
| debtId | ID of the debt to refinance |
Request Body:
The body must contain a ScheduleRefinancing object with the details of the scheduled refinancing.
Example Request:
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:
| Code | Description |
|---|---|
| 400 | Invalid request |
| 404 | Debt not found |
| 412 | Requirements for refinancing not met |
Errors will include a descriptive message in the response body.
Objects
RefinancingTerms
Represents the terms of the refinancing.
| Attribute | Description | Type |
|---|---|---|
| principal | Principal amount of the refinancing | Money object |
| repayEvery | Number of days between payments | Integer |
| interestRate | Interest rate of the refinancing | PeriodicRate object |
| installments | Number of installments | Integer |
| amortizationType | Type of amortization | String |
| startDate | Start date of the refinancing | String (date) |
| interestTax | Interest tax rate | Number |
| penalties | List of penalty policies | Array of PenaltyPolicy objects |
RefinancingWaivers
Represents the waivers applied in a refinancing.
| Attribute | Description | Type |
|---|---|---|
| amount | Total waiver amount | Money object |
| breakdown | Waiver breakdown by component | Components object |
| notes | Notes about the waiver | String |
Money
Represents a monetary amount.
| Attribute | Description | Type |
|---|---|---|
| amount | Amount | String |
| currency | Currency code | String |
PeriodicRate
Represents a periodic rate.
| Attribute | Description | Type |
|---|---|---|
| rate | Nominal rate | String |
| period | Period in days | Integer |
PenaltyPolicy
Represents a penalty policy.
| Attribute | Description | Type |
|---|---|---|
| chargeCode | Charge code | String |
| gracePeriod | Grace period in days | Integer |
| rate | Penalty rate | PeriodicRate object |
| computeEvery | Frequency of calculation in days | Integer |
| timesToCompute | Number of times to calculate | Integer |
| enabled | Indicates if the penalty is active | Boolean |
Components
Represents the components of an amount.
| Attribute | Description | Type |
|---|---|---|
| principal | Principal amount | Money object |
| interest | Interest amount | Money object |
| fees | Fees amount | Money object |
| penalties | Penalties amount | Money object |