POST
/v1/emi/schedule- Authentication
- Bearer token
- Scope
lending:calc
Before you integrate
- The last instalment is adjusted by a few paise so the balance ends at exactly 0.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
principal_minor | integer | Yes | Loan amount in paise; above 0. |
annual_rate_pct | number | Yes | Interest rate in percent a year, from 0 to 100. |
months | integer | Yes | Number of monthly instalments, from 1 to 600. |
Sample code
Set your key in the GRAPPI_API_KEY environment variable. Sample values are placeholders.
curl -sS -X POST 'https://grappi.ai/v1/emi/schedule' \
-H "Authorization: Bearer $GRAPPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"principal_minor": 10000000,
"annual_rate_pct": 12,
"months": 12
}'Sample response
{
"request_id": "req_01HZY3K8M2",
"result": {
"emi_minor": 3400221,
"total_interest_minor": 200664,
"total_payment_minor": 10200664,
"schedule": [
{
"month": 1,
"emi_minor": 3400221,
"principal_minor": 3300221,
"interest_minor": 100000,
"balance_minor": 6699779
},
{
"month": 2,
"emi_minor": 3400221,
"principal_minor": 3333223,
"interest_minor": 66998,
"balance_minor": 3366556
},
{
"month": 3,
"emi_minor": 3400222,
"principal_minor": 3366556,
"interest_minor": 33666,
"balance_minor": 0
}
]
}
}Response fields
| Field | Type | Description |
|---|---|---|
emi_minor | integer | Monthly instalment in paise. |
total_interest_minor | integer | Interest over the whole loan in paise. |
total_payment_minor | integer | Principal plus interest in paise. |
schedule | array | One row per month. |
schedule[].month | integer | Month number, starting at 1. |
schedule[].emi_minor | integer | Instalment paid that month, in paise. |
schedule[].principal_minor | integer | Part of the instalment that repays principal, in paise. |
schedule[].interest_minor | integer | Part of the instalment that is interest, in paise. |
schedule[].balance_minor | integer | Loan balance left after the instalment, in paise. |
Errors
Every failure has the same shape. A call that fails on our side or at the data source is refunded to your wallet; a "no record found" answer is charged. See the error reference.