Pular para o conteúdo principal

12 parcelas

Segurança

Para acessar a API, é necessário obter um token de acesso através do fluxo de autenticação OAuth2. Veja mais detalhes em Como obter acesso?

info

Ao gerar o token JWT, não esqueça de utilizar o escopo correto. Caso contrário, a requisição será rejeitada com o código de erro 401 Unauthorized.

Descrição dos campos

CampoTipoDescrição
additional_iof_ratenumberValor do IOF. No formato "0.0038"
daily_iof_ratenumberValor do IOF diário. No formato "0.000082"
contract_datestringData do contrato. No formato "YYYY-MM-DD"
amortization_schedule[].payment_numbernumberNúmero do pagamento
amortization_schedule[].payment_datestringData do pagamento. No formato "YYYY-MM-DD"
amortization_schedule[].beginning_balancenumberValor inicial
amortization_schedule[].paymentnumberValor do pagamento
amortization_schedule[].principal_paymentnumberValor principal
amortization_schedule[].interest_paymentnumberValor do juros
amortization_schedule[].remaining_balancenumberValor restante

Requisição

POST https://api-sandbox.catalisa.com.br/calc-engine/api/loan-iof-calculator/calculations JWT scope: calculations-engine/calculate

Parâmetros

Sem parâmetros

Cabeçalhos

NomeValor
AuthorizationBearer <token>
Content-Typeapplication/json

Exemplo de Requisição

Corpo da Requisição

{
"data": {
"type": "calculations",
"attributes": {
"additional_iof_rate": 0.0038,
"daily_iof_rate": 0.000082,
"contract_date": "2023-01-01",
"amortization_schedule": [
{
"payment_number": 1,
"payment_date": "2023-07-22",
"beginning_balance": 5000,
"payment": 974.08874,
"principal_payment": 741.58874,
"interest_payment": 232.5,
"remaining_balance": 4258.4113
},
{
"payment_number": 2,
"payment_date": "2023-08-22",
"beginning_balance": 4258.41126,
"payment": 974.08874,
"principal_payment": 776.07262,
"interest_payment": 198.01612,
"remaining_balance": 3482.3386
},
{
"payment_number": 3,
"payment_date": "2023-09-22",
"beginning_balance": 3482.33864,
"payment": 974.08874,
"principal_payment": 812.15999,
"interest_payment": 161.92875,
"remaining_balance": 2670.1787
},
{
"payment_number": 4,
"payment_date": "2023-10-22",
"beginning_balance": 2670.17865,
"payment": 974.08874,
"principal_payment": 849.92543,
"interest_payment": 124.16331,
"remaining_balance": 1820.2532
},
{
"payment_number": 5,
"payment_date": "2023-11-22",
"beginning_balance": 1820.25322,
"payment": 974.08874,
"principal_payment": 889.44697,
"interest_payment": 84.64177,
"remaining_balance": 930.8063
},
{
"payment_number": 6,
"payment_date": "2023-12-22",
"beginning_balance": 930.80625,
"payment": 974.08874,
"principal_payment": 930.80625,
"interest_payment": 43.28249,
"remaining_balance": 0
}
]
}
}
}

Respostas

CódigoDescrição
201Criado com sucesso. Retorna os dados da tabela de amortização.
401Não autorizado

Exemplo de uso

const headers = new Headers();
headers.append("Authorization", "Bearer <token>");
headers.append("Content-Type", "application/json");

const body = JSON.stringify({
data: {
type: "calculations",
attributes: {
additional_iof_rate: 0.0038,
daily_iof_rate: 0.000082,
contract_date: "2023-01-01",
amortization_schedule: [
{
payment_number: 1,
payment_date: "2023-07-22",
beginning_balance: 5000,
payment: 974.08874,
principal_payment: 741.58874,
interest_payment: 232.5,
remaining_balance: 4258.4113
},
{
payment_number: 2,
payment_date: "2023-08-22",
beginning_balance: 4258.41126,
payment: 974.08874,
principal_payment: 776.07262,
interest_payment: 198.01612,
remaining_balance: 3482.3386
},
{
payment_number: 3,
payment_date: "2023-09-22",
beginning_balance: 3482.33864,
payment: 974.08874,
principal_payment: 812.15999,
interest_payment: 161.92875,
remaining_balance: 2670.1787
},
{
payment_number: 4,
payment_date: "2023-10-22",
beginning_balance: 2670.17865,
payment: 974.08874,
principal_payment: 849.92543,
interest_payment: 124.16331,
remaining_balance: 1820.2532
},
{
payment_number: 5,
payment_date: "2023-11-22",
beginning_balance: 1820.25322,
payment: 974.08874,
principal_payment: 889.44697,
interest_payment: 84.64177,
remaining_balance: 930.8063
},
{
payment_number: 6,
payment_date: "2023-12-22",
beginning_balance: 930.80625,
payment: 974.08874,
principal_payment: 930.80625,
interest_payment: 43.28249,
remaining_balance: 0
}
]
}
}
});

const requestOptions = {
method: "POST",
headers: headers,
body: body,
};

const response = await fetch(
"https://api-sandbox.catalisa.com.br/calc-engine/api/loan-iof-calculator/calculations",
requestOptions
);
const data = await response.json();
console.log(data);

Exemplo de Sucesso

{
"data": {
"id": "cc7188bc-ac02-463e-b9ee-211269989780",
"type": "calculations",
"attributes": {
"iof_total": 134.98249278504,
"iof_additional_total": 19,
"iof_financed_total": 138.72765368763535
}
}
}