{"id":21867790,"url":"https://github.com/taxjar/taxjar-ruby","last_synced_at":"2025-04-05T14:08:24.736Z","repository":{"id":14507424,"uuid":"17220902","full_name":"taxjar/taxjar-ruby","owner":"taxjar","description":"Sales Tax API Client for Ruby","archived":false,"fork":false,"pushed_at":"2023-05-05T14:46:57.000Z","size":231,"stargazers_count":54,"open_issues_count":3,"forks_count":40,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-29T13:10:01.370Z","etag":null,"topics":["ecommerce","ruby","ruby-gem","sales-tax","sales-tax-api","tax","tax-rate","taxjar"],"latest_commit_sha":null,"homepage":"https://developers.taxjar.com/api/reference/?ruby","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taxjar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-02-26T18:40:59.000Z","updated_at":"2024-06-12T18:03:47.000Z","dependencies_parsed_at":"2024-06-18T22:36:07.829Z","dependency_job_id":"e1b07a3d-7f6e-4d68-86af-f507cb915a7f","html_url":"https://github.com/taxjar/taxjar-ruby","commit_stats":{"total_commits":231,"total_committers":23,"mean_commits":"10.043478260869565","dds":0.6017316017316017,"last_synced_commit":"5f8bbdb96c0c23dbcade807be1b66da276a1c5b4"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taxjar%2Ftaxjar-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taxjar%2Ftaxjar-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taxjar%2Ftaxjar-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taxjar%2Ftaxjar-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taxjar","download_url":"https://codeload.github.com/taxjar/taxjar-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ecommerce","ruby","ruby-gem","sales-tax","sales-tax-api","tax","tax-rate","taxjar"],"created_at":"2024-11-28T05:10:31.785Z","updated_at":"2025-04-05T14:08:24.704Z","avatar_url":"https://github.com/taxjar.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TaxJar Sales Tax API for Ruby [![RubyGems](https://img.shields.io/gem/v/taxjar-ruby.svg?style=flat-square)](https://rubygems.org/gems/taxjar-ruby) [![Build Status](https://img.shields.io/travis/taxjar/taxjar-ruby.svg?style=flat-square)](https://travis-ci.org/taxjar/taxjar-ruby)\n\n\u003ca href=\"https://developers.taxjar.com\"\u003e\u003cimg src=\"https://www.taxjar.com/wp-content/uploads/TaxJar__Wordmark_Black.svg\" alt=\"TaxJar\" width=\"220\"\u003e\u003c/a\u003e\n\nA Ruby interface to the TaxJar [Sales Tax API](https://developers.taxjar.com/api/reference/?ruby). TaxJar makes sales tax filing easier for online sellers and merchants. See local jurisdictional tax reports, get payment reminders, and more. You can use our API to access TaxJar API endpoints, which can get information on sales tax rates, categories or upload transactions.\n\n* This wrapper supports 100% of the [TaxJar API](https://developers.taxjar.com/api/#introduction)\n* Data returned from API calls are mapped to Ruby objects\n\n\u003chr\u003e\n\n[Supported Ruby Versions](#supported-ruby-versions)\u003cbr\u003e\n[Gem Dependencies](#gem-dependencies)\u003cbr\u003e\n[Installation](#installation)\u003cbr\u003e\n[Authentication](#authentication)\u003cbr\u003e\n[Usage](#usage)\u003cbr\u003e\n[Custom Options](#custom-options)\u003cbr\u003e\n[Sandbox Environment](#sandbox-environment)\u003cbr\u003e\n[Error Handling](#error-handling)\u003cbr\u003e\n[Tests](#tests)\u003cbr\u003e\n[More Information](#more-information)\u003cbr\u003e\n[License](#license)\u003cbr\u003e\n[Support](#support)\u003cbr\u003e\n[Contributing](#contributing)\n\n\u003chr\u003e\n\n## Supported Ruby Versions\n\nRuby 2.3 or greater\n\n## Gem Dependencies\n\nInstalling this gem also bundles the following dependencies:\n\n* [http](https://github.com/httprb/http.rb) - Fast Ruby HTTP client with a chainable API and full streaming support.\n* [addressable](https://github.com/sporkmonger/addressable) - Replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to the relevant RFCs and adds support for IRIs and URI templates.\n* [memoizable](https://github.com/dkubb/memoizable) - Memoize method return values.\n* [model_attribute](https://github.com/yammer/model_attribute) - Type casted attributes for non-ActiveRecord models.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'taxjar-ruby', require: 'taxjar'\n```\n\nAnd then execute:\n\n```shell\n$ bundle install\n```\n\nOr install it yourself as:\n\n```shell\n$ gem install taxjar-ruby\n```\n\n## Authentication\n\n[Generate an API token from TaxJar](https://app.taxjar.com/api_sign_up/). Copy and paste your API token when instantiating a new client:\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: 'YOUR_API_TOKEN')\n```\n\nYou're now ready to use TaxJar! [Check out our quickstart guide](https://developers.taxjar.com/api/guides/ruby/#ruby-quickstart) to get up and running quickly.\n\n## Usage\n\n[`categories` - List all tax categories](#list-all-tax-categories-api-docs)\u003cbr\u003e\n[`tax_for_order` - Calculate sales tax for an order](#calculate-sales-tax-for-an-order-api-docs)\u003cbr\u003e\n[`list_orders` - List order transactions](#list-order-transactions-api-docs)\u003cbr\u003e\n[`show_order` - Show order transaction](#show-order-transaction-api-docs)\u003cbr\u003e\n[`create_order` - Create order transaction](#create-order-transaction-api-docs)\u003cbr\u003e\n[`update_order` - Update order transaction](#update-order-transaction-api-docs)\u003cbr\u003e\n[`delete_order` - Delete order transaction](#delete-order-transaction-api-docs)\u003cbr\u003e\n[`list_refunds` - List refund transactions](#list-refund-transactions-api-docs)\u003cbr\u003e\n[`show_refund` - Show refund transaction](#show-refund-transaction-api-docs)\u003cbr\u003e\n[`create_refund` - Create refund transaction](#create-refund-transaction-api-docs)\u003cbr\u003e\n[`update_refund` - Update refund transaction](#update-refund-transaction-api-docs)\u003cbr\u003e\n[`delete_refund` - Delete refund transaction](#delete-refund-transaction-api-docs)\u003cbr\u003e\n[`list_customers` - List customers](#list-customers-api-docs)\u003cbr\u003e\n[`show_customer` - Show customer](#show-customer-api-docs)\u003cbr\u003e\n[`create_customer` - Create customer](#create-customer-api-docs)\u003cbr\u003e\n[`update_customer` - Update customer](#update-customer-api-docs)\u003cbr\u003e\n[`delete_customer` - Delete customer](#delete-customer-api-docs)\u003cbr\u003e\n[`rates_for_location` - List tax rates for a location (by zip/postal code)](#list-tax-rates-for-a-location-by-zippostal-code-api-docs)\u003cbr\u003e\n[`nexus_regions` - List nexus regions](#list-nexus-regions-api-docs)\u003cbr\u003e\n[`validate_address` - Validate an address](#validate-an-address-api-docs)\u003cbr\u003e\n[`validate` - Validate a VAT number](#validate-a-vat-number-api-docs)\u003cbr\u003e\n[`summary_rates` - Summarize tax rates for all regions](#summarize-tax-rates-for-all-regions-api-docs)\n\n\u003chr\u003e\n\n\n### List all tax categories \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-list-tax-categories))_\u003c/small\u003e\n\n\u003e 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.\n\n#### Definition\n\n```ruby\nclient.categories\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.categories\n```\n\n#### Example Response\n\n```ruby\n[\n  #\u003cTaxjar::Category:0x00000a @attrs={\n    :name =\u003e 'Digital Goods',\n    :product_tax_code =\u003e 31000,\n    :description =\u003e 'Digital products transferred electronically.'\n  }\u003e,\n  #\u003cTaxjar::Category:0x00000a @attrs={\n    :name =\u003e 'Clothing',\n    :product_tax_code =\u003e 20010,\n    :description =\u003e 'All human wearing apparel suitable for general use'\n  }\u003e,\n  #\u003cTaxjar::Category:0x00000a @attrs={\n    :name =\u003e 'Non-Prescription',\n    :product_tax_code =\u003e 51010,\n    :description =\u003e 'Drugs for human use without a prescription'\n  }\u003e\n]\n```\n\n### Calculate sales tax for an order \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#post-calculate-sales-tax-for-an-order))_\u003c/small\u003e\n\n\u003e Shows the sales tax that should be collected for a given order.\n\n#### Definition\n\n```ruby\nclient.tax_for_order\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.tax_for_order({\n    :from_country =\u003e 'US',\n    :from_zip =\u003e '94025',\n    :from_state =\u003e 'CA',\n    :from_city =\u003e 'Menlo Park',\n    :from_street =\u003e '2825 Sand Hill Rd',\n    :to_country =\u003e 'US',\n    :to_zip =\u003e '94303',\n    :to_state =\u003e 'CA',\n    :to_city =\u003e 'Palo Alto',\n    :to_street =\u003e '5230 Newell Road',\n    :amount =\u003e 267.9,\n    :shipping =\u003e 0,\n    :nexus_addresses =\u003e [{:country =\u003e 'US',\n                          :state =\u003e 'CA'}],\n    :line_items =\u003e [{:id =\u003e '1',\n                     :quantity =\u003e 1,\n                     :product_tax_code =\u003e '19005',\n                     :unit_price =\u003e 535.8,\n                     :discount =\u003e 267.9}]\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Tax:0x00000a @attrs={\n  :taxable_amount =\u003e 0,\n  :tax_source =\u003e 'destination',\n  :shipping =\u003e 0,\n  :rate =\u003e 0,\n  :order_total_amount =\u003e 267.9\n  :jurisdictions =\u003e #\u003cTaxjar::Jurisdictions:0x00000a @attrs={\n    :state =\u003e 'CA',\n    :county =\u003e 'SAN MATEO',\n    :country =\u003e 'US',\n    :city =\u003e 'EAST PALO ALTO'\n  }\u003e,\n  :has_nexus =\u003e true,\n  :freight_taxable =\u003e false,\n  :breakdown =\u003e #\u003cTaxjar::Breakdown:0x00000a @attrs={\n    :taxable_amount =\u003e 0,\n    :tax_collectable =\u003e 0,\n    :state_taxable_amount =\u003e 0,\n    :state_tax_rate =\u003e 0,\n    :state_tax_collectable =\u003e 0,\n    :special_tax_rate =\u003e 0,\n    :special_district_taxable_amount =\u003e 0,\n    :special_district_tax_collectable =\u003e 0,\n    :line_items =\u003e [\n      #\u003cTaxjar::BreakdownLineItem:0x00000a @attrs={\n        :taxable_amount =\u003e 0,\n        :tax_collectable =\u003e 0,\n        :state_taxable_amount =\u003e 0,\n        :state_sales_tax_rate =\u003e 0,\n        :state_amount =\u003e 0,\n        :special_tax_rate =\u003e 0,\n        :special_district_taxable_amount =\u003e 0,\n        :special_district_amount =\u003e 0,\n        :id =\u003e '1',\n        :county_taxable_amount =\u003e 0,\n        :county_tax_rate =\u003e 0,\n        :county_amount =\u003e 0,\n        :combined_tax_rate =\u003e 0,\n        :city_taxable_amount =\u003e 0,\n        :city_tax_rate =\u003e 0,\n        :city_amount =\u003e 0,\n      }\u003e\n    ],\n    :county_taxable_amount =\u003e 0,\n    :county_tax_rate =\u003e 0,\n    :county_tax_collectable =\u003e 0,\n    :combined_tax_rate =\u003e 0,\n    :city_taxable_amount =\u003e 0,\n    :city_tax_rate =\u003e 0,\n    :city_tax_collectable =\u003e 0\n  }\u003e\n  :amount_to_collect =\u003e 0\n}\u003e\n```\n\n### List order transactions \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-list-order-transactions))_\u003c/small\u003e\n\n\u003e Lists existing order transactions created through the API.\n\n#### Definition\n\n```ruby\nclient.list_orders\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.list_orders({:from_transaction_date =\u003e '2015/05/01',\n                    :to_transaction_date =\u003e '2015/05/31'})\n```\n\n#### Example Response\n\n```ruby\n['20', '21', '22']\n```\n\n### Show order transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-show-an-order-transaction))_\u003c/small\u003e\n\n\u003e Shows an existing order transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.show_order\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.show_order('123')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Order:0x00000a @attrs={\n  :transaction_id =\u003e '123',\n  :user_id =\u003e 11836,\n  :transaction_date =\u003e '2015-05-14T00:00:00Z',\n  :transaction_reference_id =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '93107',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'SANTA BARBARA',\n  :from_street =\u003e '1281 State St',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '90002',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'LOS ANGELES',\n  :to_street =\u003e '123 Palm Grove Ln',\n  :amount =\u003e 17,\n  :shipping =\u003e 2,\n  :sales_tax =\u003e 0.95,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e '12-34243-0',\n      :product_tax_code =\u003e nil,\n      :description =\u003e 'Heavy Widget',\n      :unit_price =\u003e 15,\n      :discount =\u003e 0,\n      :sales_tax =\u003e 0.95\n    }\n  ]\n}\u003e\n```\n\n### Create order transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#post-create-an-order-transaction))_\u003c/small\u003e\n\n\u003e Creates a new order transaction.\n\n#### Definition\n\n```ruby\nclient.create_order\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\norder = client.create_order({\n    :transaction_id =\u003e '123',\n    :transaction_date =\u003e '2015/05/15',\n    :from_country =\u003e 'US',\n    :from_zip =\u003e '94025',\n    :from_state =\u003e 'CA',\n    :from_city =\u003e 'Menlo Park',\n    :from_street =\u003e '2825 Sand Hill Rd',\n    :to_country =\u003e 'US',\n    :to_zip =\u003e '94303',\n    :to_state =\u003e 'CA',\n    :to_city =\u003e 'Palo Alto',\n    :to_street =\u003e '5230 Newell Road',\n    :amount =\u003e 267.9,\n    :shipping =\u003e 0,\n    :sales_tax =\u003e 0,\n    :line_items =\u003e [{:id =\u003e '1',\n                     :quantity =\u003e 1,\n                     :description =\u003e 'Legal Services',\n                     :product_tax_code =\u003e '19005',\n                     :unit_price =\u003e 535.8,\n                     :discount =\u003e 267.9,\n                     :sales_tax =\u003e 0}]\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Order:0x00000a @attrs={\n  :transaction_id =\u003e '123',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e '2015-05-15T00:00:00Z',\n  :transaction_reference_id =\u003e nil,\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '94025',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'MENLO PARK',\n  :from_street =\u003e '2825 Sand Hill Rd',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '94303',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'PALO ALTO',\n  :to_street =\u003e '5230 Newell Rd',\n  :amount =\u003e 267.9,\n  :shipping =\u003e 0,\n  :sales_tax =\u003e 0,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e '19005',\n      :description =\u003e 'Legal Services',\n      :unit_price =\u003e 535.8,\n      :discount =\u003e 267.9,\n      :sales_tax =\u003e 0\n    }\n  ]\n}\u003e\n```\n\n### Update order transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#put-update-an-order-transaction))_\u003c/small\u003e\n\n\u003e Updates an existing order transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.update_order\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\norder = client.update_order({\n    :transaction_id =\u003e '123',\n    :amount =\u003e 283.6,\n    :shipping =\u003e 5,\n    :sales_tax =\u003e 1.04,\n    :line_items =\u003e [\n      {\n        :id =\u003e '1',\n        :quantity =\u003e 1,\n        :description =\u003e 'Legal Services',\n        :product_tax_code =\u003e '19005',\n        :unit_price =\u003e 535.8,\n        :discount =\u003e 267.9,\n        :sales_tax =\u003e 0\n      },\n      {\n        :id =\u003e '2',\n        :quantity =\u003e 2,\n        :description =\u003e 'Hoberman Switch Pitch',\n        :unit_price =\u003e 10.7,\n        :discount =\u003e 10.7,\n        :sales_tax =\u003e 1.04\n      }\n    ]\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Order:0x00000a @attrs={\n  :transaction_id =\u003e '123',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e '2015-05-15T00:00:00Z',\n  :transaction_reference_id =\u003e nil,\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '94025',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'MENLO PARK',\n  :from_street =\u003e '2825 Sand Hill Rd',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '94303',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'PALO ALTO',\n  :to_street =\u003e '5230 Newell Road',\n  :amount =\u003e 283.6,\n  :shipping =\u003e 5,\n  :sales_tax =\u003e 1.04,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e '19005',\n      :description =\u003e 'Legal Services',\n      :unit_price =\u003e 535.8,\n      :discount =\u003e 267.9,\n      :sales_tax =\u003e 0\n    },\n    {\n      :id =\u003e '2',\n      :quantity =\u003e 2,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e nil,\n      :description =\u003e 'Hoberman Switch Pitch',\n      :unit_price =\u003e 10.7,\n      :discount =\u003e 10.7,\n      :sales_tax =\u003e 1.04\n    }\n  ]\n}\u003e\n```\n\n### Delete order transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#delete-delete-an-order-transaction))_\u003c/small\u003e\n\n\u003e Deletes an existing order transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.delete_order\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.delete_order('123')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Order:0x00000a @attrs={\n  :transaction_id =\u003e '123',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e nil,\n  :transaction_reference_id =\u003e nil,\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e nil,\n  :from_zip =\u003e nil,\n  :from_state =\u003e nil,\n  :from_city =\u003e nil,\n  :from_street =\u003e nil,\n  :to_country =\u003e nil,\n  :to_zip =\u003e nil,\n  :to_state =\u003e nil,\n  :to_city =\u003e nil,\n  :to_street =\u003e nil,\n  :amount =\u003e nil,\n  :shipping =\u003e nil,\n  :sales_tax =\u003e nil,\n  :line_items =\u003e []\n}\u003e\n```\n\n### List refund transactions \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-list-refund-transactions))_\u003c/small\u003e\n\n\u003e Lists existing refund transactions created through the API.\n\n#### Definition\n\n```ruby\nclient.list_refunds\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.list_refunds({:from_transaction_date =\u003e '2015/05/01',\n                     :to_transaction_date =\u003e '2015/05/31'})\n```\n\n#### Example Response\n\n```ruby\n['20-refund', '21-refund', '22-refund']\n```\n\n### Show refund transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-show-a-refund-transaction))_\u003c/small\u003e\n\n\u003e Shows an existing refund transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.show_refund\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.show_refund('20-refund')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Refund:0x00000a @attrs={\n  :transaction_id =\u003e '20-refund',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e '2015-05-15T00:00:00Z',\n  :transaction_reference_id =\u003e '20',\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '93107',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'SANTA BARBARA',\n  :from_street =\u003e '1218 State St',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '90002',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'LOS ANGELES',\n  :to_street =\u003e '123 Palm Grove Ln',\n  :amount =\u003e -17,\n  :shipping =\u003e -2,\n  :sales_tax =\u003e -0.95,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e '12-34243-0',\n      :product_tax_code =\u003e nil,\n      :description =\u003e 'Heavy Widget',\n      :unit_price =\u003e -15,\n      :discount =\u003e 0,\n      :sales_tax =\u003e -0.95\n    }\n  ]\n}\u003e\n```\n\n### Create refund transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#post-create-a-refund-transaction))_\u003c/small\u003e\n\n\u003e Creates a new refund transaction.\n\n#### Definition\n\n```ruby\nclient.create_refund\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nrefund = client.create_refund({\n    :transaction_id =\u003e '123-refund',\n    :transaction_reference_id =\u003e '123',\n    :transaction_date =\u003e '2015/05/15',\n    :from_country =\u003e 'US',\n    :from_zip =\u003e '94025',\n    :from_state =\u003e 'CA',\n    :from_city =\u003e 'Menlo Park',\n    :from_street =\u003e '2825 Sand Hill Rd',\n    :to_country =\u003e 'US',\n    :to_zip =\u003e '94303',\n    :to_state =\u003e 'CA',\n    :to_city =\u003e 'Palo Alto',\n    :to_street =\u003e '5230 Newell Road',\n    :amount =\u003e -5.35,\n    :shipping =\u003e -0,\n    :sales_tax =\u003e -0.52,\n    :line_items =\u003e [\n      {\n        :id =\u003e '1',\n        :quantity =\u003e 1,\n        :description =\u003e 'Legal Services',\n        :product_tax_code =\u003e '19005',\n        :unit_price =\u003e -0,\n        :discount =\u003e -0,\n        :sales_tax =\u003e -0\n      },\n      {\n        :id =\u003e '2',\n        :quantity =\u003e 1,\n        :description =\u003e 'Hoberman Switch Pitch',\n        :unit_price =\u003e -0,\n        :discount =\u003e -5.35,\n        :sales_tax =\u003e -0.52\n      }\n    ]\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Refund:0x00000a @attrs={\n  :transaction_id =\u003e '123-refund',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e '2015-05-15T00:00:00Z',\n  :transaction_reference_id =\u003e '123',\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '94025',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'MENLO PARK',\n  :from_street =\u003e '2825 Sand Hill Rd',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '94303',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'PALO ALTO',\n  :to_street =\u003e '5230 Newell Road',\n  :amount =\u003e -5.35,\n  :shipping =\u003e -0,\n  :sales_tax =\u003e -0.52,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e '19005',\n      :description =\u003e 'Legal Services',\n      :unit_price =\u003e 0,\n      :discount =\u003e 0,\n      :sales_tax =\u003e 0\n    },\n    {\n      :id =\u003e '2',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e nil,\n      :description =\u003e 'Hoberman Switch Pitch',\n      :unit_price =\u003e 0,\n      :discount =\u003e -5.35,\n      :sales_tax =\u003e -0.52\n    }\n  ]\n}\u003e\n```\n\n### Update refund transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#put-update-a-refund-transaction))_\u003c/small\u003e\n\n\u003e Updates an existing refund transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.update_refund\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nrefund = client.update_refund({\n  :transaction_id =\u003e '123-refund',\n  :transaction_reference_id =\u003e '123',\n  :amount =\u003e -10.35,\n  :shipping =\u003e -5\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Refund:0x00000a @attrs={\n  :transaction_id =\u003e '123-refund',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e '2015-05-15T00:00:00Z',\n  :transaction_reference_id =\u003e '123',\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e 'US',\n  :from_zip =\u003e '94025',\n  :from_state =\u003e 'CA',\n  :from_city =\u003e 'MENLO PARK',\n  :from_street =\u003e '2825 Sand Hill Rd',\n  :to_country =\u003e 'US',\n  :to_zip =\u003e '94303',\n  :to_state =\u003e 'CA',\n  :to_city =\u003e 'PALO ALTO',\n  :to_street =\u003e '5230 Newell Road',\n  :amount =\u003e -10.35,\n  :shipping =\u003e -5,\n  :sales_tax =\u003e 0,\n  :line_items =\u003e [\n    {\n      :id =\u003e '1',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e '19005',\n      :description =\u003e 'Legal Services',\n      :unit_price =\u003e 0,\n      :discount =\u003e 0,\n      :sales_tax =\u003e 0\n    },\n    {\n      :id =\u003e '2',\n      :quantity =\u003e 1,\n      :product_identifier =\u003e nil,\n      :product_tax_code =\u003e nil,\n      :description =\u003e 'Hoberman Switch Pitch',\n      :unit_price =\u003e 0,\n      :discount =\u003e -5.35,\n      :sales_tax =\u003e -0.52\n    }\n  ]\n}\u003e\n```\n\n### Delete refund transaction \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#delete-delete-a-refund-transaction))_\u003c/small\u003e\n\n\u003e Deletes an existing refund transaction created through the API.\n\n#### Definition\n\n```ruby\nclient.delete_refund\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.delete_refund('123-refund')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Refund:0x00000a @attrs={\n  :transaction_id =\u003e '123-refund',\n  :user_id =\u003e 11836,\n  :provider =\u003e 'api',\n  :transaction_date =\u003e nil,\n  :transaction_reference_id =\u003e nil,\n  :customer_id =\u003e nil,\n  :exemption_type =\u003e nil,\n  :from_country =\u003e nil,\n  :from_zip =\u003e nil,\n  :from_state =\u003e nil,\n  :from_city =\u003e nil,\n  :from_street =\u003e nil,\n  :to_country =\u003e nil,\n  :to_zip =\u003e nil,\n  :to_state =\u003e nil,\n  :to_city =\u003e nil,\n  :to_street =\u003e nil,\n  :amount =\u003e nil,\n  :shipping =\u003e nil,\n  :sales_tax =\u003e nil,\n  :line_items =\u003e []\n}\u003e\n```\n\n### List customers \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-list-customers))_\u003c/small\u003e\n\n\u003e Lists existing customers created through the API.\n\n#### Definition\n\n```ruby\nclient.list_customers\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.list_customers\n```\n\n#### Example Response\n\n```ruby\n['123', '124', '125']\n```\n\n### Show customer \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-show-a-customer))_\u003c/small\u003e\n\n\u003e Shows an existing customer created through the API.\n\n#### Definition\n\n```ruby\nclient.show_customer\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.show_customer('123')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Customer @attrs={\n  :customer_id =\u003e \"123\",\n  :exemption_type =\u003e \"wholesale\",\n  :exempt_regions =\u003e [\n    [0] {\n      :country =\u003e \"US\",\n      :state =\u003e \"FL\"\n    },\n    [1] {\n      :country =\u003e \"US\",\n      :state =\u003e \"PA\"\n    }\n  ],\n  :name =\u003e \"Dunder Mifflin Paper Company\",\n  :country =\u003e \"US\",\n  :state =\u003e \"PA\",\n  :zip =\u003e \"18504\",\n  :city =\u003e \"Scranton\",\n  :street =\u003e \"1725 Slough Avenue\"\n}\u003e\n```\n\n### Create customer \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#post-create-a-customer))_\u003c/small\u003e\n\n\u003e Creates a new customer.\n\n#### Definition\n\n```ruby\nclient.create_customer\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\ncustomer = client.create_customer({\n  :customer_id =\u003e '123',\n  :exemption_type =\u003e 'wholesale',\n  :name =\u003e 'Dunder Mifflin Paper Company',\n  :exempt_regions =\u003e [\n    {\n      :country =\u003e 'US',\n      :state =\u003e 'FL'\n    },\n    {\n      :country =\u003e 'US',\n      :state =\u003e 'PA'\n    }\n  ],\n  :country =\u003e 'US',\n  :state =\u003e 'PA',\n  :zip =\u003e '18504',\n  :city =\u003e 'Scranton',\n  :street =\u003e '1725 Slough Avenue'\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Customer @attrs={\n  :customer_id =\u003e \"123\",\n  :exemption_type =\u003e \"wholesale\",\n  :exempt_regions =\u003e [\n    [0] {\n      :country =\u003e \"US\",\n      :state =\u003e \"FL\"\n    },\n    [1] {\n      :country =\u003e \"US\",\n      :state =\u003e \"PA\"\n    }\n  ],\n  :name =\u003e \"Dunder Mifflin Paper Company\",\n  :country =\u003e \"US\",\n  :state =\u003e \"PA\",\n  :zip =\u003e \"18504\",\n  :city =\u003e \"Scranton\",\n  :street =\u003e \"1725 Slough Avenue\"\n}\u003e\n```\n\n### Update customer \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#put-update-a-customer))_\u003c/small\u003e\n\n\u003e Updates an existing customer created through the API.\n\n#### Definition\n\n```ruby\nclient.update_customer\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\ncustomer = client.update_customer({\n  :customer_id =\u003e '123',\n  :exemption_type =\u003e 'wholesale',\n  :name =\u003e 'Sterling Cooper',\n  :exempt_regions =\u003e [\n    {\n      :country =\u003e 'US',\n      :state =\u003e 'NY'\n    }\n  ],\n  :country =\u003e 'US',\n  :state =\u003e 'NY',\n  :zip =\u003e '10010',\n  :city =\u003e 'New York',\n  :street =\u003e '405 Madison Ave'\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Customer @attrs={\n  :customer_id =\u003e \"123\",\n  :exemption_type =\u003e \"wholesale\",\n  :exempt_regions =\u003e [\n    [0] {\n      :country =\u003e \"US\",\n      :state =\u003e \"NY\"\n    }\n  ],\n  :name =\u003e \"Sterling Cooper\",\n  :country =\u003e \"US\",\n  :state =\u003e \"NY\",\n  :zip =\u003e \"10010\",\n  :city =\u003e \"New York\",\n  :street =\u003e \"405 Madison Ave\"\n}\u003e\n```\n\n### Delete customer \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#delete-delete-a-customer))_\u003c/small\u003e\n\n\u003e Deletes an existing customer created through the API.\n\n#### Definition\n\n```ruby\nclient.delete_customer\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\nclient.delete_customer('123')\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Customer @attrs={\n  :customer_id =\u003e \"123\",\n  :exemption_type =\u003e \"wholesale\",\n  :exempt_regions =\u003e [],\n  :name =\u003e \"Dunder Mifflin Paper Company\",\n  :country =\u003e \"US\",\n  :state =\u003e \"PA\",\n  :zip =\u003e \"18504\",\n  :city =\u003e \"Scranton\",\n  :street =\u003e \"1725 Slough Avenue\"\n}\u003e\n```\n\n### List tax rates for a location (by zip/postal code) \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-show-tax-rates-for-a-location))_\u003c/small\u003e\n\n\u003e Shows the sales tax rates for a given location.\n\u003e\n\u003e **Please note this method 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 [`tax_for_order` to accurately calculate sales tax for an order](#calculate-sales-tax-for-an-order-api-docs).\n\n#### Definition\n\n```ruby\nclient.rates_for_location\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '48ceecccc8af930bd02597aec0f84a78')\n\n# United States (ZIP+4)\nrates = client.rates_for_location('90404-3370')\n\n# United States (ZIP w/ Optional Params)\nrates = client.rates_for_location('90404', {\n  :city =\u003e 'SANTA MONICA',\n  :country =\u003e 'US'\n})\n\n# International Examples (Requires City and Country)\nrates = client.rates_for_location('V5K0A1', {\n  :city =\u003e 'VANCOUVER',\n  :country =\u003e 'CA'\n})\n\nrates = client.rates_for_location('00150', {\n  :city =\u003e 'HELSINKI',\n  :country =\u003e 'FI'\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Rate:0x00000a @attrs={\n  :zip =\u003e '90002',\n  :state =\u003e 'CA',\n  :state_rate =\u003e 0.065,\n  :county =\u003e 'LOS ANGELES',\n  :county_rate =\u003e 0.01,\n  :city =\u003e 'WATTS',\n  :city_rate =\u003e 0,\n  :combined_district_rate =\u003e 0.015,\n  :combined_rate =\u003e 0.09,\n  :freight_taxable =\u003e false\n}\u003e\n\n#\u003cTaxjar::Rate:0x00000a @attrs={\n  :zip =\u003e 'V5K0A1',\n  :city =\u003e 'Vancouver',\n  :state =\u003e 'BC',\n  :country =\u003e 'CA',\n  :combined_rate =\u003e 0.12,\n  :freight_taxable =\u003e true\n}\u003e\n\n#\u003cTaxjar::Rate:0x00000a @attrs={\n  :country =\u003e 'FI',\n  :name =\u003e 'Finland',\n  :standard_rate =\u003e 0.24,\n  :reduced_rate =\u003e nil,\n  :super_reduced_rate =\u003e nil,\n  :parking_rate =\u003e nil,\n  :distance_sale_threshold =\u003e nil,\n  :freight_taxable =\u003e true\n}\u003e\n```\n\n### List nexus regions \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-list-nexus-regions))_\u003c/small\u003e\n\n\u003e Lists existing nexus locations for a TaxJar account.\n\n#### Definition\n\n```ruby\nclient.nexus_regions\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '9e0cd62a22f451701f29c3bde214')\n\nnexus_regions = client.nexus_regions\n```\n\n#### Example Response\n\n```ruby\n[\n  #\u003cTaxjar::NexusRegion:0x00000a @attrs={\n    :country_code =\u003e 'US',\n    :country =\u003e 'United States',\n    :region_code =\u003e 'CA',\n    :region =\u003e 'California'\n  }\u003e,\n  #\u003cTaxjar::NexusRegion:0x00000a @attrs={\n    :country_code =\u003e 'US',\n    :country =\u003e 'United States',\n    :region_code =\u003e 'NY',\n    :region =\u003e 'New York'\n  }\u003e,\n  #\u003cTaxjar::NexusRegion:0x00000a @attrs={\n    :country_code =\u003e 'US',\n    :country =\u003e 'United States',\n    :region_code =\u003e 'WA',\n    :region =\u003e 'Washington'\n  }\u003e\n]\n```\n\n### Validate an address \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#post-validate-an-address))_\u003c/small\u003e\n\n\u003e Validates a customer address and returns back a collection of address matches. **Address validation requires a [TaxJar Professional](https://www.taxjar.com/pricing) subscription.**\n\n#### Definition\n\n```ruby\nclient.validate_address\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '9e0cd62a22f451701f29c3bde214')\n\naddresses = client.validate_address({\n  :country =\u003e 'US',\n  :state =\u003e 'AZ',\n  :zip =\u003e '85297',\n  :city =\u003e 'Gilbert',\n  :street =\u003e '3301 Greenfield Rd'\n})\n```\n\n#### Example Response\n\n```ruby\n[\n  #\u003cTaxjar::Address:0x00000a @attrs={\n    :zip =\u003e '85297-2176',\n    :street =\u003e '3301 S Greenfield Rd',\n    :state =\u003e 'AZ',\n    :country =\u003e 'US',\n    :city =\u003e 'Gilbert'\n  }\u003e\n]\n```\n\n### Validate a VAT number \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-validate-a-vat-number))_\u003c/small\u003e\n\n\u003e Validates an existing VAT identification number against [VIES](http://ec.europa.eu/taxation_customs/vies/).\n\n#### Definition\n\n```ruby\nclient.validate\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '9e0cd62a22f451701f29c3bde214')\n\nvalidation = client.validate({\n  :vat =\u003e 'FR40303265045'\n})\n```\n\n#### Example Response\n\n```ruby\n#\u003cTaxjar::Validation:0x00000a @attrs={\n  :valid =\u003e true,\n  :exists =\u003e true,\n  :vies_available =\u003e true,\n  :vies_response =\u003e {\n    :country_code =\u003e 'FR',\n    :vat_number =\u003e '40303265045',\n    :request_date =\u003e '2016-02-10',\n    :valid =\u003e true,\n    :name =\u003e 'SA SODIMAS',\n    :address =\u003e \"11 RUE AMPERE\\n26600 PONT DE L ISERE\"\n  }\n}\u003e\n```\n\n### Summarize tax rates for all regions \u003csmall\u003e_([API docs](https://developers.taxjar.com/api/reference/?ruby#get-summarize-tax-rates-for-all-regions))_\u003c/small\u003e\n\n\u003e Retrieve minimum and average sales tax rates by region as a backup.\n\u003e\n\u003e This method is useful for periodically pulling down rates to use if the TaxJar API is unavailable. However, 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 [`tax_for_order` to accurately calculate sales tax for an order](#calculate-sales-tax-for-an-order-api-docs).\n\n#### Definition\n\n```ruby\nclient.summary_rates\n```\n\n#### Example Request\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '9e0cd62a22f451701f29c3bde214')\n\nsummarized_rates = client.summary_rates\n```\n\n#### Example Response\n\n```ruby\n[\n  #\u003cTaxjar::SummaryRate:0x00000a @attrs={\n    :country_code =\u003e 'US',\n    :country =\u003e 'United States',\n    :region_code =\u003e 'CA',\n    :region =\u003e 'California',\n    :minimum_rate =\u003e {\n      :label =\u003e 'State Tax',\n      :rate =\u003e 0.065\n    },\n    :average_rate =\u003e {\n      :label =\u003e 'Tax',\n      :rate =\u003e 0.0827\n    }\n  }\u003e,\n  #\u003cTaxjar::SummaryRate:0x00000a @attrs={\n    :country_code =\u003e 'CA',\n    :country =\u003e 'Canada',\n    :region_code =\u003e 'BC',\n    :region =\u003e 'British Columbia',\n    :minimum_rate =\u003e {\n      :label =\u003e 'GST',\n      :rate =\u003e 0.05\n    },\n    :average_rate =\u003e {\n      :label =\u003e 'PST',\n      :rate =\u003e 0.12\n    }\n  }\u003e,\n  #\u003cTaxjar::SummaryRate:0x00000a @attrs={\n    :country_code =\u003e 'UK',\n    :country =\u003e 'United Kingdom',\n    :region_code =\u003e nil,\n    :region =\u003e nil,\n    :minimum_rate =\u003e {\n      :label =\u003e 'VAT',\n      :rate =\u003e 0.2\n    },\n    :average_rate =\u003e {\n      :label =\u003e 'VAT',\n      :rate =\u003e 0.2\n    }\n  }\u003e\n]\n```\n\n## Custom Options\n\nPass a hash to any API method above for the following options:\n\n#### Timeouts\n\nSet request timeout in seconds:\n\n```ruby\nclient.tax_for_order({ timeout: 30 })\n```\n\n## Sandbox Environment\n\nYou can easily configure the client to use the [TaxJar Sandbox](https://developers.taxjar.com/api/reference/?ruby#sandbox-environment):\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: 'YOUR_SANDBOX_API_TOKEN', api_url: 'https://api.sandbox.taxjar.com')\n```\n\nFor testing specific [error response codes](https://developers.taxjar.com/api/reference/#errors), pass the custom `X-TJ-Expected-Response` header:\n\n```ruby\nclient.set_api_config('headers', {\n  'X-TJ-Expected-Response' =\u003e 422\n})\n```\n\n## Error Handling\n\nWhen invalid data is sent to TaxJar or we encounter an error, we’ll throw a `Taxjar::Error` with the HTTP status code and error message. To catch these exceptions, refer to the example below. [Click here](https://developers.taxjar.com/api/guides/ruby/#error-handling) for a list of common error response classes.\n\n```ruby\nrequire 'taxjar'\nclient = Taxjar::Client.new(api_key: '9e0cd62a22f451701f29c3bde214')\n\nbegin\n  order = client.create_order({\n    :transaction_date =\u003e '2015/05/14',\n    :to_country =\u003e 'US',\n    :to_state =\u003e 'CA',\n    :to_zip =\u003e '90002',\n    :amount =\u003e 17.45,\n    :shipping =\u003e 1.5,\n    :sales_tax =\u003e 0.95\n  })\nrescue Taxjar::Error =\u003e e\n  # \u003cTaxjar::Error::NotAcceptable: transaction_id is missing\u003e\n  puts e.class.name\n  puts e.message\nend\n```\n\n## Tests\n\nAn RSpec test suite is available to ensure API functionality:\n\n```shell\n$ git clone git://github.com/taxjar/taxjar-ruby.git\n$ bundle install\n$ rspec\n```\n\n## More Information\n\nMore information can be found on [TaxJar Developers](https://developers.taxjar.com).\n\n## License\n\nTaxJar is released under the [MIT License](https://github.com/taxjar/taxjar-ruby/blob/master/LICENSE.txt).\n\n## Support\n\nBug reports and feature requests should be filed on the [GitHub issue tracking page](https://github.com/taxjar/taxjar-ruby/issues).\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new pull request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaxjar%2Ftaxjar-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaxjar%2Ftaxjar-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaxjar%2Ftaxjar-ruby/lists"}