Skip to content

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.

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/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 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/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.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 investor-max-purchase.
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.

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

availableCashRequired
number

USD, one-time amount.

Min 0 · Max 1000000000
targetCocPctRequired
number

Target annual cash-on-cash return in percentage points.

Min 0 · Max 100
targetDscrRequired
number

Debt-service coverage multiple (1.25 means 1.25×).

Min 0.01 · Max 20
interestRatePctRequired
number

Annual nominal interest rate in percentage points (6.5 means 6.5%).

Min 0 · Max 50
loanTermYearsRequired
integer

Amortization term in whole years.

Min 1 · Max 50
downPaymentPctRequired
number

Percentage points of the purchase price.

Min 0.01 · Max 100
monthlyRentRequired
number

USD per month.

Min 0 · Max 1000000000
taxRatePctRequired
number

Annual property tax as percentage points of purchase price.

Min 0 · Max 100
insuranceRatePctRequired
number

Annual insurance as percentage points of purchase price.

Min 0 · Max 100
vacancyPctRequired
number

Percentage points of scheduled monthly rent (8 means 8%).

Min 0 · Max 100
maintenancePctRequired
number

Percentage points of scheduled monthly rent (8 means 8%).

Min 0 · Max 100
managementPctRequired
number

Percentage points of scheduled monthly rent (8 means 8%).

Min 0 · Max 100
Example 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