avatax 22.5.0 → 22.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +31 -0
- data/.gitignore +55 -55
- data/.rspec +1 -1
- data/.vs/VSWorkspaceState.json +5 -5
- data/.yardopts +4 -4
- data/Gemfile +2 -2
- data/LICENSE +201 -201
- data/README.md +98 -98
- data/Rakefile +9 -9
- data/avatax.gemspec +38 -38
- data/example/avatax.rb +47 -47
- data/example/credentials.example.yaml +5 -5
- data/lib/avatax/api.rb +27 -27
- data/lib/avatax/client/accounts.rb +22 -22
- data/lib/avatax/client/addresses.rb +4 -4
- data/lib/avatax/client/advancedrules.rb +5 -5
- data/lib/avatax/client/avafileforms.rb +7 -7
- data/lib/avatax/client/batches.rb +16 -16
- data/lib/avatax/client/certexpressinvites.rb +6 -6
- data/lib/avatax/client/certificates.rb +30 -30
- data/lib/avatax/client/companies.rb +44 -44
- data/lib/avatax/client/compliance.rb +1 -1
- data/lib/avatax/client/contacts.rb +12 -12
- data/lib/avatax/client/customers.rb +26 -26
- data/lib/avatax/client/datasources.rb +12 -12
- data/lib/avatax/client/definitions.rb +73 -73
- data/lib/avatax/client/distancethresholds.rb +12 -12
- data/lib/avatax/client/ecms.rb +73 -73
- data/lib/avatax/client/ecommercetoken.rb +4 -4
- data/lib/avatax/client/errortransactions.rb +61 -61
- data/lib/avatax/client/firmclientlinkages.rb +17 -17
- data/lib/avatax/client/free.rb +1 -1
- data/lib/avatax/client/fundingrequests.rb +4 -4
- data/lib/avatax/client/items.rb +64 -64
- data/lib/avatax/client/jurisdictionoverrides.rb +12 -12
- data/lib/avatax/client/locations.rb +24 -24
- data/lib/avatax/client/multidocument.rb +20 -20
- data/lib/avatax/client/nexus.rb +30 -30
- data/lib/avatax/client/notices.rb +8 -8
- data/lib/avatax/client/notifications.rb +6 -6
- data/lib/avatax/client/onboarding.rb +55 -55
- data/lib/avatax/client/pointofsale.rb +21 -21
- data/lib/avatax/client/provisioning.rb +4 -4
- data/lib/avatax/client/registrar.rb +19 -19
- data/lib/avatax/client/reports.rb +7 -7
- data/lib/avatax/client/settings.rb +12 -12
- data/lib/avatax/client/subscriptions.rb +6 -6
- data/lib/avatax/client/taxcodes.rb +12 -12
- data/lib/avatax/client/taxcontent.rb +8 -8
- data/lib/avatax/client/taxprofiles.rb +42 -42
- data/lib/avatax/client/taxrules.rb +12 -12
- data/lib/avatax/client/transactions.rb +41 -41
- data/lib/avatax/client/upcs.rb +12 -12
- data/lib/avatax/client/userdefinedfields.rb +6 -6
- data/lib/avatax/client/users.rb +16 -16
- data/lib/avatax/client/utilities.rb +3 -3
- data/lib/avatax/client.rb +37 -37
- data/lib/avatax/configuration.rb +76 -76
- data/lib/avatax/connection.rb +53 -53
- data/lib/avatax/request.rb +51 -51
- data/lib/avatax/version.rb +3 -3
- data/lib/avatax.rb +26 -26
- data/spec/avatax/client/accounts_spec.rb +13 -13
- data/spec/avatax/client/transactions_spec.rb +80 -80
- data/spec/avatax/request_spec.rb +25 -25
- data/spec/avatax_spec.rb +45 -45
- data/spec/credentials.yaml.example +4 -4
- data/spec/fixtures/accounts.json +15 -15
- data/spec/spec_helper.rb +27 -27
- metadata +6 -6
- data/.travis.yml +0 -19
data/README.md
CHANGED
@@ -1,98 +1,98 @@
|
|
1
|
-
The AvaTax Ruby Gem
|
2
|
-
====================
|
3
|
-
A Ruby wrapper for the AvaTax REST V2 APIs
|
4
|
-
|
5
|
-
Installation
|
6
|
-
------------
|
7
|
-
gem install avatax
|
8
|
-
|
9
|
-
Simple Code Example
|
10
|
-
-------------------------
|
11
|
-
```ruby
|
12
|
-
@client = AvaTax::Client.new(:logger => true)
|
13
|
-
|
14
|
-
createTransactionModel = {
|
15
|
-
"type" => 'SalesInvoice',
|
16
|
-
"companyCode" => '12670',
|
17
|
-
"date" => '2017-06-05',
|
18
|
-
"customerCode" => 'ABC',
|
19
|
-
"addresses" => {
|
20
|
-
"ShipFrom" => {
|
21
|
-
"line1" => "123 Main Street",
|
22
|
-
"city" => "Irvine",
|
23
|
-
"region" => "CA",
|
24
|
-
"country" => "US",
|
25
|
-
"postalCode" => "92615"
|
26
|
-
},
|
27
|
-
"ShipTo" => {
|
28
|
-
"line1" => "100 Market Street",
|
29
|
-
"city" => "San Francisco",
|
30
|
-
"region" => "CA",
|
31
|
-
"country" => "US",
|
32
|
-
"postalCode" => "94105"
|
33
|
-
}
|
34
|
-
},
|
35
|
-
"lines" => [ { "amount" => 100 }]
|
36
|
-
}
|
37
|
-
|
38
|
-
transaction = @client.create_transaction(createTransactionModel)
|
39
|
-
```
|
40
|
-
|
41
|
-
If you'd like to see a more complete code example with credentials, check out our [example folder](/example).
|
42
|
-
|
43
|
-
AvaTax REST and Search APIs
|
44
|
-
------------------------------
|
45
|
-
Our [developer site](https://developer.avalara.com/) documents all the AvaTax REST and other APIs. Subscribe to the [RSS feed](developer.avalara.com/feed.xml) to stay up to date on the lates news and announcements.
|
46
|
-
|
47
|
-
[API docs](http://www.rubydoc.info/github/avadev/AvaTax-REST-V2-Ruby-SDK/)
|
48
|
-
|
49
|
-
Blog
|
50
|
-
----------------------------
|
51
|
-
The [Developer Blog](https://developer.avalara.com/blog/) features news and important announcements about the AvaTax Platform and SDKs. You will also find tutorials and best practices to help you build great platform integrations.
|
52
|
-
|
53
|
-
Contributing
|
54
|
-
------------
|
55
|
-
In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), **everyone** is encouraged to help improve this project.
|
56
|
-
|
57
|
-
Here are some ways *you* can contribute:
|
58
|
-
|
59
|
-
* by using alpha, beta, and prerelease versions
|
60
|
-
* by reporting bugs
|
61
|
-
* by suggesting new features
|
62
|
-
* by writing or editing documentation
|
63
|
-
* by writing specifications
|
64
|
-
* by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
|
65
|
-
* by refactoring code
|
66
|
-
* by closing [issues](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues)
|
67
|
-
* by reviewing patches
|
68
|
-
|
69
|
-
|
70
|
-
Submitting an Issue
|
71
|
-
-------------------
|
72
|
-
We use the [GitHub issue tracker](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues) to track bugs and
|
73
|
-
features. Before submitting a bug report or feature request, check to make sure it hasn't already
|
74
|
-
been submitted. You can indicate support for an existing issue by voting it up. When submitting a
|
75
|
-
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
|
76
|
-
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
77
|
-
operating system. Ideally, a bug report should include a pull request with failing specs.
|
78
|
-
|
79
|
-
Submitting a Pull Request
|
80
|
-
-------------------------
|
81
|
-
1. Fork the project.
|
82
|
-
2. Create a topic branch.
|
83
|
-
3. Implement your feature or bug fix.
|
84
|
-
4. Add documentation for your feature or bug fix.
|
85
|
-
5. Run <tt>rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4.
|
86
|
-
6. Add specs for your feature or bug fix.
|
87
|
-
7. Commit and push your changes.
|
88
|
-
8. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
|
89
|
-
|
90
|
-
Build Status
|
91
|
-
------------
|
92
|
-
[](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK)
|
93
|
-
|
94
|
-
Copyright
|
95
|
-
---------
|
96
|
-
Copyright (c) 2017, Avalara, Inc. All rights reserved.
|
97
|
-
By contributing to AvaTax Ruby Gem, you agree that your contributions will be licensed under its Apache License.
|
98
|
-
See [LICENSE](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/) for details.
|
1
|
+
The AvaTax Ruby Gem
|
2
|
+
====================
|
3
|
+
A Ruby wrapper for the AvaTax REST V2 APIs
|
4
|
+
|
5
|
+
Installation
|
6
|
+
------------
|
7
|
+
gem install avatax
|
8
|
+
|
9
|
+
Simple Code Example
|
10
|
+
-------------------------
|
11
|
+
```ruby
|
12
|
+
@client = AvaTax::Client.new(:logger => true)
|
13
|
+
|
14
|
+
createTransactionModel = {
|
15
|
+
"type" => 'SalesInvoice',
|
16
|
+
"companyCode" => '12670',
|
17
|
+
"date" => '2017-06-05',
|
18
|
+
"customerCode" => 'ABC',
|
19
|
+
"addresses" => {
|
20
|
+
"ShipFrom" => {
|
21
|
+
"line1" => "123 Main Street",
|
22
|
+
"city" => "Irvine",
|
23
|
+
"region" => "CA",
|
24
|
+
"country" => "US",
|
25
|
+
"postalCode" => "92615"
|
26
|
+
},
|
27
|
+
"ShipTo" => {
|
28
|
+
"line1" => "100 Market Street",
|
29
|
+
"city" => "San Francisco",
|
30
|
+
"region" => "CA",
|
31
|
+
"country" => "US",
|
32
|
+
"postalCode" => "94105"
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"lines" => [ { "amount" => 100 }]
|
36
|
+
}
|
37
|
+
|
38
|
+
transaction = @client.create_transaction(createTransactionModel)
|
39
|
+
```
|
40
|
+
|
41
|
+
If you'd like to see a more complete code example with credentials, check out our [example folder](/example).
|
42
|
+
|
43
|
+
AvaTax REST and Search APIs
|
44
|
+
------------------------------
|
45
|
+
Our [developer site](https://developer.avalara.com/) documents all the AvaTax REST and other APIs. Subscribe to the [RSS feed](developer.avalara.com/feed.xml) to stay up to date on the lates news and announcements.
|
46
|
+
|
47
|
+
[API docs](http://www.rubydoc.info/github/avadev/AvaTax-REST-V2-Ruby-SDK/)
|
48
|
+
|
49
|
+
Blog
|
50
|
+
----------------------------
|
51
|
+
The [Developer Blog](https://developer.avalara.com/blog/) features news and important announcements about the AvaTax Platform and SDKs. You will also find tutorials and best practices to help you build great platform integrations.
|
52
|
+
|
53
|
+
Contributing
|
54
|
+
------------
|
55
|
+
In the spirit of [free software](http://www.fsf.org/licensing/essays/free-sw.html), **everyone** is encouraged to help improve this project.
|
56
|
+
|
57
|
+
Here are some ways *you* can contribute:
|
58
|
+
|
59
|
+
* by using alpha, beta, and prerelease versions
|
60
|
+
* by reporting bugs
|
61
|
+
* by suggesting new features
|
62
|
+
* by writing or editing documentation
|
63
|
+
* by writing specifications
|
64
|
+
* by writing code (**no patch is too small**: fix typos, add comments, clean up inconsistent whitespace)
|
65
|
+
* by refactoring code
|
66
|
+
* by closing [issues](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues)
|
67
|
+
* by reviewing patches
|
68
|
+
|
69
|
+
|
70
|
+
Submitting an Issue
|
71
|
+
-------------------
|
72
|
+
We use the [GitHub issue tracker](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/issues) to track bugs and
|
73
|
+
features. Before submitting a bug report or feature request, check to make sure it hasn't already
|
74
|
+
been submitted. You can indicate support for an existing issue by voting it up. When submitting a
|
75
|
+
bug report, please include a [Gist](http://gist.github.com/) that includes a stack trace and any
|
76
|
+
details that may be necessary to reproduce the bug, including your gem version, Ruby version, and
|
77
|
+
operating system. Ideally, a bug report should include a pull request with failing specs.
|
78
|
+
|
79
|
+
Submitting a Pull Request
|
80
|
+
-------------------------
|
81
|
+
1. Fork the project.
|
82
|
+
2. Create a topic branch.
|
83
|
+
3. Implement your feature or bug fix.
|
84
|
+
4. Add documentation for your feature or bug fix.
|
85
|
+
5. Run <tt>rake doc:yard</tt>. If your changes are not 100% documented, go back to step 4.
|
86
|
+
6. Add specs for your feature or bug fix.
|
87
|
+
7. Commit and push your changes.
|
88
|
+
8. Submit a pull request. Please do not include changes to the gemspec, version, or history file. (If you want to create your own version for some reason, please do so in a separate commit.)
|
89
|
+
|
90
|
+
Build Status
|
91
|
+
------------
|
92
|
+
[](https://travis-ci.org/avadev/AvaTax-REST-V2-Ruby-SDK)
|
93
|
+
|
94
|
+
Copyright
|
95
|
+
---------
|
96
|
+
Copyright (c) 2017, Avalara, Inc. All rights reserved.
|
97
|
+
By contributing to AvaTax Ruby Gem, you agree that your contributions will be licensed under its Apache License.
|
98
|
+
See [LICENSE](https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK/) for details.
|
data/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
begin
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
-
|
6
|
-
task :default => :spec
|
7
|
-
rescue LoadError
|
8
|
-
# no rspec available
|
9
|
-
end
|
1
|
+
begin
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
|
6
|
+
task :default => :spec
|
7
|
+
rescue LoadError
|
8
|
+
# no rspec available
|
9
|
+
end
|
data/avatax.gemspec
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
require File.expand_path('../lib/avatax/version', __FILE__)
|
2
|
-
|
3
|
-
Gem::Specification.new do |s|
|
4
|
-
s.add_development_dependency('rake', '~> 12.0.0')
|
5
|
-
s.add_development_dependency('rspec', '~> 3.5.0')
|
6
|
-
s.add_development_dependency('webmock', '>= 2.0.0')
|
7
|
-
s.add_runtime_dependency('faraday', '>= 0.10')
|
8
|
-
s.add_runtime_dependency('faraday_middleware', '>= 0.10')
|
9
|
-
s.add_runtime_dependency('multi_json', '>= 1.0.3')
|
10
|
-
s.authors = ["Marcus Vorwaller"]
|
11
|
-
s.description = %q{A Ruby wrapper for the AvaTax REST and Search APIs}
|
12
|
-
s.post_install_message =<<eos
|
13
|
-
********************************************************************************
|
14
|
-
|
15
|
-
AvaTax REST API
|
16
|
-
------------------------------
|
17
|
-
Our developer site documents the AvaTax REST API.
|
18
|
-
(http://developer.avatax.com).
|
19
|
-
Blog
|
20
|
-
----------------------------
|
21
|
-
The Developer Blog is a great place to learn more about the API and AvaTax integrations
|
22
|
-
Subscribe to the RSS feed be notified of new posts:
|
23
|
-
(http://developer.avatax.com/blog).
|
24
|
-
|
25
|
-
********************************************************************************
|
26
|
-
eos
|
27
|
-
s.email = ['marcus.vorwaller@avalara.com']
|
28
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
29
|
-
s.files = `git ls-files`.split("\n")
|
30
|
-
s.homepage = 'https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK'
|
31
|
-
s.name = 'avatax'
|
32
|
-
s.platform = Gem::Platform::RUBY
|
33
|
-
s.require_paths = ['lib']
|
34
|
-
s.required_rubygems_version = Gem::Requirement.new('>= 2.0.0') if s.respond_to? :required_rubygems_version=
|
35
|
-
s.summary = %q{Ruby wrapper for the AvaTax API}
|
36
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
37
|
-
s.version = AvaTax::VERSION.dup
|
38
|
-
end
|
1
|
+
require File.expand_path('../lib/avatax/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.add_development_dependency('rake', '~> 12.0.0')
|
5
|
+
s.add_development_dependency('rspec', '~> 3.5.0')
|
6
|
+
s.add_development_dependency('webmock', '>= 2.0.0')
|
7
|
+
s.add_runtime_dependency('faraday', '>= 0.10')
|
8
|
+
s.add_runtime_dependency('faraday_middleware', '>= 0.10')
|
9
|
+
s.add_runtime_dependency('multi_json', '>= 1.0.3')
|
10
|
+
s.authors = ["Marcus Vorwaller"]
|
11
|
+
s.description = %q{A Ruby wrapper for the AvaTax REST and Search APIs}
|
12
|
+
s.post_install_message =<<eos
|
13
|
+
********************************************************************************
|
14
|
+
|
15
|
+
AvaTax REST API
|
16
|
+
------------------------------
|
17
|
+
Our developer site documents the AvaTax REST API.
|
18
|
+
(http://developer.avatax.com).
|
19
|
+
Blog
|
20
|
+
----------------------------
|
21
|
+
The Developer Blog is a great place to learn more about the API and AvaTax integrations
|
22
|
+
Subscribe to the RSS feed be notified of new posts:
|
23
|
+
(http://developer.avatax.com/blog).
|
24
|
+
|
25
|
+
********************************************************************************
|
26
|
+
eos
|
27
|
+
s.email = ['marcus.vorwaller@avalara.com']
|
28
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
29
|
+
s.files = `git ls-files`.split("\n")
|
30
|
+
s.homepage = 'https://github.com/avadev/AvaTax-REST-V2-Ruby-SDK'
|
31
|
+
s.name = 'avatax'
|
32
|
+
s.platform = Gem::Platform::RUBY
|
33
|
+
s.require_paths = ['lib']
|
34
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 2.0.0') if s.respond_to? :required_rubygems_version=
|
35
|
+
s.summary = %q{Ruby wrapper for the AvaTax API}
|
36
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
37
|
+
s.version = AvaTax::VERSION.dup
|
38
|
+
end
|
data/example/avatax.rb
CHANGED
@@ -1,47 +1,47 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
require File.expand_path('../../lib/avatax', __FILE__)
|
3
|
-
|
4
|
-
credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
|
5
|
-
|
6
|
-
AvaTax.configure do |config|
|
7
|
-
begin
|
8
|
-
credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
|
9
|
-
config.endpoint = credentials['endpoint']
|
10
|
-
config.username = credentials['username']
|
11
|
-
config.password = credentials['password']
|
12
|
-
rescue
|
13
|
-
config.endpoint = 'https://sandbox-rest.avatax.com'
|
14
|
-
config.username = ENV['SANDBOX_USERNAME']
|
15
|
-
config.password = ENV['SANDBOX_PASSWORD']
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
@client = AvaTax::Client.new(:logger => true)
|
20
|
-
|
21
|
-
# puts @client.query_companies
|
22
|
-
|
23
|
-
createTransactionModel = {
|
24
|
-
"type" => 'SalesInvoice',
|
25
|
-
"companyCode" => '12670',
|
26
|
-
"date" => '2017-06-05',
|
27
|
-
"customerCode" => 'ABC',
|
28
|
-
"addresses" => {
|
29
|
-
"ShipFrom" => {
|
30
|
-
"line1" => "123 Main Street",
|
31
|
-
"city" => "Irvine",
|
32
|
-
"region" => "CA",
|
33
|
-
"country" => "US",
|
34
|
-
"postalCode" => "92615"
|
35
|
-
},
|
36
|
-
"ShipTo" => {
|
37
|
-
"line1" => "100 Market Street",
|
38
|
-
"city" => "San Francisco",
|
39
|
-
"region" => "CA",
|
40
|
-
"country" => "US",
|
41
|
-
"postalCode" => "94105"
|
42
|
-
}
|
43
|
-
},
|
44
|
-
"lines" => [ { "amount" => 100 }]
|
45
|
-
}
|
46
|
-
transaction = @client.create_transaction(createTransactionModel)
|
47
|
-
puts JSON.pretty_generate(transaction)
|
1
|
+
require 'yaml'
|
2
|
+
require File.expand_path('../../lib/avatax', __FILE__)
|
3
|
+
|
4
|
+
credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
|
5
|
+
|
6
|
+
AvaTax.configure do |config|
|
7
|
+
begin
|
8
|
+
credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
|
9
|
+
config.endpoint = credentials['endpoint']
|
10
|
+
config.username = credentials['username']
|
11
|
+
config.password = credentials['password']
|
12
|
+
rescue
|
13
|
+
config.endpoint = 'https://sandbox-rest.avatax.com'
|
14
|
+
config.username = ENV['SANDBOX_USERNAME']
|
15
|
+
config.password = ENV['SANDBOX_PASSWORD']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
@client = AvaTax::Client.new(:logger => true)
|
20
|
+
|
21
|
+
# puts @client.query_companies
|
22
|
+
|
23
|
+
createTransactionModel = {
|
24
|
+
"type" => 'SalesInvoice',
|
25
|
+
"companyCode" => '12670',
|
26
|
+
"date" => '2017-06-05',
|
27
|
+
"customerCode" => 'ABC',
|
28
|
+
"addresses" => {
|
29
|
+
"ShipFrom" => {
|
30
|
+
"line1" => "123 Main Street",
|
31
|
+
"city" => "Irvine",
|
32
|
+
"region" => "CA",
|
33
|
+
"country" => "US",
|
34
|
+
"postalCode" => "92615"
|
35
|
+
},
|
36
|
+
"ShipTo" => {
|
37
|
+
"line1" => "100 Market Street",
|
38
|
+
"city" => "San Francisco",
|
39
|
+
"region" => "CA",
|
40
|
+
"country" => "US",
|
41
|
+
"postalCode" => "94105"
|
42
|
+
}
|
43
|
+
},
|
44
|
+
"lines" => [ { "amount" => 100 }]
|
45
|
+
}
|
46
|
+
transaction = @client.create_transaction(createTransactionModel)
|
47
|
+
puts JSON.pretty_generate(transaction)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
# Copy this file as credentials.yaml and update the values to match your account
|
2
|
-
---
|
3
|
-
endpoint: https://sandbox-rest.avatax.com
|
4
|
-
username: 'example_user'
|
5
|
-
password: 'abcd1234'
|
1
|
+
# Copy this file as credentials.yaml and update the values to match your account
|
2
|
+
---
|
3
|
+
endpoint: https://sandbox-rest.avatax.com
|
4
|
+
username: 'example_user'
|
5
|
+
password: 'abcd1234'
|
data/lib/avatax/api.rb
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
require File.expand_path('../connection', __FILE__)
|
2
|
-
require File.expand_path('../request', __FILE__)
|
3
|
-
|
4
|
-
module AvaTax
|
5
|
-
class API
|
6
|
-
|
7
|
-
attr_accessor *Configuration::VALID_OPTIONS_KEYS
|
8
|
-
|
9
|
-
def initialize(options={})
|
10
|
-
options = AvaTax.options.merge(options)
|
11
|
-
Configuration::VALID_OPTIONS_KEYS.each do |key|
|
12
|
-
send("#{key}=", options[key])
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def config
|
17
|
-
conf = {}
|
18
|
-
Configuration::VALID_OPTIONS_KEYS.each do |key|
|
19
|
-
conf[key] = send key
|
20
|
-
end
|
21
|
-
conf
|
22
|
-
end
|
23
|
-
|
24
|
-
include Connection
|
25
|
-
include Request
|
26
|
-
end
|
27
|
-
end
|
1
|
+
require File.expand_path('../connection', __FILE__)
|
2
|
+
require File.expand_path('../request', __FILE__)
|
3
|
+
|
4
|
+
module AvaTax
|
5
|
+
class API
|
6
|
+
|
7
|
+
attr_accessor *Configuration::VALID_OPTIONS_KEYS
|
8
|
+
|
9
|
+
def initialize(options={})
|
10
|
+
options = AvaTax.options.merge(options)
|
11
|
+
Configuration::VALID_OPTIONS_KEYS.each do |key|
|
12
|
+
send("#{key}=", options[key])
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def config
|
17
|
+
conf = {}
|
18
|
+
Configuration::VALID_OPTIONS_KEYS.each do |key|
|
19
|
+
conf[key] = send key
|
20
|
+
end
|
21
|
+
conf
|
22
|
+
end
|
23
|
+
|
24
|
+
include Connection
|
25
|
+
include Request
|
26
|
+
end
|
27
|
+
end
|
@@ -22,13 +22,13 @@ module AvaTax
|
|
22
22
|
#
|
23
23
|
# ### Security Policies
|
24
24
|
#
|
25
|
-
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
25
|
+
# * This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
26
26
|
# Swagger Name: AvaTaxClient
|
27
27
|
# @param id [Integer] The ID of the account you wish to update.
|
28
28
|
# @param model [Object] A request confirming that you wish to reset the license key of this account.
|
29
29
|
# @return [Object]
|
30
30
|
def account_reset_license_key(id, model) path = "/api/v2/accounts/#{id}/resetlicensekey"
|
31
|
-
post(path, model, {}, "22.
|
31
|
+
post(path, model, {}, "22.6.1") end
|
32
32
|
|
33
33
|
# Activate an account by accepting terms and conditions
|
34
34
|
#
|
@@ -45,13 +45,13 @@ module AvaTax
|
|
45
45
|
#
|
46
46
|
# ### Security Policies
|
47
47
|
#
|
48
|
-
# * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
48
|
+
# * This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
49
49
|
# Swagger Name: AvaTaxClient
|
50
50
|
# @param id [Integer] The ID of the account to activate
|
51
51
|
# @param model [Object] The activation request
|
52
52
|
# @return [Object]
|
53
53
|
def activate_account(id, model) path = "/api/v2/accounts/#{id}/activate"
|
54
|
-
post(path, model, {}, "22.
|
54
|
+
post(path, model, {}, "22.6.1") end
|
55
55
|
|
56
56
|
# Retrieve audit history for an account.
|
57
57
|
#
|
@@ -72,7 +72,7 @@ module AvaTax
|
|
72
72
|
#
|
73
73
|
# ### Security Policies
|
74
74
|
#
|
75
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
75
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
76
76
|
# Swagger Name: AvaTaxClient
|
77
77
|
# @param id [Integer] The ID of the account you wish to audit.
|
78
78
|
# @param start [DateTime] The start datetime of audit history you with to retrieve, e.g. "2018-06-08T17:00:00Z". Defaults to the past 15 minutes.
|
@@ -81,7 +81,7 @@ module AvaTax
|
|
81
81
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
82
82
|
# @return [FetchResult]
|
83
83
|
def audit_account(id, options={}) path = "/api/v2/accounts/#{id}/audit"
|
84
|
-
get(path, options, "22.
|
84
|
+
get(path, options, "22.6.1") end
|
85
85
|
|
86
86
|
# Create license key for this account
|
87
87
|
#
|
@@ -98,13 +98,13 @@ module AvaTax
|
|
98
98
|
#
|
99
99
|
# ### Security Policies
|
100
100
|
#
|
101
|
-
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
101
|
+
# * This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
102
102
|
# Swagger Name: AvaTaxClient
|
103
103
|
# @param id [Integer] The ID of the account you wish to update.
|
104
104
|
# @param model [Object]
|
105
105
|
# @return [Object]
|
106
106
|
def create_license_key(id, model) path = "/api/v2/accounts/#{id}/licensekey"
|
107
|
-
post(path, model, {}, "22.
|
107
|
+
post(path, model, {}, "22.6.1") end
|
108
108
|
|
109
109
|
# Delete license key for this account by license key name
|
110
110
|
#
|
@@ -116,13 +116,13 @@ module AvaTax
|
|
116
116
|
#
|
117
117
|
# ### Security Policies
|
118
118
|
#
|
119
|
-
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
119
|
+
# * This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
120
120
|
# Swagger Name: AvaTaxClient
|
121
121
|
# @param id [Integer] The ID of the account you wish to update.
|
122
122
|
# @param licensekeyname [String] The license key name you wish to update.
|
123
123
|
# @return [ErrorDetail[]]
|
124
124
|
def delete_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
|
125
|
-
delete(path, {}, "22.
|
125
|
+
delete(path, {}, "22.6.1") end
|
126
126
|
|
127
127
|
# Retrieve a single account
|
128
128
|
#
|
@@ -134,13 +134,13 @@ module AvaTax
|
|
134
134
|
#
|
135
135
|
# ### Security Policies
|
136
136
|
#
|
137
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
137
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
138
138
|
# Swagger Name: AvaTaxClient
|
139
139
|
# @param id [Integer] The ID of the account to retrieve
|
140
140
|
# @param include [String] A comma separated list of special fetch options
|
141
141
|
# @return [Object]
|
142
142
|
def get_account(id, options={}) path = "/api/v2/accounts/#{id}"
|
143
|
-
get(path, options, "22.
|
143
|
+
get(path, options, "22.6.1") end
|
144
144
|
|
145
145
|
# Get configuration settings for this account
|
146
146
|
#
|
@@ -159,24 +159,24 @@ module AvaTax
|
|
159
159
|
#
|
160
160
|
# ### Security Policies
|
161
161
|
#
|
162
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
162
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
163
163
|
# Swagger Name: AvaTaxClient
|
164
164
|
# @param id [Integer]
|
165
165
|
# @return [AccountConfigurationModel[]]
|
166
166
|
def get_account_configuration(id) path = "/api/v2/accounts/#{id}/configuration"
|
167
|
-
get(path, {}, "22.
|
167
|
+
get(path, {}, "22.6.1") end
|
168
168
|
|
169
169
|
# Retrieve license key by license key name
|
170
170
|
#
|
171
171
|
# ### Security Policies
|
172
172
|
#
|
173
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
173
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
174
174
|
# Swagger Name: AvaTaxClient
|
175
175
|
# @param id [Integer] The ID of the account to retrieve
|
176
176
|
# @param licensekeyname [String] The ID of the account to retrieve
|
177
177
|
# @return [Object]
|
178
178
|
def get_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
|
179
|
-
get(path, {}, "22.
|
179
|
+
get(path, {}, "22.6.1") end
|
180
180
|
|
181
181
|
# Retrieve all license keys for this account
|
182
182
|
#
|
@@ -184,12 +184,12 @@ module AvaTax
|
|
184
184
|
#
|
185
185
|
# ### Security Policies
|
186
186
|
#
|
187
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
187
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
188
188
|
# Swagger Name: AvaTaxClient
|
189
189
|
# @param id [Integer] The ID of the account to retrieve
|
190
190
|
# @return [AccountLicenseKeyModel[]]
|
191
191
|
def get_license_keys(id) path = "/api/v2/accounts/#{id}/licensekeys"
|
192
|
-
get(path, {}, "22.
|
192
|
+
get(path, {}, "22.6.1") end
|
193
193
|
|
194
194
|
# Retrieve all accounts
|
195
195
|
#
|
@@ -208,7 +208,7 @@ module AvaTax
|
|
208
208
|
#
|
209
209
|
# ### Security Policies
|
210
210
|
#
|
211
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
211
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
|
212
212
|
# Swagger Name: AvaTaxClient
|
213
213
|
# @param include [String] A comma separated list of objects to fetch underneath this account. Any object with a URL path underneath this account can be fetched by specifying its name.
|
214
214
|
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* subscriptions, users
|
@@ -217,7 +217,7 @@ module AvaTax
|
|
217
217
|
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
218
218
|
# @return [FetchResult]
|
219
219
|
def query_accounts(options={}) path = "/api/v2/accounts"
|
220
|
-
get(path, options, "22.
|
220
|
+
get(path, options, "22.6.1") end
|
221
221
|
|
222
222
|
# Change configuration settings for this account
|
223
223
|
#
|
@@ -236,13 +236,13 @@ module AvaTax
|
|
236
236
|
#
|
237
237
|
# ### Security Policies
|
238
238
|
#
|
239
|
-
# * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
239
|
+
# * This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
240
240
|
# Swagger Name: AvaTaxClient
|
241
241
|
# @param id [Integer]
|
242
242
|
# @param model [AccountConfigurationModel[]]
|
243
243
|
# @return [AccountConfigurationModel[]]
|
244
244
|
def set_account_configuration(id, model) path = "/api/v2/accounts/#{id}/configuration"
|
245
|
-
post(path, model, {}, "22.
|
245
|
+
post(path, model, {}, "22.6.1") end
|
246
246
|
end
|
247
247
|
end
|
248
248
|
end
|