Skip to content

Lending · Calculation

Borrower loan schedules and two-loan comparison

Calculate monthly and annual repayment, extra principal, auto ownership costs, student deferment or ordinary business-loan coverage. Compare two named plans in the same loan family against a selected priority.

Example result · a.name: Flexible See output

Cost per success
1 calculation credit
Production plans
Standard, Business, Scale, Enterprise
Plan allowances
Free sandbox
Not available

Integration example

Make a request

Use a production key scoped to consumer-loan-scenarios.

Keep the key on your server. A successful call uses 1 calculation credit.

Production request

Set HT_PRODUCTION_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.

import { randomUUID } from "node:crypto";

const key = process.env.HT_PRODUCTION_KEY;
if (!key) throw new Error("Set HT_PRODUCTION_KEY on your server.");
const endpoint = "https://calc.hasstechapi.com/v2/calc/consumer-loan-scenarios";
const input = {
  "loanType": "PERSONAL",
  "a": {
    "scenarioName": "Flexible",
    "loanAmount": 1200,
    "loanTerm": 4,
    "interestRate": 0,
    "extraPayment": 100,
    "originationFee": 2
  },
  "b": {
    "scenarioName": "Shorter",
    "loanAmount": 1200,
    "loanTerm": 2,
    "interestRate": 0
  },
  "priority": "faster_payoff"
};
const requestId = process.env.HT_REQUEST_ID || Date.now() + "." + randomUUID();
// Keep this ID to look up usage if the connection is interrupted.
console.error("Usage lookup ID:", requestId);

const response = await fetch(endpoint, {
  method: "POST",
  redirect: "error",
  headers: {
    "Authorization": "Bearer " + key,
    "Content-Type": "application/json",
    "Idempotency-Key": requestId
  },
  body: JSON.stringify(input)
});
if (!response.ok) {
  const problem = await response.json().catch(() => null);
  const code = problem?.error?.code || response.statusText;
  const delay = response.headers.get("retry-after");
  if (delay) console.error("Retry-After (seconds):", delay);
  console.error("HTTP " + response.status + " " + code + ". Usage lookup ID: " + requestId);
  if (Array.isArray(problem?.error?.details)) {
    for (const issue of problem.error.details) console.error("Input issue:", JSON.stringify(issue));
  }
  process.exitCode = 1;
} else {
  console.log(JSON.stringify(await response.json(), null, 2));
}
cURL (shell)

Set HT_PRODUCTION_KEY on your server. Run in a POSIX shell with cURL 7.76+ and Python 3.7+ to create a request ID.

(
  set -eu
  : "${HT_PRODUCTION_KEY:?Set HT_PRODUCTION_KEY on your server}"
  request_id="${HT_REQUEST_ID:-}"
  if [ -z "$request_id" ]; then
    request_id=$(python3 -c 'import time, uuid; print(str(time.time_ns() // 1000000) + "." + str(uuid.uuid4()))')
  fi
  printf 'Usage lookup ID: %s\n' "$request_id" >&2
  # On INVALID_INPUT, read error.details in the JSON response body.
  curl --disable --silent --show-error --fail-with-body --include \
    --request POST 'https://calc.hasstechapi.com/v2/calc/consumer-loan-scenarios' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "loanType": "PERSONAL",
  "a": {
    "scenarioName": "Flexible",
    "loanAmount": 1200,
    "loanTerm": 4,
    "interestRate": 0,
    "extraPayment": 100,
    "originationFee": 2
  },
  "b": {
    "scenarioName": "Shorter",
    "loanAmount": 1200,
    "loanTerm": 2,
    "interestRate": 0
  },
  "priority": "faster_payoff"
}
HT_INPUT
)
If your request fails
400 INVALID_INPUT

Read error.details when present. Node prints each issue. cURL returns the JSON body. Each path points into your request. An empty path refers to the whole body.

Check the accepted inputs for required fields, units and ranges. Send the corrected JSON as a new request.

401 or 403
Check that the server has the bearer key for the endpoint’s environment and that the key includes consumer-loan-scenarios.
429
Read the service error code, check your allowance, and wait for the Retry-After interval when supplied before trying again.
Lost response, 409 or 503
Open Request lookup, select the same environment and enter the printed usage lookup ID. A settled ID has already consumed credits. To retry the same calculation, set HT_REQUEST_ID to the original ID and reuse the same inputs. A settled request does not return its result again. Unset the variable for a new request, which can consume credits.

