avatax 20.1.0 → 20.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/avatax.gemspec +0 -1
  3. data/lib/avatax/client/accounts.rb +236 -172
  4. data/lib/avatax/client/addresses.rb +54 -54
  5. data/lib/avatax/client/advancedrules.rb +63 -162
  6. data/lib/avatax/client/avafileforms.rb +78 -78
  7. data/lib/avatax/client/batches.rb +223 -170
  8. data/lib/avatax/client/certexpressinvites.rb +97 -97
  9. data/lib/avatax/client/certificates.rb +424 -424
  10. data/lib/avatax/client/companies.rb +457 -350
  11. data/lib/avatax/client/compliance.rb +15 -15
  12. data/lib/avatax/client/contacts.rb +106 -106
  13. data/lib/avatax/client/customers.rb +376 -376
  14. data/lib/avatax/client/datasources.rb +99 -99
  15. data/lib/avatax/client/definitions.rb +862 -847
  16. data/lib/avatax/client/distancethresholds.rb +122 -122
  17. data/lib/avatax/client/ecommercetoken.rb +37 -0
  18. data/lib/avatax/client/filingcalendars.rb +20 -508
  19. data/lib/avatax/client/filings.rb +37 -26
  20. data/lib/avatax/client/firmclientlinkages.rb +123 -123
  21. data/lib/avatax/client/free.rb +100 -100
  22. data/lib/avatax/client/fundingrequests.rb +52 -52
  23. data/lib/avatax/client/items.rb +423 -423
  24. data/lib/avatax/client/jurisdictionoverrides.rb +118 -118
  25. data/lib/avatax/client/locations.rb +253 -139
  26. data/lib/avatax/client/multidocument.rb +390 -310
  27. data/lib/avatax/client/nexus.rb +341 -201
  28. data/lib/avatax/client/notifications.rb +75 -75
  29. data/lib/avatax/client/provisioning.rb +49 -49
  30. data/lib/avatax/client/registrar.rb +198 -198
  31. data/lib/avatax/client/reports.rb +97 -97
  32. data/lib/avatax/client/settings.rb +156 -156
  33. data/lib/avatax/client/subscriptions.rb +62 -62
  34. data/lib/avatax/client/taxcodes.rb +120 -120
  35. data/lib/avatax/client/taxcontent.rb +133 -133
  36. data/lib/avatax/client/taxrules.rb +170 -170
  37. data/lib/avatax/client/transactions.rb +836 -791
  38. data/lib/avatax/client/upcs.rb +111 -111
  39. data/lib/avatax/client/users.rb +183 -183
  40. data/lib/avatax/client/utilities.rb +61 -61
  41. data/lib/avatax/connection.rb +3 -3
  42. data/lib/avatax/request.rb +2 -0
  43. data/lib/avatax/version.rb +1 -1
  44. metadata +4 -17
