apyhub
Back
▣ VERIFICATION KIT

US Sales Tax Calculator API

What it does

Sales Tax Calculator lets you add or extract U.S. sales tax from a single amount or a cart of items. Send a tax rate directly with taxPercent, look up the base state rate with state, or resolve the state from an exact zip when the ZIP code maps cleanly.

Use mode: add to calculate tax, subtotal, and total for an amount or an items array. For itemized carts, each item can include qty, name, price, and taxable; you can also apply discountPct, shipping, and shippingTaxable. Use mode: extract when you already have a tax-inclusive amount and need the pre-tax value and tax amount separated.

The response is plain JSON, with the computed sales tax result and any ZIP lookup details when you use zip. That makes it useful for checkout logic, invoice generation, quote tools, and internal pricing calculators where you need a consistent tax estimate without wiring in a full tax engine.

Sales Tax Calculator is designed for state-level calculation only. It does not guess local city, county, or district add-ons, so for addresses where those matter you should provide taxPercent yourself or use a known state rate.

POST
Calculate sales tax on an amount, adding or extracting tax, with US state base-rate lookup
https://api.eu.apyhub.com/freedailypro/us-sales-tax-calculator/sales-tax

QUICKSTART

GUIDE

Quickstart

Calculate sales tax from a simple amount and state lookup.

curl -X POST "https://api.eu.apyhub.com/freedailypro/us-sales-tax-calculator/sales-tax" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "TX",
    "amount": 100
  }'

What you'll get back

Returns a JSON object with no declared fields in the output schema.

