Tax calculation
Compute penny-rounded subtotal, tax amount, grand total, per-line-item totals, and per-jurisdiction splits in USD.
Location and sourcing
Supply exactly one location mode (maximum request body size is 16,384 bytes):
- Single location: top-level
address, or top-levellatitudeandlongitude. - Origin and destination:
shipFromandshipToobjects (each containing eitheraddressorlatitude/longitude).
When shipFrom and shipTo are provided, Net Amount applies automatic intrastate origin vs. destination and interstate destination sourcing, returning a sourcing object with rule (interstate_destination, intrastate_origin, intrastate_modified_origin, intrastate_destination, or unresolved) and appliedLocation (shipFrom, shipTo, or null). See Sourcing rules for state details.
Amounts, shipping, and rounding
Supply either amount or lineItems, never both. All math runs in exact integer cents internally and returns penny-rounded USD decimal dollars (for example, 107.5 for $107.50).
| Field | Type | Details |
|---|---|---|
amount | number | Single USD amount (0 to 1,000,000,000, max 2 decimals). Mutually exclusive with lineItems. |
lineItems | array | 1 to 100 items: { id?, amount, quantity?, taxable?, itemKey?, productCode?, discountAmount?, discountType? }. Do not combine taxable and itemKey on the same item. |
discountAmount / discountType | number / string | Optional order-level or line-level discount in USD (max 2 decimals) and type: "retailer" (default, reduces taxable base) or "manufacturer" (third-party coupon; reduces taxable base only in CT, MA, MO, PA, TX, and no-sales-tax states). Order-level discounts allocate proportionally across lines. |
includeRetailDeliveryFees / retailDeliveryFeeExempt | boolean | When includeRetailDeliveryFees is true, evaluates Colorado (C.R.S. 43-4-218) and Minnesota (Minn. Stat. 168E.03, $100+ threshold) Retail Delivery Fees and returns calculation.fees and calculation.totalFees. Set retailDeliveryFeeExempt: true to suppress fees (for example, small-seller exemptions). |
lineItems[].itemKey | string | Category slug from GET /taxability/items resolved from the database for the matched state. Requires Starter or Growth (HTTP 403 plan_upgrade_required on unsubscribed accounts); returns HTTP 422 (taxability_unknown) if no rule exists. |
lineItems[].productCode | string | Optional custom product code created via POST /products (Starter+). Resolves custom rules, baseItemKey fallback, and product default treatment; returns HTTP 422 (product_not_found) if unknown. |
entityId / entityCode / ein | string | Optional legal entity scope (supply at most one, Starter+). Scopes custom products, custom rules, default ship-from origin, exemptions, and committed ledger entries. |
buyerType / customerTags | string / string[] | Optional buyerType ("b2b" or "b2c") for B2B/B2C statutory platform taxability rules (e.g., CT, IA, MD, OH SaaS) and custom rule matching, plus up to 20 lowercase customerTags (Starter+). |
shipping | number | Optional shipping charge in USD (default 0, max 2 decimals). |
shippingTaxable | boolean | Explicit shipping taxability flag (default false). Cannot be combined with shippingType. |
shippingType | string | "separately_stated" or "bundled". Resolves shipping taxability from the database when shipping > 0 (requires Starter or Growth; HTTP 403 plan_upgrade_required on unsubscribed accounts). Cannot be combined with shippingTaxable. |
mode | string | "exclusive" (default, add tax to net amounts) or "inclusive" (extract tax from gross totals). |
rounding | string | "half_up" (default commercial rounding) or "half_even" (banker's rounding). |
customerId | string | Optional customer identifier (1 to 128 chars). Automatically matches an active exemption certificate on file for the destination state (Starter+). |
exemptionCertificateId | string | Optional explicit exemption certificate ID (exc_...). Fails with 404 or 422 if missing, revoked, expired, or invalid for the state (Starter+). |
commit | boolean | When true and the calculation matches, persists the calculation snapshot to the transaction ledger and returns a transaction summary (Starter+). |
externalId | string | Optional unique order ID (1 to 128 chars, requires commit: true). Duplicate externalId values return HTTP 409 duplicate_transaction without billing. |
transactionDate | string | Optional YYYY-MM-DD effective and accounting date (works on both quotes and commits; defaults to today UTC). Resolves effective-dated platform taxability rules (such as Jan 1, 2027 CA SB 122 and CO HB 26-1223 SaaS), custom tax rules, and exemption matching. Pass your civil date explicitly near year-end cutovers. |
metadata | object | Optional string-to-string key/value map (up to 10 keys, requires commit: true). |
Discounts and Retail Delivery Fees
Supply discountAmount and optional discountType on individual lineItems or at the order level. Order-level discounts allocate proportionally across lines in exact integer cents. Retailer discounts ("retailer", default) reduce the taxable sales price in every state. Manufacturer-reimbursed coupons ("manufacturer") reduce the taxable base in CT, MA, MO, PA, TX (and states without general sales tax), while remaining part of the taxable price in all other states.
Pass includeRetailDeliveryFees: true to evaluate state Retail Delivery Fees for delivered tangible goods. Net Amount evaluates the Colorado Retail Delivery Fee (CO_RDF, C.R.S. 43-4-218, effective-dated flat fee when an order includes at least one taxable delivered tangible item) and the Minnesota Retail Delivery Fee (MN_RDF, Minn. Stat. 168E.03, $0.50 on deliveries with at least $100.00 in eligible tangible goods or clothing plus delivery charges, excluding groceries, prepared food, prescription drugs, and OTC drugs). Applied fees are returned in calculation.fees and calculation.totalFees and added to calculation.total. Pass retailDeliveryFeeExempt: true to suppress fees for exempt merchants.
Batch tax calculation
Calculate sales tax for 1 to 25 orders in a single request (maximum body size 262,144 bytes). Requires the Starter plan or higher. Identical street addresses and coordinates are automatically deduplicated so each unique location is geocoded and spatially resolved once per batch. Each entry in items accepts all POST /tax/calculate fields plus an optional batchItemId (1 to 64 characters) echoed in the matching result. Each result entry returns status ("ok" with response, or "error" with error) and httpStatus, alongside top-level count, succeeded, and failed totals. Failed or non-matched items do not fail the rest of the batch and are not billed.
{
"items": [
{
"batchItemId": "order_1001",
"latitude": 39.7392,
"longitude": -104.9903,
"lineItems": [
{ "id": "sku_a", "amount": 80, "quantity": 1, "discountAmount": 10, "discountType": "retailer" }
],
"includeRetailDeliveryFees": true
},
{
"batchItemId": "order_1002",
"latitude": 39.7392,
"longitude": -104.9903,
"amount": 120,
"includeRetailDeliveryFees": true
}
]
}Exemptions and committing transactions
Pass customerId or exemptionCertificateId to apply stored exemption certificates automatically. When a certificate applies, the response includes an exemption block and exempts eligible line items and shipping. Set commit: true with an optional externalId to store an immutable snapshot in the transaction ledger.
{
"address": "117 W Duval St, Jacksonville, FL 32202, USA",
"lineItems": [
{ "id": "sku_1", "amount": 120, "quantity": 1, "itemKey": "general_tangible_goods" }
],
"customerId": "cust_acme_001",
"commit": true,
"externalId": "order_10492",
"transactionDate": "2026-11-29",
"metadata": { "channel": "b2b_portal" }
}Example request and response
{
"shipFrom": {
"address": "117 W Duval St, Jacksonville, FL 32202, USA"
},
"shipTo": {
"address": "400 S Orange Ave, Orlando, FL 32801, USA"
},
"lineItems": [
{
"id": "widget",
"amount": 19.99,
"quantity": 2,
"taxable": true
},
{
"id": "saas_seat",
"amount": 50,
"itemKey": "saas"
}
],
"shipping": 5,
"shippingType": "separately_stated",
"mode": "exclusive",
"rounding": "half_up"
}When status is anything other than matched, the endpoint returns calculation: null and does not count against your monthly allowance. Below is a matched single-amount response for $100.00 in Jacksonville, Florida:
{
"coordinates": {
"latitude": 30.3297,
"longitude": -81.6586
},
"status": "matched",
"hasMissingRates": false,
"taxRate": 0.075,
"jurisdictions": [
{
"name": "Florida",
"stateName": "Florida",
"relation": "inside",
"rates": [
{
"name": "Florida",
"jurisdictionType": "state",
"taxType": "Sales",
"rate": 0.06,
"effectiveDate": "2017-01-01",
"endDate": "2029-12-31"
}
]
},
{
"name": "Duval",
"stateName": "Florida",
"relation": "inside",
"rates": [
{
"name": "Duval",
"jurisdictionType": "county",
"taxType": "Sales",
"rate": 0.015,
"effectiveDate": "2021-01-01",
"endDate": "2029-12-31"
}
]
}
],
"calculation": {
"currency": "USD",
"mode": "exclusive",
"rounding": "half_up",
"subtotal": 100,
"taxableAmount": 100,
"exemptAmount": 0,
"shippingAmount": 0,
"taxAmount": 7.5,
"total": 107.5,
"lineItems": [
{
"id": "item_1",
"quantity": 1,
"unitAmount": 100,
"subtotal": 100,
"taxable": true,
"taxAmount": 7.5,
"total": 107.5
}
],
"breakdown": [
{
"jurisdictionName": "Florida",
"rateName": "Florida",
"jurisdictionType": "state",
"rate": 0.06,
"taxAmount": 6
},
{
"jurisdictionName": "Duval",
"rateName": "Duval",
"jurisdictionType": "county",
"rate": 0.015,
"taxAmount": 1.5
}
]
}
}