API Reference

Introduction

API Endpoint

https://api.taxjar.com/v2/

Sandbox API Endpoint

https://api.sandbox.taxjar.com/v2/

Welcome to the TaxJar Sales Tax API! You can use our API to get information on sales tax rates, categories or upload transactions.

We currently provide API clients for the following languages:

Before getting started, you’ll need to sign up for TaxJar and get an API key. If you have any questions or would like to request support for a new client language, feel free to contact us.

Authentication

Example Request With Authentication Headers

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;

public class AuthenticationExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");
    }

}
package main

import "github.com/taxjar/taxjar-go"

func main() {
    client := taxjar.NewClient(taxjar.Config{
      APIKey: "9e0cd62a22f451701f29c3bde214",
    })
}
# Authorization headers must be passed for every request
$ curl "API_ENDPOINT" \
  -H "Authorization: Token token="9e0cd62a22f451701f29c3bde214""

or

$ curl "API_ENDPOINT" \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Make sure to replace 9e0cd62a22f451701f29c3bde214 with your API key.

TaxJar uses API keys to allow access to the API. If you’re new to TaxJar, you’ll need to sign up for an account to get your API key. Otherwise, log in and go to Account > API Access to generate a new API token.

TaxJar expects the API key to be included in all API requests to the server using a header like the following:

Authorization: Token token="9e0cd62a22f451701f29c3bde214"

or

Authorization: Bearer 9e0cd62a22f451701f29c3bde214

API Version

Example Request Header With An API Version Specified

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

