Skip to content

Investment · Calculation

Wholesale offer and settlement

Computes end-buyer profit, assignment or double-close settlement from supplied transaction assumptions. Supports a typed end-buyer price. Jurisdiction status records the caller’s assumption and grants no legal eligibility.

Example result · state: available See output

Cost per success
20 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-wholesale.

Keep the key on your server. A successful call uses 20 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-wholesale";
const input = {
  "mode": "end-buyer-profit",
  "askingPrice": 100000,
  "assignmentFee": 10000,
  "closingCosts": 3000,
  "holdingCosts": 2000,
  "path": "assignment",
  "calculationDate": "2026-01-01",
  "jurisdictionStatus": "unknown",
  "arv": 220000,
  "repairCosts": 20000,
  "investorProfitPercentage": 30
};
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-wholesale' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "mode": "end-buyer-profit",
  "askingPrice": 100000,
  "assignmentFee": 10000,
  "closingCosts": 3000,
  "holdingCosts": 2000,
  "path": "assignment",
  "calculationDate": "2026-01-01",
  "jurisdictionStatus": "unknown",
  "arv": 220000,
  "repairCosts": 20000,
  "investorProfitPercentage": 30
}
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-wholesale.
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.

state
available
status
scenario-only
assumedJurisdictionStatus
unknown

Result warnings

  • The engine reconciles transaction economics but does not issue legal eligibility advice.
How to interpret this result
  • Computes end-buyer profit, assignment or double-close settlement from supplied transaction assumptions. Supports a typed end-buyer price. Jurisdiction status records the caller’s assumption and grants no legal eligibility.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "state": "available",
    "warnings": [
      {
        "code": "not-legal-advice",
        "severity": "info",
        "message": "The engine reconciles transaction economics but does not issue legal eligibility advice."
      }
    ],
    "status": "scenario-only",
    "assumedJurisdictionStatus": "unknown",
    "offer": {
      "maximumAllowableOffer": 119000,
      "contractPrice": 119000,
      "endBuyerPrice": 129000,
      "investorProfitDollar": 66000,
      "totalCapitalNeeded": 154000
    },
    "settlement": {
      "state": "available",
      "fieldErrors": {},
      "warnings": [
        {
          "code": "not-legal-advice",
          "severity": "info",
          "message": "The engine reconciles transaction economics but does not issue legal eligibility advice."
        }
      ],
      "assumptions": [
        {
          "key": "calculationTimeZone",
          "value": "UTC",
          "source": "default"
        }
      ],
      "provenance": [
        {
          "source": "Hypothetical scenario using caller assumptions",
          "asOf": "2026-01-01"
        }
      ],
      "formulaVersion": "wholesale-paths-1.0.0",
      "ruleVersions": [
        "wholesale-jurisdiction-gate-v1"
      ],
      "auditTrail": [
        "End-buyer price is derived from ARV less repairs, the entered target end-buyer profit and the end buyer's own closing and holding costs; it is not manufactured from asking price plus assignment fee.",
        "Calculation calendar date 2026-01-01 interpreted in UTC."
      ],
      "value": {
        "path": "assignment",
        "endBuyerPrice": "129000",
        "grossSpread": "29000",
        "transactionalFunding": "0",
        "totalCosts": "0",
        "profit": "29000",
        "underwrittenArv": "220000",
        "repairCosts": "20000",
        "endBuyerTargetProfit": "66000",
        "targetAssignmentFee": "10000",
        "targetFeeMargin": "19000",
        "targetFeeStatus": "meets-target",
        "statement": [
          {
            "date": "2026-01-01",
            "category": "end-buyer",
            "description": "End buyer consideration",
            "amount": "129000",
            "source": "calculated"
          },
          {
            "date": "2026-01-01",
            "category": "contract",
            "description": "Seller contract price",
            "amount": "-100000",
            "source": "user"
          },
          {
            "date": "2026-01-01",
            "category": "inspection-title",
            "description": "Inspection and title costs",
            "amount": "-0",
            "source": "user"
          },
          {
            "date": "2026-01-01",
            "category": "deposit-risk",
            "description": "Earnest deposit at risk",
            "amount": "-0",
            "source": "user"
          },
          {
            "date": "2026-01-01",
            "category": "closing",
            "description": "Assignment closing costs",
            "amount": "-0",
            "source": "calculated"
          }
        ],
        "eligibilityClaim": "not-evaluated"
      }
    },
    "secondScenario": null,
    "higherOfferScenario": null
  },
  "formulaVersion": "investor-wholesale-1.0.0",
  "units": {
    "monetaryAmounts": "USD",
    "calendarDates": "YYYY-MM-DD",
    "investorProfitPercentage": "percent of ARV",
    "transactionalFundingRatePct": "percent of seller contract price"
  },
  "assumptions": [
    "Computes end-buyer profit, assignment or double-close settlement from supplied transaction assumptions. Supports a typed end-buyer price. Jurisdiction status records the caller’s assumption and grants no legal eligibility."
  ],
  "warnings": [
    "The engine reconciles transaction economics but does not issue legal eligibility advice."
  ],
  "creditCost": 20
}

