---
title: "Calculates total cost including sales tax for a purchase. Given a unit price, tax rate percentage, and optional quantity, computes the subtotal (price times quantity), the tax amount rounded to two decimal places, and the final total. Useful for estimating purchase costs across US states and municipalities with different tax rates, comparing pre-tax and post-tax prices, and budgeting. Chain into salary_to_hourly to see how many work-hours a purchase represents."
method: POST
path: "/api/sales_tax"
tags: ["general"]
---

# Calculates total cost including sales tax for a purchase. Given a unit price, tax rate percentage, and optional quantity, computes the subtotal (price times quantity), the tax amount rounded to two decimal places, and the final total. Useful for estimating purchase costs across US states and municipalities with different tax rates, comparing pre-tax and post-tax prices, and budgeting. Chain into salary_to_hourly to see how many work-hours a purchase represents.

`POST /api/sales_tax`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/sales_tax`
- Auth: none declared

## Request body

- object
  - `price` number, required: Unit price of the item in dollars (or any currency). Must be positive.
  - `tax_rate_pct` number: Sales tax rate as a percentage (e.g. 8.875 for 8.875%). Defaults to 0 — enter your local rate.
  - `quantity` number: Number of items to purchase. Defaults to 1.

## Response `200`

Computed result for sales_tax

- object
  - `result` object, required
    - `subtotal` number, required: Price times quantity before tax.
    - `tax_amount` number, required: Total tax amount, rounded to two decimal places.
    - `total` number, required: Subtotal plus tax amount.
    - `effective_rate_pct` number, required: The tax rate applied, echoed back for confirmation.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
