avatax 20.1.0 → 20.9.0

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