Request contract

Accepted inputs

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

FieldType, units and limits

askingPriceRequired
number

Seller contract price, USD.

Min 0.01 · Max 1000000000
assignmentFeeRequired
number

Target assignment fee, USD.

Min 0 · Max 1000000000
closingCostsRequired
number

Buyer closing costs in ARV mode, or default closing cost assumption in typed-price mode, USD.

Min 0 · Max 1000000000
holdingCostsRequired
number

Buyer holding costs in ARV mode or wholesaler other costs in typed-price mode, USD.

Min 0 · Max 1000000000
pathRequired
stringAllowed: "assignment", "double-close"
calculationDateRequired
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
jurisdictionStatusRequired
stringAllowed: "unknown", "supported", "prohibited"
earnestDepositAtRiskOptional
number

At-risk deposit, USD.

Min 0 · Max 1000000000
inspectionAndTitleCostsOptional
number

Inspection and title cost charged to the wholesaler, USD.

Min 0 · Max 1000000000
assignmentClosingCostsOptional
number

Wholesaler assignment closing cost, USD.

Min 0 · Max 1000000000
purchaseClosingCostsOptional
number

Wholesaler first closing cost under double closing, USD.

Min 0 · Max 1000000000
resaleClosingCostsOptional
number

Wholesaler resale closing cost under double closing, USD.

Min 0 · Max 1000000000
transactionalFundingRatePctOptional
number

Funding cost on a double closing, percent of the seller contract price.

Min 0 · Max 100
modeRequired
stringMust equal "end-buyer-profit"
arvRequired
number

Assumed repaired value, USD.

Min 0.01 · Max 1000000000
repairCostsRequired
number

End buyer’s repair budget, USD.

Min 0 · Max 1000000000
investorProfitPercentageRequired
number

End buyer’s target profit, percent of ARV.

Min 0 · Max 100
compareWithOptional
object
compareWith.askingPriceRequired
number

Seller contract price, USD.

Min 0.01 · Max 1000000000
compareWith.assignmentFeeRequired
number

Target assignment fee, USD.

Min 0 · Max 1000000000
compareWith.closingCostsRequired
number

Buyer closing costs in ARV mode, or default closing cost assumption in typed-price mode, USD.

Min 0 · Max 1000000000
compareWith.holdingCostsRequired
number

Buyer holding costs in ARV mode or wholesaler other costs in typed-price mode, USD.

Min 0 · Max 1000000000
compareWith.pathRequired
stringAllowed: "assignment", "double-close"
compareWith.calculationDateRequired
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
compareWith.jurisdictionStatusRequired
stringAllowed: "unknown", "supported", "prohibited"
compareWith.earnestDepositAtRiskOptional
number

At-risk deposit, USD.

Min 0 · Max 1000000000
compareWith.inspectionAndTitleCostsOptional
number

Inspection and title cost charged to the wholesaler, USD.

Min 0 · Max 1000000000
compareWith.assignmentClosingCostsOptional
number

Wholesaler assignment closing cost, USD.

Min 0 · Max 1000000000
compareWith.purchaseClosingCostsOptional
number

Wholesaler first closing cost under double closing, USD.

Min 0 · Max 1000000000
compareWith.resaleClosingCostsOptional
number

Wholesaler resale closing cost under double closing, USD.

Min 0 · Max 1000000000
compareWith.transactionalFundingRatePctOptional
number

Funding cost on a double closing, percent of the seller contract price.

Min 0 · Max 100
compareWith.modeRequired
stringMust equal "end-buyer-profit"
compareWith.arvRequired
number

Assumed repaired value, USD.

Min 0.01 · Max 1000000000
compareWith.repairCostsRequired
number

End buyer’s repair budget, USD.

Min 0 · Max 1000000000
compareWith.investorProfitPercentageRequired
number

End buyer’s target profit, percent of ARV.

