avatax 20.7.0 → 21.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.vs/slnx.sqlite +0 -0
  3. data/lib/avatax/client/accounts.rb +22 -55
  4. data/lib/avatax/client/addresses.rb +7 -13
  5. data/lib/avatax/client/advancedrules.rb +10 -38
  6. data/lib/avatax/client/avafileforms.rb +15 -30
  7. data/lib/avatax/client/batches.rb +16 -40
  8. data/lib/avatax/client/certexpressinvites.rb +21 -30
  9. data/lib/avatax/client/certificates.rb +97 -142
  10. data/lib/avatax/client/companies.rb +137 -80
  11. data/lib/avatax/client/compliance.rb +2 -5
  12. data/lib/avatax/client/contacts.rb +12 -30
  13. data/lib/avatax/client/customers.rb +87 -126
  14. data/lib/avatax/client/datasources.rb +18 -36
  15. data/lib/avatax/client/definitions.rb +126 -303
  16. data/lib/avatax/client/distancethresholds.rb +12 -30
  17. data/lib/avatax/client/ecms.rb +26 -31
  18. data/lib/avatax/client/ecommercetoken.rb +37 -0
  19. data/lib/avatax/client/errortransactions.rb +27 -15
  20. data/lib/avatax/client/filingcalendars.rb +17 -5
  21. data/lib/avatax/client/filings.rb +15 -7
  22. data/lib/avatax/client/firmclientlinkages.rb +18 -45
  23. data/lib/avatax/client/free.rb +2 -84
  24. data/lib/avatax/client/fundingrequests.rb +6 -12
  25. data/lib/avatax/client/items.rb +38 -95
  26. data/lib/avatax/client/jurisdictionoverrides.rb +12 -30
  27. data/lib/avatax/client/locations.rb +128 -38
  28. data/lib/avatax/client/multidocument.rb +32 -62
  29. data/lib/avatax/client/nexus.rb +138 -37
  30. data/lib/avatax/client/notices.rb +47 -139
  31. data/lib/avatax/client/notifications.rb +6 -15
  32. data/lib/avatax/client/provisioning.rb +4 -10
  33. data/lib/avatax/client/registrar.rb +20 -50
  34. data/lib/avatax/client/reports.rb +17 -20
  35. data/lib/avatax/client/settings.rb +12 -30
  36. data/lib/avatax/client/subscriptions.rb +6 -15
  37. data/lib/avatax/client/taxcodes.rb +12 -30
  38. data/lib/avatax/client/taxcontent.rb +70 -16
  39. data/lib/avatax/client/taxprofiles.rb +14 -10
  40. data/lib/avatax/client/taxrules.rb +12 -30
  41. data/lib/avatax/client/transactions.rb +63 -126
  42. data/lib/avatax/client/upcs.rb +18 -36
  43. data/lib/avatax/client/users.rb +16 -40
  44. data/lib/avatax/client/utilities.rb +6 -15
  45. data/lib/avatax/configuration.rb +1 -1
  46. data/lib/avatax/request.rb +0 -2
  47. data/lib/avatax/version.rb +1 -1
  48. data/spec/avatax/request_spec.rb +25 -0
  49. metadata +4 -2
@@ -12,28 +12,32 @@ module AvaTax
12
12
  #
13
13
  # This API can be used to export a complete zip file containing your company's current tax profile, and you can then restore this
14
14
  # profile to a different company or compare it over time to see if your profile has been changed.
15
+ #
16
+ # ### Security Policies
17
+ #
18
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
19
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
15
20
  # @param companyId [Integer] The unique ID number of the company whose profile you wish to retrieve.
16
21
  # @return [Object]
17
- def export_tax_profile(companyId)
18
- path = "/api/v2/companies/#{companyId}/taxprofile"
19
- get(path)
20
- end
21
-
22
+ def export_tax_profile(companyId) path = "/api/v2/companies/#{companyId}/taxprofile"
23
+ get(path) end
22
24
 
