FTOS_BP_Simulate
Returns a simulation from PaymentSchedule with different parameters.
Syntax
The FTOS_BP_Simulate custom endpoint is called from within the Endpoint API endpoint. Visit the Endpoint API page for more details.
Copy
POST <host_address>/ftosapi/automation-processors/actions/ftos_bp_simulate
Content-Type: application/json
{
"productCode": "<product_code>",
"amount": <contract_amount>,
"downPayment": <downpayment_amount>,
"loanPeriod": <loan_periods_number>,
"interestTypeName": "<name_of_interest_type>",
"interestType": "<id_of_interest_type>",
"scheduleType": "<name_of_schedule_type>",
"optional": [
{
"Name": "<discount_name>",
"ProductDiscountId": "<product_discount_id>"
}
],
"discount": [],
"jsonFilterCommission": [{
"name": "<filter_name>",
"value": <filter_value>
}],
"jsonInsuranceFilter": [],
"jsonDiscountFilter": [],
"installmentValue": <manual_value_for_installment>,
"principalValue": <manual_value_for_principal>
}
Here's a list of the available parameters:
| Parameter | Description |
|---|---|
| host_address | URL of the FintechOS Platform server. |
| productCode | Mandatory, string. The code of the banking product. |
| amount | Mandatory, numeric. The amount of the contract. |
| loanPeriod | Mandatory, whole number. The number of periods for the loan contract. |
| scheduleType | Mandatory, string. The name of the schedule type. |
| downPayment | Optional, numeric. The amount of the contract's downpayment. |
| interestType | Mandatory if jsonInputFormula or jsonMultipleInterestRates are sent with the request, string. The id of the interest type from the option set FTOS_BP_InterestType corresponding to one of the values: Fixed, Variable, Collection, BankingFormula. |
| interestTypeName | Optional, string. The name of the interest type: Fixed, Variable, Collection, BankingFormula. |
| optional | Optional, json object. A list of selected optional product features, for example: Copy |
| discount | Optional, json object. A list of selected optional product discounts, for example: Copy |
| jsonFilterCommission | Optional, json object. A list of interest/ commission filter, for example: Copy |
| jsonInsuranceFilter | Optional, json object. A list of insurance filter, for example: Copy |
| jsonDiscountFilter | Optional, json object. A list of discount filter, for example: Copy |
| jsonInputFormula | Optional, json object. It is usually provided when interest type is BankingFormula or Collection and represents the formula input json (just like test formula). It can contain inputs for interest/commission/insurance/discount. For example, when the interestType = BankingFormula, the interestInput parameter is an object holding the input attributes used for calculating the formula that determines the interest: Copy |
| jsonMultipleInterestRates | Optional, json object. Used when interest type is Collection, for example: Copy where: "InterestRate": 8.000000 is the interest percent defined as interest type = Collection on the banking product/ Dimensions /InterestList /Interest, and "FromInstNo" and "ToInstNo" are the from and to installment numbers defined as interest type = Collection on the banking product/ Dimensions/ InterestList/ Interest. |
| installmentValue | Optional, numeric. The desired value of the installment. This parameter is available starting with Banking Product Factory v3.2. |
| principalValue | Optional, numeric. The desired value of the principal. This parameter is available starting with Banking Product Factory v3.2. |
Response
The response is an object with details about a the simulation of a payment schedule.
Example
To view the details of a payment schedule simulation for a loan contract with fixed interest type, discount and a filter on commissions, send the following request, changing the id of the product with the one you need.
Request
Copy
POST https://your_FintechOS_server/ftosapi/automation-processors/actions/ftos_bp_simulate
Content-Type: application/json
{
"productCode": "TL_ADV",
"amount": 500000,
"downPayment": 75000,
"loanPeriod": 12,
"interestTypeName": "Fixed",
"scheduleType": "Equal Installment Monthly 360",
"optional": [],
"discount": [{
"Name": "Advanced Loan Discount - 1",
"ProductCode": "TL_ADV"
}],
"jsonFilterCommission": [{
"name": "Varsta",
"value": 21
}],
"jsonInsuranceFilter": [],
"jsonDiscountFilter": [],
"installmentValue": 0.00,
"principalValue": 0.00
}
Response
Copy
{
"Records": [
{
"InterestPercent": "7.50%",
"IRR": "56.53%",
"FirstInstallment": 36871.9,
"FirstInsurance": 0,
"TotalInsurance": 0,
"FirstFee": 0,
"TotalFee": 0,
"Total": 442562.83,
"ScheduleJson": "{"paymentSchedule":[{"InstallmentNo":0,"remainingValue":500000.00,"pMT":0.00,"interest":0.00,"principal":75000.00,"managementFee":0.00,"totalInstallment":75000.00},{"InstallmentNo":1,"remainingValue":425000.00,"pMT":36871.90,"interest":2656.25,"principal":34215.65,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":2,"remainingValue":390784.35,"pMT":36871.90,"interest":2442.40,"principal":34429.50,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":3,"remainingValue":356354.85,"pMT":36871.90,"interest":2227.22,"principal":34644.68,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":4,"remainingValue":321710.17,"pMT":36871.90,"interest":2010.69,"principal":34861.21,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":5,"remainingValue":286848.96,"pMT":36871.90,"interest":1792.81,"principal":35079.09,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":6,"remainingValue":251769.87,"pMT":36871.90,"interest":1573.56,"principal":35298.34,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":7,"remainingValue":216471.53,"pMT":36871.90,"interest":1352.95,"principal":35518.95,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":8,"remainingValue":180952.58,"pMT":36871.90,"interest":1130.95,"principal":35740.95,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":9,"remainingValue":145211.63,"pMT":36871.90,"interest":907.57,"principal":35964.33,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":10,"remainingValue":109247.30,"pMT":36871.90,"interest":682.80,"principal":36189.10,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":11,"remainingValue":73058.20,"pMT":36871.90,"interest":456.61,"principal":36415.29,"managementFee":0.00,"totalInstallment":36871.90},{"InstallmentNo":12,"remainingValue":36642.91,"pMT":36871.90,"interest":229.02,"principal":36642.91,"managementFee":0.00,"totalInstallment":36871.93}]}",
"InterestId": "b552fdd6-ccb7-4411-8430-33f674781d9f",
"InterestListId": "e653e179-f1f8-44ce-a53a-e036aeca820b",
"cntInterestId": 2,
"InterestCommissionItemId": "0cfae970-0d14-422c-8dff-21a50f920df9",
"cntInterestCommissionItemId": 1,
"CommissionListId": "8cb2c666-6798-4e77-9860-3d374c6273f0",
"OutputInterestJson": "{"BaseInterestPercent":7.5000, "InterestDiscountValue":0.00, "InterestDiscountPercent":0.00}",
"OutputCommissionJson": "[{"Name":"MgmtFee", "Value":10.00, "Percent":null, "BaseValue":10.00, "BasePercent":null, "DiscountValue":0.00, "DiscountPercent":null, "ValueIsPercent":false, "CurrencyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "FeePeriodicityType":"Monthly", "FeeDate":"2021-12-21", "FeeId":"09E86821-B6BE-41AC-AE89-2A89FFB91AAD", "IsUpfront":null},{"Name":"New Contract Version Commission", "Value":100.00, "Percent":null, "BaseValue":100.00, "BasePercent":null, "DiscountValue":0.00, "DiscountPercent":null, "ValueIsPercent":false, "CurrencyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "FeePeriodicityType":"Once", "FeeDate":"2021-12-21", "FeeId":"ADE99FD8-5503-4F8C-A33B-8D9F7E4D8FBC", "IsUpfront":null},{"Name":"Admin Fee", "Value":null, "Percent":0.25, "BaseValue":null, "BasePercent":0.25, "DiscountValue":null, "DiscountPercent":0.00, "ValueIsPercent":true, "CurrencyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "FeePeriodicityType":"Monthly", "FeeDate":"2021-12-21", "FeeId":"D1D7B353-091D-4D26-B340-DDDD08EE8B69", "IsUpfront":null},{"Name":"Commission Applied To Amount", "Value":null, "Percent":10.00, "BaseValue":null, "BasePercent":10.00, "DiscountValue":null, "DiscountPercent":0.00, "ValueIsPercent":true, "CurrencyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "FeePeriodicityType":"Monthly", "FeeDate":"2021-12-21", "FeeId":"D9DF08B6-0291-46E9-A333-E0FC971AC49A", "IsUpfront":null},{"Name":"Commission to Remaining Value", "Value":null, "Percent":0.00, "BaseValue":null, "BasePercent":10.00, "DiscountValue":null, "DiscountPercent":0.00, "ValueIsPercent":true, "CurrencyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "FeePeriodicityType":"Once", "FeeDate":"2021-12-21", "FeeId":"759DCC59-2451-415F-8F84-F6EE3FB1976E", "IsUpfront":null}]",
"OutputInsuranceJson": "[{"Name":"LifeInsurance EUR", "Value":20.00, "Percent":null, "BaseValue":20.00, "BasePercent":null, "DiscountValue":0.00, "DiscountPercent":null, "ValueIsPercent":false, "CurrenctyId":"8CD87C03-A97A-40ED-A31F-7ADCD5ED7764", "InsurancePeriodicityType": "Monthly", "InsuranceDate":"2021-12-21", "InsuranceId":"993C0494-8CC1-4374-8595-523F768C9EE5", "IsUpfront":null}]"
}
],
"ReturnValue": 0
}