client.set_api_config('headers', {
  'x-api-version' => '2022-01-24'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

client.set_api_config('headers', {
  'x-api-version': '2022-01-24'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.setApiConfig('headers', {
  'x-api-version': '2022-01-24'
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$client->setApiConfig('headers', [
  'x-api-version' => '2022-01-24'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

client.setApiConfig("headers", new Dictionary<string, string> {
  { "x-api-version", "2022-01-24" }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import java.util.HashMap;
import java.util.Map;

public class ApiVersionExample {

    public static void main(String[] args) {
        Map<String, Object> params = new HashMap<>();
        params.put("x-api-version", "2022-01-24");

        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214", params);

        client.setApiConfig("x-api-version", "2022-01-24");
    }

}
package main

import "github.com/taxjar/taxjar-go"

func main() {
    client := taxjar.NewClient(taxjar.Config{
      APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    client.Headers = map[string]interface{}{
      "x-api-version": "2022-01-24",
    }
}
$ curl "API_ENDPOINT" \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "x-api-version: 2022-01-24"

TaxJar has introduced API versioning to deliver enhanced validations and features. To take advantage of an API version, 'x-api-version' must be specified in API call request headers.

'x-api-version' accepts a date in the form of a string: 'YYYY-MM-DD'. A valid version must be passed or the 'x-api-version' value will be ignored.

Current API versions

  • ‘2012-01-01’
  • ‘2020-08-07’
  • ‘2022-01-24’

For more details, see the API Changelog.

Billing

Each sales tax calculation or rate lookup request made to our API results in a “transaction”. These transactions will be counted toward your monthly plan limit. Overage fees are charged separately if you exceed your plan limit during busier months. You’ll always remain on the same plan until you decide to upgrade. You can check your API usage under “Transaction History” from Plans & Billing in the TaxJar app. Hover over the transaction counts for a breakdown of imported orders and calculations.

View our pricing to find a plan that works best for you. We also recommend our guide on avoiding unnecessary API calls to reduce your API usage and save money.

Countries

TaxJar has limited functionality for international calculations and it is only supported for users who have this feature currently implemented. If you need a global tax solution, you should consider Stripe Tax. You can learn more about Stripe Tax here. If you have additional questions please reach out to [email protected].

North America

   United States (US)

Sales Tax API

TaxJar API endpoints provide detailed US-based sales tax rates and calculations. They also support extended US-based reporting and filing capabilities for TaxJar users.

Categories

The TaxJar API provides product-level tax rules for a subset of product categories. These categories are to be used for products that are either exempt from sales tax in some jurisdictions or are taxed at reduced rates. You need not pass in a product tax code for sales tax calculations on product that is fully taxable. Simply leave that parameter out.

We will be expanding support for additional, less common categories over time. If you would like to request the addition of a new product category, please email us at [email protected].

get List tax categories

Definition

client.categories
client.categories
client.categories();
$client->categories();
client.Categories();
client.categories();
client.Categories()
GET https://api.taxjar.com/v2/categories

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

categories = client.categories
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

categories = client.categories()
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.categories().then(res => {
  res.categories; // Array of categories
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$categories = $client->categories();
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var categories = client.Categories();
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.categories.CategoryResponse;

public class CategoryExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            CategoryResponse res = client.categories();
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.Categories()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Categories)
    }
}
$ curl https://api.taxjar.com/v2/categories \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

{
  "categories": [
    {
      "name": "Installation Services",
      "product_tax_code": "10040",
      "description": "Installation services separately stated from sales of tangible personal property."
    },
    {
      "name": "General Services",
      "product_tax_code": "19000",
      "description": "Miscellaneous services which are not subject to a service-specific tax levy. This category will only treat services as taxable if the jurisdiction taxes services generally."
    },
    {
      "name": "Advertising Services",
      "product_tax_code": "19001",
      "description": "Services rendered for advertising which do not include the exchange of tangible personal property."
    },
    {
      "name": "Parking Services",
      "product_tax_code": "19002",
      "description": "Service of providing usage of a parking space."
    },
    {
      "name": "Admission Services",
      "product_tax_code": "19003",
      "description": "Admission charges associated with entry to an event."
    },
    {
      "name": "Training Services",
      "product_tax_code": "19004",
      "description": "Services provided to educate users on the proper use of a product."
    },
    {
      "name": "Professional Services",
      "product_tax_code": "19005",
      "description": "Professional services which are not subject to a service-specific tax levy."
    },
    {
      "name": "Dry Cleaning Services",
      "product_tax_code": "19006",
      "description": "Services provided in the cleaning of clothing and/or fabrics."
    },
    {
      "name": "Repair Services",
      "product_tax_code": "19007",
      "description": "Services provided to restore tangible personal property to working order or optimal functionality."
    },
    {
      "name": "Hairdressing Services",
      "product_tax_code": "19008",
      "description": "Services provided to cut and style human hair."
    },
    {
      "name": "Printing Services",
      "product_tax_code": "19009",
      "description": "Services provided to apply graphics and/or text to paper or other substrates which do not involve an exchange of tangible personal property."
    },
    {
      "name": "Clothing",
      "product_tax_code": "20010",
      "description": "All human wearing apparel suitable for general use"
    },
    {
      "name": "Clothing - Swimwear",
      "product_tax_code": "20041",
      "description": "Bathing suits and swim suits"
    },
    {
      "name": "Software as a Service",
      "product_tax_code": "30070",
      "description": "Pre-written software, delivered electronically, but access remotely."
    },
    {
      "name": "Digital Goods",
      "product_tax_code": "31000",
      "description": "Digital products transferred electronically, meaning obtained by the purchaser by means other than tangible storage media."
    },
    {
      "name": "Candy",
      "product_tax_code": "40010",
      "description": "Candy and similar items"
    },
    {
      "name": "Supplements",
      "product_tax_code": "40020",
      "description": "Non-food dietary supplements"
    },
    {
      "name": "Food & Groceries",
      "product_tax_code": "40030",
      "description": "Food for human consumption, unprepared"
    },
    {
      "name": "Soft Drinks",
      "product_tax_code": "40050",
      "description": "Soft drinks, soda, and other similar beverages. Does not include fruit juices and water."
    },
    {
      "name": "Bottled Water",
      "product_tax_code": "40060",
      "description": "Bottled, drinkable water for human consumption."
    },
    {
      "name": "Prepared Foods",
      "product_tax_code": "41000",
      "description": "Foods intended for on-site consumption. Ex. Restaurant meals."
    },
    {
      "name": "Non-Prescription",
      "product_tax_code": "51010",
      "description": "Drugs for human use without a prescription"
    },
    {
      "name": "Prescription",
      "product_tax_code": "51020",
      "description": "Drugs for human use with a prescription"
    },
    {
      "name": "Books",
      "product_tax_code": "81100",
      "description": "Books, printed"
    },
    {
      "name": "Textbook",
      "product_tax_code": "81110",
      "description": "Textbooks, printed"
    },
    {
      "name": "Religious Books",
      "product_tax_code": "81120",
      "description": "Religious books and manuals, printed"
    },
    {
      "name": "Magazines & Subscriptions",
      "product_tax_code": "81300",
      "description": "Periodicals, printed, sold by subscription"
    },
    {
      "name": "Magazine",
      "product_tax_code": "81310",
      "description": "Periodicals, printed, sold individually"
    }
  ]
}
[
  #<Taxjar::Category:0x00000a @attrs={
    :name => "Digital Goods",
    :product_tax_code => "31000",
    :description => "Digital products transferred electronically."
  }>,
  #<Taxjar::Category:0x00000a @attrs={
    :name => "Clothing",
    :product_tax_code => "20010",
    :description => "All human wearing apparel suitable for general use"
  }>,
  #<Taxjar::Category:0x00000a @attrs={
    :name => "Non-Prescription",
    :product_tax_code => "51010",
    :description => "Drugs for human use without a prescription"
  }>
]
[
  <TaxJarCategory {
    'product_tax_code': '31000',
    'name': 'Digital Goods',
    'description': 'Digital products transferred electronically, meaning obtained by the purchaser by means other than tangible storage media.'
  }>,
  <TaxJarCategory {
    'product_tax_code': '20010',
    'name': 'Clothing',
    'description': 'All human wearing apparel suitable for general use'
  }>,
  <TaxJarCategory {
    'product_tax_code': '51010',
    'name': 'Non-Prescription',
    'description': 'Drugs for human use without a prescription'
  }>
]
taxjar.CategoriesResponse{
    Categories: []taxjar.Category{
        {
            Name:           "Digital Goods",
            ProductTaxCode: "31000",
            Description:    "Digital products transferred electronically, meaning obtained by the purchaser by means other than tangible storage media.",
        },
        {
            Name:           "Clothing",
            ProductTaxCode: "20010",
            Description:    "All human wearing apparel suitable for general use",
        },
        {
            Name:           "Non-Prescription",
            ProductTaxCode: "51010",
            Description:    "Drugs for human use without a prescription",
        },
    },
}

Lists all tax categories.

Request

GET https://api.taxjar.com/v2/categories

Response

Returns a categories JSON object with an array of product categories and corresponding tax codes. The following categories are currently supported:

Category Code Countries Description

Attributes

Parameter Type Description
product_tax_code string Tax code of the given product category.
name string Name of the given product category.
description string Description of the given product category.

Taxes

post Calculate sales tax for an order

Definition

client.tax_for_order
client.tax_for_order
client.taxForOrder();
$client->taxForOrder();
client.TaxForOrder();
client.taxForOrder();
client.TaxForOrder()
POST https://api.taxjar.com/v2/taxes

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '92093',
  :from_state => 'CA',
  :from_city => 'La Jolla',
  :from_street => '9500 Gilman Drive',
  :to_country => 'US',
  :to_zip => '90002',
  :to_state => 'CA',
  :to_city => 'Los Angeles',
  :to_street => '1335 E 103rd St',
  :amount => 15,
  :shipping => 1.5,
  :nexus_addresses => [
    {
      :id => 'Main Location',
      :country => 'US',
      :zip => '92093',
      :state => 'CA',
      :city => 'La Jolla',
      :street => '9500 Gilman Drive',
    }
  ],
  :line_items => [
    {
      :id => '1',
      :quantity => 1,
      :product_tax_code => '20010',
      :unit_price => 15,
      :discount => 0
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '92093',
  'from_state': 'CA',
  'from_city': 'La Jolla',
  'from_street': '9500 Gilman Drive',
  'to_country': 'US',
  'to_zip': '90002',
  'to_state': 'CA',
  'to_city': 'Los Angeles',
  'to_street': '1335 E 103rd St',
  'amount': 15,
  'shipping': 1.5,
  'nexus_addresses': [
    {
      'id': 'Main Location',
      'country': 'US',
      'zip': '92093',
      'state': 'CA',
      'city': 'La Jolla',
      'street': '9500 Gilman Drive'
    }
  ],
  'line_items': [
    {
      'id': '1',
      'quantity': 1,
      'product_tax_code': '20010',
      'unit_price': 15,
      'discount': 0
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '92093',
  from_state: 'CA',
  from_city: 'La Jolla',
  from_street: '9500 Gilman Drive',
  to_country: 'US',
  to_zip: '90002',
  to_state: 'CA',
  to_city: 'Los Angeles',
  to_street: '1335 E 103rd St',
  amount: 15,
  shipping: 1.5,
  nexus_addresses: [
    {
      id: 'Main Location',
      country: 'US',
      zip: '92093',
      state: 'CA',
      city: 'La Jolla',
      street: '9500 Gilman Drive'
    }
  ],
  line_items: [
    {
      id: '1',
      quantity: 1,
      product_tax_code: '20010',
      unit_price: 15,
      discount: 0
    }
  ]
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '92093',
  'from_state' => 'CA',
  'from_city' => 'La Jolla',
  'from_street' => '9500 Gilman Drive',
  'to_country' => 'US',
  'to_zip' => '90002',
  'to_state' => 'CA',
  'to_city' => 'Los Angeles',
  'to_street' => '1335 E 103rd St',
  'amount' => 15,
  'shipping' => 1.5,
  'nexus_addresses' => [
    [
      'id' => 'Main Location',
      'country' => 'US',
      'zip' => '92093',
      'state' => 'CA',
      'city' => 'La Jolla',
      'street' => '9500 Gilman Drive',
    ]
  ],
  'line_items' => [
    [
      'id' => '1',
      'quantity' => 1,
      'product_tax_code' => '20010',
      'unit_price' => 15,
      'discount' => 0
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "92093",
  from_state = "CA",
  from_city = "La Jolla",
  from_street = "9500 Gilman Drive",
  to_country = "US",
  to_zip = "90002",
  to_state = "CA",
  to_city = "Los Angeles",
  to_street = "1335 E 103rd St",
  amount = 15,
  shipping = 1.5,
  nexus_addresses = new[] {
    new {
      id = "Main Location",
      country = "US",
      zip = "92093",
      state = "CA",
      city = "La Jolla",
      street = "9500 Gilman Drive",
    }
  },
  line_items = new[] {
    new {
      id = "1",
      quantity = 1,
      product_tax_code = "20010",
      unit_price = 15,
      discount = 0
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "92093");
            params.put("from_state", "CA");
            params.put("from_city", "La Jolla");
            params.put("from_street", "9500 Gilman Drive");
            params.put("to_country", "US");
            params.put("to_zip", "90002");
            params.put("to_state", "CA");
            params.put("to_city", "Los Angeles");
            params.put("to_street", "1335 E 103rd St");
            params.put("amount", 15);
            params.put("shipping", 1.5);

            List<Map> nexusAddresses = new ArrayList();
            Map<String, Object> nexusAddress = new HashMap<>();
            nexusAddress.put("country", "US");
            nexusAddress.put("zip", "92093");
            nexusAddress.put("state", "CA");
            nexusAddress.put("city", "La Jolla");
            nexusAddress.put("street", "9500 Gilman Drive");
            nexusAddresses.add(nexusAddress);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("id", 1);
            lineItem.put("quantity", 1);
            lineItem.put("product_tax_code", "20010");
            lineItem.put("unit_price", 15);
            lineItem.put("discount", 0);
            lineItems.add(lineItem);

            params.put("nexus_addresses", nexusAddresses);
            params.put("line_items", lineItems);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry:    "US",
        FromZip:        "92093",
        FromState:      "CA",
        FromCity:       "La Jolla",
        FromStreet:     "9500 Gilman Drive",
        ToCountry:      "US",
        ToZip:          "90002",
        ToState:        "CA",
        ToCity:         "Los Angeles",
        ToStreet:       "1335 E 103rd St",
        Amount:         15,
        Shipping:       1.5,
        NexusAddresses: []taxjar.NexusAddress {
            {
                ID:      "Main Location",
                Country: "US",
                Zip:     "92093",
                State:   "CA",
                City:    "La Jolla",
                Street:  "9500 Gilman Drive",
            },
        },
        LineItems: []taxjar.TaxLineItem {
            {
                ID:             "1",
                Quantity:       1,
                ProductTaxCode: "20010",
                UnitPrice:      15,
                Discount:       0,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_country": "US",
    "from_zip": "92093",
    "from_state": "CA",
    "from_city": "La Jolla",
    "from_street": "9500 Gilman Drive",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "Los Angeles",
    "to_street": "1335 E 103rd St",
    "amount": 15,
    "shipping": 1.5,
    "nexus_addresses": [
      {
        "id": "Main Location",
        "country": "US",
        "zip": "92093",
        "state": "CA",
        "city": "La Jolla",
        "street": "9500 Gilman Drive"
      }
    ],
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_tax_code": "20010",
        "unit_price": 15,
        "discount": 0
      }
    ]
  }'

Request Scenario: Origin-Based Sourcing Calculate sales tax for origin-based states such as Texas. In origin-based states, sales tax should be collected based on where you, the seller, are located. If shipping from out of state, destination-based sourcing may apply. Review our state guides to learn how to collect sales tax where you have nexus.

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '78701',
  :from_state => 'TX',
  :from_city => 'Austin',
  :from_street => '1100 Congress Ave',
  :to_country => 'US',
  :to_zip => '77058',
  :to_state => 'TX',
  :to_city => 'Houston',
  :to_street => '1601 E NASA Pkwy',
  :amount => 15,
  :shipping => 1.5,
  :nexus_addresses => [
    {
      :id => 'Main Location',
      :country => 'US',
      :zip => '78701',
      :state => 'TX',
      :city => 'Austin',
      :street => '1100 Congress Ave',
    }
  ],
  :line_items => [
    {
      :id => '1',
      :quantity => 1,
      :unit_price => 15,
      :discount => 0
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '78701',
  'from_state': 'TX',
  'from_city': 'Austin',
  'from_street': '1100 Congress Ave',
  'to_country': 'US',
  'to_zip': '77058',
  'to_state': 'TX',
  'to_city': 'Houston',
  'to_street': '1601 E NASA Pkwy',
  'amount': 15,
  'shipping': 1.5,
  'nexus_addresses': [
    {
      'id': 'Main Location',
      'country': 'US',
      'zip': '78701',
      'state': 'TX',
      'city': 'Austin',
      'street': '1100 Congress Ave'
    }
  ],
  'line_items': [
    {
      'id': '1',
      'quantity': 1,
      'unit_price': 15,
      'discount': 0
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '78701',
  from_state: 'TX',
  from_city: 'Austin',
  from_street: '1100 Congress Ave',
  to_country: 'US',
  to_zip: '77058',
  to_state: 'TX',
  to_city: 'Houston',
  to_street: '1601 E NASA Pkwy',
  amount: 15,
  shipping: 1.5,
  nexus_addresses: [
    {
      id: 'Main Location',
      country: 'US',
      zip: '78701',
      state: 'TX',
      city: 'Austin',
      street: '1100 Congress Ave'
    }
  ],
  line_items: [
    {
      id: '1',
      quantity: 1,
      unit_price: 15,
      discount: 0
    }
  ]
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '78701',
  'from_state' => 'TX',
  'from_city' => 'Austin',
  'from_street' => '1100 Congress Ave',
  'to_country' => 'US',
  'to_zip' => '77058',
  'to_state' => 'TX',
  'to_city' => 'Houston',
  'to_street' => '1601 E NASA Pkwy',
  'amount' => 15,
  'shipping' => 1.5,
  'nexus_addresses' => [
    [
      'id' => 'Main Location',
      'country' => 'US',
      'zip' => '78701',
      'state' => 'TX',
      'city' => 'Austin',
      'street' => '1100 Congress Ave',
    ]
  ],
  'line_items' => [
    [
      'id' => '1',
      'quantity' => 1,
      'unit_price' => 15,
      'discount' => 0
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "78701",
  from_state = "TX",
  from_city = "Austin",
  from_street = "1100 Congress Ave",
  to_country = "US",
  to_zip = "77058",
  to_state = "TX",
  to_city = "Houston",
  to_street = "1601 E NASA Pkwy",
  amount = 15,
  shipping = 1.5,
  nexus_addresses = new[] {
    new {
      id = "Main Location",
      country = "US",
      zip = "78701",
      state = "TX",
      city = "Austin",
      street = "1100 Congress Ave",
    }
  },
  line_items = new[] {
    new {
      id = "1",
      quantity = 1,
      unit_price = 15,
      discount = 0
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class OriginBasedSourcingTaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "78701");
            params.put("from_state", "TX");
            params.put("from_city", "Austin");
            params.put("from_street", "1100 Congress Ave");
            params.put("to_country", "US");
            params.put("to_zip", "77058");
            params.put("to_state", "TX");
            params.put("to_city", "Houston");
            params.put("to_street", "1601 E NASA Pkwy");
            params.put("amount", 15);
            params.put("shipping", 1.5);

            List<Map> nexusAddresses = new ArrayList();
            Map<String, Object> nexusAddress = new HashMap<>();
            nexusAddress.put("country", "US");
            nexusAddress.put("zip", "78701");
            nexusAddress.put("state", "TX");
            nexusAddress.put("city", "Austin");
            nexusAddress.put("street", "1100 Congress Ave");
            nexusAddresses.add(nexusAddress);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("id", 1);
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 15);
            lineItem.put("discount", 0);
            lineItems.add(lineItem);

            params.put("nexus_addresses", nexusAddresses);
            params.put("line_items", lineItems);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry:    "US",
        FromZip:        "78701",
        FromState:      "TX",
        FromCity:       "Austin",
        FromStreet:     "1100 Congress Ave",
        ToCountry:      "US",
        ToZip:          "77058",
        ToState:        "TX",
        ToCity:         "Houston",
        ToStreet:       "1601 E NASA Pkwy",
        Amount:         15,
        Shipping:       1.5,
        NexusAddresses: []taxjar.NexusAddress{
            {
                ID:      "Main Location",
                Country: "US",
                Zip:     "78701",
                State:   "TX",
                City:    "Austin",
                Street:  "1100 Congress Ave",
            },
        },
        LineItems: []taxjar.TaxLineItem{
            {
                ID:        "1",
                Quantity:  1,
                UnitPrice: 15,
                Discount:  0,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_country": "US",
    "from_zip": "78701",
    "from_state": "TX",
    "from_city": "Austin",
    "from_street": "1100 Congress Ave",
    "to_country": "US",
    "to_zip": "77058",
    "to_state": "TX",
    "to_city": "Houston",
    "to_street": "1601 E NASA Pkwy",
    "amount": 15,
    "shipping": 1.5,
    "nexus_addresses": [
      {
        "id": "Main Location",
        "country": "US",
        "zip": "78701",
        "state": "TX",
        "city": "Austin",
        "street": "1100 Congress Ave"
      }
    ],
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "unit_price": 15,
        "discount": 0
      }
    ]
  }'

Request Scenario: Shipping Exemptions If separately stated, shipping charges aren’t taxable in states such as California and Massachusetts. They are taxable if you include the charge as part of the price of the item.

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '02110',
  :from_state => 'MA',
  :from_city => 'Boston',
  :from_street => '1 Central Wharf',
  :to_country => 'US',
  :to_zip => '01608',
  :to_state => 'MA',
  :to_city => 'Worcester',
  :to_street => '455 Main St',
  :amount => 15,
  :shipping => 1.5,
  :nexus_addresses => [
    {
      :id => 'Main Location',
      :country => 'US',
      :zip => '02110',
      :state => 'MA',
      :city => 'Boston',
      :street => '1 Central Wharf',
    }
  ],
  :line_items => [
    {
      :id => '1',
      :quantity => 1,
      :unit_price => 15,
      :discount => 0
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '02110',
  'from_state': 'MA',
  'from_city': 'Boston',
  'from_street': '1 Central Wharf',
  'to_country': 'US',
  'to_zip': '01608',
  'to_state': 'MA',
  'to_city': 'Worcester',
  'to_street': '455 Main St',
  'amount': 15,
  'shipping': 1.5,
  'nexus_addresses': [
    {
      'id': 'Main Location',
      'country': 'US',
      'zip': '02110',
      'state': 'MA',
      'city': 'Boston',
      'street': '1 Central Wharf'
    }
  ],
  'line_items': [
    {
      'id': '1',
      'quantity': 1,
      'unit_price': 15,
      'discount': 0
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '02110',
  from_state: 'MA',
  from_city: 'Boston',
  from_street: '1 Central Wharf',
  to_country: 'US',
  to_zip: '01608',
  to_state: 'MA',
  to_city: 'Worcester',
  to_street: '455 Main St',
  amount: 15,
  shipping: 1.5,
  nexus_addresses: [
    {
      id: 'Main Location',
      country: 'US',
      zip: '02110',
      state: 'MA',
      city: 'Boston',
      street: '1 Central Wharf'
    }
  ],
  line_items: [
    {
      id: '1',
      quantity: 1,
      unit_price: 15,
      discount: 0
    }
  ]
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '02110',
  'from_state' => 'MA',
  'from_city' => 'Boston',
  'from_street' => '1 Central Wharf',
  'to_country' => 'US',
  'to_zip' => '01608',
  'to_state' => 'MA',
  'to_city' => 'Worcester',
  'to_street' => '455 Main St',
  'amount' => 15,
  'shipping' => 1.5,
  'nexus_addresses' => [
    [
      'id' => 'Main Location',
      'country' => 'US',
      'zip' => '02110',
      'state' => 'MA',
      'city' => 'Boston',
      'street' => '1 Central Wharf',
    ]
  ],
  'line_items' => [
    [
      'id' => '1',
      'quantity' => 1,
      'unit_price' => 15,
      'discount' => 0
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "02110",
  from_state = "MA",
  from_city = "Boston",
  from_street = "1 Central Wharf",
  to_country = "US",
  to_zip = "01608",
  to_state = "MA",
  to_city = "Worcester",
  to_street = "455 Main St",
  amount = 15,
  shipping = 1.5,
  nexus_addresses = new[] {
    new {
      id = "Main Location",
      country = "US",
      zip = "02110",
      state = "MA",
      city = "Boston",
      street = "1 Central Wharf",
    }
  },
  line_items = new[] {
    new {
      id = "1",
      quantity = 1,
      unit_price = 15,
      discount = 0
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ShippingExemptionTaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "02110");
            params.put("from_state", "MA");
            params.put("from_city", "Boston");
            params.put("from_street", "1 Central Wharf");
            params.put("to_country", "US");
            params.put("to_zip", "01608");
            params.put("to_state", "MA");
            params.put("to_city", "Worcester");
            params.put("to_street", "455 Main St");
            params.put("amount", 15);
            params.put("shipping", 1.5);

            List<Map> nexusAddresses = new ArrayList();
            Map<String, Object> nexusAddress = new HashMap<>();
            nexusAddress.put("country", "US");
            nexusAddress.put("zip", "02110");
            nexusAddress.put("state", "MA");
            nexusAddress.put("city", "Boston");
            nexusAddress.put("street", "1 Central Wharf");
            nexusAddresses.add(nexusAddress);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("id", 1);
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 15);
            lineItem.put("discount", 0);
            lineItems.add(lineItem);

            params.put("nexus_addresses", nexusAddresses);
            params.put("line_items", lineItems);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry:    "US",
        FromZip:        "02110",
        FromState:      "MA",
        FromCity:       "Boston",
        FromStreet:     "1 Central Wharf",
        ToCountry:      "US",
        ToZip:          "01608",
        ToState:        "MA",
        ToCity:         "Worcester",
        ToStreet:       "455 Main St",
        Amount:         15,
        Shipping:       1.5,
        NexusAddresses: []taxjar.NexusAddress{
            {
                ID:      "Main Location",
                Country: "US",
                Zip:     "02110",
                State:   "MA",
                City:    "Boston",
                Street:  "1 Central Wharf",
            }
        },
        LineItems: []taxjar.TaxLineItem{
            {
                ID:        "1",
                Quantity:  1,
                UnitPrice: 15,
                Discount:  0,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_country": "US",
    "from_zip": "02110",
    "from_state": "MA",
    "from_city": "Boston",
    "from_street": "1 Central Wharf",
    "to_country": "US",
    "to_zip": "01608",
    "to_state": "MA",
    "to_city": "Worcester",
    "to_street": "455 Main St",
    "amount": 15,
    "shipping": 1.5,
    "nexus_addresses": [
      {
        "id": "Main Location",
        "country": "US",
        "zip": "02110",
        "state": "MA",
        "city": "Boston",
        "street": "1 Central Wharf"
      }
    ],
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "unit_price": 15,
        "discount": 0
      }
    ]
  }'

Request Scenario: Clothing Exemptions Clothing items sold in New York under $110 are exempt from the state tax rate, but only exempt from county taxes in certain jurisdictions. We also handle clothing exemptions in states such as Pennsylvania and New Jersey.

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '12054',
  :from_state => 'NY',
  :from_city => 'Delmar',
  :to_country => 'US',
  :to_zip => '10541',
  :to_state => 'NY',
  :to_city => 'Mahopac',
  :amount => 29.94,
  :shipping => 7.99,
  :line_items => [
    {
      :quantity => 1,
      :unit_price => 19.99,
      :product_tax_code => '20010'
    },
    {
      :quantity => 1,
      :unit_price => 9.95,
      :product_tax_code => '20010'
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '12044',
  'from_state': 'NY',
  'from_city': 'Delmar',
  'to_country': 'US',
  'to_zip': '10541',
  'to_state': 'NY',
  'to_city': 'Mahopac',
  'amount': 29.94,
  'shipping': 7.99,
  'line_items': [
    {
      'quantity': 1,
      'unit_price': 19.99,
      'product_tax_code': '20010'
    },
    {
      'quantity': 1,
      'unit_price': 9.95,
      'product_tax_code': '20010'
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '12054',
  from_state: 'NY',
  from_city: 'Delmar',
  to_country: 'US',
  to_zip: '10541',
  to_state: 'NY',
  to_city: 'Mahopac',
  amount: 29.94,
  shipping: 7.99,
  line_items: [
    {
      quantity: 1,
      unit_price: 19.99,
      product_tax_code: '20010'
    },
    {
      quantity: 1,
      unit_price: 9.95,
      product_tax_code: '20010'
    }
  ]
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '12054',
  'from_state' => 'NY',
  'from_city' => 'Delmar',
  'to_country' => 'US',
  'to_zip' => '10541',
  'to_state' => 'NY',
  'to_city' => 'Mahopac',
  'amount' => 29.94,
  'shipping' => 7.99,
  'line_items' => [
    [
      'quantity' => 1,
      'unit_price' => 19.99,
      'product_tax_code' => '20010'
    ],
    [
      'quantity' => 1,
      'unit_price' => 9.95,
      'product_tax_code' => '20010'
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "12054",
  from_state = "NY",
  from_city = "Delmar",
  to_country = "US",
  to_zip = "10541",
  to_state = "NY",
  to_city = "Mahopac",
  amount = 29.94,
  shipping = 7.99,
  line_items = new[] {
    new {
      quantity = 1,
      unit_price = 19.99,
      product_tax_code = "20010"
    },
    new {
      quantity = 1,
      unit_price = 9.95,
      product_tax_code = "20010"
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ClothingExemptionTaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "12054");
            params.put("from_state", "NY");
            params.put("from_city", "Delmar");
            params.put("to_country", "US");
            params.put("to_zip", "10541");
            params.put("to_state", "NY");
            params.put("to_city", "Mahopac");
            params.put("amount", 29.94);
            params.put("shipping", 7.99);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 19.99);
            lineItem.put("product_tax_code", "20010");
            lineItems.add(lineItem);
            Map<String, Object> lineItem2 = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 9.95);
            lineItem.put("product_tax_code", "20010");
            lineItems.add(lineItem2);

            params.put("line_items", lineItems);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry: "US",
        FromZip:     "12054",
        FromState:   "NY",
        FromCity:    "Delmar",
        ToCountry:   "US",
        ToZip:       "10541",
        ToState:     "NY",
        ToCity:      "Mahopac",
        Amount:      29.94,
        Shipping:    7.99,
        LineItems:   []taxjar.TaxLineItem{
            {
                Quantity:       1,
                UnitPrice:      19.99,
                ProductTaxCode: "20010",
            },
            {
                Quantity:       1,
                UnitPrice:      9.95,
                ProductTaxCode: "20010",
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_city": "Delmar",
    "from_state": "NY",
    "from_zip": "12054",
    "from_country": "US",
    "to_city": "Mahopac",
    "to_state": "NY",
    "to_zip": "10541",
    "to_country": "US",
    "amount": 29.94,
    "shipping": 7.99,
    "line_items": [
      {
        "quantity": 1,
        "unit_price": 19.99,
        "product_tax_code": "20010"
      },
      {
        "quantity": 1,
        "unit_price": 9.95,
        "product_tax_code": "20010"
      }
    ]
  }'

Request Scenario: Food & Grocery Exemptions Food and grocery items are exempt from all sales tax in states such as California, New York, and Texas.

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '94133',
  :from_state => 'CA',
  :from_city => 'San Francisco',
  :to_country => 'US',
  :to_zip => '90071',
  :to_state => 'CA',
  :to_city => 'Los Angeles',
  :amount => 29.94,
  :shipping => 7.99,
  :line_items => [
    {
      :quantity => 1,
      :unit_price => 19.99,
      :product_tax_code => '40030'
    },
    {
      :quantity => 1,
      :unit_price => 9.95,
      :product_tax_code => '40030'
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '94133',
  'from_state': 'CA',
  'from_city': 'San Francisco',
  'to_country': 'US',
  'to_zip': '90071',
  'to_state': 'CA',
  'to_city': 'Los Angeles',
  'amount': 29.94,
  'shipping': 7.99,
  'line_items': [
    {
      'quantity': 1,
      'unit_price': 19.99,
      'product_tax_code': '40030'
    },
    {
      'quantity': 1,
      'unit_price': 9.95,
      'product_tax_code': '40030'
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '94133',
  from_state: 'CA',
  from_city: 'San Francisco',
  to_country: 'US',
  to_zip: '90071',
  to_state: 'CA',
  to_city: 'Los Angeles',
  amount: 29.94,
  shipping: 7.99,
  line_items: [
    {
      quantity: 1,
      unit_price: 19.99,
      product_tax_code: '40030'
    },
    {
      quantity: 1,
      unit_price: 9.95,
      product_tax_code: '40030'
    }
  ]
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '94133',
  'from_state' => 'CA',
  'from_city' => 'San Francisco',
  'to_country' => 'US',
  'to_zip' => '90071',
  'to_state' => 'CA',
  'to_city' => 'Los Angeles',
  'amount' => 29.94,
  'shipping' => 7.99,
  'line_items' => [
    [
      'quantity' => 1,
      'unit_price' => 19.99,
      'product_tax_code' => '40030'
    ],
    [
      'quantity' => 1,
      'unit_price' => 9.95,
      'product_tax_code' => '40030'
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "94133",
  from_state = "CA",
  from_city = "San Francisco",
  to_country = "US",
  to_zip = "90071",
  to_state = "CA",
  to_city = "Los Angeles",
  amount = 29.94,
  shipping = 7.99,
  line_items = new[] {
    new {
      quantity = 1,
      unit_price = 19.99,
      product_tax_code = "40030"
    },
    new {
      quantity = 1,
      unit_price = 9.95,
      product_tax_code = "40030"
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class FoodGroceryExemptionTaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "94133");
            params.put("from_state", "CA");
            params.put("from_city", "San Francisco");
            params.put("to_country", "US");
            params.put("to_zip", "90071");
            params.put("to_state", "CA");
            params.put("to_city", "Los Angeles");
            params.put("amount", 29.94);
            params.put("shipping", 7.99);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 19.99);
            lineItem.put("product_tax_code", "20010");
            lineItems.add(lineItem);
            Map<String, Object> lineItem2 = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("unit_price", 9.95);
            lineItem.put("product_tax_code", "20010");
            lineItems.add(lineItem2);

            params.put("line_items", lineItems);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry: "US",
        FromZip:     "94133",
        FromState:   "CA",
        FromCity:    "San Francisco",
        ToCountry:   "US",
        ToZip:       "90071",
        ToState:     "CA",
        ToCity:      "Los Angeles",
        Amount:      29.94,
        Shipping:    7.99,
        LineItems:   []taxjar.TaxLineItem{
            {
                Quantity:       1,
                UnitPrice:      19.99,
                ProductTaxCode: "40030",
            },
            {
                Quantity:       1,
                UnitPrice:      9.95,
                ProductTaxCode: "40030",
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_city": "San Francisco",
    "from_state": "CA",
    "from_zip": "94133",
    "from_country": "US",
    "to_city": "Los Angeles",
    "to_state": "CA",
    "to_zip": "90071",
    "to_country": "US",
    "amount": 29.94,
    "shipping": 7.99,
    "line_items": [
      {
        "quantity": 1,
        "unit_price": 19.99,
        "product_tax_code": "40030"
      },
      {
        "quantity": 1,
        "unit_price": 9.95,
        "product_tax_code": "40030"
      }
    ]
  }'

Request Scenario: No Nexus For interstate transactions, nexus won’t trigger for the destination state unless you provide the destination state via nexus_addresses[] or have the destination state on file in your TaxJar account.

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.tax_for_order({
  :from_country => 'US',
  :from_zip => '33018',
  :from_state => 'FL',
  :from_city => 'Miami',
  :to_country => 'US',
  :to_zip => '97035',
  :to_state => 'OR',
  :to_city => 'Portland',
  :amount => 15,
  :shipping => 1.5
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.tax_for_order({
  'from_country': 'US',
  'from_zip': '33018',
  'from_state': 'FL',
  'from_city': 'Miami',
  'to_country': 'US',
  'to_zip': '97035',
  'to_state': 'OR',
  'to_city': 'Portland',
  'amount': 15,
  'shipping': 1.5
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.taxForOrder({
  from_country: 'US',
  from_zip: '33018',
  from_state: 'FL',
  from_city: 'Miami',
  to_country: 'US',
  to_zip: '97035',
  to_state: 'OR',
  to_city: 'Portland',
  amount: 15,
  shipping: 1.5
}).then(res => {
  res.tax; // Tax object
  res.tax.amount_to_collect; // Amount to collect
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order_taxes = $client->taxForOrder([
  'from_country' => 'US',
  'from_zip' => '33018',
  'from_state' => 'FL',
  'from_city' => 'Miami',
  'to_country' => 'US',
  'to_zip' => '97035',
  'to_state' => 'OR',
  'to_city' => 'Portland',
  'amount' => 15,
  'shipping' => 1.5
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var rates = client.TaxForOrder(new {
  from_country = "US",
  from_zip = "33018",
  from_state = "FL",
  from_city = "Miami",
  to_country = "US",
  to_zip = "97305",
  to_state = "OR",
  to_city = "Portland",
  amount = 15,
  shipping = 1.5
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.taxes.TaxResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class NoNexusTaxExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("from_country", "US");
            params.put("from_zip", "33018");
            params.put("from_state", "FL");
            params.put("from_city", "Miami");
            params.put("to_country", "US");
            params.put("to_zip", "97305");
            params.put("to_state", "OR");
            params.put("to_city", "Portland");
            params.put("amount", 15);
            params.put("shipping", 1.5);

            TaxResponse res = client.taxForOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.TaxForOrder(taxjar.TaxForOrderParams{
        FromCountry: "US",
        FromZip:     "33018",
        FromState:   "FL",
        FromCity:    "Miami",
        ToCountry:   "US",
        ToZip:       "97305",
        ToState:     "OR",
        ToCity:      "Portland",
        Amount:      15,
        Shipping:    1.5,
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Tax)
    }
}
$ curl https://api.taxjar.com/v2/taxes \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "from_city": "Miami",
    "from_state": "FL",
    "from_zip": "33018",
    "from_country": "US",
    "to_city": "Portland",
    "to_state": "OR",
    "to_zip": "97035",
    "to_country": "US",
    "amount": 15,
    "shipping": 1.5
  }'

Response Example

{
  "tax": {
    "order_total_amount": 16.5,
    "shipping": 1.5,
    "taxable_amount": 15,
    "amount_to_collect": 1.35,
    "rate": 0.09,
    "has_nexus": true,
    "freight_taxable": false,
    "tax_source": "destination",
    "jurisdictions": {
      "country": "US",
      "state": "CA",
      "county": "LOS ANGELES",
      "city": "LOS ANGELES"
    },
    "breakdown": {
      "taxable_amount": 15,
      "tax_collectable": 1.35,
      "combined_tax_rate": 0.09,
      "state_taxable_amount": 15,
      "state_tax_rate": 0.0625,
      "state_tax_collectable": 0.94,
      "county_taxable_amount": 15,
      "county_tax_rate": 0.0025,
      "county_tax_collectable": 0.04,
      "city_taxable_amount": 0,
      "city_tax_rate": 0,
      "city_tax_collectable": 0,
      "special_district_taxable_amount": 15,
      "special_tax_rate": 0.025,
      "special_district_tax_collectable": 0.38,
      "line_items": [
        {
          "id": "1",
          "taxable_amount": 15,
          "tax_collectable": 1.35,
          "combined_tax_rate": 0.09,
          "state_taxable_amount": 15,
          "state_sales_tax_rate": 0.0625,
          "state_amount": 0.94,
          "county_taxable_amount": 15,
          "county_tax_rate": 0.0025,
          "county_amount": 0.04,
          "city_taxable_amount": 0,
          "city_tax_rate": 0,
          "city_amount": 0,
          "special_district_taxable_amount": 15,
          "special_tax_rate": 0.025,
          "special_district_amount": 0.38
        }
      ]
    }
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :order_total_amount => 16.5,
  :shipping => 1.5,
  :taxable_amount => 15.0,
  :amount_to_collect => 1.35,
  :rate => 0.09,
  :has_nexus => true,
  :freight_taxable => false,
  :tax_source => "destination",
  :jurisdictions => #<Taxjar::Jurisdictions:0x00000a @attrs={
    :country => 'US',
    :state => 'CA',
    :county => 'LOS ANGELES',
    :city => 'LOS ANGELES'
  }>,
  :breakdown => #<Taxjar::Breakdown:0x00000a @attrs={
    :taxable_amount => 15.0,
    :tax_collectable => 1.35,
    :combined_tax_rate => 0.09,
    :state_taxable_amount => 15.0,
    :state_tax_rate => 0.0625,
    :state_tax_collectable => 0.94,
    :county_taxable_amount => 15.0,
    :county_tax_rate => 0.0025,
    :county_tax_collectable => 0.04,
    :city_taxable_amount => 0.0,
    :city_tax_rate => 0.0,
    :city_tax_collectable => 0.0,
    :special_district_taxable_amount => 15.0,
    :special_tax_rate => 0.025,
    :special_district_tax_collectable => 0.38,
    :line_items => [
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "1",
        :taxable_amount => 15.0,
        :tax_collectable => 1.35,
        :combined_tax_rate => 0.09,
        :state_taxable_amount => 15.0,
        :state_sales_tax_rate => 0.065,
        :state_amount => 0.94,
        :county_taxable_amount => 15.0,
        :county_tax_rate => 0.0025,
        :county_amount => 0.04,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 15.0,
        :special_tax_rate => 0.025,
        :special_district_amount => 0.38
      }>
    ]
  }>
}>
<TaxJarTax {
  'breakdown': <TaxJarBreakdown {
    'special_district_taxable_amount': 15.0,
    'city_tax_rate': 0.0,
    'county_tax_collectable': 0.15,
    'county_taxable_amount': 15.0,
    'special_district_tax_collectable': 0.23,
    'line_items': [<TaxJarBreakdownLineItem {
      'special_district_taxable_amount': 15.0,
      'city_tax_rate': 0.0,
      'county_taxable_amount': 15.0,
      'special_district_amount': 0.23,
      'state_sales_tax_rate': 0.0625,
      'state_amount': 0.94,
      'city_taxable_amount': 0.0,
      'taxable_amount': 15.0,
      'special_tax_rate': 0.015,
      'state_taxable_amount': 15.0,
      'combined_tax_rate': 0.0875,
      'county_tax_rate': 0.01,
      'city_amount': 0.0,
      'county_amount': 0.15,
      'id': '1',
      'tax_collectable': 1.31
    }>],
    'taxable_amount': 15.0,
    'state_taxable_amount': 15.0,
    'combined_tax_rate': 0.0875,
    'state_tax_collectable': 0.94,
    'state_tax_rate': 0.0625,
    'city_tax_collectable': 0.0,
    'county_tax_rate': 0.01,
    'special_tax_rate': 0.015,
    'city_taxable_amount': 0.0,
    'tax_collectable': 1.31
  }>,
  'jurisdictions': <TaxJarJurisdictions {
    'country': 'US',
    'state': 'CA',
    'county': 'LOS ANGELES',
    'city': 'LOS ANGELES'
  }>,
  'has_nexus': True,
  'tax_source': 'destination',
  'shipping': 1.5,
  'taxable_amount': 15.0,
  'rate': 0.0875,
  'freight_taxable': False,
  'amount_to_collect': 1.31,
  'order_total_amount': 16.5
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        OrderTotalAmount: 16.5,
        Shipping:         1.5,
        TaxableAmount:    15,
        AmountToCollect:  1.35,
        Rate:             0.09,
        HasNexus:         true,
        FreightTaxable:   false,
        TaxSource:        "destination",
        Jurisdictions:    taxjar.Jurisdictions{
            Country: "US",
            State:   "CA",
            County:  "LOS ANGELES",
            City:    "LOS ANGELES",
        },
        Breakdown: taxjar.Breakdown{
            TaxableAmount:                 15,
            TaxCollectable:                1.35,
            CombinedTaxRate:               0.09,
            StateTaxableAmount:            15,
            StateTaxRate:                  0.0625,
            StateTaxCollectable:           0.94,
            CountyTaxableAmount:           15,
            CountyTaxRate:                 0.0025,
            CountyTaxCollectable:          0.04,
            CityTaxableAmount:             0,
            CityTaxRate:                   0,
            CityTaxCollectable:            0,
            SpecialDistrictTaxableAmount:  15,
            SpecialTaxRate:                0.025,
            SpecialDistrictTaxCollectable: 0.38,
            LineItems:                     []taxjar.LineItemBreakdown{
                {
                    ID:                           "1",
                    TaxableAmount:                15,
                    TaxCollectable:               1.35,
                    CombinedTaxRate:              0.09,
                    StateTaxableAmount:           15,
                    StateSalesTaxRate:            0.0625,
                    StateAmount:                  0.94,
                    CountyTaxableAmount:          15,
                    CountyTaxRate:                0.0025,
                    CountyAmount:                 0.04,
                    CityTaxableAmount:            0,
                    CityTaxRate:                  0,
                    CityAmount:                   0,
                    SpecialDistrictTaxableAmount: 15,
                    SpecialTaxRate:               0.025,
                    SpecialDistrictAmount:       0.38,
                },
            },
        },
    },
}

Response Scenario: Origin-Based Sourcing

{
  "tax": {
    "order_total_amount": 16.5,
    "shipping": 1.5,
    "taxable_amount": 16.5,
    "amount_to_collect": 1.36,
    "rate": 0.0825,
    "has_nexus": true,
    "freight_taxable": true,
    "tax_source": "origin",
    "jurisdictions": {
      "country": "US",
      "state": "TX",
      "county": "TRAVIS",
      "city": "AUSTIN"
    },
    "breakdown": {
      "city_tax_collectable": 0.17,
      "city_tax_rate": 0.01,
      "city_taxable_amount": 16.5,
      "combined_tax_rate": 0.0825,
      "county_tax_collectable": 0,
      "county_tax_rate": 0,
      "county_taxable_amount": 0,
      "line_items": [
        {
          "city_amount": 0.15,
          "city_tax_rate": 0.01,
          "city_taxable_amount": 15,
          "combined_tax_rate": 0.0825,
          "county_amount": 0,
          "county_tax_rate": 0,
          "county_taxable_amount": 0,
          "id": "1",
          "special_district_amount": 0.15,
          "special_district_taxable_amount": 15,
          "special_tax_rate": 0.01,
          "state_amount": 0.94,
          "state_sales_tax_rate": 0.0625,
          "state_taxable_amount": 15,
          "tax_collectable": 1.24,
          "taxable_amount": 15
        }
      ],
      "shipping": {
        "city_amount": 0.02,
        "city_tax_rate": 0.01,
        "city_taxable_amount": 1.5,
        "combined_tax_rate": 0.0825,
        "county_amount": 0,
        "county_tax_rate": 0,
        "county_taxable_amount": 0,
        "special_district_amount": 0.02,
        "special_tax_rate": 0.01,
        "special_taxable_amount": 1.5,
        "state_amount": 0.09,
        "state_sales_tax_rate": 0.0625,
        "state_taxable_amount": 1.5,
        "tax_collectable": 0.12,
        "taxable_amount": 1.5
      },
      "special_district_tax_collectable": 0.17,
      "special_district_taxable_amount": 16.5,
      "special_tax_rate": 0.01,
      "state_tax_collectable": 1.03,
      "state_tax_rate": 0.0625,
      "state_taxable_amount": 16.5,
      "tax_collectable": 1.36,
      "taxable_amount": 16.5
    }
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :order_total_amount => 16.5,
  :shipping => 1.5,
  :taxable_amount => 16.5,
  :amount_to_collect => 1.36,
  :rate => 0.0825,
  :has_nexus => true,
  :freight_taxable => true,
  :tax_source => "origin",
  :jurisdictions => #<Taxjar::Jurisdictions:0x00000a @attrs={
    :country => 'US',
    :state => 'TX',
    :county => 'TRAVIS',
    :city => 'AUSTIN'
  }>,
  :breakdown => #<Taxjar::Breakdown:0x00000a @attrs={
    :taxable_amount => 16.5,
    :tax_collectable => 1.36,
    :combined_tax_rate => 0.0825,
    :state_taxable_amount => 16.5,
    :state_tax_rate => 0.0625,
    :state_tax_collectable => 1.03,
    :county_taxable_amount => 0.0,
    :county_tax_rate => 0.0,
    :county_tax_collectable => 0.0,
    :city_taxable_amount => 16.5,
    :city_tax_rate => 0.01,
    :city_tax_collectable => 0.17,
    :special_district_taxable_amount => 16.5,
    :special_tax_rate => 0.01,
    :special_district_tax_collectable => 0.17,
    :shipping => {
      :taxable_amount => 1.5,
      :tax_collectable => 0.12,
      :combined_tax_rate => 0.0825,
      :state_taxable_amount => 1.5,
      :state_sales_tax_rate => 0.0625,
      :state_amount => 0.09,
      :county_taxable_amount => 0.0,
      :county_tax_rate => 0.0,
      :county_amount => 0.0,
      :city_taxable_amount => 1.5,
      :city_tax_rate => 0.01,
      :city_amount => 0.02,
      :special_taxable_amount => 1.5,
      :special_tax_rate => 0.01,
      :special_district_amount => 0.02
    },
    :line_items => [
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "1",
        :taxable_amount => 15.0,
        :tax_collectable => 1.24,
        :combined_tax_rate => 0.0825,
        :state_taxable_amount => 15.0,
        :state_sales_tax_rate => 0.0625,
        :state_amount => 0.94,
        :county_taxable_amount => 0.0,
        :county_tax_rate => 0.0,
        :county_amount => 0.0,
        :city_taxable_amount => 15.0,
        :city_tax_rate => 0.01,
        :city_amount => 0.15,
        :special_district_taxable_amount => 15.0,
        :special_tax_rate => 0.01,
        :special_district_amount => 0.15
      }>
    ]
  }>
}>
<TaxJarTax {
  'breakdown': <TaxJarBreakdown {
    'special_district_taxable_amount': 16.5,
    'city_tax_rate': 0.01,
    'county_tax_collectable': 0.0,
    'county_taxable_amount': 0.0,
    'special_district_tax_collectable': 0.17,
    'line_items': [
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 15.0,
        'city_tax_rate': 0.01,
        'county_taxable_amount': 0.0,
        'special_district_amount': 0.15,
        'state_sales_tax_rate': 0.0625,
        'state_amount': 0.94,
        'city_taxable_amount': 15.0,
        'taxable_amount': 15.0,
        'special_tax_rate': 0.01,
        'state_taxable_amount': 15.0,
        'combined_tax_rate': 0.0825,
        'county_tax_rate': 0.0,
        'city_amount': 0.15,
        'county_amount': 0.0,
        'id': '1',
        'tax_collectable': 1.24
      }>
    ],
    'shipping': {
      'city_tax_rate': 0.01,
      'county_taxable_amount': 0.0,
      'special_district_amount': 0.02,
      'state_sales_tax_rate': 0.0625,
      'state_amount': 0.09,
      'special_taxable_amount': 1.5,
      'city_amount': 0.02,
      'taxable_amount': 1.5,
      'state_taxable_amount': 1.5,
      'combined_tax_rate': 0.0825,
      'county_tax_rate': 0.0,
      'special_tax_rate': 0.01,
      'county_amount': 0.0,
      'city_taxable_amount': 1.5,
      'tax_collectable': 0.12
    },
    'taxable_amount': 16.5,
    'state_taxable_amount': 16.5,
    'combined_tax_rate': 0.0825,
    'state_tax_collectable': 1.03,
    'state_tax_rate': 0.0625,
    'city_tax_collectable': 0.17,
    'county_tax_rate': 0.0,
    'special_tax_rate': 0.01,
    'city_taxable_amount': 16.5,
    'tax_collectable': 1.36
  }>,
  'jurisdictions': <TaxJarJurisdictions {
    'country': 'US',
    'state': 'TX',
    'county': 'TRAVIS',
    'city': 'AUSTIN'
  }>,
  'has_nexus': True,
  'tax_source': 'origin',
  'shipping': 1.5,
  'taxable_amount': 16.5,
  'rate': 0.0825,
  'freight_taxable': True,
  'amount_to_collect': 1.36,
  'order_total_amount': 16.5
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        OrderTotalAmount: 16.5,
        Shipping:         1.5,
        TaxableAmount:    16.5,
        AmountToCollect:  1.36,
        Rate:             0.0825,
        HasNexus:         true,
        FreightTaxable:   true,
        TaxSource:        "origin",
        Jurisdictions: taxjar.Jurisdictions{
            Country: "US",
            State:   "TX",
            County:  "TRAVIS",
            City:    "AUSTIN",
        },
        Breakdown: taxjar.Breakdown{
            TaxableAmount:                 16.5,
            TaxCollectable:                1.36,
            CombinedTaxRate:               0.0825,
            StateTaxableAmount:            16.5,
            StateTaxRate:                  0.0625,
            StateTaxCollectable:           1.03,
            CountyTaxableAmount:           0.0,
            CountyTaxRate:                 0.0,
            CountyTaxCollectable:          0.0,
            CityTaxableAmount:             16.5,
            CityTaxRate:                   0.01,
            CityTaxCollectable:            0.17,
            SpecialDistrictTaxableAmount:  16.5,
            SpecialTaxRate:                0.01,
            SpecialDistrictTaxCollectable: 0.17,
            Shipping: taxjar.Shipping{
                TaxableAmount:         1.5,
                TaxCollectable:        0.12,
                CombinedTaxRate:       0.0825,
                StateTaxableAmount:    1.5,
                StateSalesTaxRate:     0.0625,
                StateAmount:           0.09,
                CountyTaxableAmount:   0.0,
                CountyTaxRate:         0.0,
                CountyAmount:          0.0,
                CityTaxableAmount:     1.5,
                CityTaxRate:           0.01,
                CityAmount:            0.02,
                SpecialTaxableAmount:  1.5,
                SpecialTaxRate:        0.01,
                SpecialDistrictAmount: 0.02,
            },
            LineItems: []taxjar.LineItemBreakdown{
                {
                    ID:                           "1",
                    TaxableAmount:                15.0,
                    TaxCollectable:               1.24,
                    CombinedTaxRate:              0.0825,
                    StateTaxableAmount:           15.0,
                    StateSalesTaxRate:            0.0625,
                    StateAmount:                  0.94,
                    CountyTaxableAmount:          0.0,
                    CountyTaxRate:                0.0,
                    CountyAmount:                 0.0,
                    CityTaxableAmount:            15.0,
                    CityTaxRate:                  0.01,
                    CityAmount:                   0.15,
                    SpecialDistrictTaxableAmount: 15.0,
                    SpecialTaxRate:               0.01,
                    SpecialDistrictAmount:        0.15,
                },
            },
        },
    },
}

Response Scenario: Shipping Exemptions

{
  "tax": {
    "order_total_amount": 16.5,
    "shipping": 1.5,
    "taxable_amount": 15,
    "amount_to_collect": 0.94,
    "rate": 0.0625,
    "has_nexus": true,
    "freight_taxable": false,
    "tax_source": "destination",
    "jurisdictions": {
      "country": "US",
      "state": "MA",
      "county": "WORCESTER",
      "city": "WORCESTER"
    },
    "breakdown": {
      "city_tax_collectable": 0,
      "city_tax_rate": 0,
      "city_taxable_amount": 0,
      "combined_tax_rate": 0.0625,
      "county_tax_collectable": 0,
      "county_tax_rate": 0,
      "county_taxable_amount": 0,
      "line_items": [
        {
          "city_amount": 0,
          "city_tax_rate": 0,
          "city_taxable_amount": 0,
          "combined_tax_rate": 0.0625,
          "county_amount": 0,
          "county_tax_rate": 0,
          "county_taxable_amount": 0,
          "id": "1",
          "special_district_amount": 0,
          "special_district_taxable_amount": 0,
          "special_tax_rate": 0,
          "state_amount": 0.94,
          "state_sales_tax_rate": 0.0625,
          "state_taxable_amount": 15,
          "tax_collectable": 0.94,
          "taxable_amount": 15
        }
      ],
      "special_district_tax_collectable": 0,
      "special_district_taxable_amount": 0,
      "special_tax_rate": 0,
      "state_tax_collectable": 0.94,
      "state_tax_rate": 0.0625,
      "state_taxable_amount": 15,
      "tax_collectable": 0.94,
      "taxable_amount": 15
    }
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :order_total_amount => 16.5,
  :shipping => 1.5,
  :taxable_amount => 15.0,
  :amount_to_collect => 0.94,
  :rate => 0.0625,
  :has_nexus => true,
  :freight_taxable => false,
  :tax_source => "destination",
  :jurisdictions => #<Taxjar::Jurisdictions:0x00000a @attrs={
    :country => 'US',
    :state => 'MA',
    :county => 'WORCESTER',
    :city => 'WORCESTER'
  }>,
  :breakdown => #<Taxjar::Breakdown:0x00000a @attrs={
    :taxable_amount => 15.0,
    :tax_collectable => 0.94,
    :combined_tax_rate => 0.0625,
    :state_taxable_amount => 15.0,
    :state_tax_rate => 0.0625,
    :state_tax_collectable => 0.94,
    :county_taxable_amount => 0.0,
    :county_tax_rate => 0.0,
    :county_tax_collectable => 0.0,
    :city_taxable_amount => 0.0,
    :city_tax_rate => 0.0,
    :city_tax_collectable => 0.0,
    :special_district_taxable_amount => 0.0,
    :special_tax_rate => 0.0,
    :special_district_tax_collectable => 0.0,
    :line_items => [
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "1",
        :taxable_amount => 15.0,
        :tax_collectable => 0.94,
        :combined_tax_rate => 0.0625,
        :state_taxable_amount => 15.0,
        :state_sales_tax_rate => 0.0625,
        :state_amount => 0.94,
        :county_taxable_amount => 0.0,
        :county_tax_rate => 0.0,
        :county_amount => 0.0,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 0.0,
        :special_tax_rate => 0.0,
        :special_district_amount => 0.0
      }>
    ]
  }>
}>
<TaxJarTax {
  'breakdown': <TaxJarBreakdown {
    'special_district_taxable_amount': 0.0,
    'city_tax_rate': 0.0,
    'county_tax_collectable': 0.0,
    'county_taxable_amount': 0.0,
    'special_district_tax_collectable': 0.0,
    'line_items': [
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 0.0,
        'city_tax_rate': 0.0,
        'county_taxable_amount': 0.0,
        'special_district_amount': 0.0,
        'state_sales_tax_rate': 0.0625,
        'state_amount': 0.94,
        'city_taxable_amount': 0.0,
        'taxable_amount': 15.0,
        'special_tax_rate': 0.0,
        'state_taxable_amount': 15.0,
        'combined_tax_rate': 0.0625,
        'county_tax_rate': 0.0,
        'city_amount': 0.0,
        'county_amount': 0.0,
        'id': '1',
        'tax_collectable': 0.94
      }>
    ],
    'taxable_amount': 15.0,
    'state_taxable_amount': 15.0,
    'combined_tax_rate': 0.0625,
    'state_tax_collectable': 0.94,
    'state_tax_rate': 0.0625,
    'city_tax_collectable': 0.0,
    'county_tax_rate': 0.0,
    'special_tax_rate': 0.0,
    'city_taxable_amount': 0.0,
    'tax_collectable': 0.94
  }>,
  'jurisdictions': <TaxJarJurisdictions {
    'country': 'US',
    'state': 'MA',
    'county': 'WORCESTER',
    'city': 'WORCESTER'
  }>,
  'has_nexus': True,
  'tax_source': 'destination',
  'shipping': 1.5,
  'taxable_amount': 15.0,
  'rate': 0.0625,
  'freight_taxable': False,
  'amount_to_collect': 0.94,
  'order_total_amount': 16.5
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        OrderTotalAmount: 16.5,
        Shipping:         1.5,
        TaxableAmount:    15.0,
        AmountToCollect:  0.94,
        Rate:             0.0625,
        HasNexus:         true,
        FreightTaxable:   false,
        TaxSource:        "destination",
        Jurisdictions: taxjar.Jurisdictions{
            Country: "US",
            State:   "MA",
            County:  "WORCESTER",
            City:    "WORCESTER",
        },
        Breakdown: taxjar.Breakdown{
            TaxableAmount:                 15.0,
            TaxCollectable:                0.94,
            CombinedTaxRate:               0.0625,
            StateTaxableAmount:            15.0,
            StateTaxRate:                  0.0625,
            StateTaxCollectable:           0.94,
            CountyTaxableAmount:           0.0,
            CountyTaxRate:                 0.0,
            CountyTaxCollectable:          0.0,
            CityTaxableAmount:             0.0,
            CityTaxRate:                   0.0,
            CityTaxCollectable:            0.0,
            SpecialDistrictTaxableAmount:  0.0,
            SpecialTaxRate:                0.0,
            SpecialDistrictTaxCollectable: 0.0,
            LineItems: []taxjar.LineItemBreakdown{
                {
                    ID:                           "1",
                    TaxableAmount:                15.0,
                    TaxCollectable:               0.94,
                    CombinedTaxRate:              0.0625,
                    StateTaxableAmount:           15.0,
                    StateSalesTaxRate:            0.0625,
                    StateAmount:                  0.94,
                    CountyTaxableAmount:          0.0,
                    CountyTaxRate:                0.0,
                    CountyAmount:                 0.0,
                    CityTaxableAmount:            0.0,
                    CityTaxRate:                  0.0,
                    CityAmount:                   0.0,
                    SpecialDistrictTaxableAmount: 0.0,
                    SpecialTaxRate:               0.0,
                    SpecialDistrictAmount:        0.0,
                },
            },
        },
    },
}

Response Scenario: Clothing Exemptions

{
  "tax": {
    "order_total_amount": 37.93,
    "shipping": 7.99,
    "taxable_amount": 37.93,
    "amount_to_collect": 1.98,
    "rate": 0.05218,
    "has_nexus": true,
    "freight_taxable": true,
    "tax_source": "destination",
    "jurisdictions": {
      "country": "US",
      "state": "NY",
      "county": "PUTNAM",
      "city": "MAHOPAC"
    },
    "breakdown": {
      "city_tax_collectable": 0,
      "city_tax_rate": 0,
      "city_taxable_amount": 0,
      "combined_tax_rate": 0.05218,
      "county_tax_collectable": 1.52,
      "county_tax_rate": 0.04,
      "county_taxable_amount": 37.93,
      "line_items": [
        {
          "city_amount": 0,
          "city_tax_rate": 0,
          "city_taxable_amount": 0,
          "combined_tax_rate": 0.04375,
          "county_amount": 0.8,
          "county_tax_rate": 0.04,
          "county_taxable_amount": 19.99,
          "id": "1",
          "special_district_amount": 0.07,
          "special_district_taxable_amount": 19.99,
          "special_tax_rate": 0.00375,
          "state_amount": 0,
          "state_sales_tax_rate": 0,
          "state_taxable_amount": 0,
          "tax_collectable": 0.87,
          "taxable_amount": 19.99
        },
        {
          "city_amount": 0,
          "city_tax_rate": 0,
          "city_taxable_amount": 0,
          "combined_tax_rate": 0.04375,
          "county_amount": 0.4,
          "county_tax_rate": 0.04,
          "county_taxable_amount": 9.95,
          "id": "2",
          "special_district_amount": 0.04,
          "special_district_taxable_amount": 9.95,
          "special_tax_rate": 0.00375,
          "state_amount": 0,
          "state_sales_tax_rate": 0,
          "state_taxable_amount": 0,
          "tax_collectable": 0.44,
          "taxable_amount": 9.95
        }
      ],
      "shipping": {
        "city_amount": 0,
        "city_tax_rate": 0,
        "city_taxable_amount": 0,
        "combined_tax_rate": 0.08375,
        "county_amount": 0.32,
        "county_tax_rate": 0.04,
        "county_taxable_amount": 7.99,
        "special_district_amount": 0.03,
        "special_tax_rate": 0.00375,
        "special_taxable_amount": 7.99,
        "state_amount": 0.32,
        "state_sales_tax_rate": 0.04,
        "state_taxable_amount": 7.99,
        "tax_collectable": 0.67,
        "taxable_amount": 7.99
      },
      "special_district_tax_collectable": 0.14,
      "special_district_taxable_amount": 37.93,
      "special_tax_rate": 0.00375,
      "state_tax_collectable": 0.32,
      "state_tax_rate": 0.04,
      "state_taxable_amount": 7.99,
      "tax_collectable": 1.98,
      "taxable_amount": 37.93
    }
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :order_total_amount => 37.93,
  :shipping => 7.99,
  :taxable_amount => 37.93,
  :amount_to_collect => 1.98,
  :rate => 0.05218,
  :has_nexus => true,
  :freight_taxable => true,
  :tax_source => "destination",
  :jurisdictions => #<Taxjar::Jurisdictions:0x00000a @attrs={
    :country => 'US',
    :state => 'NY',
    :county => 'PUTNAM',
    :city => 'MAHOPAC'
  }>,
  :breakdown => #<Taxjar::Breakdown:0x00000a @attrs={
    :taxable_amount => 37.93,
    :tax_collectable => 1.98,
    :combined_tax_rate => 0.05218,
    :state_taxable_amount => 7.99,
    :state_tax_rate => 0.04,
    :state_tax_collectable => 0.32,
    :county_taxable_amount => 37.93,
    :county_tax_rate => 0.04,
    :county_tax_collectable => 1.52,
    :city_taxable_amount => 0.0,
    :city_tax_rate => 0.0,
    :city_tax_collectable => 0.0,
    :special_district_taxable_amount => 37.93,
    :special_tax_rate => 0.00375,
    :special_district_tax_collectable => 0.14,
    :shipping => {
      :taxable_amount => 7.99,
      :tax_collectable => 0.67,
      :combined_tax_rate => 0.08375,
      :state_taxable_amount => 7.99,
      :state_sales_tax_rate => 0.04,
      :state_amount => 0.32,
      :county_taxable_amount => 7.99,
      :county_tax_rate => 0.04,
      :county_amount => 0.32,
      :city_taxable_amount => 0.0,
      :city_tax_rate => 0.0,
      :city_amount => 0.0,
      :special_taxable_amount => 7.99,
      :special_tax_rate => 0.00375,
      :special_district_amount => 0.03
    },
    :line_items => [
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "1",
        :taxable_amount => 19.99,
        :tax_collectable => 0.87,
        :combined_tax_rate => 0.04375,
        :state_taxable_amount => 0.0,
        :state_sales_tax_rate => 0.0,
        :state_amount => 0.0,
        :county_taxable_amount => 19.99,
        :county_tax_rate => 0.04,
        :county_amount => 0.8,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 19.99,
        :special_tax_rate => 0.00375,
        :special_district_amount => 0.07
      }>,
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "2",
        :taxable_amount => 9.95,
        :tax_collectable => 0.44,
        :combined_tax_rate => 0.04375,
        :state_taxable_amount => 0.0,
        :state_sales_tax_rate => 0.0,
        :state_amount => 0.0,
        :county_taxable_amount => 9.95,
        :county_tax_rate => 0.04,
        :county_amount => 0.4,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 9.95,
        :special_tax_rate => 0.00375,
        :special_district_amount => 0.04
      }>
    ]
  }>
}>
<TaxJarTax {
  'breakdown': <TaxJarBreakdown {
    'special_district_taxable_amount': 37.93,
    'city_tax_rate': 0.0,
    'county_tax_collectable': 1.52,
    'county_taxable_amount': 37.93,
    'special_district_tax_collectable': 0.14,
    'line_items': [
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 19.99,
        'city_tax_rate': 0.0,
        'county_taxable_amount': 19.99,
        'special_district_amount': 0.07,
        'state_sales_tax_rate': 0.0,
        'state_amount': 0.0,
        'city_taxable_amount': 0.0,
        'taxable_amount': 19.99,
        'special_tax_rate': 0.00375,
        'state_taxable_amount': 0.0,
        'combined_tax_rate': 0.04375,
        'county_tax_rate': 0.04,
        'city_amount': 0.0,
        'county_amount': 0.8,
        'id': '1',
        'tax_collectable': 0.87
      }>,
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 9.95,
        'city_tax_rate': 0.0,
        'county_taxable_amount': 9.95,
        'special_district_amount': 0.04,
        'state_sales_tax_rate': 0.0,
        'state_amount': 0.0,
        'city_taxable_amount': 0.0,
        'taxable_amount': 9.95,
        'special_tax_rate': 0.00375,
        'state_taxable_amount': 0.0,
        'combined_tax_rate': 0.04375,
        'county_tax_rate': 0.04,
        'city_amount': 0.0,
        'county_amount': 0.4,
        'id': '2',
        'tax_collectable': 0.44
      }>
    ],
    'shipping': {
      'city_tax_rate': 0.0,
      'county_taxable_amount': 7.99,
      'special_district_amount': 0.03,
      'state_sales_tax_rate': 0.04,
      'state_amount': 0.32,
      'special_taxable_amount': 7.99,
      'city_amount': 0.0,
      'taxable_amount': 7.99,
      'state_taxable_amount': 7.99,
      'combined_tax_rate': 0.08375,
      'county_tax_rate': 0.04,
      'special_tax_rate': 0.00375,
      'county_amount': 0.32,
      'city_taxable_amount': 0.0,
      'tax_collectable': 0.67
    },
    'taxable_amount': 37.93,
    'state_taxable_amount': 7.99,
    'combined_tax_rate': 0.05218,
    'state_tax_collectable': 0.32,
    'state_tax_rate': 0.04,
    'city_tax_collectable': 0.0,
    'county_tax_rate': 0.04,
    'special_tax_rate': 0.00375,
    'city_taxable_amount': 0.0,
    'tax_collectable': 1.98
  }>,
  'jurisdictions': <TaxJarJurisdictions {
    'country': 'US',
    'state': 'NY',
    'county': 'PUTNAM',
    'city': 'MAHOPAC'
  }>,
  'has_nexus': True,
  'tax_source': 'destination',
  'shipping': 7.99,
  'taxable_amount': 37.93,
  'rate': 0.05218,
  'freight_taxable': True,
  'amount_to_collect': 1.98,
  'order_total_amount': 37.93
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        OrderTotalAmount: 37.93,
        Shipping:         7.99,
        TaxableAmount:    37.93,
        AmountToCollect:  1.98,
        Rate:             0.05218,
        HasNexus:         true,
        FreightTaxable:   true,
        TaxSource:        "destination",
        Jurisdictions: taxjar.Jurisdictions{
            Country: "US",
            State:   "NY",
            County   "PUTNAM",
            City:    "MAHOPAC",
        },
        Breakdown: taxjar.Breakdown{
            TaxableAmount:                 37.93,
            TaxCollectable:                1.98,
            CombinedTaxRate:               0.05218,
            StateTaxableAmount:            7.99,
            StateTaxRate:                  0.04,
            StateTaxCollectable:           0.32,
            CountyTaxableAmount:           37.93,
            CountyTaxRate:                 0.04,
            CountyTaxCollectable:          1.52,
            CityTaxableAmount:             0.0,
            CityTaxRate:                   0.0,
            CityTaxCollectable:            0.0,
            SpecialDistrictTaxableAmount:  37.93,
            SpecialTaxRate:                0.00375,
            SpecialDistrictTaxCollectable: 0.14,
            Shipping: taxjar.Shipping{
                TaxableAmount:         7.99,
                TaxCollectable:        0.67,
                CombinedTaxRate:       0.08375,
                StateTaxableAmount:    7.99,
                StateSalesTaxRate:     0.04,
                StateAmount:           0.32,
                CountyTaxableAmount:   7.99,
                CountyTaxRate:         0.04,
                CountyAmount:          0.32,
                CityTaxableAmount:     0.0,
                CityTaxRate:           0.0,
                CityAmount:            0.0,
                SpecialTaxableAmount:  7.99,
                SpecialTaxRate:        0.00375,
                SpecialDistrictAmount: 0.03,
            },
            LineItems: []taxjar.LineItemBreakdown{
                {
                    ID:                           "1",
                    TaxableAmount:                19.99,
                    TaxCollectable:               0.87,
                    CombinedTaxRate:              0.04375,
                    StateTaxableAmount:           0.0,
                    StateSalesTaxRate:            0.0,
                    StateAmount:                  0.0,
                    CountyTaxableAmount:          19.99,
                    CountyTaxRate:                0.04,
                    CountyAmount:                 0.8,
                    CityTaxableAmount:            0.0,
                    CityTaxRate:                  0.0,
                    CityAmount:                   0.0,
                    SpecialDistrictTaxableAmount: 19.99,
                    SpecialTaxRate:               0.00375,
                    SpecialDistrictAmount:        0.07,
                },
                {
                    ID:                           "2",
                    TaxableAmount:                9.95,
                    TaxCollectable:               0.44,
                    CombinedTaxRate:              0.04375,
                    StateTaxableAmount:           0.0,
                    StateSalesTaxRate:            0.0,
                    StateAmount:                  0.0,
                    CountyTaxableAmount:          9.95,
                    CountyTaxRate:                0.04,
                    CountyAmount:                 0.4,
                    CityTaxableAmount:            0.0,
                    CityTaxRate:                  0.0,
                    CityAmount:                   0.0,
                    SpecialDistrictTaxableAmount: 9.95,
                    SpecialTaxRate:               0.00375,
                    SpecialDistrictAmount:        0.04,
                },
            },
        },
    },
}

Response Scenario: Food & Grocery Exemptions

{
  "tax": {
    "order_total_amount": 37.93,
    "shipping": 7.99,
    "taxable_amount": 0,
    "amount_to_collect": 0,
    "rate": 0,
    "has_nexus": true,
    "freight_taxable": false,
    "tax_source": "destination",
    "jurisdictions": {
      "country": "US",
      "state": "CA",
      "county": "LOS ANGELES",
      "city": "LOS ANGELES"
    },
    "breakdown": {
      "city_tax_collectable": 0,
      "city_tax_rate": 0,
      "city_taxable_amount": 0,
      "combined_tax_rate": 0,
      "county_tax_collectable": 0,
      "county_tax_rate": 0,
      "county_taxable_amount": 0,
      "line_items": [
        {
          "city_amount": 0,
          "city_tax_rate": 0,
          "city_taxable_amount": 0,
          "combined_tax_rate": 0,
          "county_amount": 0,
          "county_tax_rate": 0,
          "county_taxable_amount": 0,
          "id": "1",
          "special_district_amount": 0,
          "special_district_taxable_amount": 0,
          "special_tax_rate": 0,
          "state_amount": 0,
          "state_sales_tax_rate": 0,
          "state_taxable_amount": 0,
          "tax_collectable": 0,
          "taxable_amount": 0
        },
        {
          "city_amount": 0,
          "city_tax_rate": 0,
          "city_taxable_amount": 0,
          "combined_tax_rate": 0,
          "county_amount": 0,
          "county_tax_rate": 0,
          "county_taxable_amount": 0,
          "id": "2",
          "special_district_amount": 0,
          "special_district_taxable_amount": 0,
          "special_tax_rate": 0,
          "state_amount": 0,
          "state_sales_tax_rate": 0,
          "state_taxable_amount": 0,
          "tax_collectable": 0,
          "taxable_amount": 0
        }
      ],
      "special_district_tax_collectable": 0,
      "special_district_taxable_amount": 0,
      "special_tax_rate": 0,
      "state_tax_collectable": 0,
      "state_tax_rate": 0,
      "state_taxable_amount": 0,
      "tax_collectable": 0,
      "taxable_amount": 0
    }
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :order_total_amount => 37.93,
  :shipping => 7.99,
  :taxable_amount => 0.0,
  :amount_to_collect => 0.0,
  :rate => 0.0,
  :has_nexus => true,
  :freight_taxable => false,
  :tax_source => "destination",
  :jurisdictions => #<Taxjar::Jurisdictions:0x00000a @attrs={
    :country => 'US',
    :state => 'CA',
    :county => 'LOS ANGELES',
    :city => 'LOS ANGELES'
  }>,
  :breakdown => #<Taxjar::Breakdown:0x00000a @attrs={
    :taxable_amount => 0.0,
    :tax_collectable => 0.0,
    :combined_tax_rate => 0.0,
    :state_taxable_amount => 0.0,
    :state_tax_rate => 0.0,
    :state_tax_collectable => 0.0,
    :county_taxable_amount => 0.0,
    :county_tax_rate => 0.0,
    :county_tax_collectable => 0.0,
    :city_taxable_amount => 0.0,
    :city_tax_rate => 0.0,
    :city_tax_collectable => 0.0,
    :special_district_taxable_amount => 0.0,
    :special_tax_rate => 0.0,
    :special_district_tax_collectable => 0.0,
    :line_items => [
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "1",
        :taxable_amount => 0.0,
        :tax_collectable => 0.0,
        :combined_tax_rate => 0.0,
        :state_taxable_amount => 0.0,
        :state_sales_tax_rate => 0.0,
        :state_amount => 0.0,
        :county_taxable_amount => 0.0,
        :county_tax_rate => 0.0,
        :county_amount => 0.0,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 0.0,
        :special_tax_rate => 0.0,
        :special_district_amount => 0.0
      }>,
      #<Taxjar::BreakdownLineItem:0x00000a @attrs={
        :id => "2",
        :taxable_amount => 0.0,
        :tax_collectable => 0.0,
        :combined_tax_rate => 0.0,
        :state_taxable_amount => 0.0,
        :state_sales_tax_rate => 0.0,
        :state_amount => 0.0,
        :county_taxable_amount => 0.0,
        :county_tax_rate => 0.0,
        :county_amount => 0.0,
        :city_taxable_amount => 0.0,
        :city_tax_rate => 0.0,
        :city_amount => 0.0,
        :special_district_taxable_amount => 0.0,
        :special_tax_rate => 0.0,
        :special_district_amount => 0.0
      }>
    ]
  }>
}>
<TaxJarTax {
  'breakdown': <TaxJarBreakdown {
    'special_district_taxable_amount': 0.0,
    'city_tax_rate': 0.0,
    'county_tax_collectable': 0.0,
    'county_taxable_amount': 0.0,
    'special_district_tax_collectable': 0.0,
    'line_items': [
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 0.0,
        'city_tax_rate': 0.0,
        'county_taxable_amount': 0.0,
        'special_district_amount': 0.0,
        'state_sales_tax_rate': 0.0,
        'state_amount': 0.0,
        'city_taxable_amount': 0.0,
        'taxable_amount': 0.0,
        'special_tax_rate': 0.0,
        'state_taxable_amount': 0.0,
        'combined_tax_rate': 0.0,
        'county_tax_rate': 0.0,
        'city_amount': 0.0,
        'county_amount': 0.0,
        'id': '1',
        'tax_collectable': 0.0
      }>,
      <TaxJarBreakdownLineItem {
        'special_district_taxable_amount': 0.0,
        'city_tax_rate': 0.0,
        'county_taxable_amount': 0.0,
        'special_district_amount': 0.0,
        'state_sales_tax_rate': 0.0,
        'state_amount': 0.0,
        'city_taxable_amount': 0.0,
        'taxable_amount': 0.0,
        'special_tax_rate': 0.0,
        'state_taxable_amount': 0.0,
        'combined_tax_rate': 0.0,
        'county_tax_rate': 0.0,
        'city_amount': 0.0,
        'county_amount': 0.0,
        'id': '2',
        'tax_collectable': 0.0
      }>
    ],
    'taxable_amount': 0.0,
    'state_taxable_amount': 0.0,
    'combined_tax_rate': 0.0,
    'state_tax_collectable': 0.0,
    'state_tax_rate': 0.0,
    'city_tax_collectable': 0.0,
    'county_tax_rate': 0.0,
    'special_tax_rate': 0.0,
    'city_taxable_amount': 0.0,
    'tax_collectable': 0.0
  }>,
  'jurisdictions': <TaxJarJurisdictions {
    'country': 'US',
    'state': 'CA',
    'county': 'LOS ANGELES',
    'city': 'LOS ANGELES'
  }>,
  'has_nexus': True,
  'tax_source': 'destination',
  'shipping': 7.99,
  'taxable_amount': 0.0,
  'rate': 0.0,
  'freight_taxable': False,
  'amount_to_collect': 0.0,
  'order_total_amount': 37.93
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        OrderTotalAmount: 37.93,
        Shipping:         7.99,
        TaxableAmount:    0.0,
        AmountToCollect:  0.0,
        Rate:             0.0,
        HasNexus:         true,
        FreightTaxable:   false,
        TaxSource:        "destination",
        Jurisdictions: taxjar.Jurisdictions{
            Country: "US",
            State:   "CA",
            County:  "LOS ANGELES",
            City:    "LOS ANGELES",
        },
        Breakdown: taxjar.Breakdown{
            TaxableAmount:                 0.0,
            TaxCollectable:                0.0,
            CombinedTaxRate:               0.0,
            StateTaxableAmount:            0.0,
            StateTaxRate:                  0.0,
            StateTaxCollectable:           0.0,
            CountyTaxableAmount:           0.0,
            CountyTaxRate:                 0.0,
            CountyTaxCollectable:          0.0,
            CityTaxableAmount:             0.0,
            CityTaxRate:                   0.0,
            CityTaxCollectable:            0.0,
            SpecialDistrictTaxableAmount:  0.0,
            SpecialTaxRate:                0.0,
            SpecialDistrictTaxCollectable: 0.0,
            LineItems: []taxjar.LineItemBreakdown{
                {
                    ID:                           "1",
                    TaxableAmount:                0.0,
                    TaxCollectable:               0.0,
                    CombinedTaxRate:              0.0,
                    StateTaxableAmount:           0.0,
                    StateSalesTaxRate:            0.0,
                    StateAmount:                  0.0,
                    CountyTaxableAmount:          0.0,
                    CountyTaxRate:                0.0,
                    CountyAmount:                 0.0,
                    CityTaxableAmount:            0.0,
                    CityTaxRate:                  0.0,
                    CityAmount:                   0.0,
                    SpecialDistrictTaxableAmount: 0.0,
                    SpecialTaxRate:               0.0,
                    SpecialDistrictAmount:        0.0,
                },
                {
                    ID:                           "2",
                    TaxableAmount:                0.0,
                    TaxCollectable:               0.0,
                    CombinedTaxRate:              0.0,
                    StateTaxableAmount:           0.0,
                    StateSalesTaxRate:            0.0,
                    StateAmount:                  0.0,
                    CountyTaxableAmount:          0.0,
                    CountyTaxRate:                0.0,
                    CountyAmount:                 0.0,
                    CityTaxableAmount:            0.0,
                    CityTaxRate:                  0.0,
                    CityAmount:                   0.0,
                    SpecialDistrictTaxableAmount: 0.0,
                    SpecialTaxRate:               0.0,
                    SpecialDistrictAmount:        0.0,
                },
            },
        },
    },
}

Response Scenario: No Nexus

{
  "tax": {
    "amount_to_collect": 0,
    "freight_taxable": false,
    "has_nexus": false,
    "rate": 0,
    "tax_source": null,
    "taxable_amount": 0
  }
}
#<Taxjar::Tax:0x00000a @attrs={
  :taxable_amount => 0.0,
  :amount_to_collect => 0.0,
  :rate => 0.0,
  :has_nexus => false,
  :freight_taxable => false,
  :tax_source => nil
}>
<TaxJarTax {
  'has_nexus': False,
  'taxable_amount': 0.0,
  'rate': 0.0,
  'freight_taxable': False,
  'amount_to_collect': 0.0
}>
taxjar.TaxForOrderResponse{
    Tax: taxjar.Tax{
        TaxableAmount:   0.0,
        AmountToCollect: 0.0,
        Rate:            0.0,
        HasNexus:        false,
        FreightTaxable:  false,
        TaxSource:       "",
    },
}

Shows the sales tax that should be collected for a given order.

Request

POST https://api.taxjar.com/v2/taxes

Parameters

Parameter Type Required Description
from_country string optional Two-letter ISO country code of the country where the order shipped from. View Note
from_zip string optional Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string optional Two-letter ISO state code where the order shipped from.
from_city string optional City where the order shipped from.
from_street string optional Street address where the order shipped from.
to_country string required Two-letter ISO country code of the country where the order shipped to.
to_zip string required Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string required Two-letter ISO state code where the order shipped to.
to_city string optional City where the order shipped to.
to_street string optional Street address where the order shipped to. View Note
amount float optional Total amount of the order, excluding shipping. View Note
shipping float required Total amount of shipping for the order.
customer_id string optional Unique identifier of the given customer for exemptions.
exemption_type string optional Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. View Note
nexus_addresses[][id] string optional Unique identifier of the given nexus address. View Note
nexus_addresses[][country] string conditional Two-letter ISO country code for the nexus address.
nexus_addresses[][zip] string optional Postal code for the nexus address.
nexus_addresses[][state] string conditional Two-letter ISO state code for the nexus address.
nexus_addresses[][city] string optional City for the nexus address.
nexus_addresses[][street] string optional Street address for the nexus address.
line_items[][id] string optional Unique identifier of the given line item. View Note
line_items[][quantity] integer optional Quantity for the item.
line_items[][product_tax_code] string optional Product tax code for the item. If omitted, the item will remain fully taxable.
line_items[][unit_price] float optional Unit price for the item.
line_items[][discount] float optional Total discount (non-unit) for the item.

Notes

  • Either amount or line_items parameters are required to perform tax calculations.

  • The to_zip parameter is required when to_country is ‘US’.

  • The to_state parameter is required when to_country is ‘US’ or ‘CA’.

  • Either an address on file, nexus_addresses parameter, or from_ parameters are required to perform tax calculations. Providing nexus_addresses in API calls will override TaxJar Account ‘State Settings’ configurations.

Response

Returns a tax JSON object with sales tax for a given order. If available, returns a breakdown of rates by jurisdiction at the order, shipping, and line item level.

Attributes

Parameter Type Description
order_total_amount float Total amount of the order.
shipping float Total amount of shipping for the order.
taxable_amount float Amount of the order to be taxed.
amount_to_collect float Amount of sales tax to collect.
rate float Overall sales tax rate of the order (amount_to_collect ÷ taxable_amount).
has_nexus bool Whether or not you have nexus for the order based on an address on file, nexus_addresses parameter, or from_ parameters.
freight_taxable bool Freight taxability for the order.
tax_source string Origin-based or destination-based sales tax collection.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. If no customer_id or exemption_type is provided, no exemption_type is returned in the response.
jurisdictions object Jurisdiction names for the order.
breakdown object Breakdown of rates by jurisdiction for the order, shipping, and individual line items. If has_nexus is false or no line items are provided, no breakdown is returned in the response.

  United States Jurisdiction Attributes

Parameter Type Description
country string Two-letter ISO country code for given location.
state string Postal abbreviated state name for given location.
county string County name for given location.
city string City name for given location.

  United States Breakdown Attributes

Parameter Type Description
taxable_amount float Total amount of the order to be taxed.
tax_collectable float Total amount of sales tax to collect.
combined_tax_rate float Overall sales tax rate of the breakdown which includes state, county, city and district tax for the order and shipping if applicable.
state_taxable_amount float Amount of the order to be taxed at the state tax rate.
state_tax_rate float State sales tax rate for given location.
state_tax_collectable float Amount of sales tax to collect for the state.
county_taxable_amount float Amount of the order to be taxed at the county tax rate.
county_tax_rate float County sales tax rate for given location.
county_tax_collectable float Amount of sales tax to collect for the county.
city_taxable_amount float Amount of the order to be taxed at the city tax rate.
city_tax_rate float City sales tax rate for given location.
city_tax_collectable float Amount of sales tax to collect for the city.
special_district_taxable_amount float Amount of the order to be taxed at the special district tax rate.
special_tax_rate float Special district sales tax rate for given location.
special_district_tax_collectable float Amount of sales tax to collect for the special district.
shipping object Breakdown of shipping rates if applicable.
line_items object Breakdown of rates by line item if applicable.

Transactions

Manage your transactions for automated sales tax reporting and filing in TaxJar. These endpoints only affect orders and refunds created specifically through the API, not transactions from other channels.

We currently support reporting and filing in the United States.

get List order transactions

Definition

client.list_orders
client.list_orders
client.listOrders();
$client->listOrders();
client.ListOrders();
client.listOrders();
client.ListOrders()
GET https://api.taxjar.com/v2/transactions/orders

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

orders = client.list_orders({
  :from_transaction_date => '2015/05/01',
  :to_transaction_date => '2015/05/31'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

orders = client.list_orders({
  'from_transaction_date': '2015/05/01',
  'to_transaction_date': '2015/05/31'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.listOrders({
  from_transaction_date: '2015/05/01',
  to_transaction_date: '2015/05/31'
}).then(res => {
  res.orders; // Array of orders
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$orders = $client->listOrders([
  'from_transaction_date' => '2015/05/01',
  'to_transaction_date' => '2015/05/31'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var orders = client.ListOrders(new {
    from_transaction_date = "2015/05/01",
    to_transaction_date = "2015/05/31"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.OrdersResponse;
import java.util.HashMap;
import java.util.Map;

public class ListOrdersExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, String> params = new HashMap<>();
            params.put("from_transaction_date", "2015/05/01");
            params.put("to_transaction_date", "2015/05/31");
            OrdersResponse res = client.listOrders(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ListOrders(taxjar.ListOrdersParams{
        FromTransactionDate: "2015/05/01",
        ToTransactionDate:   "2015/05/31",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Orders)
    }
}
$ curl -G https://api.taxjar.com/v2/transactions/orders \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -d from_transaction_date="2015/05/01" \
  -d to_transaction_date="2015/05/31"

Response Example

{
  "orders": [
    "123",
    "456"
  ]
}
["20", "21", "22"]
['20', '21', '22']
taxjar.ListOrdersResponse{
    Orders: []string{"20", "21", "22"}
}

Lists existing order transactions created through the API.

Request

GET https://api.taxjar.com/v2/transactions/orders

Parameters

Parameter Type Required Description
transaction_date date optional The date the transactions were originally recorded. View Note
from_transaction_date date optional Start date of a range for which the transactions were originally recorded.
to_transaction_date date optional End date of a range for which the transactions were originally recorded.
provider string optional Source of where the transactions were originally recorded. Defaults to “api”.

Notes

Use transaction_date to list transactions for a specific date. Otherwise, use from_transaction_date and to_transaction_date for a range of dates.

Response

Returns an orders JSON object with an array of order IDs created through the API.

get Show an order transaction

Definition

client.show_order
client.show_order
client.showOrder();
$client->showOrder();
client.ShowOrder();
client.showOrder();
client.ShowOrder()
GET https://api.taxjar.com/v2/transactions/orders/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.show_order('123')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.show_order('123')
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.showOrder('123').then(res => {
  res.order;
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order = $client->showOrder('123');
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var order = client.ShowOrder("123");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.OrderResponse;

public class ShowOrderExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            OrderResponse res = client.showOrder("123");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ShowOrder("123")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Order)
    }
}
$ curl https://api.taxjar.com/v2/transactions/orders/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

{
  "order": {
    "transaction_id": "123",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "17.0",
    "shipping": "2.0",
    "sales_tax": "0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-0",
        "description": "Heavy Widget",
        "unit_price": "15.0",
        "discount": "0.0",
        "sales_tax": "0.95"
      }
    ]
  }
}
#<Taxjar::Order:0x00000a @attrs={
  :transaction_id => "123",
  :user_id => 11836,
  :transaction_date => "2015-05-14T00:00:00Z",
  :transaction_reference_id => nil,
  :provider => "api",
  :from_country => "US",
  :from_zip => 93107,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1281 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => 17,
  :shipping => 2,
  :sales_tax => 0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-0",
      :product_tax_code => nil,
      :description => "Heavy Widget",
      :unit_price => 15,
      :discount => 0,
      :sales_tax => 0.95
    }
  ]
}>
<TaxJarOrder {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Heavy Widget',
    'unit_price': 15,
    'discount': 0,
    'product_identifier': '12-34243-0',
    'sales_tax': 0.95,
    'product_tax_code': None,
    'id': 1,
    'quantity': 1
  }>],
  'user_id': 1,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': '93107',
  'to_country': 'US',
  'shipping': 2,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2016-03-10T00:00:00.000Z',
  'transaction_reference_id': None,
  'sales_tax': 0.95,
  'amount': 17,
  'transaction_id': '123',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.ShowOrderResponse{
    Order: taxjar.Order{
        TransactionID:          "123",
        UserID:                 11836,
        TransactionDate:        "2015-05-14T00:00:00Z",
        TransactionReferenceID: "",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93107",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1281 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 17,
        Shipping:               2,
        SalesTax:               0.95,
        LineItems: []taxjar.OrderLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                Description:       "Heavy Widget",
                ProductTaxCode:    "",
                UnitPrice:         15,
                Discount:          0,
                SalesTax:          0.95,
            },
        },
    },
}

Shows an existing order transaction created through the API.

Request

GET https://api.taxjar.com/v2/transactions/orders/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given order transaction.
provider string optional Source of where the transaction was originally recorded. Defaults to “api”, if omitted will scope to a provider of “api”. When looking up a transaction for a different provider, add “?provider=XYZ” to your request.

Response

Returns an order JSON object with details of a given order transaction created through the API.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given order transaction.
user_id integer Unique identifier of the user who created the order transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the order with shipping, excluding sales tax.
shipping float Total amount of shipping for the order.
sales_tax float Total amount of sales tax collected for the order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

post Create an order transaction

Definition

client.create_order
client.create_order
client.createOrder();
$client->createOrder();
client.CreateOrder();
client.createOrder();
client.CreateOrder()
POST https://api.taxjar.com/v2/transactions/orders

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.create_order({
  :transaction_id => '123',
  :transaction_date => '2015/05/14',
  :to_country => 'US',
  :to_zip => '90002',
  :to_state => 'CA',
  :to_city => 'Los Angeles',
  :to_street => '123 Palm Grove Ln',
  :amount => 16.5,
  :shipping => 1.5,
  :sales_tax => 0.95,
  :line_items => [
    {
      :quantity => 1,
      :product_identifier => '12-34243-9',
      :description => 'Fuzzy Widget',
      :unit_price => 15,
      :sales_tax => 0.95
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.create_order({
  'transaction_id': '123',
  'transaction_date': '2015/05/14',
  'to_country': 'US',
  'to_zip': '90002',
  'to_state': 'CA',
  'to_city': 'Los Angeles',
  'to_street': '123 Palm Grove Ln',
  'amount': 16.5,
  'shipping': 1.5,
  'sales_tax': 0.95,
  'line_items': [
    {
      'quantity': 1,
      'product_identifier': '12-34243-9',
      'description': 'Fuzzy Widget',
      'unit_price': 15,
      'sales_tax': 0.95
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.createOrder({
  transaction_id: '123',
  transaction_date: '2015/05/14',
  to_country: 'US',
  to_zip: '90002',
  to_state: 'CA',
  to_city: 'Los Angeles',
  to_street: '123 Palm Grove Ln',
  amount: 16.5,
  shipping: 1.5,
  sales_tax: 0.95,
  line_items: [
    {
      quantity: 1,
      product_identifier: '12-34243-9',
      description: 'Fuzzy Widget',
      unit_price: 15,
      sales_tax: 0.95
    }
  ]
}).then(res => {
  res.order; // Order object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order = $client->createOrder([
  'transaction_id' => '123',
  'transaction_date' => '2015/05/14',
  'to_country' => 'US',
  'to_zip' => '90002',
  'to_state' => 'CA',
  'to_city' => 'Los Angeles',
  'to_street' => '123 Palm Grove Ln',
  'amount' => 16.5,
  'shipping' => 1.5,
  'sales_tax' => 0.95,
  'line_items' => [
    [
      'quantity' => 1,
      'product_identifier' => '12-34243-9',
      'description' => 'Fuzzy Widget',
      'unit_price' => 15,
      'sales_tax' => 0.95
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var order = client.CreateOrder(new {
  transaction_id = "123",
  transaction_date = "2015/05/04",
  to_country = "US",
  to_state = "CA",
  to_zip = "90002",
  to_city = "Los Angeles",
  to_street = "123 Palm Grove Ln",
  amount = 16.5,
  shipping = 1.5,
  sales_tax = 0.95,
  line_items = new[] {
    new {
      quantity = 1,
      product_identifier = "12-34243-0",
      description = "Heavy Widget",
      unit_price = 15,
      sales_tax = 0.95
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.OrderResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CreateOrderExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("transaction_id", "123");
            params.put("transaction_date", "2015/05/04");
            params.put("to_country", "US");
            params.put("to_zip", "90002");
            params.put("to_city", "Los Angeles");
            params.put("to_street", "123 Palm Grove Ln");
            params.put("amount", 16.5);
            params.put("shipping", 1.5);
            params.put("sales_tax", 0.95);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("product_identifier", "12-34243-0");
            lineItem.put("description", "Heavy Widget");
            lineItem.put("unit_price", 15);
            lineItem.put("sales_tax", 0.95);
            lineItems.add(lineItem);

            params.put("line_items", lineItems);

            OrderResponse res = client.createOrder(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.CreateOrder(taxjar.CreateOrderParams{
        TransactionID:   "123",
        TransactionDate: "2015/05/14",
        ToCountry:       "US",
        ToZip:           "90002",
        ToState:         "CA",
        ToCity:          "Los Angeles",
        ToStreet:        "123 Palm Grove Ln",
        Amount:          16.5,
        Shipping:        1.5,
        SalesTax:        0.95,
        LineItems: []taxjar.OrderLineItem{
            {
                Quantity:          1,
                ProductIdentifier: "12-34243-9",
                Description:       "Fuzzy Widget",
                UnitPrice:         15,
                SalesTax:          0.95,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Order)
    }
}
$ curl https://api.taxjar.com/v2/transactions/orders \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "123",
    "transaction_date": "2015/05/14",
    "to_street": "123 Palm Grove Ln",
    "to_city": "Los Angeles",
    "to_state": "CA",
    "to_zip": "90002",
    "to_country": "US",
    "amount": 16.5,
    "shipping": 1.5,
    "sales_tax": 0.95,
    "line_items": [
      {
        "quantity": 1,
        "product_identifier": "12-34234-9",
        "description": "Fuzzy Widget",
        "unit_price": 15,
        "sales_tax": 0.95
      }
    ]
  }'

Response Example

{
  "order": {
    "transaction_id": "123",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "16.5",
    "shipping": "1.5",
    "sales_tax": "0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-9",
        "description": "Fuzzy Widget",
        "unit_price": "15.0",
        "discount": "0.0",
        "sales_tax": "0.95"
      }
    ]
  }
}
#<Taxjar::Order:0x00000a @attrs={
  :transaction_id => 20,
  :user_id => 11836,
  :transaction_date => "2015-05-14T00:00:00Z",
  :transaction_reference_id => nil,
  :provider => "api",
  :from_country => "US",
  :from_zip => 93101,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1218 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => 16.5,
  :shipping => 1.5,
  :sales_tax => 0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-9",
      :product_tax_code => nil,
      :description => "Fuzzy Widget",
      :unit_price => 15,
      :discount => 0,
      :sales_tax => 0.95
    }
  ]
}>
<TaxJarOrder {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Fuzzy Widget',
    'unit_price': 15,
    'discount': 0,
    'product_identifier': '12-34243-9',
    'sales_tax': 0.95,
    'product_tax_code': None,
    'id': 1,
    'quantity': 1
  }>],
  'user_id': 11836,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': '93101',
  'to_country': 'US',
  'shipping': 1.5,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2015-05-14T00:00:00Z',
  'transaction_reference_id': None,
  'sales_tax': 0.95,
  'amount': 16.5,
  'transaction_id': '20',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.CreateOrderResponse{
    Order: taxjar.Order{
        TransactionID:          "20",
        UserID:                 11836,
        TransactionDate:        "2015-05-14T00:00:00Z",
        TransactionReferenceID: "",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93101",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1218 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 16.5,
        Shipping:               1.5,
        SalesTax:               0.95,
        LineItems: []taxjar.OrderLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-9",
                Description:       "Fuzzy Widget",
                UnitPrice:         15,
                Discount:          0,
                SalesTax:          0.95,
            },
        },
    },
}

Creates a new order transaction.

Request

POST https://api.taxjar.com/v2/transactions/orders

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given order transaction. View Note
transaction_date datetime required The date/time the transaction was originally recorded. View Note
provider string optional Source of where the transaction was originally recorded. Defaults to “api”. View Note
from_country string optional Two-letter ISO country code of the country where the order shipped from. View Note
from_zip string optional Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string optional Two-letter ISO state code where the order shipped from.
from_city string optional City where the order shipped from.
from_street string optional Street address where the order shipped from.
to_country string required Two-letter ISO country code of the country where the order shipped to.
to_zip string required Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string required Two-letter ISO state code where the order shipped to.
to_city string optional City where the order shipped to.
to_street string optional Street address where the order shipped to.
amount float required Total amount of the order with shipping, excluding sales tax in dollars.
shipping float required Total amount of shipping for the order in dollars.
sales_tax float required Total amount of sales tax collected for the order in dollars.
customer_id string optional Unique identifier of the given customer for exemptions.
exemption_type string optional Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. View Note
line_items[][id] string optional Unique identifier of the given line item.
line_items[][quantity] integer optional Quantity for the item.
line_items[][product_identifier] string optional Product identifier for the item.
line_items[][description] string optional Description of the line item (up to 255 characters).
line_items[][product_tax_code] string optional Product tax code for the item. If omitted, the item will remain fully taxable. View Note
line_items[][unit_price] float optional Unit price for the item in dollars.
line_items[][discount] float optional Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float conditional Total sales tax collected (non-unit) for the item in dollars.

Notes

  • Either an address on file or from_ parameters are required to create order transactions.

  • The transaction_id should only include alphanumeric characters, underscores, and dashes.

  • The transaction_date may be a date ‘2015-05-25’, an ISO UTC date/time ‘2015-05-25T13:05:45’, or an ISO date/time with zone offset ‘2015-05-25T13:05:45-05:00’.

  • We recommend passing positive values for monetary amounts when creating or updating order transactions. Values will be signed automatically regardless of what you send in. Do not update existing orders with negative amounts to indicate a refund. Instead, create a refund transaction.

Response

Returns an order JSON object with details of the new order transaction.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given order transaction.
user_id integer Unique identifier of the user who created the order transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the order with shipping, excluding sales tax.
shipping float Total amount of shipping for the order.
sales_tax float Total amount of sales tax collected for the order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

put Update an order transaction

Definition

client.update_order
client.update_order
client.updateOrder();
$client->updateOrder();
client.UpdateOrder();
client.updateOrder();
client.UpdateOrder()
PUT https://api.taxjar.com/v2/transactions/orders/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.update_order({
  :transaction_id => '123',
  :amount => 17,
  :shipping => 2,
  :line_items => [
    {
      :quantity => 1,
      :product_identifier => '12-34243-0',
      :description => 'Heavy Widget',
      :unit_price => 15,
      :discount => 0,
      :sales_tax => 0.95
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

order = client.update_order('123', {
  'transaction_id': '123',
  'amount': 17,
  'shipping': 2,
  'line_items': [
    {
      'quantity': 1,
      'product_identifier': '12-34243-0',
      'description': 'Heavy Widget',
      'unit_price': 15,
      'discount': 0,
      'sales_tax': 0.95
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.updateOrder({
  transaction_id: '123',
  amount: 17,
  shipping: 2,
  line_items: [
    {
      quantity: 1,
      product_identifier: '12-34243-0',
      description: 'Heavy Widget',
      unit_price: 15,
      discount: 0,
      sales_tax: 0.95
    }
  ]
}).then(res => {
  res.order; // Order object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$order = $client->updateOrder([
  'transaction_id' => '123',
  'amount' => 17,
  'shipping' => 2,
  'line_items' => [
    [
      'quantity' => 1,
      'product_identifier' => '12-34243-0',
      'description' => 'Heavy Widget',
      'unit_price' => 15,
      'discount' => 0,
      'sales_tax' => 0.95
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var order = client.UpdateOrder(new
{
  transaction_id = "123",
  amount = 17,
  shipping = 2,
  line_items = new[] {
    new {
      quantity = 1,
      product_identifier = "12-34243-0",
      description = "Heavy Widget",
      unit_price = 15,
      discount = 0,
      sales_tax = 0.95
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.OrderResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UpdateOrderExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("transaction_id", "123");
            params.put("amount", 17);
            params.put("shipping", 2);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("product_identifier", "12-34243-0");
            lineItem.put("description", "Heavy Widget");
            lineItem.put("unit_price", 15);
            lineItem.put("discount", 0);
            lineItem.put("sales_tax", 0.95);
            lineItems.add(lineItem);

            params.put("line_items", lineItems);

            OrderResponse res = client.updateOrder("123", params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.UpdateOrder(taxjar.UpdateOrderParams{
        TransactionID: "123",
        Amount:        17,
        Shipping:      2,
        LineItems: []taxjar.OrderLineItem{
            {
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                Description:       "Heavy Widget",
                UnitPrice:         15,
                Discount:          0,
                SalesTax:          0.95,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Order)
    }
}
$ curl https://api.taxjar.com/v2/transactions/orders/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "123",
    "amount": 17,
    "shipping": 2,
    "line_items": [
      {
        "quantity": 1,
        "product_identifier": "12-34234-0",
        "unit_price": 15,
        "discount": 0,
        "sales_tax": 0.95
      }
    ]
  }' \
  -X PUT

Response Example

{
  "order": {
    "transaction_id": "123",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "17.0",
    "shipping": "2.0",
    "sales_tax": "0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-0",
        "description": "Heavy Widget",
        "unit_price": "15.0",
        "discount": "0.0",
        "sales_tax": "0.95"
      }
    ]
  }
}
#<Taxjar::Order:0x00000a @attrs={
  :transaction_id => "123",
  :user_id => 11836,
  :transaction_date => "2015-05-14T00:00:00Z",
  :transaction_reference_id => nil,
  :provider => 'api',
  :from_country => "US",
  :from_zip => 93101,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1218 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => 17.0,
  :shipping => 2.0,
  :sales_tax => 0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-0",
      :product_tax_code => nil,
      :description => "Heavy Widget",
      :unit_price => 15,
      :discount => 0,
      :sales_tax => 0.95
    }
  ]
}>
<TaxJarOrder {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Heavy Widget',
    'unit_price': 15,
    'discount': 0,
    'product_identifier': '12-34243-0',
    'sales_tax': 0.95,
    'product_tax_code': None,
    'id': 0,
    'quantity': 1
  }>,
  'user_id': 11836,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': '93101',
  'to_country': 'US',
  'shipping': 2,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2015-05-14T00:00:00Z',
  'transaction_reference_id': None,
  'sales_tax': 0.95,
  'amount': 17,
  'transaction_id': '123',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.UpdateOrderResponse{
    Order: taxjar.Order{
        TransactionID:          "123",
        UserID:                 11836,
        TransactionDate:        "2015-05-14T00:00:00Z",
        TransactionReferenceID: "",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93101",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1218 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 17.0,
        Shipping:               2.0,
        SalesTax:               0.95,
        LineItems: []taxjar.OrderLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                Description:       "Heavy Widget",
                UnitPrice:         15,
                Discount:          0,
                SalesTax:          0.95,
            },
        },
    },
}

Updates an existing order transaction created through the API.

Request

PUT https://api.taxjar.com/v2/transactions/orders/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given order transaction.
transaction_date datetime optional The date/time the transaction was originally recorded. View Note
from_country string optional Two-letter ISO country code of the country where the order shipped from. View Note
from_zip string optional Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string optional Two-letter ISO state code where the order shipped from.
from_city string optional City where the order shipped from.
from_street string optional Street address where the order shipped from.
to_country string optional Two-letter ISO country code of the country where the order shipped to.
to_zip string optional Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string optional Two-letter ISO state code where the order shipped to.
to_city string optional City where the order shipped to.
to_street string optional Street address where the order shipped to.
amount float optional Total amount of the order with shipping, excluding sales tax in dollars.
shipping float optional Total amount of shipping for the order in dollars.
sales_tax float optional Total amount of sales tax collected for the order in dollars.
customer_id string optional Unique identifier of the given customer for exemptions.
exemption_type string optional Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. View Note
line_items[][id] string optional Unique identifier of the given line item.
line_items[][quantity] integer optional Quantity for the item.
line_items[][product_identifier] string optional Product identifier for the item.
line_items[][description] string optional Description of the line item (up to 255 characters).
line_items[][product_tax_code] string optional Product tax code for the item. If omitted, the item will remain fully taxable. View Note
line_items[][unit_price] float optional Unit price for the item in dollars.
line_items[][discount] float optional Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float optional Total sales tax collected (non-unit) for the item in dollars.

Notes

  • Either an address on file or from_ parameters are required to update order transactions.

  • The transaction_date may be a date ‘2015-05-25’, an ISO UTC date/time ‘2015-05-25T13:05:45’, or an ISO date/time with zone offset ‘2015-05-25T13:05:45-05:00’.

Response

Returns an order JSON object with details of the updated order transaction.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given order transaction.
user_id integer Unique identifier of the user who created the order transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the order with shipping, excluding sales tax.
shipping float Total amount of shipping for the order.
sales_tax float Total amount of sales tax collected for the order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

delete Delete an order transaction

Definition

client.delete_order
client.delete_order
client.deleteOrder();
$client->deleteOrder();
client.DeleteOrder();
client.deleteOrder();
client.DeleteOrder()
DELETE https://api.taxjar.com/v2/transactions/orders/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

client.delete_order('123')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

client.delete_order('123')
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.deleteOrder('123').then(res => {
  res.order; // Order object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$client->deleteOrder('123');
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var order = client.DeleteOrder("123");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.OrderResponse;

public class DeleteOrderExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            OrderResponse res = client.deleteOrder("123");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.DeleteOrder("123")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Order)
    }
}
$ curl https://api.taxjar.com/v2/transactions/orders/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -X DELETE

Response Example

{
  "order": {
    "transaction_id": "123",
    "user_id": 10649,
    "transaction_date": null,
    "transaction_reference_id": null,
    "provider": "api",
    "from_country": null,
    "from_zip": null,
    "from_state": null,
    "from_city": null,
    "from_street": null,
    "to_country": null,
    "to_zip": null,
    "to_state": null,
    "to_city": null,
    "to_street": null,
    "amount": null,
    "shipping": null,
    "sales_tax": null,
    "line_items": []
  }
}
#<Taxjar::Order:0x00000a @attrs={
  :transaction_id => "123",
  :user_id => 10649,
  :transaction_date => nil,
  :transaction_reference_id => nil,
  :provider => "api",
  :from_country => nil,
  :from_zip => nil,
  :from_state => nil,
  :from_city => nil,
  :from_street => nil,
  :to_country => nil,
  :to_zip => nil,
  :to_state => nil,
  :to_city => nil,
  :to_street => nil,
  :amount => nil,
  :shipping => nil,
  :sales_tax => nil,
  :line_items => []
}>
<TaxJarOrder {
  'from_state': None,
  'line_items': [],
  'user_id': 10649,
  'to_zip': None,
  'from_street': None,
  'from_city': None,
  'from_zip': None,
  'to_country': None,
  'shipping': None,
  'from_country': None,
  'to_city': None,
  'to_street': None,
  'transaction_date': None,
  'transaction_reference_id': None,
  'sales_tax': None,
  'amount': None,
  'transaction_id': '123',
  'to_state': None,
  'provider': 'api'
}>
taxjar.DeleteOrderResponse{
    Order: taxjar.Order{
        TransactionID:          "123",
        UserID:                 10649,
        TransactionDate:        "",
        TransactionReferenceID: "",
        Provider:               "api",
        FromCountry:            "",
        FromZip:                "",
        FromState:              "",
        FromCity:               "",
        FromStreet:             "",
        ToCountry:              "",
        ToZip:                  "",
        ToState:                "",
        ToCity:                 "",
        ToStreet:               "",
        Amount:                 0,
        Shipping:               0,
        SalesTax:               0,
        LineItems: []taxjar.OrderLineItem{},
    },
}

Deletes an existing order transaction created through the API.

Request

DELETE https://api.taxjar.com/v2/transactions/orders/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given order transaction.
provider string optional Source of where the transaction was originally recorded. Defaults to “api”.

Response

Returns an order JSON object with the deleted order transaction identifiers.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given order transaction.
user_id integer Unique identifier of the user who created the order transaction.
provider string Source of where the transaction was originally recorded.

get List refund transactions

Definition

client.list_refunds
client.list_refunds
client.listRefunds();
$client->listRefunds();
client.ListRefunds();
client.listRefunds();
client.ListRefunds()
GET https://api.taxjar.com/v2/transactions/refunds

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

refunds = client.list_refunds({
  :from_transaction_date => '2015/05/01',
  :to_transaction_date => '2015/05/31'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

refunds = client.list_refunds({
  'from_transaction_date': '2015/05/01',
  'to_transaction_date': '2015/05/31'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.listRefunds({
  from_transaction_date: '2015/05/01',
  to_transaction_date: '2015/05/31'
}).then(res => {
  res.refunds; // Array of refunds
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$refunds = $client->listRefunds([
  'from_transaction_date' => '2015/05/01',
  'to_transaction_date' => '2015/05/31'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var refunds = client.ListRefunds(new
{
  from_transaction_date = "2015/05/01",
  to_transaction_date = "2015/05/31"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.RefundsResponse;
import java.util.HashMap;
import java.util.Map;

public class ListRefundsExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, String> params = new HashMap<>();
            params.put("from_transaction_date", "2015/05/01");
            params.put("to_transaction_date", "2015/05/31");
            RefundsResponse res = client.listRefunds(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ListRefunds(taxjar.ListRefundsParams{
        FromTransactionDate: "2015/05/01",
        ToTransactionDate:   "2015/05/31",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Refunds)
    }
}
$ curl -G https://api.taxjar.com/v2/transactions/refunds \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -d from_transaction_date="2015/05/01" \
  -d to_transaction_date="2015/05/31"

Response Example

{
  "refunds": [
    "321",
    "654"
  ]
}
["203", "204", "205"]
['203', '204', '205']
taxjar.ListRefundsResponse{
    Refunds: []string{"203", "204", "205"},
}

Lists existing refund transactions created through the API.

Request

GET https://api.taxjar.com/v2/transactions/refunds

Parameters

Parameter Type Required Description
transaction_date date optional The date the transactions were originally recorded. View Note
from_transaction_date date optional The start date of a range for which the transactions were originally recorded.
to_transaction_date date optional The end date of a range for which the transactions were originally recorded.
provider string optional Source of where the transactions were originally recorded. Defaults to “api”.

Notes

Use transaction_date to list transactions for a specific date. Otherwise, use from_transaction_date and to_transaction_date for a range of dates.

Response

Returns a refunds JSON object with an array of refund IDs created through the API.

get Show a refund transaction

Definition

client.show_refund
client.show_refund
client.showRefund();
$client->showRefund();
client.ShowRefund();
client.showRefund();
client.ShowRefund()
GET https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

refund = client.show_refund('321')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

refund = client.show_refund('321')
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.showRefund('321').then(res => {
  res.refund;
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$refund = $client->showRefund('321');
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var refund = client.ShowRefund("321");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.RefundResponse;

public class ShowRefundExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            RefundResponse res = client.showRefund("321");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ShowRefund("321")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Refund)
    }
}
$ curl https://api.taxjar.com/v2/transactions/refunds/321 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

{
  "refund": {
    "transaction_id": "321",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "transaction_reference_id": "123",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "-17.0",
    "shipping": "-2.0",
    "sales_tax": "-0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-0",
        "description": "Heavy Widget",
        "unit_price": "-15.0",
        "discount": "0.0",
        "sales_tax": "-0.95"
      }
    ]
  }
}
#<Taxjar::Refund:0x00000a @attrs={
  :transaction_id => "321",
  :user_id => 11836,
  :transaction_date => "2015-06-14T00:00:00Z",
  :transaction_reference_id => "123",
  :provider => "api",
  :from_country => "US",
  :from_zip => 93107,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1218 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => -17.0,
  :shipping => -2.0,
  :sales_tax => -0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-0",
      :product_tax_code => nil,
      :description => "Heavy Widget",
      :unit_price => -15,
      :discount => 0,
      :sales_tax => -0.95
    }
  ]
}>
<TaxJarRefund {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Heavy Widget',
    'unit_price': -15,
    'discount': 0,
    'product_identifier': '12-34243-0',
    'sales_tax': -0.95,
    'product_tax_code': None,
    'id': 0,
    'quantity': 1
  }>],
  'user_id': 11836,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': 93107,
  'to_country': 'US',
  'shipping': -2,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2015-06-14T00:00:00Z',
  'transaction_reference_id': '123',
  'sales_tax': -0.95,
  'amount': -17,
  'transaction_id': '321',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.ShowRefundResponse{
    Refund: taxjar.Refund{
        TransactionID:          "321",
        UserID:                 11836,
        TransactionDate:        "2015-06-14T00:00:00Z",
        TransactionReferenceID: "123",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93107",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1218 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 -17.0,
        Shipping:               -2.0,
        SalesTax:               -0.95,
        LineItems: []taxjar.RefundLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                ProductTaxCode:    "",
                Description:       "Heavy Widget",
                UnitPrice:         -15,
                Discount:          0,
                SalesTax:          -0.95,
            },
        },
    },
}

Shows an existing refund transaction created through the API.

Request

GET https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given refund transaction.
provider string optional Source of where the transaction was originally recorded. Defaults to “api”.

Response

Returns a refund JSON object with details of a given refund transaction created through the API.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given refund transaction.
user_id integer Unique identifier of the user who created the refund transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the refunded order with shipping, excluding sales tax.
shipping float Total amount of shipping for the refunded order.
sales_tax float Total amount of sales tax collected for the refunded order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

post Create a refund transaction

Definition

client.create_refund
client.create_refund
client.createRefund();
$client->createRefund();
client.CreateRefund();
client.createRefund();
client.CreateRefund()
POST https://api.taxjar.com/v2/transactions/refunds

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

order = client.create_refund({
  :transaction_id => '321',
  :transaction_date => '2015/05/14',
  :transaction_reference_id => '123',
  :to_country => 'US',
  :to_zip => '90002',
  :to_state => 'CA',
  :to_city => 'Los Angeles',
  :to_street => '123 Palm Grove Ln',
  :amount => -16.5,
  :shipping => -1.5,
  :sales_tax => -0.95,
  :line_items => [
    {
      :quantity => 1,
      :product_identifier => '12-34243-9',
      :description => 'Fuzzy Widget',
      :unit_price => -15,
      :sales_tax => -0.95
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

refund = client.create_refund({
  'transaction_id': '321',
  'transaction_date': '2016-05-14',
  'transaction_reference_id': '123',
  'from_state': 'CA',
  'from_city': 'Santa Barbara',
  'from_street': '1218 State St',
  'from_country': 'US',
  'from_zip': '93101',
  'to_country': 'US',
  'to_state': 'CA',
  'to_city': 'Los Angeles',
  'to_street': '123 Palm Grove Ln',
  'to_zip': '90002',
  'amount': -16.5,
  'shipping': -1.5,
  'sales_tax': -0.95,
  'line_items': [
    {
      'quantity': 1,
      'product_identifier': '12-34243-9',
      'description': 'Fuzzy Widget',
      'unit_price': -15,
      'sales_tax': -0.95
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.createRefund({
  transaction_id: '321',
  transaction_date: '2015/05/14',
  transaction_reference_id: '123',
  to_country: 'US',
  to_zip: '90002',
  to_state: 'CA',
  to_city: 'Los Angeles',
  to_street: '123 Palm Grove Ln',
  amount: -16.5,
  shipping: -1.5,
  sales_tax: -0.95,
  line_items: [
    {
      quantity: 1,
      product_identifier: '12-34243-9',
      description: 'Fuzzy Widget',
      unit_price: -15,
      sales_tax: -0.95
    }
  ]
}).then(res => {
  res.refund; // Refund object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$refund = $client->createRefund([
  'transaction_id' => '321',
  'transaction_date' => '2015/05/14',
  'transaction_reference_id' => '123',
  'to_country' => 'US',
  'to_zip' => '90002',
  'to_state' => 'CA',
  'to_city' => 'Los Angeles',
  'to_street' => '123 Palm Grove Ln',
  'amount' => -16.5,
  'shipping' => -1.5,
  'sales_tax' => -0.95,
  'line_items' => [
    [
      'quantity' => 1,
      'product_identifier' => '12-34243-9',
      'description' => 'Fuzzy Widget',
      'unit_price' => -15,
      'sales_tax' => -0.95
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var refund = client.CreateRefund(new
{
  transaction_id = "321",
  transaction_date = "2015/05/04",
  transaction_reference_id = "123",
  to_country = "US",
  to_zip = "90002",
  to_city = "Los Angeles",
  to_street = "123 Palm Grove Ln",
  amount = -16.5,
  shipping = -1.5,
  sales_tax = -0.95,
  line_items = new[] {
    new {
      quantity = 1,
      product_identifier = "12-34243-0",
      description = "Heavy Widget",
      unit_price = -15,
      sales_tax = -0.95
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.RefundResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CreateRefundExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("transaction_id", "321");
            params.put("transaction_date", "2015/05/04");
            params.put("to_country", "US");
            params.put("to_zip", "90002");
            params.put("to_city", "Los Angeles");
            params.put("to_street", "123 Palm Grove Ln");
            params.put("amount", -16.5);
            params.put("shipping", -1.5);
            params.put("sales_tax", -0.95);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("product_identifier", "12-34243-0");
            lineItem.put("description", "Heavy Widget");
            lineItem.put("unit_price", -15);
            lineItem.put("sales_tax", -0.95);
            lineItems.add(lineItem);

            params.put("line_items", lineItems);

            RefundResponse res = client.createRefund(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.CreateRefund(taxjar.CreateRefundParams{
        TransactionID:          "321",
        TransactionDate:        "2015/05/14",
        TransactionReferenceID: "123",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "Los Angeles",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 -16.5,
        Shipping:               -1.5,
        SalesTax:               -0.95,
        LineItems: []taxjar.RefundLineItem{
            {
                Quantity:          1,
                ProductIdentifier: "12-34243-9",
                Description:       "Fuzzy Widget",
                UnitPrice:         -15,
                SalesTax:          -0.95,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Refund)
    }
}
$ curl https://api.taxjar.com/v2/transactions/refunds \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "321",
    "transaction_date": "2015/05/14",
    "transaction_reference_id": "123",
    "to_street": "123 Palm Grove Ln",
    "to_city": "Los Angeles",
    "to_state": "CA",
    "to_zip": "90002",
    "to_country": "US",
    "amount": -16.5,
    "shipping": -1.5,
    "sales_tax": -0.95,
    "line_items": [
      {
        "quantity": 1,
        "product_identifier": "12-34234-9",
        "description": "Fuzzy Widget",
        "unit_price": -15,
        "sales_tax": -0.95
      }
    ]
  }'

Response Example

{
  "refund": {
    "transaction_id": "321",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "transaction_reference_id": "123",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "-16.5",
    "shipping": "-1.5",
    "sales_tax": "-0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-9",
        "description": "Fuzzy Widget",
        "unit_price": "-15.0",
        "discount": "0.0",
        "sales_tax": "-0.95"
      }
    ]
  }
}
#<Taxjar::Refund:0x00000a @attrs={
  :transaction_id => "321",
  :user_id => 11836,
  :transaction_date => "2015-06-14T00:00:00Z",
  :transaction_reference_id => "123",
  :provider => "api",
  :from_country => "US",
  :from_zip => 93107,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1218 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => -16.5,
  :shipping => -1.5,
  :sales_tax => -0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-0",
      :product_tax_code => nil,
      :description => "Heavy Widget",
      :unit_price => -15,
      :discount => 0,
      :sales_tax => -0.95
    }
  ]
}>
<TaxJarRefund {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Heavy Widget',
    'unit_price': -15,
    'discount': 0,
    'product_identifier': '12-34243-0',
    'sales_tax': -0.95,
    'product_tax_code': None,
    'id': 0,
    'quantity': 1
  }>],
  'user_id': 11836,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': 93107,
  'to_country': 'US',
  'shipping': -1.5,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2015-06-14T00:00:00Z',
  'transaction_reference_id': '123',
  'sales_tax': -0.95,
  'amount': -16.5,
  'transaction_id': '321',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.CreateRefundResponse{
    Refund: taxjar.Refund{
        TransactionID:          "321",
        UserID:                 11836,
        TransactionDate:        "2015-06-14T00:00:00Z",
        TransactionReferenceID: "123",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93107",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1218 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 -16.5,
        Shipping:               -1.5,
        SalesTax:               -0.95,
        LineItems: []taxjar.RefundLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                ProductTaxCode:    "",
                Description:       "Heavy Widget",
                UnitPrice:         -15,
                Discount:          0,
                SalesTax:          -0.95,
            },
        },
    },
}

Creates a new refund transaction.

Request

POST https://api.taxjar.com/v2/transactions/refunds

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given refund transaction. View Note
transaction_reference_id string required Unique identifier of the corresponding order transaction for the refund.
transaction_date datetime required The date/time the transaction was originally recorded. View Note
provider string optional Source of where the transaction was originally recorded. Defaults to “api”. View Note
from_country string optional Two-letter ISO country code of the country where the order shipped from. View Note
from_zip string optional Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string optional Two-letter ISO state code where the order shipped from.
from_city string optional City where the order shipped from.
from_street string optional Street address where the order shipped from.
to_country string required Two-letter ISO country code of the country where the order shipped to.
to_zip string required Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string required Two-letter ISO state code where the order shipped to.
to_city string optional City where the order shipped to.
to_street string optional Street address where the order shipped to.
amount float required Total amount of the refunded order with shipping, excluding sales tax in dollars.
shipping float required Total amount of shipping for the refunded order in dollars.
sales_tax float required Total amount of sales tax collected for the refunded order in dollars.
customer_id string optional Unique identifier of the given customer for exemptions.
exemption_type string optional Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. View Note
line_items[][id] string optional Unique identifier of the given line item.
line_items[][quantity] integer optional Quantity for the item.
line_items[][product_identifier] string optional Product identifier for the item.
line_items[][description] string optional Description of the line item (up to 255 characters).
line_items[][product_tax_code] string optional Product tax code for the item. If omitted, the item will remain fully taxable. View Note
line_items[][unit_price] float optional Unit price for the item in dollars.
line_items[][discount] float optional Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float conditional Total sales tax collected (non-unit) for the item in dollars.

Notes

  • Either an address on file or from_ parameters are required to create refund transactions.

  • The transaction_id should only include alphanumeric characters, underscores, and dashes.

  • The transaction_date may be a date ‘2015-05-25’, an ISO UTC date/time ‘2015-05-25T13:05:45’, or an ISO date/time with zone offset ‘2015-05-25T13:05:45-05:00’.

  • We recommend passing negative values for monetary amounts when creating or updating refund transactions. Values will be signed automatically regardless of what you send in.

Response

Returns a refund JSON object with details of the new refund transaction.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given refund transaction.
user_id integer Unique identifier of the user who created the refund transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the refunded order with shipping, excluding sales tax.
shipping float Total amount of shipping for the refunded order.
sales_tax float Total amount of sales tax collected for the refunded order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

put Update a refund transaction

Definition

client.update_refund
client.update_refund
client.updateRefund();
$client->updateRefund();
client.UpdateRefund();
client.updateRefund();
client.UpdateRefund()
PUT https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

refund = client.update_refund({
  :transaction_id => '321',
  :amount => -17,
  :shipping => -2,
  :sales_tax => -0.95,
  :line_items => [
    {
      :quantity => 1,
      :product_identifier => '12-34243-0',
      :description => 'Heavy Widget',
      :unit_price => -15,
      :sales_tax => -0.95
    }
  ]
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

refund = client.update_refund('321', {
  'amount': -17,
  'shipping': -2,
  'sales_tax': -0.95,
  'line_items': [
    {
      'quantity': 1,
      'product_identifier': '12-34243-0',
      'description': 'Heavy Widget',
      'unit_price': -15,
      'sales_tax': -0.95
    }
  ]
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.updateRefund({
  transaction_id: '123',
  amount: -17,
  shipping: -2,
  line_items: [
    {
      quantity: 1,
      product_identifier: '12-34243-0',
      description: 'Heavy Widget',
      unit_price: -15,
      sales_tax: -0.95
    }
  ]
}).then(res => {
  res.refund; // Refund object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$refund = $client->updateRefund([
  'transaction_id' => '321',
  'amount' => -17,
  'shipping' => -2,
  'line_items' => [
    [
      'quantity' => 1,
      'product_identifier' => '12-34243-0',
      'description' => 'Heavy Widget',
      'unit_price' => -15,
      'sales_tax' => -0.95
    ]
  ]
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var refund = client.UpdateRefund(new
{
  transaction_id = "321",
  amount = -17,
  shipping = -2,
  line_items = new[] {
    new {
      quantity = 1,
      product_identifier = "12-34243-0",
      description = "Heavy Widget",
      unit_price = -15,
      discount = 0,
      sales_tax = -0.95
    }
  }
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.RefundResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UpdateRefundExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("transaction_id", "321");
            params.put("amount", -17);
            params.put("shipping", -2);

            List<Map> lineItems = new ArrayList();
            Map<String, Object> lineItem = new HashMap<>();
            lineItem.put("quantity", 1);
            lineItem.put("product_identifier", "12-34243-0");
            lineItem.put("description", "Heavy Widget");
            lineItem.put("unit_price", -15);
            lineItem.put("discount", 0);
            lineItem.put("sales_tax", -0.95);
            lineItems.add(lineItem);

            params.put("line_items", lineItems);

            RefundResponse res = client.updateRefund("321", params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.UpdateRefund(taxjar.UpdateRefundParams{
        TransactionID: "321",
        Amount:        -17,
        Shipping:      -2,
        SalesTax:      -0.95,
        LineItems: []taxjar.RefundLineItem{
            {
                Quantity:          1,
                ProductIdentifier: "12-34243-0",
                Description:       "Heavy Widget",
                UnitPrice:         -15,
                SalesTax:          -0.95,
            },
        },
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Refund)
    }
}
$ curl https://api.taxjar.com/v2/transactions/refunds/321 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "transaction_id": "321",
    "amount": -17,
    "shipping": -2,
    "sales_tax": -0.95,
    "line_items": [
      {
        "quantity": 1,
        "product_identifier": "12-34234-0",
        "description": "Heavy Widget",
        "unit_price": -15,
        "sales_tax": -0.95
      }
    ]
  }' \
  -X PUT

Response Example

{
  "refund": {
    "transaction_id": "321",
    "user_id": 10649,
    "transaction_date": "2015-05-14T00:00:00Z",
    "transaction_reference_id": "123",
    "provider": "api",
    "to_country": "US",
    "to_zip": "90002",
    "to_state": "CA",
    "to_city": "LOS ANGELES",
    "to_street": "123 Palm Grove Ln",
    "amount": "-17.0",
    "shipping": "-2.0",
    "sales_tax": "-0.95",
    "line_items": [
      {
        "id": "1",
        "quantity": 1,
        "product_identifier": "12-34243-0",
        "description": "Heavy Widget",
        "unit_price": -15,
        "discount": 0,
        "sales_tax": -0.95
      }
    ]
  }
}
#<Taxjar::Refund:0x00000a @attrs={
  :transaction_id => "321",
  :user_id => 11836,
  :transaction_date => "2015-06-14T00:00:00Z",
  :transaction_reference_id => "123",
  :provider => "api",
  :from_country => "US",
  :from_zip => 93107,
  :from_state => "CA",
  :from_city => "SANTA BARBARA",
  :from_street => "1218 State St",
  :to_country => "US",
  :to_zip => 90002,
  :to_state => "CA",
  :to_city => "LOS ANGELES",
  :to_street => "123 Palm Grove Ln",
  :amount => -17.0,
  :shipping => -2.0,
  :sales_tax => -0.95,
  :line_items => [
    {
      :id => "1",
      :quantity => 1,
      :product_identifier => "12-34243-9",
      :product_tax_code => nil,
      :description => "Heavy Widget",
      :unit_price => -15,
      :discount => 0,
      :sales_tax => -0.95
    }
  ]
}>
<TaxJarRefund {
  'from_state': 'CA',
  'line_items': [<TaxJarLineItem {
    'description': 'Heavy Widget',
    'unit_price': -15,
    'discount': 0,
    'product_identifier': '12-34243-9',
    'sales_tax': -0.95,
    'product_tax_code': None,
    'id': 0,
    'quantity': 1
  }>],
  'user_id': 1,
  'to_zip': '90002',
  'from_street': '1218 State St',
  'from_city': 'SANTA BARBARA',
  'from_zip': 93107,
  'to_country': 'US',
  'shipping': -2,
  'from_country': 'US',
  'to_city': 'LOS ANGELES',
  'to_street': '123 Palm Grove Ln',
  'transaction_date': '2016-03-10T00:00:00.000Z',
  'transaction_reference_id': '123',
  'sales_tax': -0.95,
  'amount': -17,
  'transaction_id': '321',
  'to_state': 'CA',
  'provider': 'api'
}>
taxjar.UpdateRefundResponse{
    Refund: taxjar.Refund{
        TransactionID:          "321",
        UserID:                 11836,
        TransactionDate:        "2015-06-14T00:00:00Z",
        TransactionReferenceID: "123",
        Provider:               "api",
        FromCountry:            "US",
        FromZip:                "93107",
        FromState:              "CA",
        FromCity:               "SANTA BARBARA",
        FromStreet:             "1218 State St",
        ToCountry:              "US",
        ToZip:                  "90002",
        ToState:                "CA",
        ToCity:                 "LOS ANGELES",
        ToStreet:               "123 Palm Grove Ln",
        Amount:                 -17.0,
        Shipping:               -2.0,
        SalesTax:               -0.95,
        LineItems: []taxjar.RefundLineItem{
            {
                ID:                "1",
                Quantity:          1,
                ProductIdentifier: "12-34243-9",
                ProductTaxCode:    "",
                Description:       "Heavy Widget",
                UnitPrice:         -15,
                Discount:          0,
                SalesTax:          -0.95,
            },
        },
    },
}

Updates an existing refund transaction created through the API.

Request

PUT https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given transaction.
transaction_reference_id string required Unique identifier of the corresponding order transaction for the refund.
transaction_date datetime optional The date/time the transaction was originally recorded.
from_country string optional Two-letter ISO country code of the country where the order shipped from. View Note
from_zip string optional Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string optional Two-letter ISO state code where the order shipped from.
from_city string optional City where the order shipped from.
from_street string optional Street address where the order shipped from.
to_country string optional Two-letter ISO country code of the country where the refunded order shipped to.
to_zip string optional Postal code where the refunded order shipped to (5-Digit ZIP or ZIP+4).
to_state string optional Two-letter ISO state code where the refunded order shipped to.
to_city string optional City where the refunded order shipped to.
to_street string optional Street address where the refunded order shipped to.
amount float optional Total amount of the refunded order with shipping, excluding sales tax in dollars.
shipping float optional Total amount of shipping for the refunded order in dollars.
sales_tax float optional Total amount of sales tax collected for the refunded order in dollars.
customer_id string optional Unique identifier of the given customer for exemptions.
exemption_type string optional Type of exemption for the order: wholesale, government, marketplace, other, or non_exempt. View Note
line_items[][id] string optional Unique identifier of the given line item.
line_items[][quantity] integer optional Quantity for the item.
line_items[][product_identifier] string optional Product identifier for the item.
line_items[][description] string optional Description of the line item (up to 255 characters).
line_items[][product_tax_code] string optional Product tax code for the item. If omitted, the item will remain fully taxable. View Note
line_items[][unit_price] float optional Unit price for the item in dollars.
line_items[][discount] float optional Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float optional Total sales tax collected (non-unit) for the item in dollars.

Notes

  • Either an address on file or from_ parameters are required to update refund transactions.

  • The transaction_date may be a date ‘2015-05-25’, an ISO UTC date/time ‘2015-05-25T13:05:45’, or an ISO date/time with zone offset ‘2015-05-25T13:05:45-05:00’.

Response

Returns a refund JSON object with details of the updated refund transaction.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given refund transaction.
user_id integer Unique identifier of the user who created the refund transaction.
transaction_date datetime The date/time the transaction was originally recorded.
provider string Source of where the transaction was originally recorded.
exemption_type string Type of exemption for the order: wholesale, government, marketplace, other, non_exempt, or null. View Note
from_country string Two-letter ISO country code of the country where the order shipped from.
from_zip string Postal code where the order shipped from (5-Digit ZIP or ZIP+4).
from_state string Two-letter ISO state code where the order shipped from.
from_city string City where the order shipped from.
from_street string Street address where the order shipped from.
to_country string Two-letter ISO country code of the country where the order shipped to.
to_zip string Postal code where the order shipped to (5-Digit ZIP or ZIP+4).
to_state string Two-letter ISO state code where the order shipped to.
to_city string City where the order shipped to.
to_street string Street address where the order shipped to.
amount float Total amount of the refunded order with shipping, excluding sales tax.
shipping float Total amount of shipping for the refunded order.
sales_tax float Total amount of sales tax collected for the refunded order.
line_items[][id] string Unique identifier of the given line item.
line_items[][quantity] integer Quantity for the item.
line_items[][product_identifier] string Product identifier for the item.
line_items[][description] string Description of the line item (up to 255 characters).
line_items[][product_tax_code] string Product tax code for the item.
line_items[][unit_price] float Unit price for the item in dollars.
line_items[][discount] float Total discount (non-unit) for the item in dollars.
line_items[][sales_tax] float Total sales tax collected (non-unit) for the item in dollars.

delete Delete a refund transaction

Definition

client.delete_refund
client.delete_refund
client.deleteRefund();
$client->deleteRefund();
client.DeleteRefund();
client.deleteRefund();
client.DeleteRefund()
DELETE https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

client.delete_refund('321')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

client.delete_refund('321')
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.deleteRefund('321').then(res => {

});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$client->deleteRefund('321');
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var refund = client.DeleteRefund("321");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.RefundResponse;

public class DeleteOrderExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            OrderResponse res = client.deleteRefund("321");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.DeleteRefund("321")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Refund)
    }
}
$ curl https://api.taxjar.com/v2/transactions/refunds/321 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -X DELETE

Response Example

{
  "refund": {
    "transaction_id": "321",
    "user_id": 10649,
    "transaction_date": null,
    "transaction_reference_id": null,
    "provider": "api",
    "from_country": null,
    "from_zip": null,
    "from_state": null,
    "from_city": null,
    "from_street": null,
    "to_country": null,
    "to_zip": null,
    "to_state": null,
    "to_city": null,
    "to_street": null,
    "amount": null,
    "shipping": null,
    "sales_tax": null,
    "line_items": []
  }
}
#<Taxjar::Refund:0x00000a @attrs={
  :transaction_id => "321",
  :user_id => 11836,
  :transaction_date => nil,
  :transaction_reference_id => nil,
  :provider => "api",
  :from_country => nil,
  :from_zip => nil,
  :from_state => nil,
  :from_city => nil,
  :from_street => nil,
  :to_country => nil,
  :to_zip => nil,
  :to_state => nil,
  :to_city => nil,
  :to_street => nil,
  :amount => nil,
  :shipping => nil,
  :sales_tax => nil,
  :line_items => []
}>
<TaxJarRefund {
  'from_state': None,
  'line_items': [],
  'user_id': 11836,
  'to_zip': None,
  'from_street': None,
  'from_city': None,
  'from_zip': None,
  'to_country': None,
  'shipping': None,
  'from_country': None,
  'to_city': None,
  'to_street': None,
  'transaction_date': None,
  'transaction_reference_id': None,
  'sales_tax': None,
  'amount': None,
  'transaction_id': '321',
  'to_state': None,
  'provider': 'api'
}>
taxjar.DeleteRefundResponse{
    Refund: taxjar.Refund{
        TransactionID:          "321",
        UserID:                 11836,
        TransactionDate:        "",
        TransactionReferenceID: "",
        Provider:               "api",
        FromCountry:            "",
        FromZip:                "",
        FromState:              "",
        FromCity:               "",
        FromStreet:             "",
        ToCountry:              "",
        ToZip:                  "",
        ToState:                "",
        ToCity:                 "",
        ToStreet:               "",
        Amount:                 0,
        Shipping:               0,
        SalesTax:               0,
        LineItems: []taxjar.RefundLineItem{},
    },
}

Deletes an existing refund transaction created through the API.

Request

DELETE https://api.taxjar.com/v2/transactions/refunds/:transaction_id

Parameters

Parameter Type Required Description
transaction_id string required Unique identifier of the given refund transaction.
provider string optional Source of where the transaction was originally recorded. Defaults to “api”.

Response

Returns a refund JSON object with the deleted refund transaction identifiers.

Attributes

Parameter Type Description
transaction_id string Unique identifier of the given refund transaction.
user_id integer Unique identifier of the user who created the refund transaction.
provider string Source of where the transaction was originally recorded.

Customers

Manage your exempt customers (wholesale, government, etc) for sales tax calculations, reporting, and filing in TaxJar. After creating a new customer, pass in the customer_id to our tax and transaction endpoints to fully exempt them from sales tax.

get List customers

Definition

client.list_customers
client.list_customers
client.listCustomers();
$client->listCustomers();
client.ListCustomers();
client.listCustomers();
client.ListCustomers()
GET https://api.taxjar.com/v2/customers

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

customers = client.list_customers
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

customers = client.list_customers()
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$customers = $client->listCustomers();
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.listCustomers().then(res => {
  res.customers; // Array of customers
});
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var customers = client.ListCustomers();
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.CustomersResponse;
import java.util.HashMap;
import java.util.Map;

public class ListCustomersExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            CustomersResponse res = client.listCustomers();
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ListCustomers()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Customers)
    }
}
$ curl https://api.taxjar.com/v2/customers \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

["123", "124", "125"]
['123', '124', '125']
{
  "customers": [
    "123",
    "456"
  ]
}
taxjar.ListCustomersResponse{
  Customers: []string{
    "123",
    "456",
  },
}

Lists existing customers created through the API.

Request

GET https://api.taxjar.com/v2/customers

Response

Returns a customers JSON object with an array of customer IDs created through the API.

get Show a customer

Definition

client.show_customer
client.show_customer
client.showCustomer();
$client->showCustomer();
client.ShowCustomer();
client.showCustomer();
client.ShowCustomer()
GET https://api.taxjar.com/v2/customers/:customer_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

customer = client.show_customer('123')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

customer = client.show_customer('123')
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$customer = $client->showCustomer('123');
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.showCustomer('123').then(res => {
  res.customer;
});
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var customer = client.ShowCustomer("123");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.transactions.CustomerResponse;

public class ShowCustomerExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            CustomerResponse res = client.showCustomer("123");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ShowCustomer("123")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Customer)
    }
}
$ curl https://api.taxjar.com/v2/customers/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

#<Taxjar::Customer @attrs={
  :customer_id => "123",
  :exemption_type => "wholesale",
  :exempt_regions => [
    [0] {
      :country => "US",
      :state => "FL"
    },
    [1] {
      :country => "US",
      :state => "PA"
    }
  ],
  :name => "Dunder Mifflin Paper Company",
  :country => "US",
  :state => "PA",
  :zip => "18504",
  :city => "Scranton",
  :street => "1725 Slough Avenue"
}>
<TaxJarCustomer {
  'customer_id': '123',
  'exemption_type': 'wholesale',
  'exempt_regions': [<TaxJarExemptRegion {
    'country': 'US',
    'state': 'FL'
  }>, <TaxJarExemptRegion {
    'country': 'US',
    'state': 'PA'
  }>],
  'name': 'Dunder Mifflin Paper Company',
  'country': 'US',
  'state': 'PA',
  'zip': '18504',
  'city': 'Scranton',
  'street': '1725 Slough Avenue'
}>
{
  "customer": {
    "customer_id": "123",
    "exemption_type": "wholesale",
    "exempt_regions": [
      {
        "country": "US",
        "state": "FL"
      },
      {
        "country": "US",
        "state": "PA"
      }
    ],
    "name": "Dunder Mifflin Paper Company",
    "country": "US",
    "state": "PA",
    "zip": "18504",
    "city": "Scranton",
    "street": "1725 Slough Avenue"
  }
}
taxjar.ShowCustomerResponse{
    Customer: taxjar.Customer{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "FL",
            },
            {
                Country: "US",
                State:   "PA",
            },
        },
        Name:    "Dunder Mifflin Paper Company",
        Country: "US",
        State:   "PA",
        Zip:     "18504",
        City:    "Scranton",
        Street:  "1725 Slough Avenue",
    },
}

Shows an existing customer created through the API.

Request

GET https://api.taxjar.com/v2/customers/:customer_id

Parameters

Parameter Type Required Description
customer_id string required Unique identifier of the given customer.

Response

Returns a customer JSON object with details of a customer created through the API.

Attributes

Parameter Type Description
customer_id string Unique identifier of the given customer.
exemption_type string Type of customer exemption: wholesale, government, other, or non_exempt.
exempt_regions[][country] string Two-letter ISO country code where the customer is exempt.
exempt_regions[][state] string Two-letter ISO state code where the customer is exempt.
name string Name of the customer.
country string Two-letter ISO country code of the customer’s primary address.
state string Two-letter ISO state code of the customer’s primary address.
zip string Postal code of the customer’s primary address.
city string City of the customer’s primary address.
street string Street address of the customer’s primary address.

post Create a customer

Definition

client.create_customer
client.create_customer
client.createCustomer();
$client->createCustomer();
client.CreateCustomer();
client.createCustomer();
client.CreateCustomer()
POST https://api.taxjar.com/v2/customers

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

customer = client.create_customer({
  :customer_id => '123',
  :exemption_type => 'wholesale',
  :name => 'Dunder Mifflin Paper Company',
  :exempt_regions => [
    {
      :country => 'US',
      :state => 'FL'
    },
    {
      :country => 'US',
      :state => 'PA'
    }
  ],
  :country => 'US',
  :state => 'PA',
  :zip => '18504',
  :city => 'Scranton',
  :street => '1725 Slough Avenue'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

customer = client.create_customer({
  'customer_id': '123',
  'exemption_type': 'wholesale',
  'name': 'Dunder Mifflin Paper Company',
  'exempt_regions': [
    {
      'country': 'US',
      'state': 'FL'
    },
    {
      'country': 'US',
      'state': 'PA'
    }
  ],
  'country': 'US',
  'state': 'PA',
  'zip': '18504',
  'city': 'Scranton',
  'street': '1725 Slough Avenue'
})
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$customer = $client->createCustomer([
  'customer_id' => '123',
  'exemption_type' => 'wholesale',
  'name' => 'Dunder Mifflin Paper Company',
  'exempt_regions' => [
    [
      'country' => 'US',
      'state' => 'FL'
    ],
    [
      'country' => 'US',
      'state' => 'PA'
    ]
  ],
  'country' => 'US',
  'state' => 'PA',
  'zip' => '18504',
  'city' => 'Scranton',
  'street' => '1725 Slough Avenue'
]);
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.createCustomer({
  customer_id: '123',
  exemption_type: 'wholesale',
  name: 'Dunder Mifflin Paper Company',
  exempt_regions: [
    {
      country: 'US',
      state: 'FL'
    },
    {
      country: 'US',
      state: 'PA'
    }
  ],
  country: 'US',
  state: 'PA',
  zip: '18504',
  city: 'Scranton',
  street: '1725 Slough Avenue'
}).then(res => {
  res.customer;
});
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var customer = client.CreateCustomer(new {
  customer_id = "123",
  exemption_type = "wholesale",
  name = "Dunder Mifflin Paper Company",
  exempt_regions = new[] {
    new {
      country = "US",
      state = "FL"
    },
    new {
      country = "US",
      state = "PA"
    }
  },
  country = "US",
  state = "PA",
  zip = "18504",
  city = "Scranton",
  street = "1725 Slough Avenue"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.customers.CustomerResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CreateCustomerExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("customer_id", "123");
            params.put("exemption_type", "wholesale");
            params.put("name", "Dunder Mifflin Paper Company");
            params.put("country", "US");
            params.put("state", "PA");
            params.put("zip", "18504");
            params.put("city", "Scranton");
            params.put("street", "1725 Slough Avenue");

            List<Map> exemptRegions = new ArrayList();

            Map<String, String> exemptRegion = new HashMap<>();
            exemptRegion.put("country", "US");
            exemptRegion.put("state", "FL");

            Map<String, String> exemptRegion2 = new HashMap<>();
            exemptRegion.put("country", "US");
            exemptRegion.put("state", "PA");

            exemptRegions.add(exemptRegion);
            exemptRegions.add(exemptRegion2);

            params.put("exempt_regions", exemptRegions);

            CustomerResponse res = client.createCustomer(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.CreateCustomer(taxjar.CreateCustomerParams{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        Name:          "Dunder Mifflin Paper Company",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "FL",
            },
            {
                Country: "US",
                State:   "PA",
            },
        },
        Country: "US",
        State:   "PA",
        Zip:     "18504",
        City:    "Scranton",
        Street:  "1725 Slough Avenue",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Customer)
    }
}
$ curl https://api.taxjar.com/v2/customers \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "123",
    "exemption_type": "wholesale",
    "name": "Dunder Mifflin Paper Company",
    "exempt_regions": [
      {
        "country": "US",
        "state": "FL"
      },
      {
        "country": "US",
        "state": "PA"
      }
    ],
    "country": "US",
    "state": "PA",
    "zip": "18504",
    "city": "Scranton",
    "street": "1725 Slough Avenue"
  }'

Response Example

#<Taxjar::Customer @attrs={
  :customer_id => "123",
  :exemption_type => "wholesale",
  :exempt_regions => [
    [0] {
      :country => "US",
      :state => "FL"
    },
    [1] {
      :country => "US",
      :state => "PA"
    }
  ],
  :name => "Dunder Mifflin Paper Company",
  :country => "US",
  :state => "PA",
  :zip => "18504",
  :city => "Scranton",
  :street => "1725 Slough Avenue"
}>
<TaxJarCustomer {
  'customer_id': '123',
  'exemption_type': 'wholesale',
  'exempt_regions': [<TaxJarExemptRegion {
    'country': 'US',
    'state': 'FL'
  }>, <TaxJarExemptRegion {
    'country': 'US',
    'state': 'PA'
  }>],
  'name': 'Dunder Mifflin Paper Company',
  'country': 'US',
  'state': 'PA',
  'zip': '18504',
  'city': 'Scranton',
  'street': '1725 Slough Avenue'
}>
{
  "customer": {
    "customer_id": "123",
    "exemption_type": "wholesale",
    "exempt_regions": [
      {
        "country": "US",
        "state": "FL"
      },
      {
        "country": "US",
        "state": "PA"
      }
    ],
    "name": "Dunder Mifflin Paper Company",
    "country": "US",
    "state": "PA",
    "zip": "18504",
    "city": "Scranton",
    "street": "1725 Slough Avenue"
  }
}
taxjar.CreateCustomerResponse{
    Customer: taxjar.Customer{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        Name:          "Dunder Mifflin Paper Company",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "FL",
            },
            {
                Country: "US",
                State:   "PA",
            },
        },
        Country: "US",
        State:   "PA",
        Zip:     "18504",
        City:    "Scranton",
        Street:  "1725 Slough Avenue",
    },
}

Creates a new customer.

Request

POST https://api.taxjar.com/v2/customers

Parameters

Parameter Type Required Description
customer_id string required Unique identifier of the given customer.
exemption_type string required Type of customer exemption: wholesale, government, other, or non_exempt.
name string required Name of the customer.
exempt_regions[][country] string optional Two-letter ISO country code where the customer is exempt. View Note
exempt_regions[][state] string optional Two-letter ISO state code where the customer is exempt.
country string optional Two-letter ISO country code of the customer’s primary address.
state string optional Two-letter ISO state code of the customer’s primary address.
zip string optional Postal code of the customer’s primary address.
city string optional City of the customer’s primary address.
street string optional Street address of the customer’s primary address.

Response

Returns a customer JSON object with details of the new customer.

Attributes

Parameter Type Description
customer_id string Unique identifier of the given customer.
exemption_type string Type of customer exemption: wholesale, government, other, or non_exempt.
exempt_regions[][country] string Two-letter ISO country code where the customer is exempt.
exempt_regions[][state] string Two-letter ISO state code where the customer is exempt.
name string Name of the customer.
country string Two-letter ISO country code of the customer’s primary address.
state string Two-letter ISO state code of the customer’s primary address.
zip string Postal code of the customer’s primary address.
city string City of the customer’s primary address.
street string Street address of the customer’s primary address.

put Update a customer

Definition

client.update_customer
client.update_customer
client.updateCustomer();
$client->updateCustomer();
client.UpdateCustomer();
client.updateCustomer();
client.UpdateCustomer()
PUT https://api.taxjar.com/v2/customers/:customer_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

customer = client.update_customer({
  :customer_id => '123',
  :exemption_type => 'wholesale',
  :name => 'Sterling Cooper',
  :exempt_regions => [
    {
      :country => 'US',
      :state => 'NY'
    }
  ],
  :country => 'US',
  :state => 'NY',
  :zip => '10010',
  :city => 'New York',
  :street => '405 Madison Ave'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

customer = client.update_customer('123', {
  'exemption_type': 'wholesale',
  'name': 'Sterling Cooper',
  'exempt_regions': [
    {
      'country': 'US',
      'state': 'NY'
    }
  ],
  'country': 'US',
  'state': 'NY',
  'zip': '10010',
  'city': 'New York',
  'street': '405 Madison Ave'
})
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$customer = $client->updateCustomer([
  'customer_id' => '123',
  'exemption_type' => 'wholesale',
  'name' => 'Sterling Cooper',
  'exempt_regions' => [
    [
      'country' => 'US',
      'state' => 'NY'
    ]
  ],
  'country' => 'US',
  'state' => 'NY',
  'zip' => '10010',
  'city' => 'New York',
  'street' => '405 Madison Ave'
]);
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.updateCustomer({
  customer_id: '123',
  exemption_type: 'wholesale',
  name: 'Sterling Cooper',
  exempt_regions: [
    {
      country: 'US',
      state: 'NY'
    }
  ],
  country: 'US',
  state: 'NY',
  zip: '10010',
  city: 'New York',
  street: '405 Madison Ave'
}).then(res => {
  res.customer;
});
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var customer = client.UpdateCustomer(new {
  customer_id = "123",
  exemption_type = "wholesale",
  name = "Sterling Cooper",
  exempt_regions = new[] {
    new {
      country = "US",
      state = "NY"
    }
  },
  country = "US",
  state = "NY",
  zip = "10010",
  city = "New York",
  street = "405 Madison Ave"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.customers.CustomerResponse;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class UpdateCustomerExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("customer_id", "123");
            params.put("exemption_type", "wholesale");
            params.put("name", "Sterling Cooper");
            params.put("country", "US");
            params.put("state", "NY");
            params.put("zip", "10010");
            params.put("city", "New York");
            params.put("street", "405 Madison Ave");

            List<Map> exemptRegions = new ArrayList();

            Map<String, String> exemptRegion = new HashMap<>();
            exemptRegion.put("country", "US");
            exemptRegion.put("state", "NY");

            exemptRegions.add(exemptRegion);

            params.put("exempt_regions", exemptRegions);

            CustomerResponse res = client.updateCustomer("123", params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.UpdateCustomer(taxjar.UpdateCustomerParams{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        Name:          "Sterling Cooper",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "NY",
            },
        },
        Country: "US",
        State:   "NY",
        Zip:     "10010",
        City:    "New York",
        Street:  "405 Madison Ave",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Customer)
    }
}
$ curl https://api.taxjar.com/v2/customers/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "customer_id": "123",
    "exemption_type": "wholesale",
    "name": "Sterling Cooper",
    "exempt_regions": [
      {
        "country": "US",
        "state": "NY"
      }
    ],
    "country": "US",
    "state": "NY",
    "zip": "10010",
    "city": "New York",
    "street": "405 Madison Ave"
  }' \
  -X PUT

Response Example

#<Taxjar::Customer @attrs={
  :customer_id => "123",
  :exemption_type => "wholesale",
  :exempt_regions => [
    [0] {
      :country => "US",
      :state => "NY"
    }
  ],
  :name => "Sterling Cooper",
  :country => "US",
  :state => "NY",
  :zip => "10010",
  :city => "New York",
  :street => "405 Madison Ave"
}>
<TaxJarCustomer {
  'customer_id': '123',
  'exemption_type': 'wholesale',
  'exempt_regions': [<TaxJarExemptRegion {
    'country': 'US',
    'state': 'NY'
  }>],
  'name': 'Sterling Cooper',
  'country': 'US',
  'state': 'NY',
  'zip': '10010',
  'city': 'New York',
  'street': '405 Madison Ave'
}>
{
  "customer": {
    "customer_id": "123",
    "exemption_type": "wholesale",
    "exempt_regions": [
      {
        "country": "US",
        "state": "NY"
      }
    ],
    "name": "Sterling Cooper",
    "country": "US",
    "state": "NY",
    "zip": "10010",
    "city": "New York",
    "street": "405 Madison Ave"
  }
}
taxjar.UpdateCustomerResponse{
    Customer: taxjar.Customer{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        Name:          "Sterling Cooper",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "NY",
            },
        },
        Country: "US",
        State:   "NY",
        Zip:     "10010",
        City:    "New York",
        Street:  "405 Madison Ave",
    },
}

Updates an existing customer created through the API.

Request

PUT https://api.taxjar.com/v2/customers/:customer_id

Parameters

Parameter Type Required Description
customer_id string required Unique identifier of the given customer.
exemption_type string required Type of customer exemption: wholesale, government, other, or non_exempt.
name string required Name of the customer.
exempt_regions[][country] string optional Two-letter ISO country code where the customer is exempt. View Note
exempt_regions[][state] string optional Two-letter ISO state code where the customer is exempt.
country string optional Two-letter ISO country code of the customer’s primary address.
state string optional Two-letter ISO state code of the customer’s primary address.
zip string optional Postal code of the customer’s primary address.
city string optional City of the customer’s primary address.
street string optional Street address of the customer’s primary address.

Response

Returns a customer JSON object with details of the updated customer.

Attributes

Parameter Type Description
customer_id string Unique identifier of the given customer.
exemption_type string Type of customer exemption: wholesale, government, other, or non_exempt.
exempt_regions[][country] string Two-letter ISO country code where the customer is exempt.
exempt_regions[][state] string Two-letter ISO state code where the customer is exempt.
name string Name of the customer.
country string Two-letter ISO country code of the customer’s primary address.
state string Two-letter ISO state code of the customer’s primary address.
zip string Postal code of the customer’s primary address.
city string City of the customer’s primary address.
street string Street address of the customer’s primary address.

delete Delete a customer

Definition

client.delete_customer
client.delete_customer
client.deleteCustomer();
$client->deleteCustomer();
client.DeleteCustomer();
client.deleteCustomer();
client.DeleteCustomer()
DELETE https://api.taxjar.com/v2/customers/:customer_id

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

customer = client.delete_customer('123')
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

customer = client.delete_customer('123')
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$customer = $client->deleteCustomer('123');
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.deleteCustomer('123').then(res => {
  res.customer;
});
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var customer = client.DeleteCustomer("123");
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.customers.CustomerResponse;

public class DeleteCustomerExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            CustomerResponse res = client.deleteCustomer("123");
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.DeleteCustomer("123")
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Customer)
    }
}
$ curl https://api.taxjar.com/v2/customers/123 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -X DELETE

Response Example

#<Taxjar::Customer @attrs={
  :customer_id => "123",
  :exemption_type => "wholesale",
  :exempt_regions => [
    [0] {
      :country => "US",
      :state => "FL"
    },
    [1] {
      :country => "US",
      :state => "PA"
    }
  ],
  :name => "Dunder Mifflin Paper Company",
  :country => "US",
  :state => "PA",
  :zip => "18504",
  :city => "Scranton",
  :street => "1725 Slough Avenue"
}>
<TaxJarCustomer {
  'customer_id': '123',
  'exemption_type': 'wholesale',
  'exempt_regions': [<TaxJarExemptRegion {
    'country': 'US',
    'state': 'FL'
  }>, <TaxJarExemptRegion {
    'country': 'US',
    'state': 'PA'
  }>],
  'name': 'Dunder Mifflin Paper Company',
  'country': 'US',
  'state': 'PA',
  'zip': '18504',
  'city': 'Scranton',
  'street': '1725 Slough Avenue'
}>
{
  "customer": {
    "customer_id": "123",
    "exemption_type": "wholesale",
    "exempt_regions": [
      {
        "country": "US",
        "state": "FL"
      },
      {
        "country": "US",
        "state": "PA"
      }
    ],
    "name": "Dunder Mifflin Paper Company",
    "country": "US",
    "state": "PA",
    "zip": "18504",
    "city": "Scranton",
    "street": "1725 Slough Avenue"
  }
}
taxjar.DeleteCustomerResponse{
    Customer: taxjar.Customer{
        CustomerID:    "123",
        ExemptionType: "wholesale",
        Name:          "Dunder Mifflin Paper Company",
        ExemptRegions: []taxjar.ExemptRegion{
            {
                Country: "US",
                State:   "FL",
            },
            {
                Country: "US",
                State:   "PA",
            },
        },
        Country: "US",
        State:   "PA",
        Zip:     "18504",
        City:    "Scranton",
        Street:  "1725 Slough Avenue",
    },
}

Deletes an existing customer created through the API.

Request

DELETE https://api.taxjar.com/v2/customers/:customer_id

Parameters

Parameter Type Required Description
customer_id string required Unique identifier of the given customer.

Response

Returns a customer JSON object with the deleted customer identifiers.

Attributes

Parameter Type Description
customer_id string Unique identifier of the given customer.

Rates

get Show tax rates for a location

Definition

client.rates_for_location
client.rates_for_location
client.ratesForLocation();
$client->ratesForLocation();
client.RatesForLocation();
client.ratesForLocation();
client.RatesForLocation()
GET https://api.taxjar.com/v2/rates/:zip

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

# United States (ZIP+4)
rates = client.rates_for_location('90404-3370')

# United States (ZIP w/ Optional Params)
rates = client.rates_for_location('90404', {
  :city => 'Santa Monica',
  :state => 'CA',
  :country => 'US'
})

# United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
rates = client.rates_for_location('05495-2086', {
  :street => '312 Hurricane Lane',
  :city => 'Williston',
  :state => 'VT',
  :country => 'US'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

# United States (ZIP+4)
rates = client.rates_for_location('90404-3370')

# United States (ZIP w/ Optional Params)
rates = client.rates_for_location('90404', {
  'city': 'Santa Monica',
  'state': 'CA',
  'country': 'US'
})

# United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
rates = client.rates_for_location('05495-2086', {
  'street': '312 Hurricane Lane',
  'city': 'Williston',
  'state': 'VT',
  'country': 'US'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

// United States (ZIP+4)
client.ratesForLocation('90404-3370').then(res => {
  res.rate; // Rate object
});

// United States (ZIP w/ Optional Params)
client.ratesForLocation('90404', {
  city: 'Santa Monica',
  state: 'CA',
  country: 'US'
}).then(res => {
  res.rate; // Rate object
});

// United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
client.ratesForLocation('05495-2086', {
  street: '312 Hurricane Lane',
  city: 'Williston',
  state: 'VT',
  country: 'US'
}).then(res => {
  res.rate; // Rate object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

// United States (ZIP+4)
$rates = $client->ratesForLocation('90404-3370');

// United States (ZIP w/ Optional Params)
$rates = $client->ratesForLocation('90404', [
  'city' => 'Santa Monica',
  'state' => 'CA',
  'country' => 'US'
]);

// United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
$rates = $client->ratesForLocation('05495-2086', [
  'street' => '312 Hurricane Lane',
  'city' => 'Williston',
  'state' => 'VT',
  'country' => 'US'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

// United States (ZIP+4)
var rates = client.RatesForLocation("90404-3370");

// United States (ZIP w/ Optional Params)
var rates = client.RatesForLocation("90404", new {
  city = "Santa Monica",
  state = "CA",
  country = "US"
});

// United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
var rates = client.RatesForLocation("05495-2086", new {
  street = "312 Hurricane Lane",
  city = "Williston",
  state = "VT",
  country = "US"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.rates.RateResponse;
import java.util.HashMap;
import java.util.Map;

public class RatesExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            RateResponse res = client.ratesForLocation("90404-3370");

            Map<String, String> params = new HashMap<>();
            params.put("city", "Santa Monica");
            params.put("state", "CA");
            params.put("country", "US");
            RateResponse res = client.ratesForLocation("90404", params);

            Map<String, String> params = new HashMap<>();
            params.put("street", "312 Hurricane Lane");
            params.put("city", "Williston");
            params.put("state", "VT");
            params.put("country", "US");
            RateResponse res = client.ratesForLocation("05495-2086", params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    // United States (ZIP+4)
    res, err := client.RatesForLocation("90404-3370")

    // United States (ZIP w/ Optional Params)
    res, err := client.RatesForLocation("90404", taxjar.RatesForLocationParams{
        City:    "Santa Monica",
        State:   "CA",
        Country: "US",
    })

    // United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
    res, err := client.RatesForLocation("05495-2086", taxjar.RatesForLocationParams{
        Street:  "312 Hurricane Lane",
        City:    "Williston",
        State:   "VT",
        Country: "US",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Rate)
    }
}
# United States (ZIP+4)
$ curl https://api.taxjar.com/v2/rates/90404-3370 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

# United States (ZIP w/ Optional Params)
$ curl -G https://api.taxjar.com/v2/rates/90404 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -d city="Santa%20Monica" \
  -d state="CA" \
  -d country="US"

# United States (ZIP+4 w/ Street Address for Rooftop Accuracy)
$ curl -G https://api.taxjar.com/v2/rates/05495-2086 \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -d street="312 Hurricane Lane" \
  -d city="Williston" \
  -d state="VT" \
  -d country="US"

Response Example

{
  "rate": {
    "zip": "90404",
    "state": "CA",
    "state_rate": "0.0625",
    "county": "LOS ANGELES",
    "county_rate": "0.01",
    "city": "SANTA MONICA",
    "city_rate": "0.0",
    "combined_district_rate": "0.025",
    "combined_rate": "0.0975",
    "freight_taxable": false
  }
}

{
  "rate": {
    "zip": "05495-2086",
    "country": "US",
    "country_rate": "0.0",
    "state": "VT",
    "state_rate": "0.06",
    "county": "CHITTENDEN",
    "county_rate": "0.0",
    "city": "WILLISTON",
    "city_rate": "0.0",
    "combined_district_rate": "0.01",
    "combined_rate": "0.07",
    "freight_taxable": true
  }
}
#<Taxjar::Rate:0x00000a @attrs={
  :zip => "90404",
  :state => "CA",
  :state_rate => 0.065,
  :county => "LOS ANGELES",
  :county_rate => 0.01,
  :city => "SANTA MONICA",
  :city_rate => 0.005,
  :combined_district_rate => 0.015,
  :combined_rate => 0.095,
  :freight_taxable => false
}>

#<Taxjar::Rate:0x00000a @attrs={
  :zip => "05495-2086",
  :country => "US",
  :country_rate => 0,
  :state => "VT",
  :state_rate => 0.06,
  :county => "CHITTENDEN",
  :county_rate => 0,
  :city => "WILLISTON",
  :city_rate => 0,
  :combined_district_rate => 0.01,
  :combined_rate => 0.07,
  :freight_taxable => true
}>
<TaxJarRate {
  'city': 'SANTA MONICA',
  'zip': '90404',
  'combined_district_rate': 0.025,
  'state_rate': 0.0625,
  'city_rate': 0,
  'county': 'LOS ANGELES',
  'state': 'CA',
  'combined_rate': 0.0975,
  'county_rate': 0.01,
  'freight_taxable': False
}>

<TaxJarRate {
  'city': 'WILLISTON',
  'zip': '05495-2086',
  'combined_district_rate': 0.01,
  'state_rate': 0.06,
  'city_rate': 0,
  'country_rate': 0,
  'county': 'CHITTENDEN',
  'state': 'VT',
  'country': 'US',
  'combined_rate': 0.07,
  'county_rate': 0,
  'freight_taxable': True
}>
taxjar.RatesForLocationResponse{
    Rate: taxjar.Rate{
        Zip:                  "90404",
        State:                "CA",
        StateRate:            0.065,
        County:               "LOS ANGELES",
        CountyRate:           0.01,
        City:                 "SANTA MONICA",
        CityRate:             0.005,
        CombinedDistrictRate: 0.015,
        CombinedRate:         0.095,
        FreightTaxable:       false,
    },
}

taxjar.RatesForLocationResponse{
    Rate: taxjar.Rate{
        Zip:                  "05495-2086",
        Country:              "US",
        CountryRate:          0,
        State:                "VT",
        StateRate:            0.06,
        County:               "CHITTENDEN",
        CountyRate:           0,
        City:                 "WILLISTON",
        CityRate:             0,
        CombinedDistrictRate: 0.01,
        CombinedRate:         0.07,
        FreightTaxable:       true,
    },
}

Shows the sales tax rates for a given location.

Please note this endpoint only returns the full combined rate for a given location. It does not support nexus determination, sourcing based on a ship from and ship to address, shipping taxability, product exemptions, customer exemptions, or sales tax holidays. We recommend using our taxes endpoint to accurately calculate sales tax for an order.

Request

GET https://api.taxjar.com/v2/rates/:zip

Parameters

Parameter Type Required Description
country string optional Two-letter ISO country code for given location.
zip string required Postal code for given location (5-Digit ZIP or ZIP+4).
state string optional Two-letter ISO state code for given location.
city string optional City for given location.
street string optional Street address for given location. View Note

Response

Returns a rate JSON object with rates for a given location broken down by state, county, city, and district.

  United States Attributes

Parameter Type Description
zip string Postal code for given location.
country string Country for given location if SST state. View Note
country_rate float Country sales tax rate for given location if SST state. View Note
state string Postal abbreviated state name for given location.
state_rate float State sales tax rate for given location.
county string County name for given location.
county_rate float County sales tax rate for given location.
city string City name for given location.
city_rate float City sales tax rate for given location.
combined_district_rate float Aggregate rate for all city and county sales tax districts effective at the location.
combined_rate float Overall sales tax rate which includes state, county, city and district tax. This rate should be used to determine how much sales tax to collect for an order.
freight_taxable bool Freight taxability for given location.

Nexus

get List nexus regions

Definition

client.nexus_regions
client.nexus_regions
client.nexusRegions();
$client->nexusRegions();
client.NexusRegions();
client.nexusRegions();
client.NexusRegions()
GET https://api.taxjar.com/v2/nexus/regions

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

nexus_regions = client.nexus_regions
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

nexus_regions = client.nexus_regions()
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.nexusRegions().then(res => {
  res.regions; // Array of nexus regions
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$nexus_regions = $client->nexusRegions();
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var nexusRegions = client.NexusRegions();
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.nexus.RegionResponse;

public class NexusRegionsExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            RegionResponse res = client.nexusRegions();
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.NexusRegions()
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Regions)
    }
}
$ curl https://api.taxjar.com/v2/nexus/regions \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214"

Response Example

{
  "regions": [
    {
      "country_code": "US",
      "country": "United States",
      "region_code": "CA",
      "region": "California"
    },
    {
      "country_code": "US",
      "country": "United States",
      "region_code": "NY",
      "region": "New York"
    },
    {
      "country_code": "US",
      "country": "United States",
      "region_code": "WA",
      "region": "Washington"
    }
  ]
}
[
  #<Taxjar::NexusRegion:0x00000a @attrs={
    :country_code => "US",
    :country => "United States",
    :region_code => "CA",
    :region => "California"
  }>,
  #<Taxjar::NexusRegion:0x00000a @attrs={
    :country_code => "US",
    :country => "United States",
    :region_code => "NY",
    :region => "New York"
  }>,
  #<Taxjar::NexusRegion:0x00000a @attrs={
    :country_code => "US",
    :country => "United States",
    :region_code => "WA",
    :region => "Washington"
  }>
]
[
  <TaxJarRegion {
    'country_code': 'US',
    'country': 'United States',
    'region_code': 'CA',
    'region': 'California'
  }>,
  <TaxJarRegion {
    'country_code': 'US',
    'country': 'United States',
    'region_code': 'NY',
    'region': 'New York'
  }>,
  <TaxJarRegion {
    'country_code': 'US',
    'country': 'United States',
    'region_code': 'WA',
    'region': 'Washington'
  }>
]
taxjar.NexusRegionsResponse{
    Regions: []taxjar.NexusRegion{
        {
            CountryCode: "US",
            Country:     "United States",
            RegionCode:  "CA",
            Region:      "California",
        },
        {
            CountryCode: "US",
            Country:     "United States",
            RegionCode:  "NY",
            Region:      "New York",
        },
        {
            CountryCode: "US",
            Country:     "United States",
            RegionCode:  "WA",
            Region:      "Washington",
        },
    },
}

Lists existing nexus locations for an existing TaxJar account.

Request

GET https://api.taxjar.com/v2/nexus/regions

Response

Returns a regions JSON object with an array of nexus regions sorted alphabetically.

Attributes

Parameter Type Description
country_code string Two-letter ISO country code for nexus region.
country string Country name for nexus region.
region_code string Two-letter ISO region code for nexus region.
region string Region name for nexus region.

Validations

post Validate an address

Definition

client.validate_address
client.validate_address
client.validateAddress();
$client->validateAddress();
client.ValidateAddress();
client.validateAddress();
client.ValidateAddress()
POST https://api.taxjar.com/v2/addresses/validate

Request Example

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

addresses = client.validate_address({
  :country => 'US',
  :state => 'AZ',
  :zip => '85297',
  :city => 'Gilbert',
  :street => '3301 South Greenfield Rd'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

addresses = client.validate_address({
  'country': 'US',
  'state': 'AZ',
  'zip': '85297',
  'city': 'Gilbert',
  'street': '3301 South Greenfield Rd'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.validateAddress({
  country: 'US',
  state: 'AZ',
  zip: '85297',
  city: 'Gilbert',
  street: '3301 South Greenfield Rd'
}).then(res => {
  res.addresses; // Addresses object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$addresses = $client->validateAddress([
  'country' => 'US',
  'state' => 'AZ',
  'zip' => '85297',
  'city' => 'Gilbert',
  'street' => '3301 South Greenfield Rd'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var addresses = client.ValidateAddress(new {
  country = "US",
  state = "AZ",
  zip = "85297",
  city = "Gilbert",
  street = "3301 South Greenfield Rd"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.validations.AddressResponse;
import java.util.HashMap;
import java.util.Map;

public class ValidateAddressExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("country", "US");
            params.put("state", "AZ");
            params.put("zip", "85297");
            params.put("city", "Gilbert");
            params.put("street", "3301 South Greenfield Rd");

            AddressResponse res = client.validateAddress(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ValidateAddress(taxjar.ValidateAddressParams{
        Country: "US",
        State:   "AZ",
        Zip:     "85297",
        City:    "Gilbert",
        Street:  "3301 South Greenfield Rd",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Addresses)
    }
}
$ curl https://api.taxjar.com/v2/addresses/validate \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "country": "US",
    "state": "AZ",
    "zip": "85297",
    "city": "Gilbert",
    "street": "3301 South Greenfield Rd"
  }'

Request Scenario: Multiple Address Matches

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

addresses = client.validate_address({
  :state => 'AZ',
  :city => 'Phoenix',
  :street => '1109 9th'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

addresses = client.validate_address({
  'state': 'AZ',
  'city': 'Phoenix',
  'street': '1109 9th'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.validateAddress({
  state: 'AZ',
  city: 'Phoenix',
  street: '1109 9th'
}).then(res => {
  res.addresses; // Addresses object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$addresses = $client->validateAddress([
  'state' => 'AZ',
  'city' => 'Phoenix',
  'street' => '1109 9th'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var addresses = client.ValidateAddress(new {
  state = "AZ",
  city = "Phoenix",
  street = "1109 9th"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.validations.AddressResponse;
import java.util.HashMap;
import java.util.Map;

public class ValidateAddressExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("state", "AZ");
            params.put("city", "Phoenix");
            params.put("street", "1109 9th");

            AddressResponse res = client.validateAddress(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ValidateAddress(taxjar.ValidateAddressParams{
        State:  "AZ",
        City:   "Phoenix",
        Street: "1109 9th",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Addresses)
    }
}
$ curl https://api.taxjar.com/v2/addresses/validate \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "state": "AZ",
    "city": "Phoenix",
    "street": "1109 9th"
  }'

Request Scenario: Zip-Only Address Validation

require "taxjar"
client = Taxjar::Client.new(api_key: "9e0cd62a22f451701f29c3bde214")

addresses = client.validate_address({
  :zip => '98122'
})
import taxjar
client = taxjar.Client(api_key='9e0cd62a22f451701f29c3bde214')

addresses = client.validate_address({
  'zip': '98122'
})
const Taxjar = require('taxjar');

const client = new Taxjar({
  apiKey: '9e0cd62a22f451701f29c3bde214'
});

client.validateAddress({
  zip: '98122'
}).then(res => {
  res.addresses; // Addresses object
});
require __DIR__ . '/vendor/autoload.php';
$client = TaxJar\Client::withApiKey("9e0cd62a22f451701f29c3bde214");

$addresses = $client->validateAddress([
  'zip' => '98122'
]);
using Taxjar;
var client = new TaxjarApi("9e0cd62a22f451701f29c3bde214");

var addresses = client.ValidateAddress(new {
  zip = "98122"
});
import com.taxjar.Taxjar;
import com.taxjar.exception.TaxjarException;
import com.taxjar.model.validations.AddressResponse;
import java.util.HashMap;
import java.util.Map;

public class ValidateAddressExample {

    public static void main(String[] args) {
        Taxjar client = new Taxjar("9e0cd62a22f451701f29c3bde214");

        try {
            Map<String, Object> params = new HashMap<>();
            params.put("zip", "98122");

            AddressResponse res = client.validateAddress(params);
        } catch (TaxjarException e) {
            e.printStackTrace();
        }
    }

}
package main

import (
    "fmt"

    "github.com/taxjar/taxjar-go"
)

func main() {
    client := taxjar.NewClient(taxjar.Config{
        APIKey: "9e0cd62a22f451701f29c3bde214",
    })

    res, err := client.ValidateAddress(taxjar.ValidateAddressParams{
        Zip: "98122",
    })
    if err != nil {
        fmt.Println(err)
    } else {
        fmt.Println(res.Addresses)
    }
}
$ curl https://api.taxjar.com/v2/addresses/validate \
  -H "Authorization: Bearer 9e0cd62a22f451701f29c3bde214" \
  -H "Content-Type: application/json" \
  -d '{
    "zip": "98122"
  }'

Response Example

{
  "addresses": [
    {
      "zip": "85297-2176",
      "street": "3301 S Greenfield Rd",
      "state": "AZ",
      "country": "US",
      "city": "Gilbert"
    }
  ]
}
[
  #<Taxjar::Address:0x00000a @attrs={
    :zip => "85297-2176",
    :street => "3301 S Greenfield Rd",
    :state => "AZ",
    :country => "US",
    :city => "Gilbert"
  }>
]
[
  <TaxJarAddress {
    'zip': '85297-2176',
    'stree