23
25
  # Import a tax profile.
24
26
  #
25
27
  # Imports a tax profile to a new company, along with the option to import account settings.
28
+ #
29
+ # ### Security Policies
30
+ #
31
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
32
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
26
33
  # @param accountId [Integer] The account id of the account to which the tax profile will be imported.
27
34
  # @param newCompanyCode [String] The companyCode to use for the imported company.
28
35
  # @param replaceAccountSettings [Boolean] Replace the current account settings with the ones in the tax profile.
29
36
  # @param bypassNexusValidation [Boolean] Enable invalid nexus to be imported.
30
37
  # @param taxProfile [Object] The taxProfile
31
38
  # @return [Object]
32
- def import_tax_profile()
33
- path = "/api/v2/taxprofile"
34
- post(path)
35
- end
36
-
39
+ def import_tax_profile() path = "/api/v2/taxprofile"
40
+ post(path) end
37
41
  end
38
42
  end
39
43
  end
@@ -25,11 +25,8 @@ module AvaTax
25
25
  # @param companyId [Integer] The ID of the company that owns this tax rule.
26
26
  # @param model [TaxRuleModel[]] The tax rule you wish to create.
27
27
  # @return [TaxRuleModel[]]
28
- def create_tax_rules(companyId, model)
29
- path = "/api/v2/companies/#{companyId}/taxrules"
30
- post(path, model)
31
- end
32
-
28
+ def create_tax_rules(companyId, model) path = "/api/v2/companies/#{companyId}/taxrules"
29
+ post(path, model) end
33
30
 
34
31
  # Delete a single tax rule
35
32
  #
@@ -53,11 +50,8 @@ module AvaTax
53
50
  # @param companyId [Integer] The ID of the company that owns this tax rule.
54
51
  # @param id [Integer] The ID of the tax rule you wish to delete.
55
52
  # @return [ErrorDetail[]]
56
- def delete_tax_rule(companyId, id)
57
- path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
58
- delete(path)
59
- end
60
-
53
+ def delete_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
54
+ delete(path) end
61
55
 
62
56
  # Retrieve a single tax rule
63
57
  #
@@ -81,11 +75,8 @@ module AvaTax
81
75
  # @param companyId [Integer] The ID of the company that owns this tax rule
82
76
  # @param id [Integer] The primary key of this tax rule
83
77
  # @return [Object]
84
- def get_tax_rule(companyId, id)
85
- path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
86
- get(path)
87
- end
88
-
78
+ def get_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
79
+ get(path) end
89
80
 
90
81
  # Retrieve tax rules for this company
91
82
  #
@@ -116,11 +107,8 @@ module AvaTax
116
107
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
117
108
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
118
109
  # @return [FetchResult]
119
- def list_tax_rules(companyId, options={})
120
- path = "/api/v2/companies/#{companyId}/taxrules"
121
- get(path, options)
122
- end
123
-
110
+ def list_tax_rules(companyId, options={}) path = "/api/v2/companies/#{companyId}/taxrules"
111
+ get(path, options) end
124
112
 
125
113
  # Retrieve all tax rules
126
114
  #
@@ -150,11 +138,8 @@ module AvaTax
150
138
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
151
139
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
152
140
  # @return [FetchResult]
153
- def query_tax_rules(options={})
154
- path = "/api/v2/taxrules"
155
- get(path, options)
156
- end
157
-
141
+ def query_tax_rules(options={}) path = "/api/v2/taxrules"
142
+ get(path, options) end
158
143
 
159
144
  # Update a single tax rule
160
145
  #
@@ -179,11 +164,8 @@ module AvaTax
179
164
  # @param id [Integer] The ID of the tax rule you wish to update
180
165
  # @param model [Object] The tax rule you wish to update.
181
166
  # @return [Object]
182
- def update_tax_rule(companyId, id, model)
183
- path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
184
- put(path, model)
185
- end
186
-
167
+ def update_tax_rule(companyId, id, model) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
168
+ put(path, model) end
187
169
  end
