Calculate sales tax
Turn an order into jurisdiction-accurate tax with a single call.
Tax calculation happens through POST /api/v2/transactions/create. You describe the document — its type, addresses, and line items — and AvaTax returns tax for every applicable jurisdiction.
Document types
The type field controls whether a transaction is recorded.
Use SalesOrder while a customer is shopping, then create a SalesInvoice at checkout.
Request
Line-level detail
Each entry in lines can carry its own item code, tax code, and amount. AvaTax maps itemCode to the tax rules you’ve configured, so a potted fern and a gift card on the same order are taxed correctly.
Set discounted: true on the lines a document-level discount should apply to. AvaTax spreads the discount across those lines before calculating tax.
Response
The response echoes each line with its computed tax, plus a summary array breaking tax down by jurisdiction and tax type.
Exemptions
To exempt a line or document, pass an exemptionNo or an entityUseCode (for example, G for a government buyer). AvaTax validates the reason and zeroes out tax where the exemption applies.
Calculation is deterministic: the same document always yields the same tax. Persist the returned transaction code so you can commit, adjust, or void it later.

