Skip to content
ToolsOnDuty - free online tools
ToolsOnDuty / docs
Browse documentation

Reference / Finance

Finance API

22 endpoints for finance workflows. Every call requires bearer authentication and uses the standard ToolsOnDuty response envelope.

Try it

Runs a real request from your browser to your own ToolsOnDuty account. Your key is only kept in this page and is never stored.

POST/v1/finance/loan1 credit / call

Loan payment calculator

Amortizing loan payment, total payment and total interest.

ParameterTypeRequiredDescription
principalnumberYesLoan amount.
annualRatePercentnumberYesAnnual interest rate (%).
termnumberYesLoan term.
termUnitstringNoyears | months. Default: years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/loan \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"principal":200000,"annualRatePercent":6,"term":30,"termUnit":"years"}'

Response

{
  "ok": true,
  "data": {
    "monthlyPayment": 1199.1
  }
}
POST/v1/finance/emi1 credit / call

EMI calculator

Equated monthly installment, total interest and total amount payable (same amortizing formula as finance/loan).

ParameterTypeRequiredDescription
principalnumberYesLoan amount.
annualRatePercentnumberYesAnnual interest rate (%).
termnumberYesLoan term.
termUnitstringNoyears | months. Default: years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/emi \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"principal":500000,"annualRatePercent":9,"term":60,"termUnit":"months"}'

Response

{
  "ok": true,
  "data": {
    "emi": 10379.09
  }
}
POST/v1/finance/simple-interest1 credit / call

Simple interest

Simple interest and total amount: SI = P x R x T / 100.

ParameterTypeRequiredDescription
principalnumberYesPrincipal amount.
annualRatePercentnumberYesAnnual interest rate (%).
timenumberYesTime period.
timeUnitstringNoyears | months. Default: years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/simple-interest \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"principal":1000,"annualRatePercent":5,"time":2}'

Response

{
  "ok": true,
  "data": {
    "interest": 100,
    "total": 1100
  }
}
POST/v1/finance/compound-interest1 credit / call

Compound interest

Compound interest future value and total interest: A = P(1 + r/n)^(nt).

ParameterTypeRequiredDescription
principalnumberYesPrincipal amount.
annualRatePercentnumberYesAnnual interest rate (%).
timenumberYesTime period.
timeUnitstringNoyears | months. Default: years.
frequencystringNoannually | semiannually | quarterly | monthly | daily. Default: annually.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/compound-interest \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"principal":1000,"annualRatePercent":5,"time":10,"frequency":"monthly"}'

Response

{
  "ok": true,
  "data": {
    "futureValue": 1647.01,
    "interest": 647.01
  }
}
POST/v1/finance/investment1 credit / call

Investment growth

Future value of an initial investment plus regular contributions, with total contributions and growth.

ParameterTypeRequiredDescription
initialnumberYesInitial investment amount.
contributionnumberYesRegular contribution amount.
contributionFrequencystringNomonthly | quarterly | annually. Default: monthly.
annualReturnPercentnumberYesExpected annual return (%).
yearsnumberYesInvestment period in years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/investment \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"initial":1000,"contribution":100,"annualReturnPercent":7,"years":10}'

Response

{
  "ok": true,
  "data": {
    "futureValue": 18415
  }
}
POST/v1/finance/roi1 credit / call

Return on investment

ROI percentage and profit or loss from an initial investment and final value.

ParameterTypeRequiredDescription
initialInvestmentnumberYesInitial investment amount.
finalValuenumberYesFinal value.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/roi \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"initialInvestment":1000,"finalValue":1250}'

Response

{
  "ok": true,
  "data": {
    "roiPercent": 25,
    "profit": 250
  }
}
POST/v1/finance/savings1 credit / call

Savings growth

Future value of a savings balance with regular contributions.

ParameterTypeRequiredDescription
startingBalancenumberYesStarting balance.
contributionnumberYesRegular contribution amount.
contributionFrequencystringNomonthly | quarterly | annually. Default: monthly.
annualRatePercentnumberYesAnnual interest rate (%).
yearsnumberYesSavings period in years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/savings \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"startingBalance":5000,"contribution":200,"annualRatePercent":4,"years":5}'

Response

{
  "ok": true,
  "data": {
    "futureValue": 18424
  }
}
POST/v1/finance/mortgage1 credit / call

Mortgage calculator