188
170
  end
189
171
  end
@@ -29,15 +29,12 @@ module AvaTax
29
29
  # ### Security Policies
30
30
  #
31
31
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
32
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
32
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
33
33
  # @param include [String] Specifies objects to include in the response after transaction is created
34
34
  # @param model [Object] information about the transaction and lines to be added
35
35
  # @return [Object]
36
- def add_lines(model, options={})
37
- path = "/api/v2/companies/transactions/lines/add"
38
- post(path, model, options)
39
- end
40
-
36
+ def add_lines(model, options={}) path = "/api/v2/companies/transactions/lines/add"
37
+ post(path, model, options) end
41
38
 
42
39
  # Correct a previously created transaction
43
40
  #
@@ -74,18 +71,15 @@ module AvaTax
74
71
  # ### Security Policies
75
72
  #
76
73
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
77
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
74
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
78
75
  # @param companyCode [String] The company code of the company that recorded this transaction
79
76
  # @param transactionCode [String] The transaction code to adjust
80
77
  # @param documentType [String] (Optional): The document type of the transaction to adjust. (See DocumentType::* for a list of allowable values)
81
78
  # @param include [String] Specifies objects to include in this fetch call
82
79
  # @param model [Object] The adjustment you wish to make
83
80
  # @return [Object]
84
- def adjust_transaction(companyCode, transactionCode, model, options={})
85
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
86
- post(path, model, options)
87
- end
88
-
81
+ def adjust_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
82
+ post(path, model, options) end
89
83
 
90
84
  # Get audit information about a transaction
91
85
  #
@@ -116,15 +110,12 @@ module AvaTax
116
110
  # ### Security Policies
117
111
  #
118
112
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
119
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
113
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
120
114
  # @param companyCode [String] The code identifying the company that owns this transaction
121
115
  # @param transactionCode [String] The code identifying the transaction
122
116
  # @return [Object]
123
- def audit_transaction(companyCode, transactionCode)
124
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
125
- get(path)
126
- end
127
-
117
+ def audit_transaction(companyCode, transactionCode) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
118
+ get(path) end
128
119
 
129
120
  # Get audit information about a transaction
130
121
  #
@@ -155,16 +146,13 @@ module AvaTax
155
146
  # ### Security Policies
156
147
  #
157
148
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
158
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
149
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
159
150
  # @param companyCode [String] The code identifying the company that owns this transaction
160
151
  # @param transactionCode [String] The code identifying the transaction
161
152
  # @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
162
153
  # @return [Object]
163
- def audit_transaction_with_type(companyCode, transactionCode, documentType)
164
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
165
- get(path)
166
- end
167
-
154
+ def audit_transaction_with_type(companyCode, transactionCode, documentType) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
155
+ get(path) end
168
156
 
169
157
  # Lock a set of documents
170
158
  #
@@ -179,14 +167,11 @@ module AvaTax
179
167
  # ### Security Policies
180
168
  #
181
169
  # * This API requires the user role Compliance Root User.
182
- # * 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.
170
+ # * This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
183
171
  # @param model [Object] bulk lock request
184
172
  # @return [Object]
185
- def bulk_lock_transaction(model)
186
- path = "/api/v2/transactions/lock"
187
- post(path, model)
188
- end
189
-
173
+ def bulk_lock_transaction(model) path = "/api/v2/transactions/lock"
174
+ post(path, model) end
190
175
 
191
176
  # Change a transaction's code
192
177
  #
@@ -223,18 +208,15 @@ module AvaTax
223
208
  # ### Security Policies
224
209
  #
225
210
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
226
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
211
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
227
212
  # @param companyCode [String] The company code of the company that recorded this transaction
228
213
  # @param transactionCode [String] The transaction code to change
229
214
  # @param documentType [String] (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
230
215
  # @param include [String] Specifies objects to include in this fetch call
