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