Mortgage loan amount, monthly payment and totals, with optional property tax and insurance.

ParameterTypeRequiredDescription
homePricenumberYesHome price.
downPaymentnumberYesDown payment.
annualRatePercentnumberYesAnnual interest rate (%).
termYearsnumberYesLoan term in years.
annualPropertyTaxnumberNoAnnual property tax. Default: 0.
annualHomeInsurancenumberNoAnnual home insurance. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/mortgage \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"homePrice":400000,"downPayment":80000,"annualRatePercent":6,"termYears":30}'

Response

{
  "ok": true,
  "data": {
    "monthlyTotal": 1918.6
  }
}
POST/v1/finance/amortization1 credit / call

Amortization schedule

Payment, totals and a principal/interest schedule (capped to 60 rows) for a loan.

ParameterTypeRequiredDescription
loanAmountnumberYesLoan amount.
annualRatePercentnumberYesAnnual interest rate (%).
termYearsnumberYesLoan term in years.
frequencystringNomonthly | quarterly | annually. Default: monthly.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/amortization \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"loanAmount":100000,"annualRatePercent":5,"termYears":15}'

Response

{
  "ok": true,
  "data": {
    "payment": 790.79,
    "totalInterest": 42342
  }
}
POST/v1/finance/interest-rate1 credit / call

Interest rate solver

Derive the nominal and effective annual interest rate from a principal, final amount, time and compounding frequency.

ParameterTypeRequiredDescription
principalnumberYesStarting principal.
finalAmountnumberYesFinal amount.
timenumberYesTime period.
timeUnitstringNoyears | months. Default: years.
frequencystringNoannually | semiannually | quarterly | monthly | daily. Default: annually.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/interest-rate \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"principal":1000,"finalAmount":1500,"time":5}'

Response

{
  "ok": true,
  "data": {
    "nominalRatePercent": 8.45,
    "effectiveRatePercent": 8.45
  }
}
POST/v1/finance/discount1 credit / call

Discount calculator

Discount amount, final price and savings from an original price and discount percent.

ParameterTypeRequiredDescription
originalPricenumberYesOriginal price.
discountPercentnumberYesDiscount percentage (0-100).

Request

curl -X POST https://toolsonduty.com/api/v1/finance/discount \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"originalPrice":80,"discountPercent":25}'

Response

{
  "ok": true,
  "data": {
    "discountAmount": 20,
    "finalPrice": 60,
    "saved": 20
  }
}
POST/v1/finance/percentage-off1 credit / call

Percentage-off calculator

Amount off and final sale price for a price and percentage off (same math as finance/discount).

ParameterTypeRequiredDescription
pricenumberYesOriginal price.
percentOffnumberYesPercentage off (0-100).

Request

curl -X POST https://toolsonduty.com/api/v1/finance/percentage-off \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"price":80,"percentOff":25}'

Response

{
  "ok": true,
  "data": {
    "amountOff": 20,
    "finalPrice": 60
  }
}
POST/v1/finance/profit-margin1 credit / call

Profit margin calculator

Profit, profit margin percentage and markup percentage from revenue and cost.

ParameterTypeRequiredDescription
revenuenumberYesRevenue.
costnumberYesCost.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/profit-margin \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"revenue":150,"cost":100}'

Response

{
  "ok": true,
  "data": {
    "profit": 50,
    "marginPercent": 33.33,
    "markupPercent": 50
  }
}
POST/v1/finance/vat1 credit / call

VAT calculator

Add or remove VAT (or any percentage tax) from an amount: net, tax and gross.

ParameterTypeRequiredDescription
amountnumberYesAmount.
ratePercentnumberYesVAT rate (%).
modestringNoadd | remove. Default: add.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/vat \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"amount":100,"ratePercent":20,"mode":"add"}'

Response

{
  "ok": true,
  "data": {
    "netAmount": 100,
    "taxAmount": 20,
    "grossAmount": 120
  }
}
POST/v1/finance/sales-tax1 credit / call

Sales tax calculator

Sales tax amount and total price for a price and tax rate.

ParameterTypeRequiredDescription
pricenumberYesPrice before tax.
ratePercentnumberYesSales tax rate (%).

Request

curl -X POST https://toolsonduty.com/api/v1/finance/sales-tax \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"price":50,"ratePercent":8.5}'

Response