231
216
  # @param model [Object] The code change request you wish to execute
232
217
  # @return [Object]
233
- def change_transaction_code(companyCode, transactionCode, model, options={})
234
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
235
- post(path, model, options)
236
- end
237
-
218
+ def change_transaction_code(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
219
+ post(path, model, options) end
238
220
 
239
221
  # Commit a transaction for reporting
240
222
  #
@@ -276,11 +258,8 @@ module AvaTax
276
258
  # @param include [String] Specifies objects to include in this fetch call
277
259
  # @param model [Object] The commit request you wish to execute
278
260
  # @return [Object]
279
- def commit_transaction(companyCode, transactionCode, model, options={})
280
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
281
- post(path, model, options)
282
- end
283
-
261
+ def commit_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
262
+ post(path, model, options) end
284
263
 
285
264
  # Create or adjust a transaction
286
265
  #
@@ -321,15 +300,12 @@ module AvaTax
321
300
  # ### Security Policies
322
301
  #
323
302
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
324
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
303
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
325
304
  # @param include [String] Specifies objects to include in the response after transaction is created
326
305
  # @param model [Object] The transaction you wish to create or adjust
327
306
  # @return [Object]
328
- def create_or_adjust_transaction(model, options={})
329
- path = "/api/v2/transactions/createoradjust"
330
- post(path, model, options)
331
- end
332
-
307
+ def create_or_adjust_transaction(model, options={}) path = "/api/v2/transactions/createoradjust"
308
+ post(path, model, options) end
333
309
 
334
310
  # Create a new transaction
335
311
  #
@@ -377,15 +353,12 @@ module AvaTax
377
353
  # ### Security Policies
378
354
  #
379
355
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
380
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
356
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
381
357
  # @param include [String] Specifies objects to include in the response after transaction is created
382
358
  # @param model [Object] The transaction you wish to create
383
359
  # @return [Object]
384
- def create_transaction(model, options={})
385
- path = "/api/v2/transactions/create"
386
- post(path, model, options)
387
- end
388
-
360
+ def create_transaction(model, options={}) path = "/api/v2/transactions/create"
361
+ post(path, model, options) end
389
362
 
390
363
  # Remove lines from an existing unlocked transaction
391
364
  #
@@ -410,15 +383,12 @@ module AvaTax
410
383
  # ### Security Policies
411
384
  #
412
385
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
413
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
386
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
414
387
  # @param include [String] Specifies objects to include in the response after transaction is created
415
388
  # @param model [Object] information about the transaction and lines to be removed
416
389
  # @return [Object]
417
- def delete_lines(model, options={})
418
- path = "/api/v2/companies/transactions/lines/delete"
419
- post(path, model, options)
420
- end
421
-
390
+ def delete_lines(model, options={}) path = "/api/v2/companies/transactions/lines/delete"
391
+ post(path, model, options) end
422
392
 
423
393
  # Retrieve a single transaction by code
424
394
  #
@@ -452,17 +422,14 @@ module AvaTax
452
422
  # ### Security Policies
453
423
  #
454
424
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
455
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
425
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
456
426
  # @param companyCode [String] The company code of the company that recorded this transaction
457
427
  # @param transactionCode [String] The transaction code to retrieve
458
428
  # @param documentType [String] (Optional): The document type of the transaction to retrieve (See DocumentType::* for a list of allowable values)
459
429
  # @param include [String] Specifies objects to include in this fetch call
460
430
  # @return [Object]
461
- def get_transaction_by_code(companyCode, transactionCode, options={})
462
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
463
- get(path, options)
464
- end
465
-
431
+ def get_transaction_by_code(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
432
+ get(path, options) end
466
433
 
467
434
  # Retrieve a single transaction by code
468
435
  #
@@ -479,17 +446,14 @@ module AvaTax
479
446
  # ### Security Policies
480
447
  #
481
448
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
482
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
449
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
483
450
  # @param companyCode [String] The company code of the company that recorded this transaction
484
451
  # @param transactionCode [String] The transaction code to retrieve
485
452
  # @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
486
453
  # @param include [String] Specifies objects to include in this fetch call
487
454
  # @return [Object]
488
- def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={})
489
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
490
- get(path, options)
491
- end
492
-
455
+ def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
456
+ get(path, options) end
493
457
 
494
458
  # Retrieve a single transaction by ID
495
459
  #
@@ -514,15 +478,12 @@ module AvaTax
514
478
  # ### Security Policies
515
479
  #
516
480
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
517
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
481
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
518
482
  # @param id [Integer] The unique ID number of the transaction to retrieve
519
483
  # @param include [String] Specifies objects to include in this fetch call
520
484
  # @return [Object]
521
- def get_transaction_by_id(id, options={})
522
- path = "/api/v2/transactions/#{id}"
523
- get(path, options)
524
- end
525
-
485
+ def get_transaction_by_id(id, options={}) path = "/api/v2/transactions/#{id}"
486
+ get(path, options) end
526
487
 
527
488
  # Retrieve all transactions
528
489
  #
@@ -559,26 +520,23 @@ module AvaTax
559
520
  # ### Security Policies
560
521
  #
561
522
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
562
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
523
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
563
524
  # @param companyCode [String] The company code of the company that recorded this transaction
564
525
  # @param dataSourceId [Integer] Optionally filter transactions to those from a specific data source.
565
526
  # @param include [String] Specifies objects to include in this fetch call
566
- # @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:* totalDiscount, lines, addresses, locationTypes, summary, taxDetailsByTaxType, parameters, messages, invoiceMessages, isFakeTransaction
527
+ # @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:* exchangeRateCurrencyCode, totalDiscount, lines, addresses, locationTypes, summary, taxDetailsByTaxType, parameters, messages, invoiceMessages, isFakeTransaction
567
528
  # @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.
568
529
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
569
530
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
570
531
  # @return [FetchResult]
571
- def list_transactions_by_company(companyCode, options={})
572
- path = "/api/v2/companies/#{companyCode}/transactions"
573
- get(path, options)
574
- end
575
-
532
+ def list_transactions_by_company(companyCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions"
533
+ get(path, options) end
576
534
 
577
535
  # Lock a single transaction
578
536
  #
579
537
  # Lock a transaction uniquely identified by this URL.
580
538
  #
581
- # This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
539
+ # This API is mainly used for connector developers to simulate what happens when the Returns product locks a document.
582
540
  # After this API call succeeds, the document will be locked and can't be voided or adjusted.
583
541
  #
584
542
  # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
@@ -609,18 +567,15 @@ module AvaTax
609
567
  # ### Security Policies
610
568
  #
611
569
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
612
- # * 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.
570
+ # * This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
613
571
  # @param companyCode [String] The company code of the company that recorded this transaction
614
572
  # @param transactionCode [String] The transaction code to lock
615
573
  # @param documentType [String] (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
616
574
  # @param include [String] Specifies objects to include in this fetch call
617
575
  # @param model [Object] The lock request you wish to execute
618
576
  # @return [Object]
619
- def lock_transaction(companyCode, transactionCode, model, options={})
620
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
621
- post(path, model, options)
622
- end
623
-
577
+ def lock_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
578
+ post(path, model, options) end
624
579
 
625
580
  # Create a refund for a transaction
626
581
  #
@@ -667,7 +622,7 @@ module AvaTax
667
622
  # ### Security Policies
668
623
  #
669
624
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
670
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
625
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
671
626
  # @param companyCode [String] The code of the company that made the original sale
672
627
  # @param transactionCode [String] The transaction code of the original sale
673
628
  # @param include [String] Specifies objects to include in the response after transaction is created
@@ -675,11 +630,8 @@ module AvaTax
675
630
  # @param useTaxDateOverride [Boolean] (Optional): If set to true, processes refund using taxDateOverride rather than taxAmountOverride (Note: taxAmountOverride is not allowed for SST states).
676
631
  # @param model [Object] Information about the refund to create
677
632
  # @return [Object]
678
- def refund_transaction(companyCode, transactionCode, model, options={})
679
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
680
- post(path, model, options)
681
- end
682
-
633
+ def refund_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
634
+ post(path, model, options) end
683
635
 
684
636
  # Perform multiple actions on a transaction
685
637
  #
@@ -721,11 +673,8 @@ module AvaTax
721
673
  # @param include [String] Specifies objects to include in this fetch call
722
674
  # @param model [Object] The data from an external system to reconcile against AvaTax
723
675
  # @return [Object]
724
- def settle_transaction(companyCode, transactionCode, model, options={})
725
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
726
- post(path, model, options)
727
- end
728
-
676
+ def settle_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
677
+ post(path, model, options) end
729
678
 
730
679
  # Uncommit a transaction for reporting
731
680
  #
@@ -755,17 +704,14 @@ module AvaTax
755
704
  # ### Security Policies
756
705
  #
757
706
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
758
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
707
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
759
708
  # @param companyCode [String] The company code of the company that recorded this transaction
760
709
  # @param transactionCode [String] The transaction code to Uncommit
761
710
  # @param documentType [String] (Optional): The document type of the transaction to Uncommit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
762
711
  # @param include [String] Specifies objects to include in this fetch call
763
712
  # @return [Object]
764
- def uncommit_transaction(companyCode, transactionCode, options={})
765
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
766
- post(path, options)
767
- end
768
-
713
+ def uncommit_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
714
+ post(path, options) end
769
715
 
770
716
  # Unvoids a transaction
771
717
  #
@@ -792,17 +738,14 @@ module AvaTax
792
738
  # ### Security Policies
793
739
  #
794
740
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
795
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
741
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
796
742
  # @param companyCode [String] The company code of the company that recorded this transaction
797
743
  # @param transactionCode [String] The transaction code to commit
798
744
  # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
799
745
  # @param include [String] Specifies objects to include in this fetch call
800
746
  # @return [Object]
801
- def unvoid_transaction(companyCode, transactionCode, options={})
802
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
803
- post(path, options)
804
- end
805
-
747
+ def unvoid_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
748
+ post(path, options) end
806
749
 
807
750
  # Verify a transaction
808
751
  #
@@ -836,18 +779,15 @@ module AvaTax
836
779
  # ### Security Policies
837
780
  #
838
781
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
839
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
782
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
840
783
  # @param companyCode [String] The company code of the company that recorded this transaction
841
784
  # @param transactionCode [String] The transaction code to settle
842
785
  # @param documentType [String] (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
843
786
  # @param include [String] Specifies objects to include in this fetch call
844
787
  # @param model [Object] The data from an external system to reconcile against AvaTax
845
788
  # @return [Object]
846
- def verify_transaction(companyCode, transactionCode, model, options={})
847
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
848
- post(path, model, options)
849
- end
850
-
789
+ def verify_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
790
+ post(path, model, options) end
851
791
 
852
792
  # Void a transaction
853
793
  #
@@ -883,18 +823,15 @@ module AvaTax
883
823
  # ### Security Policies
884
824
  #
885
825
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
886
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
826
+ # * This API depends on the following active services:*Required* (all): AvaTaxPro, BasicReturns.
887
827
  # @param companyCode [String] The company code of the company that recorded this transaction
888
828
  # @param transactionCode [String] The transaction code to void
889
829
  # @param documentType [String] (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
890
830
  # @param include [String] Specifies objects to include in this fetch call
891
831
  # @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
892
832
  # @return [Object]
893
- def void_transaction(companyCode, transactionCode, model, options={})
894
- path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
895
- post(path, model, options)
896
- end
897
-
833
+ def void_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
834
+ post(path, model, options) end
898
835
  end
899
836
  end
900
837
  end