Calcular Tabela de Amortização (Sem IOF)
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
Campo | Tipo | Descrição |
---|---|---|
interest_rate | number | Valor da taxa de juros. No formato "0.0000" |
present_value | number | Valor atual |
number_of_payments | number | Número de pagamentos |
payment_dates[] | string | Array com lista de datas. No formato "YYYY-MM-DD" |
Requisição
POST https://api-sandbox.catalisa.com.br/calc-engine/api/loan-amortization-schedule-calculator/calculationsParâmetros
Sem parâmetros
Cabeçalhos
Nome | Valor |
---|---|
Authorization | Bearer <token> |
Content-Type | application/json |
Exemplo de Requisição
Corpo da Requisição
{
"data": {
"type": "calculations",
"attributes": {
"interest_rate": 0.0465,
"present_value": 10000,
"number_of_payments": 6,
"payment_dates": [
"2023-10-18",
"2023-11-18",
"2023-12-18",
"2024-01-18",
"2024-02-18",
"2024-03-18"
]
}
}
}
Respostas
Código | Descrição |
---|---|
201 | Criado com sucesso. Retorna os dados calculados. |
401 | Não autorizado |
Exemplo de uso
- Javascript
- CURL
const headers = new Headers();
headers.append("Authorization", "Bearer <token>");
headers.append("Content-Type", "application/json");
const body = JSON.stringify({
data: {
type: "calculations",
attributes: {
interest_rate: 0.0465,
present_value: 10000,
number_of_payments: 6,
payment_dates: [
"2023-10-18",
"2023-11-18",
"2023-12-18",
"2024-01-18",
"2024-02-18",
"2024-03-18"
]
}
}
});
const requestOptions = {
method: "POST",
headers: headers,
body: body,
};
const response = await fetch(
"https://api-sandbox.catalisa.com.br/calc-engine/api/loan-amortization-schedule-calculator/calculations",
requestOptions
);
const data = await response.json();
console.log(data);
curl --location 'https://api-sandbox.catalisa.com.br/calc-engine/api/loan-amortization-schedule-calculator/calculations' \
--header 'Authorization: Bearer <token>' \
--data '{
"data": {
"type": "calculations",
"attributes": {
"interest_rate": 0.0465,
"present_value": 10000,
"number_of_payments": 6,
"payment_dates": [
"2023-10-18",
"2023-11-18",
"2023-12-18",
"2024-01-18",
"2024-02-18",
"2024-03-18"
]
}
}
}'
Exemplo de Sucesso
{
"data": {
"id": "ab843bc3-b945-4647-a21f-df60ed7e8a9a",
"type": "calculations",
"attributes": {
"amortization_schedule": [
{
"payment_number": 1,
"payment_date": "2023-10-18",
"beginning_balance": 10000,
"payment": 1948.17748,
"principal_payment": 1483.17748,
"interest_payment": 465,
"remaining_balance": 8516.8225
},
{
"payment_number": 2,
"payment_date": "2023-11-18",
"beginning_balance": 8516.82252,
"payment": 1948.17748,
"principal_payment": 1552.14523,
"interest_payment": 396.03225,
"remaining_balance": 6964.6773
},
{
"payment_number": 3,
"payment_date": "2023-12-18",
"beginning_balance": 6964.67729,
"payment": 1948.17748,
"principal_payment": 1624.31999,
"interest_payment": 323.85749,
"remaining_balance": 5340.3573
},
{
"payment_number": 4,
"payment_date": "2024-01-18",
"beginning_balance": 5340.3573,
"payment": 1948.17748,
"principal_payment": 1699.85087,
"interest_payment": 248.32661,
"remaining_balance": 3640.5064
},
{
"payment_number": 5,
"payment_date": "2024-02-18",
"beginning_balance": 3640.50643,
"payment": 1948.17748,
"principal_payment": 1778.89393,
"interest_payment": 169.28355,
"remaining_balance": 1861.6125
},
{
"payment_number": 6,
"payment_date": "2024-03-18",
"beginning_balance": 1861.6125,
"payment": 1948.17748,
"principal_payment": 1861.6125,
"interest_payment": 86.56498,
"remaining_balance": 0
}
]
}
}
}