{
  "ok": true,
  "data": {
    "taxAmount": 4.25,
    "totalPrice": 54.25
  }
}
POST/v1/finance/tip1 credit / call

Tip calculator

Tip amount, total bill and per-person split.

ParameterTypeRequiredDescription
billAmountnumberYesBill amount.
tipPercentnumberYesTip percentage.
peoplenumberNoNumber of people splitting the bill. Default: 1.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/tip \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"billAmount":100,"tipPercent":18,"people":4}'

Response

{
  "ok": true,
  "data": {
    "tipAmount": 18,
    "totalBill": 118,
    "perPerson": 29.5
  }
}
POST/v1/finance/salary1 credit / call

Salary converter

Convert a salary across hourly, daily, weekly, monthly and annual pay periods.

ParameterTypeRequiredDescription
amountnumberYesSalary amount.
frequencystringYeshourly | daily | weekly | monthly | annual.
hoursPerDaynumberNoWork hours per day. Default: 8.
daysPerWeeknumberNoWork days per week. Default: 5.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/salary \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"amount":60000,"frequency":"annual"}'

Response

{
  "ok": true,
  "data": {
    "hourly": 28.85,
    "monthly": 5000
  }
}
POST/v1/finance/take-home1 credit / call

Take-home pay estimator

Estimate take-home pay from a gross salary, a deduction percentage and optional fixed deductions.

ParameterTypeRequiredDescription
grossSalarynumberYesGross salary.
deductionPercentnumberYesDeduction percentage (0-100).
otherDeductionsnumberNoAdditional fixed deductions. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/take-home \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"grossSalary":60000,"deductionPercent":20}'

Response

{
  "ok": true,
  "data": {
    "grossSalary": 60000,
    "deductionAmount": 12000,
    "takeHome": 48000
  }
}
POST/v1/finance/debt-to-income1 credit / call

Debt-to-income ratio

DTI percentage and an interpretation band (lower | moderate | higher) from monthly income and debt.

ParameterTypeRequiredDescription
monthlyIncomenumberYesGross monthly income.
monthlyDebtnumberYesTotal monthly debt payments.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/debt-to-income \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"monthlyIncome":5000,"monthlyDebt":1500}'

Response

{
  "ok": true,
  "data": {
    "dtiPercent": 30,
    "category": "lower"
  }
}
POST/v1/finance/retirement1 credit / call

Retirement savings estimator

Estimated retirement savings, contributions and investment growth from current age, retirement age, savings and monthly contribution.

ParameterTypeRequiredDescription
currentAgenumberYesCurrent age.
retirementAgenumberYesTarget retirement age (must exceed current age).
currentSavingsnumberYesCurrent retirement savings.
monthlyContributionnumberYesMonthly contribution.
annualReturnPercentnumberYesExpected annual return (%).

Request

curl -X POST https://toolsonduty.com/api/v1/finance/retirement \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"currentAge":30,"retirementAge":65,"currentSavings":20000,"monthlyContribution":500,"annualReturnPercent":7}'

Response

{
  "ok": true,
  "data": {
    "futureSavings": 963000
  }
}
POST/v1/finance/inflation1 credit / call

Inflation calculator

Future cost, purchasing power and total inflation from a current amount, inflation rate and number of years.

ParameterTypeRequiredDescription
currentAmountnumberYesCurrent amount.
inflationRatenumberYesAnnual inflation rate (%).
yearsnumberYesNumber of years.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/inflation \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"currentAmount":1000,"inflationRate":3,"years":10}'

Response

{
  "ok": true,
  "data": {
    "futureCost": 1343.92
  }
}
POST/v1/finance/invoice1 credit / call

Invoice totals calculator

Validate line items and calculate subtotal, fixed discount, tax and total; this endpoint does not render a document.

ParameterTypeRequiredDescription
itemsstringYesJSON array of {description, quantity, unitPrice} objects.
taxRatenumberNoTax percentage from 0 to 100. Default: 0.
discountnumberNoFixed discount amount. Default: 0.

Request

curl -X POST https://toolsonduty.com/api/v1/finance/invoice \
  -H "Authorization: ******" \
  -H "Content-Type: application/json" \
  -d '{"items":"[{\"description\":\"Service\",\"quantity\":2,\"unitPrice\":50}]","taxRate":10}'

Response

{
  "ok": true,
  "data": {
    "subtotal": 100,
    "tax": 10,
    "total": 110
  }
}