Chapter 2 - Calculate Taxes
Your First CalcTaxes Request
Let’s dive right in. We’re going to send a simple
CalcTaxes call using Postman and inspect the results.
Add the following mandatory headers to your request:
For the body of the
POST request, copy and paste the following example:
What are we sending?
In the example above, our request body begins with information that describes your company (
Next comes the Invoice (
inv). This object contains details of the transaction(s). We’ve included a document code so we can commit this transaction later. Our BillTo Location (
bill) is a Location object and can be specified in several ways. In this example, we passed in a combination of Country, City, State and Zip Code, but we can also pass a single PCode, FIPS, or NPANXX value. Because we didn’t specify a Street Address (
addr), the tax engine will make a best effort guess a location when determining tax jurisdiction.
The value you assign to the
date key is important: this affects which rules are used by our tax engine to calculate taxes. Tax rules change frequently and our Content Team continuously updates our tax engine to reflect these changes.
Inside the Invoice is a LineItem(
itms). This is where information like the Charge, Transaction/Service Pair, number of Lines, etc. is stored.
At the bottom of the JSON object we’ve set the Commit flag (
false. This is the default behavior so this line is optional, but you can set the flag to
true if you want to commit the transaction without using the Commit API later.
The response contains a list of tax amounts:
Each tax amount returned contains additional information including:
bill: Is the tax billable? Or, can this tax be passed on to the end-customer?
cmpl: Will this tax be included in compliance reporting?
tm: Taxable Measure
cat: Tax Category
rate: Tax Rate
lvl: Tax Level (Federal, State, County, Local)
tax: Tax Amount
More information about the CalcTaxesResponse can be found here.