avatax 20.1.0 → 20.9.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,311 +1,391 @@
|
|
1
|
-
module AvaTax
|
2
|
-
class Client
|
3
|
-
module MultiDocument
|
4
|
-
|
5
|
-
|
6
|
-
# Adjust a MultiDocument transaction
|
7
|
-
#
|
8
|
-
# Adjusts the current MultiDocument transaction uniquely identified by this URL.
|
9
|
-
#
|
10
|
-
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
11
|
-
# sales, purchases, inventory transfer, and returns (also called refunds).
|
12
|
-
#
|
13
|
-
# When you adjust a transaction, that transaction's status is recorded as `Adjusted`.
|
14
|
-
#
|
15
|
-
# Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service.
|
16
|
-
#
|
17
|
-
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
# *
|
22
|
-
# *
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# *
|
51
|
-
# *
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
#
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
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
|
-
# a MultiDocument transaction
|
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
|
-
# This
|
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
|
-
|
1
|
+
module AvaTax
|
2
|
+
class Client
|
3
|
+
module MultiDocument
|
4
|
+
|
5
|
+
|
6
|
+
# Adjust a MultiDocument transaction
|
7
|
+
#
|
8
|
+
# Adjusts the current MultiDocument transaction uniquely identified by this URL.
|
9
|
+
#
|
10
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
11
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
12
|
+
#
|
13
|
+
# When you adjust a transaction, that transaction's status is recorded as `Adjusted`.
|
14
|
+
#
|
15
|
+
# Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service.
|
16
|
+
#
|
17
|
+
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.
|
18
|
+
#
|
19
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
20
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
21
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
22
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
23
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
24
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
25
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
26
|
+
#
|
27
|
+
# ### Security Policies
|
28
|
+
#
|
29
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
30
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
31
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
32
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
33
|
+
# @param include [String] Specifies objects to include in this fetch call
|
34
|
+
# @param model [Object] The adjust request you wish to execute
|
35
|
+
# @return [Object]
|
36
|
+
def adjust_multi_document_transaction(code, type, model, options={}) path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/adjust"
|
37
|
+
post(path, model, options) end
|
38
|
+
|
39
|
+
# Get audit information about a MultiDocument transaction
|
40
|
+
#
|
41
|
+
# Retrieve audit information about a MultiDocument transaction stored in AvaTax.
|
42
|
+
#
|
43
|
+
# The audit API retrieves audit information related to a specific MultiDocument transaction. This audit
|
44
|
+
# information includes the following:
|
45
|
+
#
|
46
|
+
# * The `code` of the MultiDocument transaction
|
47
|
+
# * The `type` of the MultiDocument transaction
|
48
|
+
# * The server timestamp representing the exact server time when the transaction was created
|
49
|
+
# * The server duration - how long it took to process this transaction
|
50
|
+
# * Whether exact API call details were logged
|
51
|
+
# * A reconstructed API call showing what the original create call looked like
|
52
|
+
#
|
53
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
54
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
55
|
+
#
|
56
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
57
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
58
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
59
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
60
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
61
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
62
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
63
|
+
#
|
64
|
+
# ### Security Policies
|
65
|
+
#
|
66
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
67
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
68
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
69
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
70
|
+
# @return [Object]
|
71
|
+
def audit_multi_document_transaction(code, type) path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/audit"
|
72
|
+
get(path) end
|
73
|
+
|
74
|
+
# Commit a MultiDocument transaction
|
75
|
+
#
|
76
|
+
# Marks a list of transactions by changing its status to `Committed`.
|
77
|
+
#
|
78
|
+
# Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
|
79
|
+
#
|
80
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
81
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
82
|
+
#
|
83
|
+
# Any changes made to a committed transaction will generate a transaction history.
|
84
|
+
#
|
85
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
86
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
87
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
88
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
89
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
90
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
91
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
92
|
+
#
|
93
|
+
# ### Security Policies
|
94
|
+
#
|
95
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
|
96
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
97
|
+
# @param model [Object] The commit request you wish to execute
|
98
|
+
# @return [Object]
|
99
|
+
def commit_multi_document_transaction(model) path = "/api/v2/transactions/multidocument/commit"
|
100
|
+
post(path, model) end
|
101
|
+
|
102
|
+
# Create a new MultiDocument transaction
|
103
|
+
#
|
104
|
+
# Records a new MultiDocument transaction in AvaTax.
|
105
|
+
#
|
106
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
107
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
108
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
109
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
110
|
+
#
|
111
|
+
# This API will report an error if you attempt to create a transaction when one already exists with the specified `code`.
|
112
|
+
# If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust`
|
113
|
+
# value to `true`.
|
114
|
+
#
|
115
|
+
# To generate a refund for a transaction, use the `RefundTransaction` API.
|
116
|
+
#
|
117
|
+
# The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
|
118
|
+
# a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
|
119
|
+
#
|
120
|
+
# The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
|
121
|
+
# provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
|
122
|
+
# information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
|
123
|
+
# using the best available address location information.
|
124
|
+
#
|
125
|
+
# 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:
|
126
|
+
#
|
127
|
+
# * Lines
|
128
|
+
# * Details (implies lines)
|
129
|
+
# * Summary (implies details)
|
130
|
+
# * Addresses
|
131
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
132
|
+
# * LinesOnly (omit details - reduces API response size)
|
133
|
+
# * 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.
|
134
|
+
#
|
135
|
+
# If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
|
136
|
+
#
|
137
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
138
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
139
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
140
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
141
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
142
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
143
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
144
|
+
#
|
145
|
+
# ### Security Policies
|
146
|
+
#
|
147
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
148
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
149
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
150
|
+
# @param model [Object] the multi document transaction model
|
151
|
+
# @return [Object]
|
152
|
+
def create_multi_document_transaction(model, options={}) path = "/api/v2/transactions/multidocument"
|
153
|
+
post(path, model, options) end
|
154
|
+
|
155
|
+
# Retrieve a MultiDocument transaction
|
156
|
+
#
|
157
|
+
# Get the current MultiDocument transaction identified by this URL.
|
158
|
+
#
|
159
|
+
# If this transaction was adjusted, the return value of this API will be the current transaction with this code.
|
160
|
+
#
|
161
|
+
# 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:
|
162
|
+
#
|
163
|
+
# * Lines
|
164
|
+
# * Details (implies lines)
|
165
|
+
# * Summary (implies details)
|
166
|
+
# * Addresses
|
167
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
168
|
+
# * LinesOnly (omit details - reduces API response size)
|
169
|
+
#
|
170
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
171
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
172
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
173
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
174
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
175
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
176
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
177
|
+
#
|
178
|
+
# ### Security Policies
|
179
|
+
#
|
180
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
181
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
182
|
+
# @param code [String]
|
183
|
+
# @param type [String] (See DocumentType::* for a list of allowable values)
|
184
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
185
|
+
# @return [Object]
|
186
|
+
def get_multi_document_transaction_by_code_and_type(code, type, options={}) path = "/api/v2/transactions/multidocument/#{code}/type/#{type}"
|
187
|
+
get(path, options) end
|
188
|
+
|
189
|
+
# Retrieve a MultiDocument transaction by ID
|
190
|
+
#
|
191
|
+
# Get the unique MultiDocument transaction identified by this URL.
|
192
|
+
#
|
193
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
194
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
195
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
196
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
197
|
+
#
|
198
|
+
# This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
|
199
|
+
# by using the `AdjustTransaction` endpoint.
|
200
|
+
#
|
201
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
202
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
203
|
+
#
|
204
|
+
# 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:
|
205
|
+
#
|
206
|
+
# * Lines
|
207
|
+
# * Details (implies lines)
|
208
|
+
# * Summary (implies details)
|
209
|
+
# * Addresses
|
210
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
211
|
+
# * LinesOnly (omit details - reduces API response size)
|
212
|
+
#
|
213
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
214
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
215
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
216
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
217
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
218
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
219
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
220
|
+
#
|
221
|
+
# ### Security Policies
|
222
|
+
#
|
223
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
224
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
225
|
+
# @param id [Integer] The unique ID number of the MultiDocument transaction to retrieve
|
226
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
227
|
+
# @return [Object]
|
228
|
+
def get_multi_document_transaction_by_id(id, options={}) path = "/api/v2/transactions/multidocument/#{id}"
|
229
|
+
get(path, options) end
|
230
|
+
|
231
|
+
# Retrieve all MultiDocument transactions
|
232
|
+
#
|
233
|
+
# List all MultiDocument transactions within this account.
|
234
|
+
#
|
235
|
+
# This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument
|
236
|
+
# transactions, please use the pagination features of the API.
|
237
|
+
#
|
238
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
239
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
240
|
+
#
|
241
|
+
# 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/) .
|
242
|
+
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
|
243
|
+
#
|
244
|
+
# 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:
|
245
|
+
#
|
246
|
+
# * Lines
|
247
|
+
# * Details (implies lines)
|
248
|
+
# * Summary (implies details)
|
249
|
+
# * Addresses
|
250
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
251
|
+
# * LinesOnly (omit details - reduces API response size)
|
252
|
+
#
|
253
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
254
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
255
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
256
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
257
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
258
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
259
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
260
|
+
#
|
261
|
+
# ### Security Policies
|
262
|
+
#
|
263
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
264
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
265
|
+
# @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:* documents
|
266
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
267
|
+
# @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.
|
268
|
+
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
269
|
+
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
270
|
+
# @return [FetchResult]
|
271
|
+
def list_multi_document_transactions(options={}) path = "/api/v2/transactions/multidocument"
|
272
|
+
get(path, options) end
|
273
|
+
|
274
|
+
# Create a refund for a MultiDocument transaction
|
275
|
+
#
|
276
|
+
# Create a refund for a MultiDocument transaction.
|
277
|
+
#
|
278
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
279
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
280
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
281
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
282
|
+
#
|
283
|
+
# The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
|
284
|
+
# for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
|
285
|
+
# specify individual line items from the original sale for refund.
|
286
|
+
#
|
287
|
+
# The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
|
288
|
+
# was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
|
289
|
+
# nexus, or any other setting.
|
290
|
+
#
|
291
|
+
# This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
|
292
|
+
# common refund scenarios:
|
293
|
+
#
|
294
|
+
# * A full refund of a previous sale
|
295
|
+
# * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
|
296
|
+
# * Refunding one or more items (lines) from a previous sale
|
297
|
+
# * Granting a customer a percentage refund of a previous sale
|
298
|
+
#
|
299
|
+
# For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
|
300
|
+
# create a custom refund transaction.
|
301
|
+
#
|
302
|
+
# 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:
|
303
|
+
#
|
304
|
+
# * Lines
|
305
|
+
# * Details (implies lines)
|
306
|
+
# * Summary (implies details)
|
307
|
+
# * Addresses
|
308
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
309
|
+
# * LinesOnly (omit details - reduces API response size)
|
310
|
+
#
|
311
|
+
# If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
|
312
|
+
#
|
313
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
314
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
315
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
316
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
317
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
318
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
319
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
320
|
+
#
|
321
|
+
# ### Security Policies
|
322
|
+
#
|
323
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
324
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
325
|
+
# @param code [String] The code of this MultiDocument transaction
|
326
|
+
# @param type [String] The type of this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
327
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
328
|
+
# @param model [Object] Information about the refund to create
|
329
|
+
# @return [Object]
|
330
|
+
def refund_multi_document_transaction(code, type, model, options={}) path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/refund"
|
331
|
+
post(path, model, options) end
|
332
|
+
|
333
|
+
# Verify a MultiDocument transaction
|
334
|
+
#
|
335
|
+
# Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values.
|
336
|
+
#
|
337
|
+
# If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
|
338
|
+
#
|
339
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
340
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
341
|
+
#
|
342
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
343
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
344
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
345
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
346
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
347
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
348
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
349
|
+
#
|
350
|
+
# ### Security Policies
|
351
|
+
#
|
352
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
353
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
354
|
+
# @param model [Object] Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax
|
355
|
+
# @return [Object]
|
356
|
+
def verify_multi_document_transaction(model) path = "/api/v2/transactions/multidocument/verify"
|
357
|
+
post(path, model) end
|
358
|
+
|
359
|
+
# Void a MultiDocument transaction
|
360
|
+
#
|
361
|
+
# Voids the current transaction uniquely identified by this URL.
|
362
|
+
#
|
363
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
364
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
365
|
+
#
|
366
|
+
# When you void a transaction, that transaction's status is recorded as `DocVoided`.
|
367
|
+
#
|
368
|
+
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`,
|
369
|
+
# and they are no longer available to be voided.
|
370
|
+
#
|
371
|
+
# NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
|
372
|
+
# * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
|
373
|
+
# * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
|
374
|
+
# * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
|
375
|
+
# * Replace '%' with '\_-ava25-\_' For example: document%Code becomes document_-ava25-_Code
|
376
|
+
# * Replace '#' with '\_-ava23-\_' For example: document#Code becomes document_-ava23-_Code
|
377
|
+
# * Replace ' ' with '%20' For example: document Code becomes document%20Code
|
378
|
+
#
|
379
|
+
# ### Security Policies
|
380
|
+
#
|
381
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
|
382
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
383
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
384
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
385
|
+
# @param model [Object] The void request you wish to execute
|
386
|
+
# @return [Object]
|
387
|
+
def void_multi_document_transaction(code, type, model) path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/void"
|
388
|
+
post(path, model) end
|
389
|
+
end
|
390
|
+
end
|
311
391
|
end
|