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,171 +1,171 @@
1
- module AvaTax
2
- class Client
3
- module TaxRules
4
-
5
-
6
- # Create a new tax rule
7
- #
8
- # Create one or more custom tax rules attached to this company.
9
- #
10
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
11
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
12
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
13
- # with the transaction.
14
- #
15
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
16
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
17
- # custom tax rules to redefine the behavior for your company or item.
18
- #
19
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
20
- # auditor, legal representative, and accounting team.
21
- #
22
- # ### Security Policies
23
- #
24
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
25
- # @param companyId [Integer] The ID of the company that owns this tax rule.
26
- # @param model [TaxRuleModel[]] The tax rule you wish to create.
27
- # @return [TaxRuleModel[]]
28
- def create_tax_rules(companyId, model) path = "/api/v2/companies/#{companyId}/taxrules"
29
- post(path, model) end
30
-
31
- # Delete a single tax rule
32
- #
33
- # Mark the custom tax rule identified by this URL as deleted.
34
- #
35
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
36
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
37
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
38
- # with the transaction.
39
- #
40
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
41
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
42
- # custom tax rules to redefine the behavior for your company or item.
43
- #
44
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
45
- # auditor, legal representative, and accounting team.
46
- #
47
- # ### Security Policies
48
- #
49
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
50
- # @param companyId [Integer] The ID of the company that owns this tax rule.
51
- # @param id [Integer] The ID of the tax rule you wish to delete.
52
- # @return [ErrorDetail[]]
53
- def delete_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
54
- delete(path) end
55
-
56
- # Retrieve a single tax rule
57
- #
58
- # Get the taxrule object identified by this URL.
59
- #
60
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
61
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
62
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
63
- # with the transaction.
64
- #
65
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
66
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
67
- # custom tax rules to redefine the behavior for your company or item.
68
- #
69
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
70
- # auditor, legal representative, and accounting team.
71
- #
72
- # ### Security Policies
73
- #
74
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
75
- # @param companyId [Integer] The ID of the company that owns this tax rule
76
- # @param id [Integer] The primary key of this tax rule
77
- # @return [Object]
78
- def get_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
79
- get(path) end
80
-
81
- # Retrieve tax rules for this company
82
- #
83
- # List all taxrule objects attached to this company.
84
- #
85
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
86
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
87
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
88
- # with the transaction.
89
- #
90
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
91
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
92
- # custom tax rules to redefine the behavior for your company or item.
93
- #
94
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
95
- # auditor, legal representative, and accounting team.
96
- #
97
- # 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/) .
98
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
99
- #
100
- # ### Security Policies
101
- #
102
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
103
- # @param companyId [Integer] The ID of the company that owns these tax rules
104
- # @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:* taxCode, rateTypeCode, taxTypeGroup, taxSubType
105
- # @param include [String] A comma separated list of additional data to retrieve.
106
- # @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.
107
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
108
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
109
- # @return [FetchResult]
110
- def list_tax_rules(companyId, options={}) path = "/api/v2/companies/#{companyId}/taxrules"
111
- get(path, options) end
112
-
113
- # Retrieve all tax rules
114
- #
115
- # Get multiple taxrule objects across all companies.
116
- #
117
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
118
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
119
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
120
- # with the transaction.
121
- #
122
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
123
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
124
- # custom tax rules to redefine the behavior for your company or item.
125
- #
126
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
127
- # auditor, legal representative, and accounting team.
128
- #
129
- # 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/) .
130
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
131
- #
132
- # ### Security Policies
133
- #
134
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
135
- # @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:* taxCode, rateTypeCode, taxTypeGroup, taxSubType
136
- # @param include [String] A comma separated list of additional data to retrieve.
137
- # @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.
138
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
139
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
140
- # @return [FetchResult]
141
- def query_tax_rules(options={}) path = "/api/v2/taxrules"
142
- get(path, options) end
143
-
144
- # Update a single tax rule
145
- #
146
- # Replace the existing custom tax rule object at this URL with an updated object.
147
- #
148
- # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
149
- # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
150
- # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
151
- # with the transaction.
152
- #
153
- # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
154
- # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
155
- # custom tax rules to redefine the behavior for your company or item.
156
- #
157
- # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
158
- # auditor, legal representative, and accounting team.
159
- #
160
- # ### Security Policies
161
- #
162
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
163
- # @param companyId [Integer] The ID of the company that this tax rule belongs to.
164
- # @param id [Integer] The ID of the tax rule you wish to update
165
- # @param model [Object] The tax rule you wish to update.
166
- # @return [Object]
167
- def update_tax_rule(companyId, id, model) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
168
- put(path, model) end
169
- end
170
- end
1
+ module AvaTax
2
+ class Client
3
+ module TaxRules
4
+
5
+
6
+ # Create a new tax rule
7
+ #
8
+ # Create one or more custom tax rules attached to this company.
9
+ #
10
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
11
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
12
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
13
+ # with the transaction.
14
+ #
15
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
16
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
17
+ # custom tax rules to redefine the behavior for your company or item.
18
+ #
19
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
20
+ # auditor, legal representative, and accounting team.
21
+ #
22
+ # ### Security Policies
23
+ #
24
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
25
+ # @param companyId [Integer] The ID of the company that owns this tax rule.
26
+ # @param model [TaxRuleModel[]] The tax rule you wish to create.
27
+ # @return [TaxRuleModel[]]
28
+ def create_tax_rules(companyId, model) path = "/api/v2/companies/#{companyId}/taxrules"
29
+ post(path, model) end
30
+
31
+ # Delete a single tax rule
32
+ #
33
+ # Mark the custom tax rule identified by this URL as deleted.
34
+ #
35
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
36
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
37
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
38
+ # with the transaction.
39
+ #
40
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
41
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
42
+ # custom tax rules to redefine the behavior for your company or item.
43
+ #
44
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
45
+ # auditor, legal representative, and accounting team.
46
+ #
47
+ # ### Security Policies
48
+ #
49
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
50
+ # @param companyId [Integer] The ID of the company that owns this tax rule.
51
+ # @param id [Integer] The ID of the tax rule you wish to delete.
52
+ # @return [ErrorDetail[]]
53
+ def delete_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
54
+ delete(path) end
55
+
56
+ # Retrieve a single tax rule
57
+ #
58
+ # Get the taxrule object identified by this URL.
59
+ #
60
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
61
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
62
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
63
+ # with the transaction.
64
+ #
65
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
66
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
67
+ # custom tax rules to redefine the behavior for your company or item.
68
+ #
69
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
70
+ # auditor, legal representative, and accounting team.
71
+ #
72
+ # ### Security Policies
73
+ #
74
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
75
+ # @param companyId [Integer] The ID of the company that owns this tax rule
76
+ # @param id [Integer] The primary key of this tax rule
77
+ # @return [Object]
78
+ def get_tax_rule(companyId, id) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
79
+ get(path) end
80
+
81
+ # Retrieve tax rules for this company
82
+ #
83
+ # List all taxrule objects attached to this company.
84
+ #
85
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
86
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
87
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
88
+ # with the transaction.
89
+ #
90
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
91
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
92
+ # custom tax rules to redefine the behavior for your company or item.
93
+ #
94
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
95
+ # auditor, legal representative, and accounting team.
96
+ #
97
+ # 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/) .
98
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
99
+ #
100
+ # ### Security Policies
101
+ #
102
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
103
+ # @param companyId [Integer] The ID of the company that owns these tax rules
104
+ # @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:* taxCode, rateTypeCode, taxTypeGroup, taxSubType
105
+ # @param include [String] A comma separated list of additional data to retrieve.
106
+ # @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.
107
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
108
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
109
+ # @return [FetchResult]
110
+ def list_tax_rules(companyId, options={}) path = "/api/v2/companies/#{companyId}/taxrules"
111
+ get(path, options) end
112
+
113
+ # Retrieve all tax rules
114
+ #
115
+ # Get multiple taxrule objects across all companies.
116
+ #
117
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
118
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
119
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
120
+ # with the transaction.
121
+ #
122
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
123
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
124
+ # custom tax rules to redefine the behavior for your company or item.
125
+ #
126
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
127
+ # auditor, legal representative, and accounting team.
128
+ #
129
+ # 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/) .
130
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
131
+ #
132
+ # ### Security Policies
133
+ #
134
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
135
+ # @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:* taxCode, rateTypeCode, taxTypeGroup, taxSubType
136
+ # @param include [String] A comma separated list of additional data to retrieve.
137
+ # @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.
138
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
139
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
140
+ # @return [FetchResult]
141
+ def query_tax_rules(options={}) path = "/api/v2/taxrules"
142
+ get(path, options) end
143
+
144
+ # Update a single tax rule
145
+ #
146
+ # Replace the existing custom tax rule object at this URL with an updated object.
147
+ #
148
+ # A tax rule represents a rule that changes the default AvaTax behavior for a product or jurisdiction. Custom tax rules
149
+ # can be used to change the taxability of an item, to change the tax base of an item, or to change the tax rate
150
+ # charged when selling an item. Tax rules can also change tax behavior depending on the `entityUseCode` value submitted
151
+ # with the transaction.
152
+ #
153
+ # You can create custom tax rules to customize the behavior of AvaTax to match specific rules that are custom to your
154
+ # business. If you have obtained a ruling from a tax auditor that requires custom tax calculations, you can use
155
+ # custom tax rules to redefine the behavior for your company or item.
156
+ #
157
+ # Please use custom tax rules carefully and ensure that these tax rules match the behavior agreed upon with your
158
+ # auditor, legal representative, and accounting team.
159
+ #
160
+ # ### Security Policies
161
+ #
162
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
163
+ # @param companyId [Integer] The ID of the company that this tax rule belongs to.
164
+ # @param id [Integer] The ID of the tax rule you wish to update
165
+ # @param model [Object] The tax rule you wish to update.
166
+ # @return [Object]
167
+ def update_tax_rule(companyId, id, model) path = "/api/v2/companies/#{companyId}/taxrules/#{id}"
168
+ put(path, model) end
169
+ end
170
+ end
171
171
  end