@@ -1,163 +1,64 @@
1
- module AvaTax
2
- class Client
3
- module AdvancedRules
4
-
5
-
6
- # Approve an advanced rule script to run.
7
- #
8
- # This API is available by invite only and implementation support is required.
9
- # Please contact your Customer Account Manager if you are interested in using
10
- # Advanced Rules in your AvaTax integration.
11
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
12
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
13
- # @return [Object]
14
- def approve_advanced_rule_script(accountId, scriptType)
15
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}/approve"
16
- post(path)
17
- end
18
-
19
-
20
- # Create an advanced rule.
21
- #
22
- # This API is available by invite only and implementation support is required.
23
- # Please contact your Customer Account Manager if you are interested in using
24
- # Advanced Rules in your AvaTax integration.
25
- # @param accountId [Integer] The ID of the account that will own the Advanced Rule.
26
- # @param scriptType [String] The script transform type, Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
27
- # @param crashBehavior [String] The behavior the script should take if it crashes: Fail or Proceed. (See AdvancedRuleCrashBehavior::* for a list of allowable values)
28
- # @param file [Object] The JavaScript file containing the advanced rule.
29
- # @return [String]
30
- def create_advanced_rule_script(accountId, scriptType, options={})
31
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}"
32
- post(path, options)
33
- end
34
-
35
-
36
- # Create a lookup table for an advanced rule
37
- #
38
- # This API is available by invite only and implementation support is required.
39
- # Please contact your Customer Account Manager if you are interested in using
40
- # Advanced Rules in your AvaTax integration.
41
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
42
- # @param csvTableName [String] The name to assign the CSV lookup table.
43
- # @param file [Object] A CSV file containing lookup data for an advanced rule.
44
- # @return [String]
45
- def create_advanced_rule_table(accountId, csvTableName)
46
- path = "/api/v2/accounts/#{accountId}/advancedruletables/#{csvTableName}"
47
- post(path)
48
- end
49
-
50
-
51
- # Delete an account's active advanced rule
52
- #
53
- # This API is available by invite only and implementation support is required.
54
- # Please contact your Customer Account Manager if you are interested in using
55
- # Advanced Rules in your AvaTax integration.
56
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
57
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
58
- # @return [ErrorDetail[]]
59
- def delete_advanced_rule_script(accountId, scriptType)
60
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}"
61
- delete(path)
62
- end
63
-
64
-
65
- # Delete a lookup table for an advanced rule.
66
- #
67
- # This API is available by invite only and implementation support is required.
68
- # Please contact your Customer Account Manager if you are interested in using
69
- # Advanced Rules in your AvaTax integration.
70
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
71
- # @param csvTableName [String] The name of the CSV lookup table to delete.
72
- # @return [ErrorDetail[]]
73
- def delete_advanced_rule_table(accountId, csvTableName)
74
- path = "/api/v2/accounts/#{accountId}/advancedruletables/#{csvTableName}"
75
- delete(path)
76
- end
77
-
78
-
79
- # Disable an advanced rule so that it cannot be run.
80
- #
81
- # This API is available by invite only and implementation support is required.
82
- # Please contact your Customer Account Manager if you are interested in using
83
- # Advanced Rules in your AvaTax integration. ///
84
- # @param accountId [Integer]
85
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
86
- # @return [Object]
87
- def disable_advanced_rule_script(accountId, scriptType)
88
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}/disable"
89
- post(path)
90
- end
91
-
92
-
93
- # Enable an approved advanced rule so that it can be run.
94
- #
95
- # This API is available by invite only and implementation support is required.
96
- # Please contact your Customer Account Manager if you are interested in using
97
- # Advanced Rules in your AvaTax integration.
98
- # @param accountId [Integer]
99
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
100
- # @return [Object]
101
- def enable_advanced_rule_script(accountId, scriptType)
102
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}/enable"
103
- post(path)
104
- end
105
-
106
-
107
- # Get an account's advanced rule script.
108
- #
109
- # This API is available by invite only and implementation support is required.
110
- # Please contact your Customer Account Manager if you are interested in using
111
- # Advanced Rules in your AvaTax integration.
112
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
113
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
114
- # @return [Object]
115
- def get_advanced_rule_script(accountId, scriptType)
116
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}"
117
- get(path)
118
- end
119
-
120
-
121
- # Get an advanced rule lookup table for an account
122
- #
123
- # This API is available by invite only and implementation support is required.
124
- # Please contact your Customer Account Manager if you are interested in using
125
- # Advanced Rules in your AvaTax integration.
126
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
127
- # @param csvTableName [String] The name of the CSV lookup table to get.
128
- # @return [Object]
129
- def get_advanced_rule_table(accountId, csvTableName)
130
- path = "/api/v2/accounts/#{accountId}/advancedruletables/#{csvTableName}"
131
- get(path)
132
- end
133
-
134
-
135
- # Get all advanced rule lookup tables for an account
136
- #
137
- # This API is available by invite only and implementation support is required.
138
- # Please contact your Customer Account Manager if you are interested in using
139
- # Advanced Rules in your AvaTax integration.
140
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
141
- # @return [Object]
142
- def get_advanced_rule_tables(accountId)
143
- path = "/api/v2/accounts/#{accountId}/advancedruletables"
144
- get(path)
145
- end
146
-
147
-
148
- # Unapprove an advanced rule script so that it cannot be run.
149
- #
150
- # This API is available by invite only and implementation support is required.
151
- # Please contact your Customer Account Manager if you are interested in using
152
- # Advanced Rules in your AvaTax integration.
153
- # @param accountId [Integer] The ID of the account that owns the Advanced Rule.
154
- # @param scriptType [String] The script transform type: Request or Response. (See AdvancedRuleScriptType::* for a list of allowable values)
155
- # @return [Object]
156
- def unapprove_advanced_rule_script(accountId, scriptType)
157
- path = "/api/v2/accounts/#{accountId}/advancedrulescripts/#{scriptType}/unapprove"
158
- post(path)
159
- end
160
-
161
- end
162
- end
1
+ module AvaTax
2
+ class Client
3
+ module AdvancedRules
4
+
5
+
6
+ # Create a lookup file for a company
7
+ #
8
+ #
9
+ # @param accountId [Integer] The ID of the account for the company
10
+ # @param companyId [Integer] The ID of the company for which the lookup file is to be created
11
+ # @param model [Object] The lookup file you wish to create
12
+ # @return [Object]
13
+ def create_company_lookup_file(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
14
+ post(path, model) end
15
+
16
+ # Delete a lookup file
17
+ #
18
+ #
19
+ # @param accountId [Integer] The ID of the account for the company the lookup file is for
20
+ # @param id [String] The unique ID/GUID for the company lookup file to be deleted
21
+ # @return [ErrorDetail[]]
22
+ def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
23
+ delete(path) end
24
+
25
+ # Get audit records by account id and date range.
26
+ #
27
+ #
28
+ # @param accountId [Integer] The ID of the account
29
+ # @param fromDate [String] Date
30
+ # @param toDate [String] Date
31
+ # @return [Object]
32
+ def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
33
+ get(path) end
34
+
35
+ # Get the lookup files for a company
36
+ #
37
+ #
38
+ # @param accountId [Integer] The account ID for the company
39
+ # @param companyId [Integer] The ID of the company for which to retrieve lookup files
40
+ # @return [FetchResult]
41
+ def get_company_lookup_files(accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
42
+ get(path) end
43
+
44
+ # Get a lookup file for an accountId and companyLookupFileId
45
+ #
46
+ #
47
+ # @param accountId [Integer] The ID of the account for the lookup file
48
+ # @param id [String] The unique ID/GUID of the company lookup file to return
49
+ # @return [Object]
50
+ def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
51
+ get(path) end
52
+
53
+ # Update a lookup file
54
+ #
55
+ #
56
+ # @param accountId [Integer] The ID of the account for the company the lookup file is for
57
+ # @param id [String] The unique ID/GUID of the company lookup file to be updated
58
+ # @param model [Object] The new values to update the lookup file
59
+ # @return [Object]
60
+ def update_lookup_file(accountId, id, model) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
61
+ put(path, model) end
62
+ end
63
+ end
163
64
  end
@@ -1,79 +1,79 @@
1
- module AvaTax
2
- class Client
3
- module AvaFileForms
4
-
5
-
6
- # Create a new AvaFileForm
7
- #
8
- # Create one or more AvaFileForms
9
- # A 'AvaFileForm' represents a form supported by our returns team
10
- #
11
- # ### Security Policies
12
- #
13
- # * This API requires the user role Compliance Root User.
14
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
15
- # @param model [AvaFileFormModel[]] The AvaFileForm you wish to create.
16
- # @return [AvaFileFormModel[]]
17
- def create_ava_file_forms(model) path = "/api/v2/avafileforms"
18
- post(path, model) end
19
-
20
- # Delete a single AvaFileForm
21
- #
22
- # Marks the existing AvaFileForm object at this URL as deleted.
23
- #
24
- # ### Security Policies
25
- #
26
- # * This API requires one of the following user roles: Compliance Root User, ComplianceUser, FirmAdmin.
27
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
28
- # @param id [Integer] The ID of the AvaFileForm you wish to delete.
29
- # @return [ErrorDetail[]]
30
- def delete_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
31
- delete(path) end
32
-
33
- # Retrieve a single AvaFileForm
34
- #
35
- # Get the AvaFileForm object identified by this URL.
36
- #
37
- # ### Security Policies
38
- #
39
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
40
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
41
- # @param id [Integer] The primary key of this AvaFileForm
42
- # @return [Object]
43
- def get_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
44
- get(path) end
45
-
46
- # Retrieve all AvaFileForms
47
- #
48
- # Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
49
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
50
- #
51
- # ### Security Policies
52
- #
53
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
54
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
55
- # @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:* outletTypeId
56
- # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
57
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
58
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
59
- # @return [FetchResult]
60
- def query_ava_file_forms(options={}) path = "/api/v2/avafileforms"
61
- get(path, options) end
62
-
63
- # Update a AvaFileForm
64
- #
65
- # All data from the existing object will be replaced with data in the object you PUT.
66
- # To set a field's value to null, you may either set its value to null or omit that field from the object you post.
67
- #
68
- # ### Security Policies
69
- #
70
- # * This API requires the user role Compliance Root User.
71
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
72
- # @param id [Integer] The ID of the AvaFileForm you wish to update
73
- # @param model [Object] The AvaFileForm model you wish to update.
74
- # @return [Object]
75
- def update_ava_file_form(id, model) path = "/api/v2/avafileforms/#{id}"
76
- put(path, model) end
77
- end
78
- end
1
+ module AvaTax
2
+ class Client
3
+ module AvaFileForms
4
+
5
+
6
+ # Create a new AvaFileForm
7
+ #
8
+ # Create one or more AvaFileForms
9
+ # A 'AvaFileForm' represents a form supported by our returns team
10
+ #
11
+ # ### Security Policies
12
+ #
13
+ # * This API requires the user role Compliance Root User.
14
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
15
+ # @param model [AvaFileFormModel[]] The AvaFileForm you wish to create.
16
+ # @return [AvaFileFormModel[]]
17
+ def create_ava_file_forms(model) path = "/api/v2/avafileforms"
18
+ post(path, model) end
19
+
20
+ # Delete a single AvaFileForm
21
+ #
22
+ # Marks the existing AvaFileForm object at this URL as deleted.
23
+ #
24
+ # ### Security Policies
25
+ #
26
+ # * This API requires one of the following user roles: Compliance Root User, ComplianceUser, FirmAdmin.
27
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
28
+ # @param id [Integer] The ID of the AvaFileForm you wish to delete.
29
+ # @return [ErrorDetail[]]
30
+ def delete_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
31
+ delete(path) end
32
+
33
+ # Retrieve a single AvaFileForm
34
+ #
35
+ # Get the AvaFileForm object identified by this URL.
36
+ #
37
+ # ### Security Policies
38
+ #
39
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
40
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
41
+ # @param id [Integer] The primary key of this AvaFileForm
42
+ # @return [Object]
43
+ def get_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
44
+ get(path) end
45
+
46
+ # Retrieve all AvaFileForms
47
+ #
48
+ # Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
49
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
50
+ #
51
+ # ### Security Policies
52
+ #
53
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
54
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
55
+ # @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:* outletTypeId
56
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
57
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
58
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
59
+ # @return [FetchResult]
60
+ def query_ava_file_forms(options={}) path = "/api/v2/avafileforms"
61
+ get(path, options) end
62
+
63
+ # Update a AvaFileForm
64
+ #
65
+ # All data from the existing object will be replaced with data in the object you PUT.
66
+ # To set a field's value to null, you may either set its value to null or omit that field from the object you post.
67
+ #
68
+ # ### Security Policies
69
+ #
70
+ # * This API requires the user role Compliance Root User.
71
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
72
+ # @param id [Integer] The ID of the AvaFileForm you wish to update
73
+ # @param model [Object] The AvaFileForm model you wish to update.
74
+ # @return [Object]
75
+ def update_ava_file_form(id, model) path = "/api/v2/avafileforms/#{id}"
76
+ put(path, model) end
77
+ end
78
+ end
79
79
  end
@@ -1,171 +1,224 @@
1
- module AvaTax
2
- class Client
3
- module Batches
4
-
5
-
6
- # Create a new batch
7
- #
8
- # Create one or more new batch objects attached to this company.
9
- #
10
- # Each batch object may have one or more file objects (currently only one file is supported).
11
- #
12
- # When a batch is created, it is added to the AvaTax Batch Queue and will be
13
- # processed as quickly as possible in the order it was received. To check the
14
- # status of a batch, fetch the batch and retrieve the results of the batch
15
- # operation.
16
- #
17
- # Because the batch system processes with a degree of concurrency, and
18
- # because of batch sizes in the queue vary, AvaTax API is unable to accurately
19
- # predict when a batch will complete. If high performance processing is
20
- # required, please use the
21
- # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
22
- #
23
- # The maximum content length of the request body is limited to 28.6 MB. If this limit
24
- # is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if
25
- # the API is called from a browser). In this situation, please split the request into
26
- # smaller batches.
27
- #
28
- # ### Security Policies
29
- #
30
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
31
- # @param companyId [Integer] The ID of the company that owns this batch.
32
- # @param model [BatchModel[]] The batch you wish to create.
33
- # @return [BatchModel[]]
34
- def create_batches(companyId, model) path = "/api/v2/companies/#{companyId}/batches"
35
- post(path, model) end
36
-
37
- # Delete a single batch
38
- #
39
- # Marks the batch identified by this URL as deleted.
40
- #
41
- # If you attempt to delete a batch that is being processed, you will receive an error message.
42
- # Deleting a batch does not delete any transactions that were created by importing the batch.
43
- #
44
- # Because the batch system processes with a degree of concurrency, and
45
- # because of batch sizes in the queue vary, AvaTax API is unable to accurately
46
- # predict when a batch will complete. If high performance processing is
47
- # required, please use the
48
- # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
49
- #
50
- # ### Security Policies
51
- #
52
- # * This API requires one of the following user roles: CSPAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
53
- # @param companyId [Integer] The ID of the company that owns this batch.
54
- # @param id [Integer] The ID of the batch to delete.
55
- # @return [ErrorDetail[]]
56
- def delete_batch(companyId, id) path = "/api/v2/companies/#{companyId}/batches/#{id}"
57
- delete(path) end
58
-
59
- # Download a single batch file
60
- #
61
- # Download a single batch file identified by this URL.
62
- #
63
- # ### Security Policies
64
- #
65
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
66
- # @param companyId [Integer] The ID of the company that owns this batch
67
- # @param batchId [Integer] The ID of the batch object
68
- # @param id [Integer] The primary key of this batch file object
69
- # @return [Object]
70
- def download_batch(companyId, batchId, id) path = "/api/v2/companies/#{companyId}/batches/#{batchId}/files/#{id}/attachment"
71
- get(path) end
72
-
73
- # Retrieve a single batch
74
- #
75
- # Get the batch object identified by this URL. A batch object is a large
76
- # collection of API calls stored in a compact file.
77
- #
78
- # Use this endpoint to retrieve the results or check the status of a batch.
79
- #
80
- # When a batch is created, it is added to the AvaTax Batch Queue and will be
81
- # processed as quickly as possible in the order it was received. To check the
82
- # status of a batch, fetch the batch and retrieve the results of the batch
83
- # operation.
84
- #
85
- # Because the batch system processes with a degree of concurrency, and
86
- # because of batch sizes in the queue vary, AvaTax API is unable to accurately
87
- # predict when a batch will complete. If high performance processing is
88
- # required, please use the
89
- # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
90
- #
91
- # ### Security Policies
92
- #
93
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
94
- # @param companyId [Integer] The ID of the company that owns this batch
95
- # @param id [Integer] The primary key of this batch
96
- # @return [Object]
97
- def get_batch(companyId, id) path = "/api/v2/companies/#{companyId}/batches/#{id}"
98
- get(path) end
99
-
100
- # Retrieve all batches for this company
101
- #
102
- # List all batch objects attached to the specified company.
103
- #
104
- # A batch object is a large collection of API calls stored in a compact file.
105
- #
106
- # Search for specific objects using the criteria in the `$filter` parameter;
107
- # full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
108
- # Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
109
- #
110
- # Use [GetBatch](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Batches/GetBatch/)
111
- # to retrieve the results, or check the status, of an individual batch.
112
- #
113
- # When a batch is created, it is added to the AvaTax Batch Queue and will be
114
- # processed as quickly as possible in the order it was received. To check the
115
- # status of a batch, fetch the batch and retrieve the results of the batch
116
- # operation.
117
- #
118
- # Because the batch system processes with a degree of concurrency, and
119
- # because of batch sizes in the queue vary, AvaTax API is unable to accurately
120
- # predict when a batch will complete. If high performance processing is
121
- # required, please use the
122
- # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
123
- #
124
- # ### Security Policies
125
- #
126
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
127
- # @param companyId [Integer] The ID of the company that owns these batches
128
- # @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:* files
129
- # @param include [String] A comma separated list of additional data to retrieve.
130
- # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
131
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
132
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
133
- # @return [FetchResult]
134
- def list_batches_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/batches"
135
- get(path, options) end
136
-
137
- # Retrieve all batches
138
- #
139
- # Get multiple batch objects across all companies.
140
- #
141
- # A batch object is a large collection of API calls stored in a compact file.
142
- #
143
- # Search for specific objects using the criteria in the `$filter` parameter;
144
- # full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
145
- # Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
146
- #
147
- # When a batch is created, it is added to the AvaTax Batch Queue and will be
148
- # processed as quickly as possible in the order it was received. To check the
149
- # status of a batch, fetch the batch and retrieve the results of the batch
150
- # operation.
151
- #
152
- # Because the batch system processes with a degree of concurrency, and
153
- # because of batch sizes in the queue vary, AvaTax API is unable to accurately
154
- # predict when a batch will complete. If high performance processing is
155
- # required, please use the
156
- # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
157
- #
158
- # ### Security Policies
159
- #
160
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
161
- # @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:* files
162
- # @param include [String] A comma separated list of additional data to retrieve.
163
- # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
164
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
165
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
166
- # @return [FetchResult]
167
- def query_batches(options={}) path = "/api/v2/batches"
168
- get(path, options) end
169
- end
170
- end
1
+ module AvaTax
2
+ class Client
3
+ module Batches
4
+
5
+
6
+ # Cancel an in progress batch
7
+ #
8
+ # Marks the in progress batch identified by this URL as cancelled.
9
+ #
10
+ # Only JSON batches can be cancelled. If you attempt to cancel a file batch, you will receive an error message.
11
+ #
12
+ # Only in progress batches can be cancelled. If you attempt to cancel a batch that its status is not Waiting or Processing, you will receive an error message.
13
+ # Cancelling an in progress batch does not delete any transactions that were created before the cancellation.
14
+ #
15
+ # Because the batch system processes with a degree of concurrency, and
16
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
17
+ # predict when a batch will complete. If high performance processing is
18
+ # required, please use the
19
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
20
+ #
21
+ # ### Security Policies
22
+ #
23
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
24
+ # @param companyId [Integer] The ID of the company that owns this batch.
25
+ # @param id [Integer] The ID of the batch to cancel.
26
+ # @return [Object]
27
+ def cancel_batch(companyId, id) path = "/api/v2/companies/#{companyId}/batches/#{id}/cancel"
28
+ post(path) end
29
+
30
+ # Create a new batch
31
+ #
32
+ # Create one or more new batch objects attached to this company.
33
+ #
34
+ # Each batch object may have one or more file objects (currently only one file is supported).
35
+ #
36
+ # When a batch is created, it is added to the AvaTax Batch Queue and will be
37
+ # processed as quickly as possible in the order it was received. To check the
38
+ # status of a batch, fetch the batch and retrieve the results of the batch
39
+ # operation.
40
+ #
41
+ # Because the batch system processes with a degree of concurrency, and
42
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
43
+ # predict when a batch will complete. If high performance processing is
44
+ # required, please use the
45
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
46
+ #
47
+ # The maximum content length of the request body is limited to 28.6 MB. If this limit
48
+ # is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if
49
+ # the API is called from a browser). In this situation, please split the request into
50
+ # smaller batches.
51
+ #
52
+ # ### Security Policies
53
+ #
54
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
55
+ # @param companyId [Integer] The ID of the company that owns this batch.
56
+ # @param model [BatchModel[]] The batch you wish to create.
57
+ # @return [BatchModel[]]
58
+ def create_batches(companyId, model) path = "/api/v2/companies/#{companyId}/batches"
59
+ post(path, model) end
60
+
61
+ # Create a new transaction batch
62
+ #
63
+ # Create a new transaction batch objects attached to this company.
64
+ #
65
+ # When a transaction batch is created, it is added to the AvaTax Batch v2 Queue and will be
66
+ # processed as quickly as possible in the order it was received. To check the
67
+ # status of a batch, fetch the batch and retrieve the results of the batch
68
+ # operation.
69
+ #
70
+ # Because the batch system processes with a degree of concurrency, and
71
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
72
+ # predict when a batch will complete. If high performance processing is
73
+ # required, please use the
74
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
75
+ #
76
+ # The maximum content length of the request body is limited to 28.6 MB. If this limit
77
+ # is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if
78
+ # the API is called from a browser). In this situation, please split the request into
79
+ # smaller batches.
80
+ #
81
+ # ### Security Policies
82
+ #
83
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
84
+ # @param companyId [Integer] The ID of the company that owns this batch.
85
+ # @param model [Object] The transaction batch you wish to create.
86
+ # @return [Object]
87
+ def create_transaction_batch(companyId, model) path = "/api/v2/companies/#{companyId}/batches/transactions"
88
+ post(path, model) end
89
+
90
+ # Delete a single batch
91
+ #
92
+ # Marks the batch identified by this URL as deleted.
93
+ #
94
+ # If you attempt to delete a batch that is being processed, you will receive an error message.
95
+ # Deleting a batch does not delete any transactions that were created by importing the batch.
96
+ #
97
+ # Because the batch system processes with a degree of concurrency, and
98
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
99
+ # predict when a batch will complete. If high performance processing is
100
+ # required, please use the
101
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
102
+ #
103
+ # ### Security Policies
104
+ #
105
+ # * This API requires one of the following user roles: CSPAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
106
+ # @param companyId [Integer] The ID of the company that owns this batch.
107
+ # @param id [Integer] The ID of the batch to delete.
108
+ # @return [ErrorDetail[]]
109
+ def delete_batch(companyId, id) path = "/api/v2/companies/#{companyId}/batches/#{id}"
110
+ delete(path) end
111
+
112
+ # Download a single batch file
113
+ #
114
+ # Download a single batch file identified by this URL.
115
+ #
116
+ # ### Security Policies
117
+ #
118
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
119
+ # @param companyId [Integer] The ID of the company that owns this batch
120
+ # @param batchId [Integer] The ID of the batch object
121
+ # @param id [Integer] The primary key of this batch file object
122
+ # @return [Object]
123
+ def download_batch(companyId, batchId, id) path = "/api/v2/companies/#{companyId}/batches/#{batchId}/files/#{id}/attachment"
124
+ get(path) end
125
+
126
+ # Retrieve a single batch
127
+ #
128
+ # Get the batch object identified by this URL. A batch object is a large
129
+ # collection of API calls stored in a compact file.
130
+ #
131
+ # Use this endpoint to retrieve the results or check the status of a batch.
132
+ #
133
+ # When a batch is created, it is added to the AvaTax Batch Queue and will be
134
+ # processed as quickly as possible in the order it was received. To check the
135
+ # status of a batch, fetch the batch and retrieve the results of the batch
136
+ # operation.
137
+ #
138
+ # Because the batch system processes with a degree of concurrency, and
139
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
140
+ # predict when a batch will complete. If high performance processing is
141
+ # required, please use the
142
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
143
+ #
144
+ # ### Security Policies
145
+ #
146
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
147
+ # @param companyId [Integer] The ID of the company that owns this batch
148
+ # @param id [Integer] The primary key of this batch
149
+ # @return [Object]
150
+ def get_batch(companyId, id) path = "/api/v2/companies/#{companyId}/batches/#{id}"
151
+ get(path) end
152
+
153
+ # Retrieve all batches for this company
154
+ #
155
+ # List all batch objects attached to the specified company.
156
+ #
157
+ # A batch object is a large collection of API calls stored in a compact file.
158
+ #
159
+ # Search for specific objects using the criteria in the `$filter` parameter;
160
+ # full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
161
+ # Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
162
+ #
163
+ # Use [GetBatch](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Batches/GetBatch/)
164
+ # to retrieve the results, or check the status, of an individual batch.
165
+ #
166
+ # When a batch is created, it is added to the AvaTax Batch Queue and will be
167
+ # processed as quickly as possible in the order it was received. To check the
168
+ # status of a batch, fetch the batch and retrieve the results of the batch
169
+ # operation.
170
+ #
171
+ # Because the batch system processes with a degree of concurrency, and
172
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
173
+ # predict when a batch will complete. If high performance processing is
174
+ # required, please use the
175
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
176
+ #
177
+ # ### Security Policies
178
+ #
179
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
180
+ # @param companyId [Integer] The ID of the company that owns these batches
181
+ # @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:* files
182
+ # @param include [String] A comma separated list of additional data to retrieve.
183
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
184
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
185
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
186
+ # @return [FetchResult]
187
+ def list_batches_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/batches"
188
+ get(path, options) end
189
+
190
+ # Retrieve all batches
191
+ #
192
+ # Get multiple batch objects across all companies.
193
+ #
194
+ # A batch object is a large collection of API calls stored in a compact file.
195
+ #
196
+ # Search for specific objects using the criteria in the `$filter` parameter;
197
+ # full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
198
+ # Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
199
+ #
200
+ # When a batch is created, it is added to the AvaTax Batch Queue and will be
201
+ # processed as quickly as possible in the order it was received. To check the
202
+ # status of a batch, fetch the batch and retrieve the results of the batch
203
+ # operation.
204
+ #
205
+ # Because the batch system processes with a degree of concurrency, and
206
+ # because of batch sizes in the queue vary, AvaTax API is unable to accurately
207
+ # predict when a batch will complete. If high performance processing is
208
+ # required, please use the
209
+ # [CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
210
+ #
211
+ # ### Security Policies
212
+ #
213
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
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:* files
215
+ # @param include [String] A comma separated list of additional data to retrieve.
216
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
217
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
218
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
219
+ # @return [FetchResult]
220
+ def query_batches(options={}) path = "/api/v2/batches"
221
+ get(path, options) end
222
+ end
223
+ end
171
224
  end