{
  "result": {
    "taxAmount": 6.25,
    "total": 106.25,
    "net": 100,
    "amount": 100,
    "ratePct": 6.25,
    "rateSource": "US state base rate (local taxes excluded)",
    "state": "Texas",
    "stateBaseRatePct": 6.25,
    "averageCombinedRatePct": 8.2,
    "ratesAsOf": "Tax Foundation, 1 July 2026",
    "ratesAsOfDate": "2026-07-01",
    "ratesCheckedOn": "2026-10-30",
    "ratesAgeDays": 134,
    "ratesStale": false,
    "taxYear": 2026,
    "dataStatus": "estimate",
    "notes": [
      "Rate used: Texas STATE base rate 6.25%. Local (city, county, district) sales taxes are not included; the average combined rate is 8.2% (reference only, not applied). For an exact local rate send taxPercent."
    ],
    "disclaimer": "Estimate for information only. Not tax, legal or financial advice; check the figures with the tax authority or a qualified adviser."
  }
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
Send either amount or items, not both. If both are sent, items is used and amount is ignored. Send at least one rate source: taxPercent, state, or an exact zip.
US ZIP code, 5 digits or ZIP+4. Used to find the state. A rate is applied only where it is exact: 0% for DE, NH and OR, or the state rate for states with no local add-on. For any other ZIP, or a ZIP that can fall in more than one state, the call returns a 400 asking for state or taxPercent.
add (default) adds tax on top of the amount. extract treats the amount as tax-inclusive and returns the net and the tax in it. extract cannot be used with items.
items
A cart of 1 to 100 items. Add mode only. A response adds cart with taxable and exempt subtotals, tax, total, steps and lines.
items-1*
Price of one unit.

About this endpoint

What it does

Calculates sales tax for a US amount using either a provided tax rate, a US state lookup, or an exact ZIP lookup when available. It supports both single-amount and multi-item cart calculations, with optional shipping and discount handling in item mode.

Request Body

ParameterTypeMandatoryDescription
zipStringNoUS ZIP code (5 digits or ZIP+4). Used to find the state. The rate is filled in only where it is exact: 0% for DE, NH and OR, or the state rate for states with no local add-on in the Tax Foundation midyear 2026 table. For any other state no rate is guessed; the response's zip.message says so, and you send taxPercent or state.
modeENUMNoAllowed values: add, extract.
itemsObject ArrayNoSeveral items, used in add mode only. Each item may include: qty (integer, minimum 1, maximum 9007199254740991), name (string), price (number, minimum 0, required), taxable (boolean, default true). Maximum 100 items, minimum 1 item. Response adds cart with taxable and exempt subtotals, tax, total, steps and lines.
items[].qtyIntegerNoQuantity for the item, minimum 1, maximum 9007199254740991.
items[].nameStringNoItem name.
items[].priceNumberYesItem price, minimum 0.
items[].taxableBooleanNoMarks the item exempt when false. Default true.
stateStringNoUS state code (two-letter code such as TX, or the full name; DC included). Looks up the state base sales tax rate only (Tax Foundation, 1 July 2026). Local city, county, and district rates are not included.
amountNumberNoAmount to tax, or the tax-inclusive amount in extract mode. Required unless items is sent. Minimum 0.
shippingNumberNoShipping charged when using items. Minimum 0.
taxPercentNumberNoTax rate in percent. Required unless state or an exact zip is sent. Takes priority over state. Minimum 0, maximum 100.
discountPctNumberNoWith items: percentage discount on every line. Minimum 0, maximum 100.
shippingTaxableBooleanNoWith items: true adds shipping to the taxable amount. Default false (rules differ by state, so you choose).

Response

The endpoint returns a JSON object with the result under result. Which fields appear depends on how you called it, as shown in the last column.

FieldTypeDescriptionReturned
taxAmountNumberThe sales tax, rounded to the cent (half a cent rounds up). With items, this is the tax for the whole cart.Always
totalNumberNet plus tax. With items, the whole cart including exempt items, discount and shipping.Always
netNumberThe amount before tax. With items, the whole cart after discount and including shipping.Always
amountNumberThe amount you sent, or with items the sum of the item prices before any discount.Always
ratePctNumberThe rate that was applied, in percent.Always
rateSourceStringWhere the rate came from, for example US state base rate (local taxes excluded) or taxPercent sent by the caller.Always
stateStringThe state used.When the rate came from state or zip
stateBaseRatePctNumberThe state base rate, in percent.When a state was used
averageCombinedRatePctNumberThe average combined state and local rate for the state, for reference only. It is not applied.When a state was used
zipObjectThe state found from the ZIP, whether a rate was applied (rateApplied), a message, and the source.When zip was sent
ratesAsOfStringWho published the rate table and its date.Always
ratesAsOfDateStringDate of the rate table (YYYY-MM-DD).When a state rate was used
ratesCheckedOnStringDate the table was last checked (YYYY-MM-DD).When a state rate was used
ratesAgeDaysIntegerAge of the rate table in days.When a state rate was used
ratesStaleBooleantrue if the table is older than the review period.When a state rate was used
cartObjectThe cart breakdown.When items was sent
cart.subtotalNumberTotal of all items after any discount.items
cart.taxableSubtotalNumberTaxable items after any discount.items
cart.exemptSubtotalNumberExempt items after any discount.items
cart.shippingNumberThe shipping charge.items
cart.shippingTaxableBooleanWhether shipping was taxed.items
cart.taxableAmountNumberThe amount tax was worked out on: taxable items, plus shipping if taxed.items
cart.taxNumberTax on the cart.items
cart.totalNumberTotal of the cart.items
cart.linesArrayThe cart as readable lines, each with a label and a value.items
cart.stepsArrayThe cart calculation, one step at a time.items
cart.noteStringA note about shipping and the state.items
stepsArrayThe calculation, one step at a time.Always
steps[].labelStringName of the step, for example Sales tax.Always
steps[].formulaStringThe formula used.Always
steps[].inputsObjectThe numbers that went into the step.Always
steps[].resultNumberThe result of the step.Always
taxYearIntegerTax year of the rates.Always
sourcesStringWhere the rates come from, and when they were last checked.Always
dataStatusStringStatus of the rate data. estimate means confirm with the tax authority.Always
notesString ArrayNotes about this result, such as that local taxes are not included.Always
disclaimerStringUse notice.Always
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.