Lending · Calculation
Business financing program comparison
Compares up to five quoted business financing programs, with coverage, fee-inclusive cost, borrowing capacity, checklist and first-year payments.
- 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 business-financing-comparison.
Keep the key on your server. A successful call uses 1 calculation credit.
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/business-financing-comparison";
const input = {
"loanAmount": 1200,
"originationFeePercent": 10,
"monthlyRevenue": 240,
"monthlyExpenses": 100,
"existingMonthlyDebtService": 0,
"offers": [
{
"program": "sba7a",
"annualRate": 0,
"termYears": 1,
"quotedGuaranteeFee": 12,
"amountLimit": 1500,
"maxTermYears": 2
},
{
"program": "term",
"annualRate": 0,
"termYears": 1
}
]
};
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 -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/business-financing-comparison' \
--header "Authorization: Bearer $HT_PRODUCTION_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $request_id" \
--data-binary @- <<'HT_INPUT'
{
"loanAmount": 1200,
"originationFeePercent": 10,
"monthlyRevenue": 240,
"monthlyExpenses": 100,
"existingMonthlyDebtService": 0,
"offers": [
{
"program": "sba7a",
"annualRate": 0,
"termYears": 1,
"quotedGuaranteeFee": 12,
"amountLimit": 1500,
"maxTermYears": 2
},
{
"program": "term",
"annualRate": 0,
"termYears": 1
}
]
}
HT_INPUT
) If your request fails
400 INVALID_INPUT-
Read
error.detailswhen present. Node prints each issue. cURL returns the JSON body. Eachpathpoints 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.
401or403- Check that the server has the bearer key for the endpoint’s environment and that the key includes
business-financing-comparison. 429- Read the service error code, check your allowance, and wait for the
Retry-Afterinterval when supplied before trying again. - Lost response,
409or503 - 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_IDto 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.
Result warnings
- term checklist omits unsupplied program limits.
How to interpret this result
- Each offer uses its supplied rate and term. Supply the upfront fee for each SBA program, including an explicit zero for a waiver. Origination fees are financed and the guarantee fee is paid separately.
- For the line of credit the entire amount is drawn and paid down in equal monthly installments. Checklist limit tests require supplied program limits. Coverage is modeled at 1.25x.
{
"status": "available",
"result": {
"offers": [
{
"program": "sba7a",
"annualRate": 0,
"termYears": 1,
"monthlyPayment": 110,
"totalInterest": 0,
"totalCost": 1332,
"totalFinanced": 1320,
"totalFees": 132,
"origFee": 120,
"sbaFee": 12,
"noi": 140,
"dscr": 1.2727272727272727,
"dscrStatus": "available",
"qualifies": true,
"maxLoanAtDSCR": 1221.8181818181818,
"maxPaymentAtDSCR": 112,
"totalDebtService": 110,
"schedule": [
{
"month": 1,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 1210
},
{
"month": 2,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 1100
},
{
"month": 3,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 990
},
{
"month": 4,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 880
},
{
"month": 5,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 770
},
{
"month": 6,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 660
},
{
"month": 7,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 550
},
{
"month": 8,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 440
},
{
"month": 9,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 330
},
{
"month": 10,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 220
},
{
"month": 11,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 110
},
{
"month": 12,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 0
}
],
"termMonths": 12,
"loanAprPct": 19.91241410570548,
"printed": {
"loan": 1200,
"origFee": 120,
"sbaFee": 12,
"totalFees": 132,
"financed": 1320,
"interest": 0,
"totalCost": 1332,
"noi": 140,
"debtService": 110,
"cushion": 30,
"cushionAgainstCents": 30
},
"comparisonRow": {
"payment": 110,
"totalInterest": 0,
"totalCost": 1332,
"sbaFee": 12
},
"checklist": {
"meetsCoverage": true,
"positiveOperatingIncome": true,
"withinAmountLimit": true,
"withinTermLimit": true,
"revenueCoversTwiceDebtService": true
}
},
{
"program": "term",
"annualRate": 0,
"termYears": 1,
"monthlyPayment": 110,
"totalInterest": 0,
"totalCost": 1320,
"totalFinanced": 1320,
"totalFees": 120,
"origFee": 120,
"sbaFee": 0,
"noi": 140,
"dscr": 1.2727272727272727,
"dscrStatus": "available",
"qualifies": true,
"maxLoanAtDSCR": 1221.8181818181818,
"maxPaymentAtDSCR": 112,
"totalDebtService": 110,
"schedule": [
{
"month": 1,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 1210
},
{
"month": 2,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 1100
},
{
"month": 3,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 990
},
{
"month": 4,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 880
},
{
"month": 5,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 770
},
{
"month": 6,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 660
},
{
"month": 7,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 550
},
{
"month": 8,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 440
},
{
"month": 9,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 330
},
{
"month": 10,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 220
},
{
"month": 11,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 110
},
{
"month": 12,
"payment": 110,
"principal": 110,
"interest": 0,
"balance": 0
}
],
"termMonths": 12,
"loanAprPct": 17.97199749803545,
"printed": {
"loan": 1200,
"origFee": 120,
"sbaFee": 0,
"totalFees": 120,
"financed": 1320,
"interest": 0,
"totalCost": 1320,
"noi": 140,
"debtService": 110,
"cushion": 30,
"cushionAgainstCents": 30
},
"comparisonRow": {
"payment": 110,
"totalInterest": 0,
"totalCost": 1320,
"sbaFee": 0
},
"checklist": {
"meetsCoverage": true,
"positiveOperatingIncome": true,
"withinAmountLimit": null,
"withinTermLimit": null,
"revenueCoversTwiceDebtService": true
}
}
],
"selected": null
},
"formulaVersion": "business-financing-comparison-1.0.0",
"units": {
"money": "USD",
"monthlyPayment": "USD/month",
"noi": "USD/month",
"loanAprPct": "annual percent",
"dscr": "multiple",
"schedule": "whole USD per monthly row",
"comparisonRow": "whole USD"
},
"assumptions": [
"Each offer uses its supplied rate and term. Supply the upfront fee for each SBA program, including an explicit zero for a waiver. Origination fees are financed and the guarantee fee is paid separately.",
"For the line of credit the entire amount is drawn and paid down in equal monthly installments. Checklist limit tests require supplied program limits. Coverage is modeled at 1.25x."
],
"warnings": [
"term checklist omits unsupplied program limits."
],
"creditCost": 1
} Request contract
Accepted inputs
Fields for this example. Expand the schema for all supported combinations and limits.
FieldType, units and limits
loanAmountRequiredGross requested principal, or SBA-backed debenture for a 504 loan (USD, cents).
Min 0.01 · Max 1000000000 · Step 0.01originationFeePercentRequiredOrigination fee financed with each loan (percentage points, up to 6 decimals).
Min 0 · Max 100 · Step 0.000001monthlyRevenueRequiredMonthly business revenue (USD, cents).
Min 0 · Max 1000000000 · Step 0.01monthlyExpensesRequiredMonthly operating expenses (USD, cents).
Min 0 · Max 1000000000 · Step 0.01existingMonthlyDebtServiceRequiredExisting monthly debt payments (USD, cents).
Min 0 · Max 1000000000 · Step 0.01offersRequiredoffers[].programRequiredSBA financing program.
Allowed: "sba7a", "sba504"offers[].annualRateRequiredQuoted annual note rate (percentage points, up to 6 decimals).
Min 0 · Max 100 · Step 0.000001offers[].termYearsRequiredOffered term in years, rounded to the nearest payment month.
Min 0.08333333333333333 · Max 100offers[].amountLimitOptionalOffer or program amount limit (USD, cents).
Min 0.01 · Max 1000000000 · Step 0.01offers[].maxTermYearsOptionalOffer or program maximum term (years).
Min 0.08333333333333333 · Max 100offers[].quotedGuaranteeFeeRequiredTotal quoted upfront guarantee fee paid separately from principal (USD, cents).
Min 0 · Max 1000000000 · Step 0.01selectedOfferOptionalOptional customized terms for the active program, independent from that program’s comparison row.
Example request body (JSON)
{
"loanAmount": 1200,
"originationFeePercent": 10,
"monthlyRevenue": 240,
"monthlyExpenses": 100,
"existingMonthlyDebtService": 0,
"offers": [
{
"program": "sba7a",
"annualRate": 0,
"termYears": 1,
"quotedGuaranteeFee": 12,
"amountLimit": 1500,
"maxTermYears": 2
},
{
"program": "term",
"annualRate": 0,
"termYears": 1
}
]
} Full JSON schema
{
"type": "object",
"properties": {
"loanAmount": {
"type": "number",
"description": "Gross requested principal, or SBA-backed debenture for a 504 loan (USD, cents).",
"minimum": 0.01,
"maximum": 1000000000,
"multipleOf": 0.01
},
"originationFeePercent": {
"type": "number",
"description": "Origination fee financed with each loan (percentage points, up to 6 decimals).",
"minimum": 0,
"maximum": 100,
"multipleOf": 0.000001
},
"monthlyRevenue": {
"type": "number",
"description": "Monthly business revenue (USD, cents).",
"minimum": 0,
"maximum": 1000000000,
"multipleOf": 0.01
},
"monthlyExpenses": {
"type": "number",
"description": "Monthly operating expenses (USD, cents).",
"minimum": 0,
"maximum": 1000000000,
"multipleOf": 0.01
},
"existingMonthlyDebtService": {
"type": "number",
"description": "Existing monthly debt payments (USD, cents).",
"minimum": 0,
"maximum": 1000000000,
"multipleOf": 0.01
},
"offers": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"program": {
"type": "string",
"enum": [
"sba7a",
"sba504"
],
"description": "SBA financing program."
},
"annualRate": {
"type": "number",
"description": "Quoted annual note rate (percentage points, up to 6 decimals).",
"minimum": 0,
"maximum": 100,
"multipleOf": 0.000001
},
"termYears": {
"type": "number",
"description": "Offered term in years, rounded to the nearest payment month.",
"minimum": 0.08333333333333333,
"maximum": 100
},
"amountLimit": {
"type": "number",
"description": "Offer or program amount limit (USD, cents).",
"minimum": 0.01,
"maximum": 1000000000,
"multipleOf": 0.01
},
"maxTermYears": {
"type": "number",
"description": "Offer or program maximum term (years).",
"minimum": 0.08333333333333333,
"maximum": 100
},
"quotedGuaranteeFee": {
"type": "number",
"description": "Total quoted upfront guarantee fee paid separately from principal (USD, cents).",
"minimum": 0,
"maximum": 1000000000,
"multipleOf": 0.01
}
},
"required": [
"program",
"annualRate",
"termYears",
"quotedGuaranteeFee"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"program": {
"type": "string",
"enum": [
"term",
"equipment",
"loc"
],
"description": "Non-SBA financing program."
},
"annualRate": {
"type": "number",
"description": "Quoted annual note rate (percentage points, up to 6 decimals).",
"minimum": 0,
"maximum": 100,
"multipleOf": 0.000001
},
"termYears": {
"type": "number",
"description": "Offered term in years, rounded to the nearest payment month.",
"minimum": 0.08333333333333333,
"maximum": 100
},
"amountLimit": {
"type": "number",
"description": "Offer or program amount limit (USD, cents).",
"minimum": 0.01,
"maximum": 1000000000,
"multipleOf": 0.01
},
"maxTermYears": {
"type": "number",
"description": "Offer or program maximum term (years).",
"minimum": 0.08333333333333333,
"maximum": 100
}
},
"required": [
"program",
"annualRate",
"termYears"
],
"additionalProperties": false
}
]
},
"minItems": 1,
"maxItems": 5
},
"selectedOffer": {
"oneOf": [
{
"type": "object",
"properties": {
"program": {
"type": "string",
"enum": [
"sba7a",
"sba504"
],
"description": "SBA financing program."
},
"annualRate": {
"type": "number",
"description": "Quoted annual note rate (percentage points, up to 6 decimals).",
"minimum": 0,
"maximum": 100,
"multipleOf": 0.000001
},
"termYears": {
"type": "number",
"description": "Offered term in years, rounded to the nearest payment month.",
"minimum": 0.08333333333333333,
"maximum": 100
},
"amountLimit": {
"type": "number",
"description": "Offer or program amount limit (USD, cents).",
"minimum": 0.01,
"maximum": 1000000000,
"multipleOf": 0.01
},
"maxTermYears": {
"type": "number",
"description": "Offer or program maximum term (years).",
"minimum": 0.08333333333333333,
"maximum": 100
},
"quotedGuaranteeFee": {
"type": "number",
"description": "Total quoted upfront guarantee fee paid separately from principal (USD, cents).",
"minimum": 0,
"maximum": 1000000000,
"multipleOf": 0.01
}
},
"required": [
"program",
"annualRate",
"termYears",
"quotedGuaranteeFee"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"program": {
"type": "string",
"enum": [
"term",
"equipment",
"loc"
],
"description": "Non-SBA financing program."
},
"annualRate": {
"type": "number",
"description": "Quoted annual note rate (percentage points, up to 6 decimals).",
"minimum": 0,
"maximum": 100,
"multipleOf": 0.000001
},
"termYears": {
"type": "number",
"description": "Offered term in years, rounded to the nearest payment month.",
"minimum": 0.08333333333333333,
"maximum": 100
},
"amountLimit": {
"type": "number",
"description": "Offer or program amount limit (USD, cents).",
"minimum": 0.01,
"maximum": 1000000000,
"multipleOf": 0.01
},
"maxTermYears": {
"type": "number",
"description": "Offer or program maximum term (years).",
"minimum": 0.08333333333333333,
"maximum": 100
}
},
"required": [
"program",
"annualRate",
"termYears"
],
"additionalProperties": false
}
],
"description": "Optional customized terms for the active program, independent from that program’s comparison row."
}
},
"required": [
"loanAmount",
"originationFeePercent",
"monthlyRevenue",
"monthlyExpenses",
"existingMonthlyDebtService",
"offers"
],
"additionalProperties": false
}Production endpoint: POST https://calc.hasstechapi.com/v2/calc/business-financing-comparison
Formula: business-financing-comparison-1.0.0