Skip to content

Mortgage · Calculation

Buyer and seller closing-cost worksheet

Allocate supplied line-item amounts among buyer and seller in cents and compute estimated buyer cash at closing. The example supplies an amount and payer for every line.

Example result · price: 300000 See output

Cost per success
2 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 closing-cost-payer-allocation.

Keep the key on your server. A successful call uses 2 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/closing-cost-payer-allocation";
const input = {
  "input": {
    "homePrice": 300000,
    "downPayment": 60000,
    "loanAmount": 240000,
    "interestRate": 6,
    "selectedState": ""
  },
  "overrides": {
    "origination": {
      "amount": 2000,
      "paidBy": "buyer"
    },
    "underwriting": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "processing": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "appraisal": {
      "amount": 600,
      "paidBy": "buyer"
    },
    "credit": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "flood": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "title_search": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "lender_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "settlement": {
      "amount": 500,
      "paidBy": "split"
    },
    "survey": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "attorney": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "recording": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "buyer_transfer": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "seller_transfer": {
      "amount": 1000,
      "paidBy": "seller"
    },
    "mortgage_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "local_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "insurance": {
      "amount": 900,
      "paidBy": "buyer"
    },
    "interest": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "escrow": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "owner_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "inspection": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "other": {
      "amount": 0,
      "paidBy": "buyer"
    }
  }
};
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/closing-cost-payer-allocation' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "input": {
    "homePrice": 300000,
    "downPayment": 60000,
    "loanAmount": 240000,
    "interestRate": 6,
    "selectedState": ""
  },
  "overrides": {
    "origination": {
      "amount": 2000,
      "paidBy": "buyer"
    },
    "underwriting": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "processing": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "appraisal": {
      "amount": 600,
      "paidBy": "buyer"
    },
    "credit": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "flood": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "title_search": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "lender_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "settlement": {
      "amount": 500,
      "paidBy": "split"
    },
    "survey": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "attorney": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "recording": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "buyer_transfer": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "seller_transfer": {
      "amount": 1000,
      "paidBy": "seller"
    },
    "mortgage_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "local_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "insurance": {
      "amount": 900,
      "paidBy": "buyer"
    },
    "interest": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "escrow": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "owner_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "inspection": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "other": {
      "amount": 0,
      "paidBy": "buyer"
    }
  }
}
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 closing-cost-payer-allocation.
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.

