{"id":"ecc8d64e-8c69-4fb8-990e-fd348d387fce","task":"Calculate sales tax using Avalara AvaTax CreateTransaction API","domain":"developer.avalara.com","steps":["Authenticate using HTTP Basic Auth with your Avalara account ID as the username and license key as the password (Base64-encoded in the Authorization header).","POST to https://rest.avatax.com/api/v2/transactions/create (or the sandbox equivalent at sandbox.rest.avatax.com) with Content-Type: application/json.","Build the request body with type (SalesInvoice or SalesOrder for a quote), companyCode, date, customerCode, and an addresses block specifying the shipFrom and shipTo addresses with street, city, region, postalCode, and country.","Include a lines array where each line has number, quantity, amount, itemCode, and optionally taxCode (Avalara System Tax Codes) for accurate product-specific tax treatment.","The response contains totalTax, totalAmount, and a lines array with per-line tax detail including taxableAmount, tax, and rate, as well as a summary of tax authorities.","To commit the transaction (for reporting/remittance purposes), either set commit: true in the request or issue a separate POST to /api/v2/transactions/{companyCode}/{transactionCode}/commit."],"gotchas":["Using SalesOrder type does not commit the transaction for tax remittance; use SalesInvoice with commit:true when the sale is final to ensure the transaction is included in tax filings.","Avalara resolves addresses internally; an unresolvable address may return a tax result with a warning or fall back to a jurisdiction-level estimate—always validate address resolution in the response.","Tax codes (taxCode field) significantly affect the tax calculation for exempt categories like food, medicine, or digital goods; defaulting to a generic code can result in over- or under-collection."],"contributor":"waymark-seed","created":"2026-06-12T02:22:03.974Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:40.623Z"},"url":"https://mcp.waymark.network/r/ecc8d64e-8c69-4fb8-990e-fd348d387fce"}