calculate_sales_tax
Sales tax calculator with US state base-rate lookup (local rates excluded) — add or extract tax
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | US 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 (a ZIP can cross city, county and district lines): the response's zip.message says so, and you send taxPercent or state. Response adds 'zip' with the state, status, message, source and the state's official lookup page where one was verified. | |
| mode | No | ||
| items | No | Several items (mode add only). Response adds 'cart' with taxable and exempt subtotals, tax, total, steps and lines. | |
| state | No | US state (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. | |
| amount | No | Amount to tax (or the tax-inclusive amount in extract mode). Required unless items is sent. | |
| shipping | No | With items: shipping charged. | |
| taxPercent | No | Tax rate in percent. Required unless state or an exact zip is sent. Takes priority over state. | |
| discountPct | No | With items: percentage discount on every line. | |
| shippingTaxable | No | With items: true adds shipping to the taxable amount. Default false (rules differ by state, so you choose). |