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