The usage lookup ID is the Idempotency-Key your server sends. The response’s x-request-id identifies the HTTP exchange for support.

Output

Example result

These values come from running this operation on the example inputs.

a.name
Flexible
a.state
financed
a.figures.monthlyPayment
300 USD/month
How to interpret this result
  • Extra principal changes the monthly and annual payoff schedules. The base payment and the app’s auto true monthly cost exclude this optional extra.
  • Vehicle-equity checkpoints use baseline loan balances and the app depreciation curve. They are estimates. Interest on an unsubsidized student loan during deferment is capitalized before repayment.
  • Origination fees are withheld from personal and student proceeds. The business embed allows ordinary origination fees to be withheld or financed, and divides monthly net operating income by the required loan payment. Schedules start at repayment. A priority match uses the app’s materiality thresholds, with risk unknown.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "a": {
      "name": "Flexible",
      "state": "financed",
      "figures": {
        "monthlyPayment": 300,
        "loanAmount": 1200,
        "principal": 1200,
        "interest": 0,
        "feeFromProceeds": 24,
        "totalLoanCost": 1200,
        "trueMonthlyCost": null
      },
      "schedule": [
        {
          "month": 1,
          "interest": 0,
          "principal": 400,
          "remainingBalance": 800
        },
        {
          "month": 2,
          "interest": 0,
          "principal": 400,
          "remainingBalance": 400
        },
        {
          "month": 3,
          "interest": 0,
          "principal": 400,
          "remainingBalance": 0
        }
      ],
      "yearlySchedule": [
        {
          "year": 1,
          "totalInterest": 0,
          "totalPrincipal": 1200,
          "remainingBalance": 0
        }
      ],
      "extra": {
        "totalInterestPaidWithExtra": 0,
        "totalInterestPaidWithoutExtra": 0,
        "interestSaved": 0,
        "payoffTimeYears": 0,
        "payoffTimeMonths": 3,
        "originalPayoffYears": 0.3333333333333333,
        "timeSavedYears": 0,
        "timeSavedMonths": 1
      },
      "vehicleEquity": [],
      "netProceeds": 1176,
      "capitalizedInterest": 0,
      "vehicleCosts": null,
      "reportBaseline": {
        "months": 4,
        "interest": 0,
        "totalRepaid": 1200,
        "originationFee": 24,
        "halfPaidMonth": 2,
        "paymentSplits": [
          {
            "month": 1,
            "interest": 0,
            "principal": 300,
            "remainingBalance": 900
          },
          {
            "month": 2,
            "interest": 0,
            "principal": 300,
            "remainingBalance": 600
          },
          {
            "month": 4,
            "interest": 0,
            "principal": 300,
            "remainingBalance": 0
          }
        ],
        "upfrontTaxAndFees": 0,
        "feeTreatment": "withheld",
        "equityWindow": null
      },
      "businessCoverage": null,
      "halfPaidMonth": 2
    },
    "b": {
      "name": "Shorter",
      "state": "financed",
      "figures": {
        "monthlyPayment": 600,
        "loanAmount": 1200,
        "principal": 1200,
        "interest": 0,
        "feeFromProceeds": 0,
        "totalLoanCost": 1200,
        "trueMonthlyCost": null
      },
      "schedule": [
        {
          "month": 1,
          "interest": 0,
          "principal": 600,
          "remainingBalance": 600
        },
        {
          "month": 2,
          "interest": 0,
          "principal": 600,
          "remainingBalance": 0
        }
      ],
      "yearlySchedule": [
        {
          "year": 1,
          "totalInterest": 0,
          "totalPrincipal": 1200,
          "remainingBalance": 0
        }
      ],
      "extra": null,
      "vehicleEquity": [],
      "netProceeds": 1200,
      "capitalizedInterest": 0,
      "vehicleCosts": null,
      "reportBaseline": {
        "months": 2,
        "interest": 0,
        "totalRepaid": 1200,
        "originationFee": 0,
        "halfPaidMonth": 1,
        "paymentSplits": [
          {
            "month": 1,
            "interest": 0,
            "principal": 600,
            "remainingBalance": 600
          }
        ],
        "upfrontTaxAndFees": 0,
        "feeTreatment": "none",
        "equityWindow": null
      },
      "businessCoverage": null,
      "halfPaidMonth": 1
    },
    "comparison": {
      "tradeOffType": "trade_off",
      "priority": "faster_payoff",
      "verdictLabel": "Best fit for your priority",
      "verdictReason": "Scenario B is the better fit for a faster payoff by 1 months. This is a priority match, not a universal winner.",
      "priorityFit": "B",
      "riskComparison": "unknown",
      "horizonMonths": null,
      "breakEven": null,
      "metrics": [
        {
          "name": "monthlyDifference",
          "winner": "A",
          "delta": 200,
          "unit": "USD/month",
          "available": true,
          "materialityThreshold": 1,
          "valueA": "$400.00",
          "valueB": "$600.00",
          "formattedDelta": "$200.00"
        },
        {
          "name": "monthlyInterestDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "USD/month",
          "available": true,
          "materialityThreshold": 1,
          "valueA": "$0.00",
          "valueB": "$0.00",
          "formattedDelta": "$0.00"
        },
        {
          "name": "monthlyPrincipalDifference",
          "winner": "B",
          "delta": 300,
          "unit": "USD/month",
          "available": true,
          "materialityThreshold": 1,
          "valueA": "$300.00",
          "valueB": "$600.00",
          "formattedDelta": "$300.00"
        },
        {
          "name": "upfrontDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "USD",
          "available": true,
          "materialityThreshold": 100,
          "valueA": "$0.00",
          "valueB": "$0.00",
          "formattedDelta": "$0.00"
        },
        {
          "name": "longTermDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "USD",
          "available": true,
          "materialityThreshold": 100,
          "valueA": "$0.00",
          "valueB": "$0.00",
          "formattedDelta": "$0.00"
        },
        {
          "name": "totalLoanCostDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "USD",
          "available": true,
          "materialityThreshold": 100,
          "valueA": "$1,200.00",
          "valueB": "$1,200.00",
          "formattedDelta": "$0.00"
        },
        {
          "name": "totalPrincipalDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "USD",
          "available": true,
          "materialityThreshold": 100,
          "valueA": "$1,200.00",
          "valueB": "$1,200.00",
          "formattedDelta": "$0.00"
        },
        {
          "name": "rateDifference",
          "winner": "Tie",
          "delta": 0,
          "unit": "percentage points",
          "available": true,
          "materialityThreshold": 0.01,
          "valueA": "0.00%",
          "valueB": "0.00%",
          "formattedDelta": "0.00 pp"
        },
        {
          "name": "timeDifference",
          "winner": "B",
          "delta": 1,
          "unit": "months",
          "available": true,
          "materialityThreshold": null,
          "valueA": 3,
          "valueB": 2,
          "formattedDelta": "1 months"
        }
      ],
      "presentation": {
        "optionALabel": "Flexible",
        "optionBLabel": "Shorter",
        "selectedPriority": "faster_payoff",
        "goalLabel": "Faster payoff",
        "priorityFit": "B",
        "priorityOutcome": "Pay off 1 months sooner",
        "title": "Shorter is the stronger fit for this goal",
        "summary": "Shorter leads on faster payoff by 1 months. This ranks the selected goal only.",
        "rows": [
          {
            "id": "payoffTiming",
            "factor": "Payoff timing",
            "helper": "How long the modeled balance remains outstanding",
            "isPriority": true,
            "optionA": {
              "value": "3 months",
              "detail": "Stays in debt longer by 1 months.",
              "tone": "give-up"
            },
            "optionB": {
              "value": "2 months",
              "detail": "Pays off sooner by 1 months.",
              "tone": "benefit"
            }
          },
          {
            "id": "monthlyPayment",
            "factor": "Monthly payment",
            "helper": "Recurring payment under the supplied assumptions",
            "isPriority": false,
            "optionA": {
              "value": "$400.00",
              "detail": "Lower monthly cost by $200.00.",
              "tone": "benefit"
            },
            "optionB": {
              "value": "$600.00",
              "detail": "Higher monthly cost by $200.00.",
              "tone": "give-up"
            }
          },
          {
            "id": "upfrontCash",
            "factor": "Upfront cash",
            "helper": "Cash due now, including supplied down payment and closing costs",
            "isPriority": false,
            "optionA": {
              "value": "$0.00",
              "detail": "No material difference on this factor.",
              "tone": "neutral"
            },
            "optionB": {
              "value": "$0.00",
              "detail": "No material difference on this factor.",
              "tone": "neutral"
            }
          },
          {
            "id": "lifetimeCost",
            "factor": "Lifetime cost / interest",
            "helper": "Modeled cost over the stated term or comparison horizon",
            "isPriority": false,
            "optionA": {
              "value": "$1,200.00",
              "detail": "No material difference on this factor.",
              "tone": "neutral"
            },
            "optionB": {
              "value": "$1,200.00",
              "detail": "No material difference on this factor.",
              "tone": "neutral"
            }
          },
          {
            "id": "breakEven",
            "factor": "Break-even",
            "helper": "When added upfront cash is recovered through monthly savings",
            "isPriority": false,
            "optionA": {
              "value": "No crossover modeled",
              "detail": "The supplied upfront and monthly figures do not create a usable break-even point.",
              "tone": "neutral"
            },
            "optionB": {
              "value": "No crossover modeled",
              "detail": "The supplied upfront and monthly figures do not create a usable break-even point.",
              "tone": "neutral"
            }
          },
          {
            "id": "riskAssumptions",
            "factor": "Risk & assumptions",
            "helper": "Loan features and estimates that can change the result",
            "isPriority": false,
            "optionA": {
              "value": "Needs review",
              "detail": "Verify rate type, fees, mortgage insurance, penalties, and expected holding period.",
              "tone": "neutral"
            },
            "optionB": {
              "value": "Needs review",
              "detail": "Verify rate type, fees, mortgage insurance, penalties, and expected holding period.",
              "tone": "neutral"
            }
          }
        ],
        "optionStories": {
          "A": {
            "benefits": [
              "Lower monthly cost by $200.00"
            ],
            "giveUps": [
              "Stays in debt longer by 1 months"
            ],
            "bestFitFor": [
              "Keeping the monthly obligation lower"
            ]
          },
          "B": {
            "benefits": [
              "Pays off sooner by 1 months"
            ],
            "giveUps": [
              "Higher monthly cost by $200.00"
            ],
            "bestFitFor": [
              "Reaching payoff sooner"
            ]
          }
        }
      },
      "equalPaymentReport": {
        "lowerPaymentOption": "A",
        "higherPaymentOption": "B",
        "principalAndInterest": 600,
        "extraAboveRequired": 300,
        "months": 2,
        "repaymentInterest": 0,
        "lowerOptionInterestAndFees": 24,
        "higherOptionInterestAndFees": 0,
        "shownCostDifference": -24,
        "lowerCostOption": "B"
      }
    }
  },
  "formulaVersion": "consumer-loan-scenarios-htcalc-749139391f46-v1",
  "units": {
    "money": "USD",
    "monthlyPayment": "USD/month",
    "interestRate": "annual percent",
    "rateDifference": "percentage points",
    "timeDifference": "months",
    "term": "months for AUTO and PERSONAL, years for STUDENT and BUSINESS",
    "businessCoverage": "monthly USD, DSCR as a ratio",
    "schedule": "repayment month, starting after any school deferment"
  },
  "assumptions": [
    "Extra principal changes the monthly and annual payoff schedules. The base payment and the app’s auto true monthly cost exclude this optional extra.",
    "Vehicle-equity checkpoints use baseline loan balances and the app depreciation curve. They are estimates. Interest on an unsubsidized student loan during deferment is capitalized before repayment.",
    "Origination fees are withheld from personal and student proceeds. The business embed allows ordinary origination fees to be withheld or financed, and divides monthly net operating income by the required loan payment. Schedules start at repayment. A priority match uses the app’s materiality thresholds, with risk unknown."
  ],
  "warnings": [],
  "creditCost": 1
}