@@ -1,792 +1,837 @@
1
- module AvaTax
2
- class Client
3
- module Transactions
4
-
5
-
6
- # Add lines to an existing unlocked transaction
7
- #
8
- # Add lines to an existing unlocked transaction.
9
- #
10
- # The `AddLines` API allows you to add additional transaction lines to existing transaction, so that customer will
11
- # be able to append multiple calls together and form an extremely large transaction. If customer does not specify line number
12
- # in the lines to be added, a new random Guid string will be generated for line number. If customer are not satisfied with
13
- # the line number for the transaction lines, they can turn on the renumber switch to have REST v2 automatically renumber all
14
- # transaction lines for them, in this case, the line number becomes: "1", "2", "3", ...
15
- #
16
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
17
- # sales, purchases, inventory transfer, and returns (also called refunds).
18
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
19
- #
20
- # * Lines
21
- # * Details (implies lines)
22
- # * Summary (implies details)
23
- # * Addresses
24
- # * SummaryOnly (omit lines and details - reduces API response size)
25
- # * LinesOnly (omit details - reduces API response size)
26
- #
27
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
28
- #
29
- # ### Security Policies
30
- #
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.
33
- # @param include [String] Specifies objects to include in the response after transaction is created
34
- # @param model [Object] information about the transaction and lines to be added
35
- # @return [Object]
36
- def add_lines(model, options={}) path = "/api/v2/companies/transactions/lines/add"
37
- post(path, model, options) end
38
-
39
- # Correct a previously created transaction
40
- #
41
- # Replaces the current transaction uniquely identified by this URL with a new transaction.
42
- #
43
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
44
- # sales, purchases, inventory transfer, and returns (also called refunds).
45
- #
46
- # When you adjust a committed transaction, the original transaction will be updated with the status code `Adjusted`, and
47
- # both revisions will be available for retrieval based on their code and ID numbers.
48
- # Only transactions in `Committed` status are reported by Avalara Managed Returns.
49
- #
50
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
51
- # no longer available for adjustments.
52
- #
53
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
54
- #
55
- # * Lines
56
- # * Details (implies lines)
57
- # * Summary (implies details)
58
- # * Addresses
59
- # * SummaryOnly (omit lines and details - reduces API response size)
60
- # * LinesOnly (omit details - reduces API response size)
61
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
62
- #
63
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
64
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
65
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
66
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
67
- #
68
- # ### Security Policies
69
- #
70
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
71
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
72
- # @param companyCode [String] The company code of the company that recorded this transaction
73
- # @param transactionCode [String] The transaction code to adjust
74
- # @param documentType [String] (Optional): The document type of the transaction to adjust. (See DocumentType::* for a list of allowable values)
75
- # @param include [String] Specifies objects to include in this fetch call
76
- # @param model [Object] The adjustment you wish to make
77
- # @return [Object]
78
- def adjust_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
79
- post(path, model, options) end
80
-
81
- # Get audit information about a transaction
82
- #
83
- # Retrieve audit information about a transaction stored in AvaTax.
84
- #
85
- # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
86
- # information includes the following:
87
- #
88
- # * The `CompanyId` of the company that created the transaction
89
- # * The server timestamp representing the exact server time when the transaction was created
90
- # * The server duration - how long it took to process this transaction
91
- # * Whether exact API call details were logged
92
- # * A reconstructed API call showing what the original CreateTransaction call looked like
93
- #
94
- # This API can be used to examine information about a previously created transaction.
95
- #
96
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
97
- # sales, purchases, inventory transfer, and returns (also called refunds).
98
- #
99
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
100
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
101
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
102
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
103
- #
104
- # ### Security Policies
105
- #
106
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
107
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
108
- # @param companyCode [String] The code identifying the company that owns this transaction
109
- # @param transactionCode [String] The code identifying the transaction
110
- # @return [Object]
111
- def audit_transaction(companyCode, transactionCode) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
112
- get(path) end
113
-
114
- # Get audit information about a transaction
115
- #
116
- # Retrieve audit information about a transaction stored in AvaTax.
117
- #
118
- # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
119
- # information includes the following:
120
- #
121
- # * The `CompanyId` of the company that created the transaction
122
- # * The server timestamp representing the exact server time when the transaction was created
123
- # * The server duration - how long it took to process this transaction
124
- # * Whether exact API call details were logged
125
- # * A reconstructed API call showing what the original CreateTransaction call looked like
126
- #
127
- # This API can be used to examine information about a previously created transaction.
128
- #
129
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
130
- # sales, purchases, inventory transfer, and returns (also called refunds).
131
- #
132
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
133
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
134
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
135
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
136
- #
137
- # ### Security Policies
138
- #
139
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
140
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
141
- # @param companyCode [String] The code identifying the company that owns this transaction
142
- # @param transactionCode [String] The code identifying the transaction
143
- # @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
144
- # @return [Object]
145
- def audit_transaction_with_type(companyCode, transactionCode, documentType) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
146
- get(path) end
147
-
148
- # Lock a set of documents
149
- #
150
- # This API is available by invitation only.
151
- #
152
- # Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
153
- # After this API call succeeds, documents will be locked and can't be voided.
154
- #
155
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
156
- # sales, purchases, inventory transfer, and returns (also called refunds).
157
- #
158
- # ### Security Policies
159
- #
160
- # * This API requires the user role Compliance Root User.
161
- # * 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.
162
- # @param model [Object] bulk lock request
163
- # @return [Object]
164
- def bulk_lock_transaction(model) path = "/api/v2/transactions/lock"
165
- post(path, model) end
166
-
167
- # Change a transaction's code
168
- #
169
- # Renames a transaction uniquely identified by this URL by changing its `code` value.
170
- #
171
- # This API is available as long as the transaction is in `saved` or `posted` status. When a transaction
172
- # is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method.
173
- #
174
- # After this API call succeeds, the transaction will have a new URL matching its new `code`.
175
- #
176
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
177
- #
178
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
179
- # sales, purchases, inventory transfer, and returns (also called refunds).
180
- #
181
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
182
- #
183
- # * Lines
184
- # * Details (implies lines)
185
- # * Summary (implies details)
186
- # * Addresses
187
- # * SummaryOnly (omit lines and details - reduces API response size)
188
- # * LinesOnly (omit details - reduces API response size)
189
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
190
- #
191
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
192
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
193
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
194
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
195
- #
196
- # ### Security Policies
197
- #
198
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
199
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
200
- # @param companyCode [String] The company code of the company that recorded this transaction
201
- # @param transactionCode [String] The transaction code to change
202
- # @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)
203
- # @param include [String] Specifies objects to include in this fetch call
204
- # @param model [Object] The code change request you wish to execute
205
- # @return [Object]
206
- def change_transaction_code(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
207
- post(path, model, options) end
208
-
209
- # Commit a transaction for reporting
210
- #
211
- # Marks a transaction by changing its status to `Committed`.
212
- #
213
- # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
214
- #
215
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
216
- # sales, purchases, inventory transfer, and returns (also called refunds).
217
- #
218
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
219
- #
220
- # Any changes made to a committed transaction will generate a transaction history.
221
- #
222
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
223
- #
224
- # * Lines
225
- # * Details (implies lines)
226
- # * Summary (implies details)
227
- # * Addresses
228
- # * SummaryOnly (omit lines and details - reduces API response size)
229
- # * LinesOnly (omit details - reduces API response size)
230
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
231
- #
232
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
233
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
234
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
235
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
236
- #
237
- # ### Security Policies
238
- #
239
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
240
- # @param companyCode [String] The company code of the company that recorded this transaction
241
- # @param transactionCode [String] The transaction code to commit
242
- # @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)
243
- # @param include [String] Specifies objects to include in this fetch call
244
- # @param model [Object] The commit request you wish to execute
245
- # @return [Object]
246
- def commit_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
247
- post(path, model, options) end
248
-
249
- # Create or adjust a transaction
250
- #
251
- # Records a new transaction or adjust an existing transaction in AvaTax.
252
- #
253
- # The `CreateOrAdjustTransaction` endpoint is used to create a new transaction or update an existing one. This API
254
- # can help you create an idempotent service that creates transactions
255
- # If there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
256
- # in the input transaction.
257
- #
258
- # The `CreateOrAdjustTransaction` API cannot modify any transaction that has been reported to a tax authority using
259
- # the Avalara Managed Returns Service or any other tax filing service. If you call this API to attempt to modify
260
- # a transaction that has been reported on a tax filing, you will receive the error `CannotModifyLockedTransaction`.
261
- #
262
- # To generate a refund for a transaction, use the `RefundTransaction` API.
263
- #
264
- # If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database.
265
- #
266
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
267
- # sales, purchases, inventory transfer, and returns (also called refunds).
268
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
269
- #
270
- # * Lines
271
- # * Details (implies lines)
272
- # * Summary (implies details)
273
- # * Addresses
274
- # * SummaryOnly (omit lines and details - reduces API response size)
275
- # * LinesOnly (omit details - reduces API response size)
276
- # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
277
- #
278
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
279
- #
280
- # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
281
- # * \_-ava2f-\_
282
- # * \_-ava2b-\_
283
- # * \_-ava3f-\_
284
- #
285
- # ### Security Policies
286
- #
287
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
288
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
289
- # @param include [String] Specifies objects to include in the response after transaction is created
290
- # @param model [Object] The transaction you wish to create or adjust
291
- # @return [Object]
292
- def create_or_adjust_transaction(model, options={}) path = "/api/v2/transactions/createoradjust"
293
- post(path, model, options) end
294
-
295
- # Create a new transaction
296
- #
297
- # Records a new transaction in AvaTax.
298
- #
299
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
300
- # sales, purchases, inventory transfer, and returns (also called refunds).
301
- #
302
- # The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules
303
- # and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your
304
- # company's configuration and the data provided in this API call.
305
- #
306
- # The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To
307
- # avoid this error, use the `CreateOrAdjustTransaction` API - it will create the transaction if it does not exist, or
308
- # update it if it does exist.
309
- #
310
- # To generate a refund for a transaction, use the `RefundTransaction` API.
311
- #
312
- # The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
313
- # a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
314
- #
315
- # The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
316
- # provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
317
- # information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
318
- # using the best available address location information.
319
- #
320
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
321
- #
322
- # * Lines
323
- # * Details (implies lines)
324
- # * Summary (implies details)
325
- # * Addresses
326
- # * SummaryOnly (omit lines and details - reduces API response size)
327
- # * LinesOnly (omit details - reduces API response size)
328
- # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
329
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
330
- #
331
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
332
- #
333
- # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
334
- # * \_-ava2f-\_
335
- # * \_-ava2b-\_
336
- # * \_-ava3f-\_
337
- #
338
- # ### Security Policies
339
- #
340
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
341
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
342
- # @param include [String] Specifies objects to include in the response after transaction is created
343
- # @param model [Object] The transaction you wish to create
344
- # @return [Object]
345
- def create_transaction(model, options={}) path = "/api/v2/transactions/create"
346
- post(path, model, options) end
347
-
348
- # Remove lines from an existing unlocked transaction
349
- #
350
- # Remove lines to an existing unlocked transaction.
351
- #
352
- # The `DeleteLines` API allows you to remove transaction lines from existing unlocked transaction, so that customer will
353
- # be able to delete transaction lines and adjust original transaction the way they like
354
- #
355
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
356
- # sales, purchases, inventory transfer, and returns (also called refunds).
357
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
358
- #
359
- # * Lines
360
- # * Details (implies lines)
361
- # * Summary (implies details)
362
- # * Addresses
363
- # * SummaryOnly (omit lines and details - reduces API response size)
364
- # * LinesOnly (omit details - reduces API response size)
365
- #
366
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
367
- #
368
- # ### Security Policies
369
- #
370
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
371
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
372
- # @param include [String] Specifies objects to include in the response after transaction is created
373
- # @param model [Object] information about the transaction and lines to be removed
374
- # @return [Object]
375
- def delete_lines(model, options={}) path = "/api/v2/companies/transactions/lines/delete"
376
- post(path, model, options) end
377
-
378
- # Retrieve a single transaction by code
379
- #
380
- # Get the current transaction identified by this company code, transaction code, and document type.
381
- #
382
- # A transaction is uniquely identified by `companyCode`, `code` (often called Transaction Code), and `documentType`.
383
- #
384
- # For compatibility purposes, when this API finds multiple transactions with the same transaction code, and if you have not specified
385
- # the `type` parameter to this API, it will default to selecting the `SalesInvoices` transaction. To change this behavior, use the
386
- # optional `documentType` parameter to specify the specific document type you wish to find.
387
- #
388
- # If this transaction was adjusted, the return value of this API will be the current transaction with this code.
389
- #
390
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
391
- #
392
- # * Lines
393
- # * Details (implies lines)
394
- # * Summary (implies details)
395
- # * Addresses
396
- # * SummaryOnly (omit lines and details - reduces API response size)
397
- # * LinesOnly (omit details - reduces API response size)
398
- #
399
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
400
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
401
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
402
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
403
- #
404
- # ### Security Policies
405
- #
406
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
407
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
408
- # @param companyCode [String] The company code of the company that recorded this transaction
409
- # @param transactionCode [String] The transaction code to retrieve
410
- # @param documentType [String] (Optional): The document type of the transaction to retrieve (See DocumentType::* for a list of allowable values)
411
- # @param include [String] Specifies objects to include in this fetch call
412
- # @return [Object]
413
- def get_transaction_by_code(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
414
- get(path, options) end
415
-
416
- # Retrieve a single transaction by code
417
- #
418
- # DEPRECATED: Please use the `GetTransactionByCode` API instead.
419
- #
420
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
421
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
422
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
423
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
424
- #
425
- # ### Security Policies
426
- #
427
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
428
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
429
- # @param companyCode [String] The company code of the company that recorded this transaction
430
- # @param transactionCode [String] The transaction code to retrieve
431
- # @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
432
- # @param include [String] Specifies objects to include in this fetch call
433
- # @return [Object]
434
- def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
435
- get(path, options) end
436
-
437
- # Retrieve a single transaction by ID
438
- #
439
- # Get the unique transaction identified by this URL.
440
- #
441
- # This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
442
- # by using the `AdjustTransaction` endpoint.
443
- #
444
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
445
- # sales, purchases, inventory transfer, and returns (also called refunds).
446
- #
447
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
448
- #
449
- # * Lines
450
- # * Details (implies lines)
451
- # * Summary (implies details)
452
- # * Addresses
453
- # * SummaryOnly (omit lines and details - reduces API response size)
454
- # * LinesOnly (omit details - reduces API response size)
455
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
456
- #
457
- # ### Security Policies
458
- #
459
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
460
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
461
- # @param id [Integer] The unique ID number of the transaction to retrieve
462
- # @param include [String] Specifies objects to include in this fetch call
463
- # @return [Object]
464
- def get_transaction_by_id(id, options={}) path = "/api/v2/transactions/#{id}"
465
- get(path, options) end
466
-
467
- # Retrieve all transactions
468
- #
469
- # List all transactions attached to this company.
470
- #
471
- # This endpoint is limited to returning 1,000 transactions at a time maximum.
472
- #
473
- # When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field
474
- # criteria, the query will default to looking at only those transactions with `date` in the past 30 days.
475
- #
476
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
477
- # sales, purchases, inventory transfer, and returns (also called refunds).
478
- #
479
- # 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/) .
480
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
481
- #
482
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
483
- #
484
- # * Lines
485
- # * Details (implies lines)
486
- # * Summary (implies details)
487
- # * Addresses
488
- # * SummaryOnly (omit lines and details - reduces API response size)
489
- # * LinesOnly (omit details - reduces API response size)
490
- #
491
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
492
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
493
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
494
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
495
- #
496
- # ### Security Policies
497
- #
498
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
499
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
500
- # @param companyCode [String] The company code of the company that recorded this transaction
501
- # @param dataSourceId [Integer] Optionally filter transactions to those from a specific data source.
502
- # @param include [String] Specifies objects to include in this fetch call
503
- # @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
504
- # @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.
505
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
506
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
507
- # @return [FetchResult]
508
- def list_transactions_by_company(companyCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions"
509
- get(path, options) end
510
-
511
- # Lock a single transaction
512
- #
513
- # Lock a transaction uniquely identified by this URL.
514
- #
515
- # This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
516
- # After this API call succeeds, the document will be locked and can't be voided or adjusted.
517
- #
518
- # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
519
- #
520
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
521
- #
522
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
523
- # sales, purchases, inventory transfer, and returns (also called refunds).
524
- #
525
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
526
- #
527
- # * Lines
528
- # * Details (implies lines)
529
- # * Summary (implies details)
530
- # * Addresses
531
- # * SummaryOnly (omit lines and details - reduces API response size)
532
- # * LinesOnly (omit details - reduces API response size)
533
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
534
- #
535
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
536
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
537
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
538
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
539
- #
540
- # ### Security Policies
541
- #
542
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
543
- # * 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.
544
- # @param companyCode [String] The company code of the company that recorded this transaction
545
- # @param transactionCode [String] The transaction code to lock
546
- # @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)
547
- # @param include [String] Specifies objects to include in this fetch call
548
- # @param model [Object] The lock request you wish to execute
549
- # @return [Object]
550
- def lock_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
551
- post(path, model, options) end
552
-
553
- # Create a refund for a transaction
554
- #
555
- # Create a refund for a transaction.
556
- #
557
- # The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
558
- # for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
559
- # specify individual line items from the original sale for refund.
560
- #
561
- # The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
562
- # was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
563
- # nexus, or any other setting.
564
- #
565
- # This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
566
- # common refund scenarios:
567
- #
568
- # * A full refund of a previous sale
569
- # * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
570
- # * Refunding one or more items (lines) from a previous sale
571
- # * Granting a customer a percentage refund of a previous sale
572
- #
573
- # For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
574
- # create a custom refund transaction.
575
- #
576
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
577
- #
578
- # * Lines
579
- # * Details (implies lines)
580
- # * Summary (implies details)
581
- # * Addresses
582
- # * SummaryOnly (omit lines and details - reduces API response size)
583
- # * LinesOnly (omit details - reduces API response size)
584
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
585
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
586
- #
587
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
588
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
589
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
590
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
591
- #
592
- # ### Security Policies
593
- #
594
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
595
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
596
- # @param companyCode [String] The code of the company that made the original sale
597
- # @param transactionCode [String] The transaction code of the original sale
598
- # @param include [String] Specifies objects to include in the response after transaction is created
599
- # @param documentType [String] (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
600
- # @param useTaxDateOverride [Boolean] (Optional): If set to true, processes refund using taxDateOverride rather than taxAmountOverride (Note: taxAmountOverride is not allowed for SST states).
601
- # @param model [Object] Information about the refund to create
602
- # @return [Object]
603
- def refund_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
604
- post(path, model, options) end
605
-
606
- # Perform multiple actions on a transaction
607
- #
608
- # Performs one or more actions against the current transaction uniquely identified by this URL.
609
- #
610
- # The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`.
611
- #
612
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
613
- # sales, purchases, inventory transfer, and returns (also called refunds).
614
- #
615
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
616
- #
617
- # This API is available for users who want to execute more than one action at a time.
618
- #
619
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
620
- #
621
- # * Lines
622
- # * Details (implies lines)
623
- # * Summary (implies details)
624
- # * Addresses
625
- # * SummaryOnly (omit lines and details - reduces API response size)
626
- # * LinesOnly (omit details - reduces API response size)
627
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
628
- #
629
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
630
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
631
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
632
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
633
- #
634
- # ### Security Policies
635
- #
636
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
637
- # @param companyCode [String] The company code of the company that recorded this transaction
638
- # @param transactionCode [String] The transaction code to settle
639
- # @param documentType [String] (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
640
- # @param include [String] Specifies objects to include in this fetch call
641
- # @param model [Object] The data from an external system to reconcile against AvaTax
642
- # @return [Object]
643
- def settle_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
644
- post(path, model, options) end
645
-
646
- # Uncommit a transaction for reporting
647
- #
648
- # Adjusts a transaction by changing it to an uncommitted status.
649
- #
650
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
651
- # no longer available to be uncommitted.
652
- #
653
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
654
- #
655
- # * Lines
656
- # * Details (implies lines)
657
- # * Summary (implies details)
658
- # * Addresses
659
- # * SummaryOnly (omit lines and details - reduces API response size)
660
- # * LinesOnly (omit details - reduces API response size)
661
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
662
- #
663
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
664
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
665
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
666
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
667
- #
668
- # ### Security Policies
669
- #
670
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
671
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
672
- # @param companyCode [String] The company code of the company that recorded this transaction
673
- # @param transactionCode [String] The transaction code to Uncommit
674
- # @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)
675
- # @param include [String] Specifies objects to include in this fetch call
676
- # @return [Object]
677
- def uncommit_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
678
- post(path, options) end
679
-
680
- # Unvoids a transaction
681
- #
682
- # Unvoids a voided transaction
683
- #
684
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
685
- #
686
- # * Lines
687
- # * Details (implies lines)
688
- # * Summary (implies details)
689
- # * Addresses
690
- # * SummaryOnly (omit lines and details - reduces API response size)
691
- # * LinesOnly (omit details - reduces API response size)
692
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
693
- #
694
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
695
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
696
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
697
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
698
- #
699
- # ### Security Policies
700
- #
701
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
702
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
703
- # @param companyCode [String] The company code of the company that recorded this transaction
704
- # @param transactionCode [String] The transaction code to commit
705
- # @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)
706
- # @param include [String] Specifies objects to include in this fetch call
707
- # @return [Object]
708
- def unvoid_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
709
- post(path, options) end
710
-
711
- # Verify a transaction
712
- #
713
- # Verifies that the transaction uniquely identified by this URL matches certain expected values.
714
- #
715
- # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
716
- #
717
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
718
- #
719
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
720
- # sales, purchases, inventory transfer, and returns (also called refunds).
721
- #
722
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
723
- #
724
- # * Lines
725
- # * Details (implies lines)
726
- # * Summary (implies details)
727
- # * Addresses
728
- # * SummaryOnly (omit lines and details - reduces API response size)
729
- # * LinesOnly (omit details - reduces API response size)
730
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
731
- #
732
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
733
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
734
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
735
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
736
- #
737
- # ### Security Policies
738
- #
739
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
740
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
741
- # @param companyCode [String] The company code of the company that recorded this transaction
742
- # @param transactionCode [String] The transaction code to settle
743
- # @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)
744
- # @param include [String] Specifies objects to include in this fetch call
745
- # @param model [Object] The data from an external system to reconcile against AvaTax
746
- # @return [Object]
747
- def verify_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
748
- post(path, model, options) end
749
-
750
- # Void a transaction
751
- #
752
- # Voids the current transaction uniquely identified by this URL.
753
- #
754
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
755
- # sales, purchases, inventory transfer, and returns (also called refunds).
756
- #
757
- # When you void a transaction, that transaction's status is recorded as `DocVoided`.
758
- #
759
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
760
- #
761
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
762
- #
763
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
764
- #
765
- # * Lines
766
- # * Details (implies lines)
767
- # * Summary (implies details)
768
- # * Addresses
769
- # * SummaryOnly (omit lines and details - reduces API response size)
770
- # * LinesOnly (omit details - reduces API response size)
771
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
772
- #
773
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
774
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
775
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
776
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
777
- #
778
- # ### Security Policies
779
- #
780
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
781
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
782
- # @param companyCode [String] The company code of the company that recorded this transaction
783
- # @param transactionCode [String] The transaction code to void
784
- # @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)
785
- # @param include [String] Specifies objects to include in this fetch call
786
- # @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
787
- # @return [Object]
788
- def void_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
789
- post(path, model, options) end
790
- end
791
- end
1
+ module AvaTax
2
+ class Client
3
+ module Transactions
4
+
5
+
6
+ # Add lines to an existing unlocked transaction
7
+ #
8
+ # Add lines to an existing unlocked transaction.
9
+ #
10
+ # The `AddLines` API allows you to add additional transaction lines to existing transaction, so that customer will
11
+ # be able to append multiple calls together and form an extremely large transaction. If customer does not specify line number
12
+ # in the lines to be added, a new random Guid string will be generated for line number. If customer are not satisfied with
13
+ # the line number for the transaction lines, they can turn on the renumber switch to have REST v2 automatically renumber all
14
+ # transaction lines for them, in this case, the line number becomes: "1", "2", "3", ...
15
+ #
16
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
17
+ # sales, purchases, inventory transfer, and returns (also called refunds).
18
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
19
+ #
20
+ # * Lines
21
+ # * Details (implies lines)
22
+ # * Summary (implies details)
23
+ # * Addresses
24
+ # * SummaryOnly (omit lines and details - reduces API response size)
25
+ # * LinesOnly (omit details - reduces API response size)
26
+ #
27
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
28
+ #
29
+ # ### Security Policies
30
+ #
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.
33
+ # @param include [String] Specifies objects to include in the response after transaction is created
34
+ # @param model [Object] information about the transaction and lines to be added
35
+ # @return [Object]
36
+ def add_lines(model, options={}) path = "/api/v2/companies/transactions/lines/add"
37
+ post(path, model, options) end
38
+
39
+ # Correct a previously created transaction
40
+ #
41
+ # Replaces the current transaction uniquely identified by this URL with a new transaction.
42
+ #
43
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
44
+ # sales, purchases, inventory transfer, and returns (also called refunds).
45
+ #
46
+ # When you adjust a committed transaction, the original transaction will be updated with the status code `Adjusted`, and
47
+ # both revisions will be available for retrieval based on their code and ID numbers.
48
+ # Only transactions in `Committed` status are reported by Avalara Managed Returns.
49
+ #
50
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
51
+ # no longer available for adjustments.
52
+ #
53
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
54
+ #
55
+ # * Lines
56
+ # * Details (implies lines)
57
+ # * Summary (implies details)
58
+ # * Addresses
59
+ # * SummaryOnly (omit lines and details - reduces API response size)
60
+ # * LinesOnly (omit details - reduces API response size)
61
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
62
+ #
63
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
64
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
65
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
66
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
67
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
68
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
69
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
70
+ #
71
+ # ### Security Policies
72
+ #
73
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
74
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
75
+ # @param companyCode [String] The company code of the company that recorded this transaction
76
+ # @param transactionCode [String] The transaction code to adjust
77
+ # @param documentType [String] (Optional): The document type of the transaction to adjust. (See DocumentType::* for a list of allowable values)
78
+ # @param include [String] Specifies objects to include in this fetch call
79
+ # @param model [Object] The adjustment you wish to make
80
+ # @return [Object]
81
+ def adjust_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
82
+ post(path, model, options) end
83
+
84
+ # Get audit information about a transaction
85
+ #
86
+ # Retrieve audit information about a transaction stored in AvaTax.
87
+ #
88
+ # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
89
+ # information includes the following:
90
+ #
91
+ # * The `CompanyId` of the company that created the transaction
92
+ # * The server timestamp representing the exact server time when the transaction was created
93
+ # * The server duration - how long it took to process this transaction
94
+ # * Whether exact API call details were logged
95
+ # * A reconstructed API call showing what the original CreateTransaction call looked like
96
+ #
97
+ # This API can be used to examine information about a previously created transaction.
98
+ #
99
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
100
+ # sales, purchases, inventory transfer, and returns (also called refunds).
101
+ #
102
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
103
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
104
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
105
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
106
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
107
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
108
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
109
+ #
110
+ # ### Security Policies
111
+ #
112
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
113
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
114
+ # @param companyCode [String] The code identifying the company that owns this transaction
115
+ # @param transactionCode [String] The code identifying the transaction
116
+ # @return [Object]
117
+ def audit_transaction(companyCode, transactionCode) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
118
+ get(path) end
119
+
120
+ # Get audit information about a transaction
121
+ #
122
+ # Retrieve audit information about a transaction stored in AvaTax.
123
+ #
124
+ # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
125
+ # information includes the following:
126
+ #
127
+ # * The `CompanyId` of the company that created the transaction
128
+ # * The server timestamp representing the exact server time when the transaction was created
129
+ # * The server duration - how long it took to process this transaction
130
+ # * Whether exact API call details were logged
131
+ # * A reconstructed API call showing what the original CreateTransaction call looked like
132
+ #
133
+ # This API can be used to examine information about a previously created transaction.
134
+ #
135
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
136
+ # sales, purchases, inventory transfer, and returns (also called refunds).
137
+ #
138
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
139
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
140
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
141
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
142
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
143
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
144
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
145
+ #
146
+ # ### Security Policies
147
+ #
148
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
149
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
150
+ # @param companyCode [String] The code identifying the company that owns this transaction
151
+ # @param transactionCode [String] The code identifying the transaction
152
+ # @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
153
+ # @return [Object]
154
+ def audit_transaction_with_type(companyCode, transactionCode, documentType) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
155
+ get(path) end
156
+
157
+ # Lock a set of documents
158
+ #
159
+ # This API is available by invitation only.
160
+ #
161
+ # Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
162
+ # After this API call succeeds, documents will be locked and can't be voided.
163
+ #
164
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
165
+ # sales, purchases, inventory transfer, and returns (also called refunds).
166
+ #
167
+ # ### Security Policies
168
+ #
169
+ # * This API requires the user role Compliance Root User.
170
+ # * 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.
171
+ # @param model [Object] bulk lock request
172
+ # @return [Object]
173
+ def bulk_lock_transaction(model) path = "/api/v2/transactions/lock"
174
+ post(path, model) end
175
+
176
+ # Change a transaction's code
177
+ #
178
+ # Renames a transaction uniquely identified by this URL by changing its `code` value.
179
+ #
180
+ # This API is available as long as the transaction is in `saved` or `posted` status. When a transaction
181
+ # is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method.
182
+ #
183
+ # After this API call succeeds, the transaction will have a new URL matching its new `code`.
184
+ #
185
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
186
+ #
187
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
188
+ # sales, purchases, inventory transfer, and returns (also called refunds).
189
+ #
190
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
191
+ #
192
+ # * Lines
193
+ # * Details (implies lines)
194
+ # * Summary (implies details)
195
+ # * Addresses
196
+ # * SummaryOnly (omit lines and details - reduces API response size)
197
+ # * LinesOnly (omit details - reduces API response size)
198
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
199
+ #
200
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
201
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
202
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
203
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
204
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
205
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
206
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
207
+ #
208
+ # ### Security Policies
209
+ #
210
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
211
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
212
+ # @param companyCode [String] The company code of the company that recorded this transaction
213
+ # @param transactionCode [String] The transaction code to change
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)
215
+ # @param include [String] Specifies objects to include in this fetch call
216
+ # @param model [Object] The code change request you wish to execute
217
+ # @return [Object]
218
+ def change_transaction_code(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
219
+ post(path, model, options) end
220
+
221
+ # Commit a transaction for reporting
222
+ #
223
+ # Marks a transaction by changing its status to `Committed`.
224
+ #
225
+ # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
226
+ #
227
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
228
+ # sales, purchases, inventory transfer, and returns (also called refunds).
229
+ #
230
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
231
+ #
232
+ # Any changes made to a committed transaction will generate a transaction history.
233
+ #
234
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
235
+ #
236
+ # * Lines
237
+ # * Details (implies lines)
238
+ # * Summary (implies details)
239
+ # * Addresses
240
+ # * SummaryOnly (omit lines and details - reduces API response size)
241
+ # * LinesOnly (omit details - reduces API response size)
242
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
243
+ #
244
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
245
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
246
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
247
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
248
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
249
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
250
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
251
+ #
252
+ # ### Security Policies
253
+ #
254
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
255
+ # @param companyCode [String] The company code of the company that recorded this transaction
256
+ # @param transactionCode [String] The transaction code to commit
257
+ # @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)
258
+ # @param include [String] Specifies objects to include in this fetch call
259
+ # @param model [Object] The commit request you wish to execute
260
+ # @return [Object]
261
+ def commit_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
262
+ post(path, model, options) end
263
+
264
+ # Create or adjust a transaction
265
+ #
266
+ # Records a new transaction or adjust an existing transaction in AvaTax.
267
+ #
268
+ # The `CreateOrAdjustTransaction` endpoint is used to create a new transaction or update an existing one. This API
269
+ # can help you create an idempotent service that creates transactions
270
+ # If there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
271
+ # in the input transaction.
272
+ #
273
+ # The `CreateOrAdjustTransaction` API cannot modify any transaction that has been reported to a tax authority using
274
+ # the Avalara Managed Returns Service or any other tax filing service. If you call this API to attempt to modify
275
+ # a transaction that has been reported on a tax filing, you will receive the error `CannotModifyLockedTransaction`.
276
+ #
277
+ # To generate a refund for a transaction, use the `RefundTransaction` API.
278
+ #
279
+ # If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database.
280
+ #
281
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
282
+ # sales, purchases, inventory transfer, and returns (also called refunds).
283
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
284
+ #
285
+ # * Lines
286
+ # * Details (implies lines)
287
+ # * Summary (implies details)
288
+ # * Addresses
289
+ # * SummaryOnly (omit lines and details - reduces API response size)
290
+ # * LinesOnly (omit details - reduces API response size)
291
+ # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
292
+ #
293
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
294
+ #
295
+ # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
296
+ # * \_-ava2f-\_
297
+ # * \_-ava2b-\_
298
+ # * \_-ava3f-\_
299
+ #
300
+ # ### Security Policies
301
+ #
302
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
303
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
304
+ # @param include [String] Specifies objects to include in the response after transaction is created
305
+ # @param model [Object] The transaction you wish to create or adjust
306
+ # @return [Object]
307
+ def create_or_adjust_transaction(model, options={}) path = "/api/v2/transactions/createoradjust"
308
+ post(path, model, options) end
309
+
310
+ # Create a new transaction
311
+ #
312
+ # Records a new transaction in AvaTax.
313
+ #
314
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
315
+ # sales, purchases, inventory transfer, and returns (also called refunds).
316
+ #
317
+ # The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules
318
+ # and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your
319
+ # company's configuration and the data provided in this API call.
320
+ #
321
+ # The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To
322
+ # avoid this error, use the `CreateOrAdjustTransaction` API - it will create the transaction if it does not exist, or
323
+ # update it if it does exist.
324
+ #
325
+ # To generate a refund for a transaction, use the `RefundTransaction` API.
326
+ #
327
+ # The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
328
+ # a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
329
+ #
330
+ # The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
331
+ # provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
332
+ # information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
333
+ # using the best available address location information.
334
+ #
335
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
336
+ #
337
+ # * Lines
338
+ # * Details (implies lines)
339
+ # * Summary (implies details)
340
+ # * Addresses
341
+ # * SummaryOnly (omit lines and details - reduces API response size)
342
+ # * LinesOnly (omit details - reduces API response size)
343
+ # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
344
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
345
+ #
346
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
347
+ #
348
+ # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
349
+ # * \_-ava2f-\_
350
+ # * \_-ava2b-\_
351
+ # * \_-ava3f-\_
352
+ #
353
+ # ### Security Policies
354
+ #
355
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
356
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
357
+ # @param include [String] Specifies objects to include in the response after transaction is created
358
+ # @param model [Object] The transaction you wish to create
359
+ # @return [Object]
360
+ def create_transaction(model, options={}) path = "/api/v2/transactions/create"
361
+ post(path, model, options) end
362
+
363
+ # Remove lines from an existing unlocked transaction
364
+ #
365
+ # Remove lines to an existing unlocked transaction.
366
+ #
367
+ # The `DeleteLines` API allows you to remove transaction lines from existing unlocked transaction, so that customer will
368
+ # be able to delete transaction lines and adjust original transaction the way they like
369
+ #
370
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
371
+ # sales, purchases, inventory transfer, and returns (also called refunds).
372
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
373
+ #
374
+ # * Lines
375
+ # * Details (implies lines)
376
+ # * Summary (implies details)
377
+ # * Addresses
378
+ # * SummaryOnly (omit lines and details - reduces API response size)
379
+ # * LinesOnly (omit details - reduces API response size)
380
+ #
381
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
382
+ #
383
+ # ### Security Policies
384
+ #
385
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
386
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
387
+ # @param include [String] Specifies objects to include in the response after transaction is created
388
+ # @param model [Object] information about the transaction and lines to be removed
389
+ # @return [Object]
390
+ def delete_lines(model, options={}) path = "/api/v2/companies/transactions/lines/delete"
391
+ post(path, model, options) end
392
+
393
+ # Retrieve a single transaction by code
394
+ #
395
+ # Get the current transaction identified by this company code, transaction code, and document type.
396
+ #
397
+ # A transaction is uniquely identified by `companyCode`, `code` (often called Transaction Code), and `documentType`.
398
+ #
399
+ # For compatibility purposes, when this API finds multiple transactions with the same transaction code, and if you have not specified
400
+ # the `type` parameter to this API, it will default to selecting the `SalesInvoices` transaction. To change this behavior, use the
401
+ # optional `documentType` parameter to specify the specific document type you wish to find.
402
+ #
403
+ # If this transaction was adjusted, the return value of this API will be the current transaction with this code.
404
+ #
405
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
406
+ #
407
+ # * Lines
408
+ # * Details (implies lines)
409
+ # * Summary (implies details)
410
+ # * Addresses
411
+ # * SummaryOnly (omit lines and details - reduces API response size)
412
+ # * LinesOnly (omit details - reduces API response size)
413
+ #
414
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
415
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
416
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
417
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
418
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
419
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
420
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
421
+ #
422
+ # ### Security Policies
423
+ #
424
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
425
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
426
+ # @param companyCode [String] The company code of the company that recorded this transaction
427
+ # @param transactionCode [String] The transaction code to retrieve
428
+ # @param documentType [String] (Optional): The document type of the transaction to retrieve (See DocumentType::* for a list of allowable values)
429
+ # @param include [String] Specifies objects to include in this fetch call
430
+ # @return [Object]
431
+ def get_transaction_by_code(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
432
+ get(path, options) end
433
+
434
+ # Retrieve a single transaction by code
435
+ #
436
+ # DEPRECATED: Please use the `GetTransactionByCode` API instead.
437
+ #
438
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
439
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
440
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
441
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
442
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
443
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
444
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
445
+ #
446
+ # ### Security Policies
447
+ #
448
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
449
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
450
+ # @param companyCode [String] The company code of the company that recorded this transaction
451
+ # @param transactionCode [String] The transaction code to retrieve
452
+ # @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
453
+ # @param include [String] Specifies objects to include in this fetch call
454
+ # @return [Object]
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
457
+
458
+ # Retrieve a single transaction by ID
459
+ #
460
+ # Get the unique transaction identified by this URL.
461
+ #
462
+ # This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
463
+ # by using the `AdjustTransaction` endpoint.
464
+ #
465
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
466
+ # sales, purchases, inventory transfer, and returns (also called refunds).
467
+ #
468
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
469
+ #
470
+ # * Lines
471
+ # * Details (implies lines)
472
+ # * Summary (implies details)
473
+ # * Addresses
474
+ # * SummaryOnly (omit lines and details - reduces API response size)
475
+ # * LinesOnly (omit details - reduces API response size)
476
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
477
+ #
478
+ # ### Security Policies
479
+ #
480
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
481
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
482
+ # @param id [Integer] The unique ID number of the transaction to retrieve
483
+ # @param include [String] Specifies objects to include in this fetch call
484
+ # @return [Object]
485
+ def get_transaction_by_id(id, options={}) path = "/api/v2/transactions/#{id}"
486
+ get(path, options) end
487
+
488
+ # Retrieve all transactions
489
+ #
490
+ # List all transactions attached to this company.
491
+ #
492
+ # This endpoint is limited to returning 1,000 transactions at a time maximum.
493
+ #
494
+ # When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field
495
+ # criteria, the query will default to looking at only those transactions with `date` in the past 30 days.
496
+ #
497
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
498
+ # sales, purchases, inventory transfer, and returns (also called refunds).
499
+ #
500
+ # 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/) .
501
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
502
+ #
503
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
504
+ #
505
+ # * Lines
506
+ # * Details (implies lines)
507
+ # * Summary (implies details)
508
+ # * Addresses
509
+ # * SummaryOnly (omit lines and details - reduces API response size)
510
+ # * LinesOnly (omit details - reduces API response size)
511
+ #
512
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
513
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
514
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
515
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
516
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
517
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
518
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
519
+ #
520
+ # ### Security Policies
521
+ #
522
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
523
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
524
+ # @param companyCode [String] The company code of the company that recorded this transaction
525
+ # @param dataSourceId [Integer] Optionally filter transactions to those from a specific data source.
526
+ # @param include [String] Specifies objects to include in this fetch call
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:* totalDiscount, lines, addresses, locationTypes, summary, taxDetailsByTaxType, parameters, messages, invoiceMessages, isFakeTransaction
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.
529
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
530
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
531
+ # @return [FetchResult]
532
+ def list_transactions_by_company(companyCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions"
533
+ get(path, options) end
534
+
535
+ # Lock a single transaction
536
+ #
537
+ # Lock a transaction uniquely identified by this URL.
538
+ #
539
+ # This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
540
+ # After this API call succeeds, the document will be locked and can't be voided or adjusted.
541
+ #
542
+ # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
543
+ #
544
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
545
+ #
546
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
547
+ # sales, purchases, inventory transfer, and returns (also called refunds).
548
+ #
549
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
550
+ #
551
+ # * Lines
552
+ # * Details (implies lines)
553
+ # * Summary (implies details)
554
+ # * Addresses
555
+ # * SummaryOnly (omit lines and details - reduces API response size)
556
+ # * LinesOnly (omit details - reduces API response size)
557
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
558
+ #
559
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
560
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
561
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
562
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
563
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
564
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
565
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
566
+ #
567
+ # ### Security Policies
568
+ #
569
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
570
+ # * 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.
571
+ # @param companyCode [String] The company code of the company that recorded this transaction
572
+ # @param transactionCode [String] The transaction code to lock
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)
574
+ # @param include [String] Specifies objects to include in this fetch call
575
+ # @param model [Object] The lock request you wish to execute
576
+ # @return [Object]
577
+ def lock_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
578
+ post(path, model, options) end
579
+
580
+ # Create a refund for a transaction
581
+ #
582
+ # Create a refund for a transaction.
583
+ #
584
+ # The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
585
+ # for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
586
+ # specify individual line items from the original sale for refund.
587
+ #
588
+ # The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
589
+ # was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
590
+ # nexus, or any other setting.
591
+ #
592
+ # This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
593
+ # common refund scenarios:
594
+ #
595
+ # * A full refund of a previous sale
596
+ # * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
597
+ # * Refunding one or more items (lines) from a previous sale
598
+ # * Granting a customer a percentage refund of a previous sale
599
+ #
600
+ # For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
601
+ # create a custom refund transaction.
602
+ #
603
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
604
+ #
605
+ # * Lines
606
+ # * Details (implies lines)
607
+ # * Summary (implies details)
608
+ # * Addresses
609
+ # * SummaryOnly (omit lines and details - reduces API response size)
610
+ # * LinesOnly (omit details - reduces API response size)
611
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
612
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
613
+ #
614
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
615
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
616
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
617
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
618
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
619
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
620
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
621
+ #
622
+ # ### Security Policies
623
+ #
624
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
625
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
626
+ # @param companyCode [String] The code of the company that made the original sale
627
+ # @param transactionCode [String] The transaction code of the original sale
628
+ # @param include [String] Specifies objects to include in the response after transaction is created
629
+ # @param documentType [String] (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
630
+ # @param useTaxDateOverride [Boolean] (Optional): If set to true, processes refund using taxDateOverride rather than taxAmountOverride (Note: taxAmountOverride is not allowed for SST states).
631
+ # @param model [Object] Information about the refund to create
632
+ # @return [Object]
633
+ def refund_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
634
+ post(path, model, options) end
635
+
636
+ # Perform multiple actions on a transaction
637
+ #
638
+ # Performs one or more actions against the current transaction uniquely identified by this URL.
639
+ #
640
+ # The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`.
641
+ #
642
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
643
+ # sales, purchases, inventory transfer, and returns (also called refunds).
644
+ #
645
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
646
+ #
647
+ # This API is available for users who want to execute more than one action at a time.
648
+ #
649
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
650
+ #
651
+ # * Lines
652
+ # * Details (implies lines)
653
+ # * Summary (implies details)
654
+ # * Addresses
655
+ # * SummaryOnly (omit lines and details - reduces API response size)
656
+ # * LinesOnly (omit details - reduces API response size)
657
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
658
+ #
659
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
660
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
661
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
662
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
663
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
664
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
665
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
666
+ #
667
+ # ### Security Policies
668
+ #
669
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
670
+ # @param companyCode [String] The company code of the company that recorded this transaction
671
+ # @param transactionCode [String] The transaction code to settle
672
+ # @param documentType [String] (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
673
+ # @param include [String] Specifies objects to include in this fetch call
674
+ # @param model [Object] The data from an external system to reconcile against AvaTax
675
+ # @return [Object]
676
+ def settle_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
677
+ post(path, model, options) end
678
+
679
+ # Uncommit a transaction for reporting
680
+ #
681
+ # Adjusts a transaction by changing it to an uncommitted status.
682
+ #
683
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
684
+ # no longer available to be uncommitted.
685
+ #
686
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
687
+ #
688
+ # * Lines
689
+ # * Details (implies lines)
690
+ # * Summary (implies details)
691
+ # * Addresses
692
+ # * SummaryOnly (omit lines and details - reduces API response size)
693
+ # * LinesOnly (omit details - reduces API response size)
694
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
695
+ #
696
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
697
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
698
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
699
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
700
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
701
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
702
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
703
+ #
704
+ # ### Security Policies
705
+ #
706
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
707
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
708
+ # @param companyCode [String] The company code of the company that recorded this transaction
709
+ # @param transactionCode [String] The transaction code to Uncommit
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)
711
+ # @param include [String] Specifies objects to include in this fetch call
712
+ # @return [Object]
713
+ def uncommit_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
714
+ post(path, options) end
715
+
716
+ # Unvoids a transaction
717
+ #
718
+ # Unvoids a voided transaction
719
+ #
720
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
721
+ #
722
+ # * Lines
723
+ # * Details (implies lines)
724
+ # * Summary (implies details)
725
+ # * Addresses
726
+ # * SummaryOnly (omit lines and details - reduces API response size)
727
+ # * LinesOnly (omit details - reduces API response size)
728
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
729
+ #
730
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
731
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
732
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
733
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
734
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
735
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
736
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
737
+ #
738
+ # ### Security Policies
739
+ #
740
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
741
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
742
+ # @param companyCode [String] The company code of the company that recorded this transaction
743
+ # @param transactionCode [String] The transaction code to commit
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)
745
+ # @param include [String] Specifies objects to include in this fetch call
746
+ # @return [Object]
747
+ def unvoid_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
748
+ post(path, options) end
749
+
750
+ # Verify a transaction
751
+ #
752
+ # Verifies that the transaction uniquely identified by this URL matches certain expected values.
753
+ #
754
+ # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
755
+ #
756
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
757
+ #
758
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
759
+ # sales, purchases, inventory transfer, and returns (also called refunds).
760
+ #
761
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
762
+ #
763
+ # * Lines
764
+ # * Details (implies lines)
765
+ # * Summary (implies details)
766
+ # * Addresses
767
+ # * SummaryOnly (omit lines and details - reduces API response size)
768
+ # * LinesOnly (omit details - reduces API response size)
769
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
770
+ #
771
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
772
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
773
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
774
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
775
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
776
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
777
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
778
+ #
779
+ # ### Security Policies
780
+ #
781
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
782
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
783
+ # @param companyCode [String] The company code of the company that recorded this transaction
784
+ # @param transactionCode [String] The transaction code to settle
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)
786
+ # @param include [String] Specifies objects to include in this fetch call
787
+ # @param model [Object] The data from an external system to reconcile against AvaTax
788
+ # @return [Object]
789
+ def verify_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
790
+ post(path, model, options) end
791
+
792
+ # Void a transaction
793
+ #
794
+ # Voids the current transaction uniquely identified by this URL.
795
+ #
796
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
797
+ # sales, purchases, inventory transfer, and returns (also called refunds).
798
+ #
799
+ # When you void a transaction, that transaction's status is recorded as `DocVoided`.
800
+ #
801
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
802
+ #
803
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
804
+ #
805
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
806
+ #
807
+ # * Lines
808
+ # * Details (implies lines)
809
+ # * Summary (implies details)
810
+ # * Addresses
811
+ # * SummaryOnly (omit lines and details - reduces API response size)
812
+ # * LinesOnly (omit details - reduces API response size)
813
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
814
+ #
815
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
816
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
817
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
818
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
819
+ # * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
820
+ # * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
821
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
822
+ #
823
+ # ### Security Policies
824
+ #
825
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
826
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
827
+ # @param companyCode [String] The company code of the company that recorded this transaction
828
+ # @param transactionCode [String] The transaction code to void
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)
830
+ # @param include [String] Specifies objects to include in this fetch call
831
+ # @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
832
+ # @return [Object]
833
+ def void_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
834
+ post(path, model, options) end
835
+ end
836
+ end
792
837
  end