price
300000
loan
240000
rate
6
How to interpret this result
  • The caller enters all 22 fee amounts and payer allocations. State estimates are disabled.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "sections": [
      {
        "id": "A",
        "title": "Origination Charges (Section A)",
        "icon": "🏦",
        "items": [
          {
            "id": "origination",
            "name": "Loan Origination Fee",
            "amount": 2000,
            "paidBy": "buyer",
            "buyerAmount": 2000,
            "sellerAmount": 0,
            "cents": 200000,
            "buyerCents": 200000,
            "sellerCents": 0,
            "tooltip": "Illustrative 1% allowance, not a lender quote. Origination, underwriting and processing may overlap; replace each with your actual charges to avoid duplication."
          },
          {
            "id": "underwriting",
            "name": "Underwriting Fee",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Illustrative lender charge; set to zero if already included in origination."
          },
          {
            "id": "processing",
            "name": "Processing Fee",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Illustrative administrative charge; set to zero if already included elsewhere."
          }
        ]
      },
      {
        "id": "B",
        "title": "Services You Cannot Shop For (Section B)",
        "icon": "🔍",
        "items": [
          {
            "id": "appraisal",
            "name": "Appraisal Fee",
            "amount": 600,
            "paidBy": "buyer",
            "buyerAmount": 600,
            "sellerAmount": 0,
            "cents": 60000,
            "buyerCents": 60000,
            "sellerCents": 0,
            "tooltip": "Assumes a lender-selected appraisal; replace with the actual fee."
          },
          {
            "id": "credit",
            "name": "Credit Report Fee",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Lender-selected credit report service allowance."
          },
          {
            "id": "flood",
            "name": "Flood Certification",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Lender-selected flood determination service allowance."
          }
        ]
      },
      {
        "id": "C",
        "title": "Services You Can Shop For (Section C)",
        "icon": "📋",
        "items": [
          {
            "id": "title_search",
            "name": "Title Search",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Assumes you can shop for this provider. Split means 50/50 here; actual payer and LE placement depend on your lender and contract."
          },
          {
            "id": "lender_title",
            "name": "Lender's Title Insurance",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Illustrative allowance, not a regulated premium quote. Simultaneous-issue discounts and local rates may change the cost."
          },
          {
            "id": "settlement",
            "name": "Settlement/Closing Fee",
            "amount": 500,
            "paidBy": "split",
            "buyerAmount": 250,
            "sellerAmount": 250,
            "cents": 50000,
            "buyerCents": 25000,
            "sellerCents": 25000,
            "tooltip": "Planning allowance for settlement. Split means 50/50; use the actual contract allocation."
          },
          {
            "id": "survey",
            "name": "Survey Fee",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Assumes a lender-required service you can shop for. Set to zero if not needed; negotiable amounts are budgeted to buyer until changed."
          },
          {
            "id": "attorney",
            "name": "Attorney Fee Allowance",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Planning allowance only, not a statement that state law requires an attorney. Actual fee, provider choice and LE category vary."
          }
        ]
      },
      {
        "id": "E",
        "title": "Taxes & Other Government Fees (Section E)",
        "icon": "🏛️",
        "items": [
          {
            "id": "recording",
            "name": "Recording Fees",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Illustrative recording allowance; actual fees depend on documents and jurisdiction."
          },
          {
            "id": "buyer_transfer",
            "name": "Buyer Transfer Tax Allowance",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "State planning model only. Local taxes, exemptions and contract allocation may differ; enter the title agent quote. NY includes the base residential mansion tax when applicable, not NYC supplements."
          },
          {
            "id": "seller_transfer",
            "name": "Seller Transfer Tax Allowance",
            "amount": 1000,
            "paidBy": "seller",
            "buyerAmount": 0,
            "sellerAmount": 1000,
            "cents": 100000,
            "buyerCents": 0,
            "sellerCents": 100000,
            "tooltip": "State planning model only. WA uses 2023–2026 residential state brackets; NJ assumes no exemption and includes its current graduated fee. Local charges are separate."
          },
          {
            "id": "mortgage_tax",
            "name": "Mortgage Tax Allowance",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Planning allowance. Florida includes recorded-mortgage stamps plus intangible tax, assumed passed to borrower, using home price as the collateral-value proxy. NY county-specific rates and exemptions need a quote."
          },
          {
            "id": "local_tax",
            "name": "Additional Local Taxes",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Not included until entered. Add county/city surcharges, mansion-tax supplements or other quoted taxes not covered by the preset."
          }
        ]
      },
      {
        "id": "F",
        "title": "Prepaids (Section F)",
        "icon": "📅",
        "items": [
          {
            "id": "insurance",
            "name": "Homeowner's Insurance (1yr)",
            "amount": 900,
            "paidBy": "buyer",
            "buyerAmount": 900,
            "sellerAmount": 0,
            "cents": 90000,
            "buyerCents": 90000,
            "sellerCents": 0,
            "tooltip": "Illustrative annual premium of 0.35% of price. Replace with your insurance quote."
          },
          {
            "id": "interest",
            "name": "Per-Diem Interest (15 days)",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Assumes 15 days using actual/365 simple interest. Actual prepaid days and day-count convention depend on closing and lender."
          }
        ]
      },
      {
        "id": "G",
        "title": "Initial Escrow Payment (Section G)",
        "icon": "📅",
        "items": [
          {
            "id": "escrow",
            "name": "Initial Escrow (3mo tax + 2mo insurance)",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Assumes annual property tax of 1.2% of price, three tax months and two insurance months. This deposit is separate from the first annual insurance premium; replace with your lender escrow analysis."
          }
        ]
      },
      {
        "id": "H",
        "title": "Other Costs (Section H)",
        "icon": "🏠",
        "items": [
          {
            "id": "owner_title",
            "name": "Owner's Title Insurance",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Optional owner policy allowance of 0.3% of price; seller payment is a changeable planning assumption, not a state rule."
          },
          {
            "id": "inspection",
            "name": "Home Inspection",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Optional inspection allowance; can be paid before closing. It is not assumed to be a lender-required Section B service."
          },
          {
            "id": "other",
            "name": "Other Quoted Closing Fee",
            "amount": 0,
            "paidBy": "buyer",
            "buyerAmount": 0,
            "sellerAmount": 0,
            "cents": 0,
            "buyerCents": 0,
            "sellerCents": 0,
            "tooltip": "Enter another quoted fee, including any applicable loan-program or funding fee not already included or financed. Do not count a charge twice; choose its actual payer."
          }
        ]
      }
    ],
    "price": 300000,
    "loan": 240000,
    "rate": 6,
    "downPayment": 60000,
    "errors": [],
    "buyerCents": 375000,
    "sellerCents": 125000,
    "buyerHighCents": 450000,
    "totalCents": 500000,
    "buyerTotal": 3750,
    "sellerTotal": 1250,
    "transactionTotal": 5000,
    "buyerHigh": 4500,
    "cashLow": 63750,
    "cashHigh": 64500
  },
  "formulaVersion": "closing-cost-payer-allocation-htcalc-719df2c0e105",
  "units": {
    "buyerTotal": "USD",
    "sellerTotal": "USD",
    "transactionTotal": "USD",
    "cashLow": "USD",
    "cashHigh": "USD"
  },
  "assumptions": [
    "The caller enters all 22 fee amounts and payer allocations. State estimates are disabled."
  ],
  "warnings": [],
  "creditCost": 2
}

Request contract

Accepted inputs

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

FieldType, units and limits

inputRequired
object
input.homePriceRequired
number

Positive US dollars

Min 0.01 · Max 1000000000
input.downPaymentRequired
number

US dollars

Min 0 · Max 1000000000
input.loanAmountRequired
number

US dollars