Request contract

Accepted inputs

Fields for this example. Expand the schema for all supported combinations and limits.

FieldType, units and limits

loanTypeRequired
stringMust equal "PERSONAL"
aRequired
object
a.scenarioNameOptional
string

Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B.

Min length 1 · Max length 80
a.interestRateRequired
number

Annual note rate (percent, e.g. 6 for 6%).

Min 0 · Max 100 · Step 0.000001
a.extraPaymentOptional
number

Additional principal paid each repayment month (USD).

Min 0 · Max 100000000 · Step 0.01
a.loanAmountRequired
number

Gross personal-loan principal (USD).

Min 1 · Max 100000 · Step 0.01
a.loanTermRequired
integer

Repayment term in whole months.

Min 1 · Max 1200
a.originationFeeOptional
number

Fee withheld from original proceeds (percent, e.g. 6 for 6%).

Min 0 · Max 20 · Step 0.000001
bOptional
object
b.scenarioNameOptional
string

Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B.

Min length 1 · Max length 80
b.interestRateRequired
number

Annual note rate (percent, e.g. 6 for 6%).

Min 0 · Max 100 · Step 0.000001
b.extraPaymentOptional
number

Additional principal paid each repayment month (USD).

Min 0 · Max 100000000 · Step 0.01
b.loanAmountRequired
number