Min 0 · Max 100
Example request body (JSON)
{
  "mode": "end-buyer-profit",
  "askingPrice": 100000,
  "assignmentFee": 10000,
  "closingCosts": 3000,
  "holdingCosts": 2000,
  "path": "assignment",
  "calculationDate": "2026-01-01",
  "jurisdictionStatus": "unknown",
  "arv": 220000,
  "repairCosts": 20000,
  "investorProfitPercentage": 30
}
Full JSON schema
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "askingPrice": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 1000000000,
          "description": "Seller contract price, USD."
        },
        "assignmentFee": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Target assignment fee, USD."
        },
        "closingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Buyer closing costs in ARV mode, or default closing cost assumption in typed-price mode, USD."
        },
        "holdingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Buyer holding costs in ARV mode or wholesaler other costs in typed-price mode, USD."
        },
        "path": {
          "enum": [
            "assignment",
            "double-close"
          ]
        },
        "calculationDate": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        },
        "jurisdictionStatus": {
          "enum": [
            "unknown",
            "supported",
            "prohibited"
          ]
        },
        "earnestDepositAtRisk": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "At-risk deposit, USD."
        },
        "inspectionAndTitleCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Inspection and title cost charged to the wholesaler, USD."
        },
        "assignmentClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler assignment closing cost, USD."
        },
        "purchaseClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler first closing cost under double closing, USD."
        },
        "resaleClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler resale closing cost under double closing, USD."
        },
        "transactionalFundingRatePct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Funding cost on a double closing, percent of the seller contract price."
        },
        "mode": {
          "const": "end-buyer-profit"
        },
        "arv": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 1000000000,
          "description": "Assumed repaired value, USD."
        },
        "repairCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "End buyer’s repair budget, USD."
        },
        "investorProfitPercentage": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "End buyer’s target profit, percent of ARV."
        },
        "compareWith": {
          "type": "object",
          "properties": {
            "askingPrice": {
              "type": "number",
              "minimum": 0.01,
              "maximum": 1000000000,
              "description": "Seller contract price, USD."
            },
            "assignmentFee": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Target assignment fee, USD."
            },
            "closingCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Buyer closing costs in ARV mode, or default closing cost assumption in typed-price mode, USD."
            },
            "holdingCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Buyer holding costs in ARV mode or wholesaler other costs in typed-price mode, USD."
            },
            "path": {
              "enum": [
                "assignment",
                "double-close"
              ]
            },
            "calculationDate": {
              "type": "string",
              "format": "date",
              "minLength": 10,
              "maxLength": 10,
              "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
              "description": "Gregorian calendar date, YYYY-MM-DD."
            },
            "jurisdictionStatus": {
              "enum": [
                "unknown",
                "supported",
                "prohibited"
              ]
            },
            "earnestDepositAtRisk": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "At-risk deposit, USD."
            },
            "inspectionAndTitleCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Inspection and title cost charged to the wholesaler, USD."
            },
            "assignmentClosingCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Wholesaler assignment closing cost, USD."
            },
            "purchaseClosingCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Wholesaler first closing cost under double closing, USD."
            },
            "resaleClosingCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "Wholesaler resale closing cost under double closing, USD."
            },
            "transactionalFundingRatePct": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "Funding cost on a double closing, percent of the seller contract price."
            },
            "mode": {
              "const": "end-buyer-profit"
            },
            "arv": {
              "type": "number",
              "minimum": 0.01,
              "maximum": 1000000000,
              "description": "Assumed repaired value, USD."
            },
            "repairCosts": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "End buyer’s repair budget, USD."
            },
            "investorProfitPercentage": {
              "type": "number",
              "minimum": 0,
              "maximum": 100,
              "description": "End buyer’s target profit, percent of ARV."
            }
          },
          "required": [
            "askingPrice",
            "assignmentFee",
            "closingCosts",
            "holdingCosts",
            "path",
            "calculationDate",
            "jurisdictionStatus",
            "mode",
            "arv",
            "repairCosts",
            "investorProfitPercentage"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "askingPrice",
        "assignmentFee",
        "closingCosts",
        "holdingCosts",
        "path",
        "calculationDate",
        "jurisdictionStatus",
        "mode",
        "arv",
        "repairCosts",
        "investorProfitPercentage"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "askingPrice": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 1000000000,
          "description": "Seller contract price, USD."
        },
        "assignmentFee": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Target assignment fee, USD."
        },
        "closingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Buyer closing costs in ARV mode, or default closing cost assumption in typed-price mode, USD."
        },
        "holdingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Buyer holding costs in ARV mode or wholesaler other costs in typed-price mode, USD."
        },
        "path": {
          "enum": [
            "assignment",
            "double-close"
          ]
        },
        "calculationDate": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        },
        "jurisdictionStatus": {
          "enum": [
            "unknown",
            "supported",
            "prohibited"
          ]
        },
        "earnestDepositAtRisk": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "At-risk deposit, USD."
        },
        "inspectionAndTitleCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Inspection and title cost charged to the wholesaler, USD."
        },
        "assignmentClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler assignment closing cost, USD."
        },
        "purchaseClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler first closing cost under double closing, USD."
        },
        "resaleClosingCosts": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Wholesaler resale closing cost under double closing, USD."
        },
        "transactionalFundingRatePct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Funding cost on a double closing, percent of the seller contract price."
        },
        "mode": {
          "const": "supplied-buyer-price"
        },
        "endBuyerPrice": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 1000000000,
          "description": "Supplied end-buyer consideration, USD."
        }
      },
      "required": [
        "askingPrice",
        "assignmentFee",
        "closingCosts",
        "holdingCosts",
        "path",
        "calculationDate",
        "jurisdictionStatus",
        "mode",
        "endBuyerPrice"
      ],
      "additionalProperties": false
    }
  ],
  "description": "Computes end-buyer profit, assignment or double-close settlement from supplied transaction assumptions. Supports a typed end-buyer price. Jurisdiction status records the caller’s assumption and grants no legal eligibility."
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/investor-wholesale
Formula: investor-wholesale-1.0.0

Related PDF reports