Skip to content

Investment · Calculation

Rental income and expense ledger

Builds balanced journal entries and cash-basis totals from up to five anonymous property ledgers for a supplied year. Supports the app’s five other-income categories, dated expenses, late fees and uncollected rent.

Open Rental Income & Expense Tracker in HT Calc

This HT Calc screen includes a Pro sample for visitors.

Example result · formulaVersion: rules-workflows-1.1.0 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-rental-tracker.

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-rental-tracker";
const input = {
  "year": 2026,
  "properties": [
    {
      "months": [
        {
          "month": 1,
          "rentReceived": true,
          "rentCents": 180000,
          "lateFeeCents": 0,
          "otherIncomeCents": {
            "parking": 5000
          },
          "expenses": [
            {
              "category": "Repairs",
              "date": "2026-01-03",
              "amountCents": 15000
            }
          ]
        }
      ]
    }
  ]
};
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-rental-tracker' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "year": 2026,
  "properties": [
    {
      "months": [
        {
          "month": 1,
          "rentReceived": true,
          "rentCents": 180000,
          "lateFeeCents": 0,
          "otherIncomeCents": {
            "parking": 5000
          },
          "expenses": [
            {
              "category": "Repairs",
              "date": "2026-01-03",
              "amountCents": 15000
            }
          ]
        }
      ]
    }
  ]
}
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-rental-tracker.
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.

formulaVersion
rules-workflows-1.1.0
status
balanced
entryCount
3
How to interpret this result
  • Builds balanced journal entries and cash-basis totals from up to five anonymous property ledgers for a supplied year. Supports the app’s five other-income categories, dated expenses, late fees and uncollected rent.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "formulaVersion": "rules-workflows-1.1.0",
    "status": "balanced",
    "entryCount": 3,
    "incomeCents": 185000,
    "expenseCents": 15000,
    "netCents": 170000,
    "issues": [],
    "assumptions": [
      "Rent is recognized only when the month is marked received.",
      "Late fees and other-income entries are treated as received cash."
    ],
    "provenance": [
      "User-entered rental tracker rows projected into balanced double-entry journals."
    ],
    "periodTotals": [
      {
        "propertyIndex": 0,
        "year": 2026,
        "months": [
          {
            "month": 1,
            "incomeCents": 185000,
            "expenseCents": 15000,
            "netCents": 170000
          }
        ],
        "incomeCents": 185000,
        "expenseCents": 15000,
        "netCents": 170000
      }
    ],
    "entries": [
      {
        "id": "property-1:2026-1:income:rent",
        "tenantId": "scenario",
        "propertyId": "property-1",
        "occurredOn": "2026-01-01",
        "category": "Rent received",
        "memo": "Rent received recorded for property-1",
        "revision": 1,
        "postings": [
          {
            "accountId": "asset:cash",
            "debitCents": 180000,
            "creditCents": 0
          },
          {
            "accountId": "income:rent",
            "debitCents": 0,
            "creditCents": 180000
          }
        ]
      },
      {
        "id": "property-1:2026-1:income:parking",
        "tenantId": "scenario",
        "propertyId": "property-1",
        "occurredOn": "2026-01-01",
        "category": "Other income: parking",
        "memo": "Other income: parking recorded for property-1",
        "revision": 1,
        "postings": [
          {
            "accountId": "asset:cash",
            "debitCents": 5000,
            "creditCents": 0
          },
          {
            "accountId": "income:parking",
            "debitCents": 0,
            "creditCents": 5000
          }
        ]
      },
      {
        "id": "property-1:2026-1:expense:expense-1",
        "tenantId": "scenario",
        "propertyId": "property-1",
        "occurredOn": "2026-01-03",
        "category": "Repairs",
        "memo": "Repairs",
        "revision": 1,
        "postings": [
          {
            "accountId": "expense:repairs",
            "debitCents": 15000,
            "creditCents": 0
          },
          {
            "accountId": "asset:cash",
            "debitCents": 0,
            "creditCents": 15000
          }
        ]
      }
    ],
    "csv": "\"entry_id\",\"property_id\",\"occurred_on\",\"category\",\"memo\",\"account_id\",\"debit_cents\",\"credit_cents\"\r\n\"property-1:2026-1:income:parking\",\"property-1\",\"2026-01-01\",\"Other income: parking\",\"Other income: parking recorded for property-1\",\"asset:cash\",\"5000\",\"0\"\r\n\"property-1:2026-1:income:parking\",\"property-1\",\"2026-01-01\",\"Other income: parking\",\"Other income: parking recorded for property-1\",\"income:parking\",\"0\",\"5000\"\r\n\"property-1:2026-1:income:rent\",\"property-1\",\"2026-01-01\",\"Rent received\",\"Rent received recorded for property-1\",\"asset:cash\",\"180000\",\"0\"\r\n\"property-1:2026-1:income:rent\",\"property-1\",\"2026-01-01\",\"Rent received\",\"Rent received recorded for property-1\",\"income:rent\",\"0\",\"180000\"\r\n\"property-1:2026-1:expense:expense-1\",\"property-1\",\"2026-01-03\",\"Repairs\",\"Repairs\",\"expense:repairs\",\"15000\",\"0\"\r\n\"property-1:2026-1:expense:expense-1\",\"property-1\",\"2026-01-03\",\"Repairs\",\"Repairs\",\"asset:cash\",\"0\",\"15000\"\r\n"
  },
  "formulaVersion": "rules-workflows-1.1.0-marketplace.1",
  "units": {
    "*Cents": "integer USD cents",
    "month": "calendar month 1–12",
    "year": "calendar year",
    "date": "YYYY-MM-DD"
  },
  "assumptions": [
    "Builds balanced journal entries and cash-basis totals from up to five anonymous property ledgers for a supplied year. Supports the app’s five other-income categories, dated expenses, late fees and uncollected rent."
  ],
  "warnings": [],
  "creditCost": 10
}