Gross personal-loan principal (USD).

Min 1 · Max 100000 · Step 0.01
b.loanTermRequired
integer

Repayment term in whole months.

Min 1 · Max 1200
b.originationFeeOptional
number

Fee withheld from original proceeds (percent, e.g. 6 for 6%).

Min 0 · Max 20 · Step 0.000001
priorityOptional
string

Optional borrower priority. Requires a second option.

Allowed: "lower_monthly_payment", "lower_upfront_cost", "lower_total_cost", "faster_payoff"
Example request body (JSON)
{
  "loanType": "PERSONAL",
  "a": {
    "scenarioName": "Flexible",
    "loanAmount": 1200,
    "loanTerm": 4,
    "interestRate": 0,
    "extraPayment": 100,
    "originationFee": 2
  },
  "b": {
    "scenarioName": "Shorter",
    "loanAmount": 1200,
    "loanTerm": 2,
    "interestRate": 0
  },
  "priority": "faster_payoff"
}
Full JSON schema
{
  "type": "object",
  "description": "Calculate a borrower scenario. A second, same-family scenario enables named loan comparison.",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "loanType": {
          "type": "string",
          "const": "AUTO"
        },
        "a": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 250000,
              "multipleOf": 0.01,
              "description": "Vehicle purchase price (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole months.",
              "minimum": 1,
              "maximum": 1200
            },
            "downPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Cash down (USD)."
            },
            "tradeInValue": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Trade-in allowance (USD)."
            },
            "amountOwedOnTrade": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Outstanding trade-in loan payoff (USD)."
            },
            "fees": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Financed vehicle purchase fees (USD)."
            },
            "salesTaxRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Vehicle sales tax (percent, e.g. 6 for 6%)."
            },
            "tradeInReducesTax": {
              "type": "boolean",
              "description": "Deduct trade-in from taxable purchase price. Default true."
            },
            "monthlyGas": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly fuel cost (USD)."
            },
            "monthlyInsurance": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly vehicle insurance (USD)."
            },
            "monthlyMaintenance": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly maintenance (USD)."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "b": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 250000,
              "multipleOf": 0.01,
              "description": "Vehicle purchase price (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole months.",
              "minimum": 1,
              "maximum": 1200
            },
            "downPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Cash down (USD)."
            },
            "tradeInValue": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Trade-in allowance (USD)."
            },
            "amountOwedOnTrade": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Outstanding trade-in loan payoff (USD)."
            },
            "fees": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Financed vehicle purchase fees (USD)."
            },
            "salesTaxRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Vehicle sales tax (percent, e.g. 6 for 6%)."
            },
            "tradeInReducesTax": {
              "type": "boolean",
              "description": "Deduct trade-in from taxable purchase price. Default true."
            },
            "monthlyGas": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly fuel cost (USD)."
            },
            "monthlyInsurance": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly vehicle insurance (USD)."
            },
            "monthlyMaintenance": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly maintenance (USD)."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "priority": {
          "type": "string",
          "description": "Optional borrower priority. Requires a second option.",
          "enum": [
            "lower_monthly_payment",
            "lower_upfront_cost",
            "lower_total_cost",
            "faster_payoff"
          ]
        }
      },
      "required": [
        "loanType",
        "a"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "loanType": {
          "type": "string",
          "const": "PERSONAL"
        },
        "a": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000,
              "multipleOf": 0.01,
              "description": "Gross personal-loan principal (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole months.",
              "minimum": 1,
              "maximum": 1200
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Fee withheld from original proceeds (percent, e.g. 6 for 6%)."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "b": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 100000,
              "multipleOf": 0.01,
              "description": "Gross personal-loan principal (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole months.",
              "minimum": 1,
              "maximum": 1200
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Fee withheld from original proceeds (percent, e.g. 6 for 6%)."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "priority": {
          "type": "string",
          "description": "Optional borrower priority. Requires a second option.",
          "enum": [
            "lower_monthly_payment",
            "lower_upfront_cost",
            "lower_total_cost",
            "faster_payoff"
          ]
        }
      },
      "required": [
        "loanType",
        "a"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "loanType": {
          "type": "string",
          "const": "BUSINESS"
        },
        "a": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 10000000,
              "multipleOf": 0.01,
              "description": "Ordinary business loan principal before fees (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole years.",
              "minimum": 1,
              "maximum": 100
            },
            "businessRevenue": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly business revenue (USD)."
            },
            "businessExpenses": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly operating expenses (USD)."
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Ordinary origination fee on original principal (percent, e.g. 6 for 6%)."
            },
            "financeOriginationFee": {
              "type": "boolean",
              "description": "Finance the origination fee. Default false deducts it from proceeds."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate",
            "businessRevenue",
            "businessExpenses"
          ],
          "additionalProperties": false
        },
        "b": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 10000000,
              "multipleOf": 0.01,
              "description": "Ordinary business loan principal before fees (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole years.",
              "minimum": 1,
              "maximum": 100
            },
            "businessRevenue": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly business revenue (USD)."
            },
            "businessExpenses": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Monthly operating expenses (USD)."
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 20,
              "multipleOf": 0.000001,
              "description": "Ordinary origination fee on original principal (percent, e.g. 6 for 6%)."
            },
            "financeOriginationFee": {
              "type": "boolean",
              "description": "Finance the origination fee. Default false deducts it from proceeds."
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate",
            "businessRevenue",
            "businessExpenses"
          ],
          "additionalProperties": false
        },
        "priority": {
          "type": "string",
          "description": "Optional borrower priority. Requires a second option.",
          "enum": [
            "lower_monthly_payment",
            "lower_upfront_cost",
            "lower_total_cost",
            "faster_payoff"
          ]
        }
      },
      "required": [
        "loanType",
        "a"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "loanType": {
          "type": "string",
          "const": "STUDENT"
        },
        "a": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 500000,
              "multipleOf": 0.01,
              "description": "Original student principal before deferment (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole years, excluding deferment.",
              "minimum": 1,
              "maximum": 100
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 10,
              "multipleOf": 0.000001,
              "description": "Fee withheld from initial disbursement (percent, e.g. 6 for 6%)."
            },
            "defermentMonths": {
              "type": "integer",
              "description": "Months before repayment.",
              "minimum": 0,
              "maximum": 120
            },
            "loanSubtype": {
              "type": "string",
              "description": "Default unsubsidized. Subsidized loans accrue no modeled deferment interest.",
              "enum": [
                "subsidized",
                "unsubsidized"
              ]
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "b": {
          "type": "object",
          "properties": {
            "scenarioName": {
              "type": "string",
              "minLength": 1,
              "maxLength": 80,
              "description": "Optional caller label; whitespace is trimmed. Defaults to Scenario A / Scenario B."
            },
            "interestRate": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "multipleOf": 0.000001,
              "description": "Annual note rate (percent, e.g. 6 for 6%)."
            },
            "extraPayment": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000000,
              "multipleOf": 0.01,
              "description": "Additional principal paid each repayment month (USD)."
            },
            "loanAmount": {
              "type": "number",
              "minimum": 1,
              "maximum": 500000,
              "multipleOf": 0.01,
              "description": "Original student principal before deferment (USD)."
            },
            "loanTerm": {
              "type": "integer",
              "description": "Repayment term in whole years, excluding deferment.",
              "minimum": 1,
              "maximum": 100
            },
            "originationFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 10,
              "multipleOf": 0.000001,
              "description": "Fee withheld from initial disbursement (percent, e.g. 6 for 6%)."
            },
            "defermentMonths": {
              "type": "integer",
              "description": "Months before repayment.",
              "minimum": 0,
              "maximum": 120
            },
            "loanSubtype": {
              "type": "string",
              "description": "Default unsubsidized. Subsidized loans accrue no modeled deferment interest.",
              "enum": [
                "subsidized",
                "unsubsidized"
              ]
            }
          },
          "required": [
            "loanAmount",
            "loanTerm",
            "interestRate"
          ],
          "additionalProperties": false
        },
        "priority": {
          "type": "string",
          "description": "Optional borrower priority. Requires a second option.",
          "enum": [
            "lower_monthly_payment",
            "lower_upfront_cost",
            "lower_total_cost",
            "faster_payoff"
          ]
        }
      },
      "required": [
        "loanType",
        "a"
      ],
      "additionalProperties": false
    }
  ]
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/consumer-loan-scenarios
Formula: consumer-loan-scenarios-htcalc-749139391f46-v1