avatax 19.12.0 → 20.7.0

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