API reference / Lending

EMI / amortization

Amortization schedule, EMI, total interest.

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

FieldTypeRequiredDescription
principal_minorintegerYesLoan amount in paise; above 0.
annual_rate_pctnumberYesInterest rate in percent a year, from 0 to 100.
monthsintegerYesNumber 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

FieldTypeDescription
emi_minorintegerMonthly instalment in paise.
total_interest_minorintegerInterest over the whole loan in paise.
total_payment_minorintegerPrincipal plus interest in paise.
schedulearrayOne row per month.
schedule[].monthintegerMonth number, starting at 1.
schedule[].emi_minorintegerInstalment paid that month, in paise.
schedule[].principal_minorintegerPart of the instalment that repays principal, in paise.
schedule[].interest_minorintegerPart of the instalment that is interest, in paise.
schedule[].balance_minorintegerLoan 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.