Min 0 · Max 1000000000
input.interestRateRequired
number

Annual note rate in percent; 6 means 6%

Min 0 · Max 50
input.selectedStateOptional
string

No state fee table; each figure is supplied in overrides.

Must equal ""
overridesRequired
object
overrides.originationRequired
object
overrides.origination.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.origination.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.underwritingRequired
object
overrides.underwriting.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.underwriting.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.processingRequired
object
overrides.processing.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.processing.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.appraisalRequired
object
overrides.appraisal.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.appraisal.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.creditRequired
object
overrides.credit.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.credit.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.floodRequired
object
overrides.flood.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.flood.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.title_searchRequired
object
overrides.title_search.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.title_search.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.lender_titleRequired
object
overrides.lender_title.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.lender_title.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.settlementRequired
object
overrides.settlement.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.settlement.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.surveyRequired
object
overrides.survey.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.survey.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.attorneyRequired
object
overrides.attorney.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.attorney.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.recordingRequired
object
overrides.recording.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.recording.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.buyer_transferRequired
object
overrides.buyer_transfer.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.buyer_transfer.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.seller_transferRequired
object
overrides.seller_transfer.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.seller_transfer.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.mortgage_taxRequired
object
overrides.mortgage_tax.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.mortgage_tax.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.local_taxRequired
object
overrides.local_tax.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.local_tax.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.insuranceRequired
object
overrides.insurance.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.insurance.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.interestRequired
object
overrides.interest.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.interest.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.escrowRequired
object
overrides.escrow.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.escrow.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.owner_titleRequired
object
overrides.owner_title.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.owner_title.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.inspectionRequired
object
overrides.inspection.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.inspection.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
overrides.otherRequired
object
overrides.other.amountRequired
number

US dollars

Min 0 · Max 1000000000
overrides.other.paidByRequired
stringAllowed: "buyer", "seller", "split", "negotiable"
Example request body (JSON)
{
  "input": {
    "homePrice": 300000,
    "downPayment": 60000,
    "loanAmount": 240000,
    "interestRate": 6,
    "selectedState": ""
  },
  "overrides": {
    "origination": {
      "amount": 2000,
      "paidBy": "buyer"
    },
    "underwriting": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "processing": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "appraisal": {
      "amount": 600,
      "paidBy": "buyer"
    },
    "credit": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "flood": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "title_search": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "lender_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "settlement": {
      "amount": 500,
      "paidBy": "split"
    },
    "survey": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "attorney": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "recording": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "buyer_transfer": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "seller_transfer": {
      "amount": 1000,
      "paidBy": "seller"
    },
    "mortgage_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "local_tax": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "insurance": {
      "amount": 900,
      "paidBy": "buyer"
    },
    "interest": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "escrow": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "owner_title": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "inspection": {
      "amount": 0,
      "paidBy": "buyer"
    },
    "other": {
      "amount": 0,
      "paidBy": "buyer"
    }
  }
}
Full JSON schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "input": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "homePrice": {
          "type": "number",
          "minimum": 0.01,
          "maximum": 1000000000,
          "description": "Positive US dollars"
        },
        "downPayment": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "US dollars"
        },
        "loanAmount": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "US dollars"
        },
        "interestRate": {
          "type": "number",
          "minimum": 0,
          "maximum": 50,
          "description": "Annual note rate in percent; 6 means 6%"
        },
        "selectedState": {
          "type": "string",
          "const": "",
          "description": "No state fee table; each figure is supplied in overrides."
        }
      },
      "required": [
        "homePrice",
        "downPayment",
        "loanAmount",
        "interestRate"
      ]
    },
    "overrides": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "origination": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "underwriting": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "processing": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "appraisal": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "credit": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "flood": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "title_search": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "lender_title": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "settlement": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "survey": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "attorney": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "recording": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "buyer_transfer": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "seller_transfer": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "mortgage_tax": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "local_tax": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "insurance": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "interest": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "escrow": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "owner_title": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "inspection": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        },
        "other": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 1000000000,
              "description": "US dollars"
            },
            "paidBy": {
              "type": "string",
              "enum": [
                "buyer",
                "seller",
                "split",
                "negotiable"
              ]
            }
          },
          "required": [
            "amount",
            "paidBy"
          ]
        }
      },
      "required": [
        "origination",
        "underwriting",
        "processing",
        "appraisal",
        "credit",
        "flood",
        "title_search",
        "lender_title",
        "settlement",
        "survey",
        "attorney",
        "recording",
        "buyer_transfer",
        "seller_transfer",
        "mortgage_tax",
        "local_tax",
        "insurance",
        "interest",
        "escrow",
        "owner_title",
        "inspection",
        "other"
      ]
    }
  },
  "required": [
    "input",
    "overrides"
  ]
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/closing-cost-payer-allocation
Formula: closing-cost-payer-allocation-htcalc-719df2c0e105

Method and sources

Amounts and payers must be supplied for all 22 rows; empty state and a no-table dependency port. Generic line labels/illustrative explanation are retained from the original; applied amounts come from the caller.

Reviewed .