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