{"id":23766038,"url":"https://github.com/skukx/avatax","last_synced_at":"2025-09-05T10:32:53.571Z","repository":{"id":62553807,"uuid":"87680164","full_name":"skukx/avatax","owner":"skukx","description":"Ruby client for avatax","archived":false,"fork":false,"pushed_at":"2023-08-14T22:46:08.000Z","size":60,"stargazers_count":0,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-01T01:12:12.138Z","etag":null,"topics":["api-client","avalara","avatax","ruby"],"latest_commit_sha":null,"homepage":null,"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/skukx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-09T03:29:29.000Z","updated_at":"2020-05-26T23:01:58.000Z","dependencies_parsed_at":"2022-11-03T04:30:46.381Z","dependency_job_id":null,"html_url":"https://github.com/skukx/avatax","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skukx%2Favatax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skukx%2Favatax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skukx%2Favatax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skukx%2Favatax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skukx","download_url":"https://codeload.github.com/skukx/avatax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232037318,"owners_count":18463714,"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":["api-client","avalara","avatax","ruby"],"created_at":"2024-12-31T23:36:17.904Z","updated_at":"2024-12-31T23:36:20.295Z","avatar_url":"https://github.com/skukx.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Avatax\n[![CircleCI](https://circleci.com/gh/skukx/avatax.svg?style=shield)](https://circleci.com/gh/skukx/avatax)\n\nThis gem is a work in progress for providing a ruby client for Avatax REST api v2.\nSee: http://developer.avalara.com/avatax/api-reference/tax/v2/\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'avatax-ruby', git: 'git@github.com:skukx/avatax.git'\n```\n\nOr\n\n```ruby\ngem 'avatax-ruby'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\n### Setting Up the client\n```ruby\nclient = Avatax::Client.new(\n    username: 'avatax_user',\n    password: 'avatax_password',\n    logger: Logger.new(STDOUT),\n    env: :sandbox\n)\n```\nThe `env` can be set to `:sandbox` or `:production`.\n\n### Estimating Taxes\n```ruby\n##\n# Estimate by address\n# @see http://developer.avalara.com/avatax/api-reference/tax/v2/TaxRates/#ApiV2TaxratesByaddressGet\n#\nparams = {\n    line1: '350 State St.',\n    city: 'Salt Lake City',\n    region: 'CA',\n    postalCode: '84111',\n    country: 'US'\n}\nresp = client.tax_rates.get(:by_address, params)\n\n##\n# Estimate by postal code\n# @see http://developer.avalara.com/avatax/api-reference/tax/v2/TaxRates/#ApiV2TaxratesBypostalcodeGet\n#\nparams = { country: 'US', postalCode: '84111' }\nresp = client.tax_rates.get(:by_postal_code, params)\n\nresp.success? # =\u003e true\n```\n\n### Transactions\n\n#### Get all transactions within a company.\n```ruby\nclient.transactions.all('my_company')\n```\n\n#### Find a transaction by code\n```ruby\nclient.transactions.find_by_code('my_company', 'transaction_code')\n```\n\n#### Find a transaction by avatax id.\n```ruby\nclient.transactions.find_by_id('my_company', '123')\n```\n\n#### Adjust an existing transaction.\n```ruby\nparams = {\n  adjustmentReason: 8,\n  adjustmentDescription: 'New line item.',\n  new_transaction: { ... }\n}\n\nclient.transactions.adjust('my_company', 'my_code', params)\n```\n\n#### Change a transaction code\n```ruby\nparams = { newCode: 'my_new_code' }\nclient.transactions.change_code('my_company', 'my_code', params)\n```\n\n#### Commit a transaction\nBy default, if not present, the post request will contain the body `{ commit: true }`\n\n```ruby\nclient.transactions.commit('my_company', 'my_code')\n```\n\n#### Settle a transaction\nThis call can perform multiple actions on a transaction. See [avatax docs](https://developer.avalara.com/avatax/api-reference/tax/v2/Transactions/#SettleTransaction) for more information.\n```ruby\nparams = { ... }\nclient.transactions.settle('my_company', 'my_code', params)\n```\n\n#### Void a transaction.\n```ruby\nclient.transactions.void('my_company', 'my_code')\n```\n\n#### Create a transaction\n```ruby\nparams = {\n  code: 'my_code',\n  type: 'SalesInvoice',\n  companyCode: 'my_company',\n  date: Date.current.to_s,\n  customerCode: 1,\n  discount: 0.00,\n  addresses: {\n    ShipTo: {\n      line1: '50 Main street',\n      city: 'Salt Lake City',\n      region: 'UT',\n      country: 'US',\n      postalCode: '84144'\n    }\n  },\n  lines: [\n    {\n      amount: 9.99,\n      quantity: 1\n    }\n  ]\n}\n\nclient.transactions.create(params)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/avatax.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskukx%2Favatax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskukx%2Favatax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskukx%2Favatax/lists"}