Investment · Calculation
Investor maximum purchase price
Finds the modeled purchase limits for cash on hand, target cash-on-cash return and DSCR. Includes PITI, cash flow and the rate/return sensitivity matrix. Closing costs are excluded. All-cash purchases have no debt-service constraint.
Example result · maxPrice: 177529.66776452775 See output
- Cost per success
- 10 calculation credits
- Production plans
- Standard, Business, Scale, Enterprise
Plan allowances - Free sandbox
- Not available
Integration example
Make a request
Use a production key scoped to investor-max-purchase.
Keep the key on your server. A successful call uses 10 calculation credits.
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/investor-max-purchase";
const input = {
"availableCash": 100000,
"targetCocPct": 8,
"targetDscr": 1.25,
"interestRatePct": 7,
"loanTermYears": 30,
"downPaymentPct": 25,
"monthlyRent": 2200,
"taxRatePct": 1.2,
"insuranceRatePct": 0.5,
"vacancyPct": 5,
"maintenancePct": 5,
"managementPct": 8
};
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/investor-max-purchase' \
--header "Authorization: Bearer $HT_PRODUCTION_KEY" \
--header 'Content-Type: application/json' \
--header "Idempotency-Key: $request_id" \
--data-binary @- <<'HT_INPUT'
{
"availableCash": 100000,
"targetCocPct": 8,
"targetDscr": 1.25,
"interestRatePct": 7,
"loanTermYears": 30,
"downPaymentPct": 25,
"monthlyRent": 2200,
"taxRatePct": 1.2,
"insuranceRatePct": 0.5,
"vacancyPct": 5,
"maintenancePct": 5,
"managementPct": 8
}
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
investor-max-purchase. 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.
maxPrice- 177529.66776452775
bindingIndex- 0
loanAmount- 133147.25082339582
How to interpret this result
- Finds the modeled purchase limits for cash on hand, target cash-on-cash return and DSCR. Includes PITI, cash flow and the rate/return sensitivity matrix. Closing costs are excluded. All-cash purchases have no debt-service constraint.
Full example response (JSON)
{
"status": "available",
"result": {
"limits": [
{
"key": "coc",
"label": "Cash-on-Cash Return",
"maxPrice": 177529.66776452775
},
{
"key": "dscr",
"label": "DSCR Coverage",
"maxPrice": 235697.36339057982
},
{
"key": "cash",
"label": "Available Cash",
"maxPrice": 400000
}
],
"maxPrice": 177529.66776452775,
"bindingIndex": 0,
"loanAmount": 133147.25082339582,
"downPayment": 44382.41694113193,
"monthlyPI": 885.8319819905,
"monthlyTax": 177.52966776452774,
"monthlyIns": 73.97069490188657,
"totalPITI": 1137.3323446569145,
"monthlyCashFlow": 666.6676553430855,
"annualCashFlow": 8000.011864117026,
"actualCOC": 8.000011864117026,
"effectiveMonthlyRent": 2090,
"monthlyOpEx": 286,
"requiredAnnualCashFlow": 8000,
"sensitivityData": [
[
259144.23498027038,
229776.19411316488,
200407.99834941304,
171039.80258566112,
141671.80711080946
],
[
248704.95885763856,
220519.81863369734,
192334.84795273832,
164149.7521125657,
135964.65627239316
],
[
238853.87702883905,
211785.28305930123,
184716.5724149338,
157647.86177056623,
130579.1511261987
],
[
229560.74800971322,
203545.20788712046,
177529.66776452775,
151514.127641935,
125498.58751934224
],
[
220794.992403417,
195772.8432116568,
170750.6940198967,
145728.69246246162,
120706.56721633747
],
[
212526.97162188683,
188441.80597700938,
164356.79100242336,
140271.6521109302,
116186.51321943708
]
],
"dscrApplies": true,
"sensitivityRatePct": [
5.5,
6,
6.5,
7,
7.5,
8
],
"sensitivityCocPct": [
4,
6,
8,
10,
12
]
},
"formulaVersion": "investor-max-purchase-1.0.0",
"units": {
"*Pct": "percentage points",
"targetDscr": "ratio",
"loanTermYears": "years",
"monthlyRent": "USD/month",
"actualCOC": "percentage points",
"monthly amounts and totalPITI": "USD/month",
"annual amounts": "USD/year",
"prices, loan amount, down payment and matrix cells": "USD"
},
"assumptions": [
"Finds the modeled purchase limits for cash on hand, target cash-on-cash return and DSCR. Includes PITI, cash flow and the rate/return sensitivity matrix. Closing costs are excluded. All-cash purchases have no debt-service constraint."
],
"warnings": [],
"creditCost": 10
}Request contract
Accepted inputs
Fields for this example. Expand the schema for all supported combinations and limits.
FieldType, units and limits
availableCashRequiredUSD, one-time amount.
Min 0 · Max 1000000000targetCocPctRequiredTarget annual cash-on-cash return in percentage points.
Min 0 · Max 100targetDscrRequiredDebt-service coverage multiple (1.25 means 1.25×).
Min 0.01 · Max 20interestRatePctRequiredAnnual nominal interest rate in percentage points (6.5 means 6.5%).
Min 0 · Max 50loanTermYearsRequiredAmortization term in whole years.
Min 1 · Max 50downPaymentPctRequiredPercentage points of the purchase price.
Min 0.01 · Max 100monthlyRentRequiredUSD per month.
Min 0 · Max 1000000000taxRatePctRequiredAnnual property tax as percentage points of purchase price.
Min 0 · Max 100insuranceRatePctRequiredAnnual insurance as percentage points of purchase price.
Min 0 · Max 100vacancyPctRequiredPercentage points of scheduled monthly rent (8 means 8%).
Min 0 · Max 100maintenancePctRequiredPercentage points of scheduled monthly rent (8 means 8%).
Min 0 · Max 100managementPctRequiredPercentage points of scheduled monthly rent (8 means 8%).
Min 0 · Max 100Example request body (JSON)
{
"availableCash": 100000,
"targetCocPct": 8,
"targetDscr": 1.25,
"interestRatePct": 7,
"loanTermYears": 30,
"downPaymentPct": 25,
"monthlyRent": 2200,
"taxRatePct": 1.2,
"insuranceRatePct": 0.5,
"vacancyPct": 5,
"maintenancePct": 5,
"managementPct": 8
} Full JSON schema
{
"type": "object",
"properties": {
"availableCash": {
"type": "number",
"minimum": 0,
"maximum": 1000000000,
"description": "USD, one-time amount."
},
"targetCocPct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Target annual cash-on-cash return in percentage points."
},
"targetDscr": {
"type": "number",
"minimum": 0.01,
"maximum": 20,
"description": "Debt-service coverage multiple (1.25 means 1.25×)."
},
"interestRatePct": {
"type": "number",
"minimum": 0,
"maximum": 50,
"description": "Annual nominal interest rate in percentage points (6.5 means 6.5%)."
},
"loanTermYears": {
"type": "integer",
"minimum": 1,
"maximum": 50,
"description": "Amortization term in whole years."
},
"downPaymentPct": {
"type": "number",
"minimum": 0.01,
"maximum": 100,
"description": "Percentage points of the purchase price."
},
"monthlyRent": {
"type": "number",
"minimum": 0,
"maximum": 1000000000,
"description": "USD per month."
},
"taxRatePct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Annual property tax as percentage points of purchase price."
},
"insuranceRatePct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Annual insurance as percentage points of purchase price."
},
"vacancyPct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Percentage points of scheduled monthly rent (8 means 8%)."
},
"maintenancePct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Percentage points of scheduled monthly rent (8 means 8%)."
},
"managementPct": {
"type": "number",
"minimum": 0,
"maximum": 100,
"description": "Percentage points of scheduled monthly rent (8 means 8%)."
}
},
"required": [
"availableCash",
"targetCocPct",
"targetDscr",
"interestRatePct",
"loanTermYears",
"downPaymentPct",
"monthlyRent",
"taxRatePct",
"insuranceRatePct",
"vacancyPct",
"maintenancePct",
"managementPct"
],
"additionalProperties": false,
"description": "Finds the modeled purchase limits for cash on hand, target cash-on-cash return and DSCR. Includes PITI, cash flow and the rate/return sensitivity matrix. Closing costs are excluded. All-cash purchases have no debt-service constraint."
}Production endpoint: POST https://calc.hasstechapi.com/v2/calc/investor-max-purchase
Formula: investor-max-purchase-1.0.0