Request contract

Accepted inputs

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

FieldType, units and limits

yearRequired
integer

Gregorian calendar year.

Min 1900 · Max 2200
propertiesRequired
arrayMin items 1 · Max items 5
properties[].monthsRequired
arrayMin items 0 · Max items 12
properties[].months[].monthRequired
integer

Calendar month number, January = 1.

Min 1 · Max 12
properties[].months[].rentReceivedRequired
boolean
properties[].months[].rentCentsRequired
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].rentDateOptional
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
properties[].months[].lateFeeCentsRequired
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].otherIncomeCentsOptional
object
properties[].months[].otherIncomeCents.laundryOptional
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].otherIncomeCents.storageOptional
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].otherIncomeCents.parkingOptional
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].otherIncomeCents.feesOptional
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].otherIncomeCents.otherOptional
integer

USD cents for this month, integer amount.

Min 0 · Max 100000000000
properties[].months[].expensesRequired
arrayMin items 0 · Max items 20
properties[].months[].expenses[].categoryRequired
stringAllowed: "Advertising", "Auto & Travel", "Cleaning & Maintenance", "Commissions", "Insurance", "Legal & Professional", "Management Fees", "Mortgage Interest", "Other Interest", "Repairs", "Supplies", "Taxes", "Utilities", "Other"
properties[].months[].expenses[].dateRequired
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
properties[].months[].expenses[].amountCentsRequired
integer

USD cents, integer amount.

Min 0 · Max 100000000000
Example request body (JSON)
{
  "year": 2026,
  "properties": [
    {
      "months": [
        {
          "month": 1,
          "rentReceived": true,
          "rentCents": 180000,
          "lateFeeCents": 0,
          "otherIncomeCents": {
            "parking": 5000
          },
          "expenses": [
            {
              "category": "Repairs",
              "date": "2026-01-03",
              "amountCents": 15000
            }
          ]
        }
      ]
    }
  ]
}
Full JSON schema
{
  "type": "object",
  "properties": {
    "year": {
      "type": "integer",
      "minimum": 1900,
      "maximum": 2200,
      "description": "Gregorian calendar year."
    },
    "properties": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "months": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "month": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 12,
                  "description": "Calendar month number, January = 1."
                },
                "rentReceived": {
                  "type": "boolean"
                },
                "rentCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100000000000,
                  "description": "USD cents for this month, integer amount."
                },
                "rentDate": {
                  "type": "string",
                  "format": "date",
                  "minLength": 10,
                  "maxLength": 10,
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                  "description": "Gregorian calendar date, YYYY-MM-DD."
                },
                "lateFeeCents": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 100000000000,
                  "description": "USD cents for this month, integer amount."
                },
                "otherIncomeCents": {
                  "type": "object",
                  "properties": {
                    "laundry": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000000,
                      "description": "USD cents for this month, integer amount."
                    },
                    "storage": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000000,
                      "description": "USD cents for this month, integer amount."
                    },
                    "parking": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000000,
                      "description": "USD cents for this month, integer amount."
                    },
                    "fees": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000000,
                      "description": "USD cents for this month, integer amount."
                    },
                    "other": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100000000000,
                      "description": "USD cents for this month, integer amount."
                    }
                  },
                  "required": [],
                  "additionalProperties": false
                },
                "expenses": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "category": {
                        "enum": [
                          "Advertising",
                          "Auto & Travel",
                          "Cleaning & Maintenance",
                          "Commissions",
                          "Insurance",
                          "Legal & Professional",
                          "Management Fees",
                          "Mortgage Interest",
                          "Other Interest",
                          "Repairs",
                          "Supplies",
                          "Taxes",
                          "Utilities",
                          "Other"
                        ]
                      },
                      "date": {
                        "type": "string",
                        "format": "date",
                        "minLength": 10,
                        "maxLength": 10,
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "description": "Gregorian calendar date, YYYY-MM-DD."
                      },
                      "amountCents": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 100000000000,
                        "description": "USD cents, integer amount."
                      }
                    },
                    "required": [
                      "category",
                      "date",
                      "amountCents"
                    ],
                    "additionalProperties": false
                  },
                  "minItems": 0,
                  "maxItems": 20
                }
              },
              "required": [
                "month",
                "rentReceived",
                "rentCents",
                "lateFeeCents",
                "expenses"
              ],
              "additionalProperties": false
            },
            "minItems": 0,
            "maxItems": 12
          }
        },
        "required": [
          "months"
        ],
        "additionalProperties": false
      },
      "minItems": 1,
      "maxItems": 5
    }
  },
  "required": [
    "year",
    "properties"
  ],
  "additionalProperties": false,
  "description": "Builds balanced journal entries and cash-basis totals from up to five anonymous property ledgers for a supplied year. Supports the app’s five other-income categories, dated expenses, late fees and uncollected rent."
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/investor-rental-tracker
Formula: rules-workflows-1.1.0-marketplace.1