avatax 19.12.0 → 20.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,59 +1,59 @@
1
- module AvaTax
2
- class Client
3
- module FundingRequests
4
-
5
-
6
- # Request the javascript for a funding setup widget
7
- #
8
- # This API is available by invitation only.
9
- # Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are
10
- # required to setup their funding configuration before Avalara can begin filing tax returns on their
11
- # behalf.
12
- # Funding configuration for each company is set up by submitting a funding setup request, which can
13
- # be sent either via email or via an embedded HTML widget.
14
- # When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members
15
- # before approval.
16
- # This API returns back the actual javascript code to insert into your application to render the
17
- # JavaScript funding setup widget inline.
18
- # Use the 'methodReturn.javaScript' return value to insert this widget into your HTML page.
19
- # This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
20
- #
21
- # ### Security Policies
22
- #
23
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
24
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
25
- # @param id [Integer] The unique ID number of this funding request
26
- # @return [Object]
27
- def activate_funding_request(id)
28
- path = "/api/v2/fundingrequests/#{id}/widget"
29
- get(path)
30
- end
31
-
32
-
33
- # Retrieve status about a funding setup request
34
- #
35
- # This API is available by invitation only.
36
- # Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are
37
- # required to setup their funding configuration before Avalara can begin filing tax returns on their
38
- # behalf.
39
- # Funding configuration for each company is set up by submitting a funding setup request, which can
40
- # be sent either via email or via an embedded HTML widget.
41
- # When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members
42
- # before approval.
43
- # This API checks the status on an existing funding request.
44
- # This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
45
- #
46
- # ### Security Policies
47
- #
48
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
49
- # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
50
- # @param id [Integer] The unique ID number of this funding request
51
- # @return [Object]
52
- def funding_request_status(id)
53
- path = "/api/v2/fundingrequests/#{id}"
54
- get(path)
55
- end
56
-
57
- end
58
- end
1
+ module AvaTax
2
+ class Client
3
+ module FundingRequests
4
+
5
+
6
+ # Request the javascript for a funding setup widget
7
+ #
8
+ # This API is available by invitation only.
9
+ # Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are
10
+ # required to setup their funding configuration before Avalara can begin filing tax returns on their
11
+ # behalf.
12
+ # Funding configuration for each company is set up by submitting a funding setup request, which can
13
+ # be sent either via email or via an embedded HTML widget.
14
+ # When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members
15
+ # before approval.
16
+ # This API returns back the actual javascript code to insert into your application to render the
17
+ # JavaScript funding setup widget inline.
18
+ # Use the 'methodReturn.javaScript' return value to insert this widget into your HTML page.
19
+ # This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
20
+ #
21
+ # ### Security Policies
22
+ #
23
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
24
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
25
+ # @param id [Integer] The unique ID number of this funding request
26
+ # @return [Object]
27
+ def activate_funding_request(id)
28
+ path = "/api/v2/fundingrequests/#{id}/widget"
29
+ get(path)
30
+ end
31
+
32
+
33
+ # Retrieve status about a funding setup request
34
+ #
35
+ # This API is available by invitation only.
36
+ # Companies that use the Avalara Managed Returns or the SST Certified Service Provider services are
37
+ # required to setup their funding configuration before Avalara can begin filing tax returns on their
38
+ # behalf.
39
+ # Funding configuration for each company is set up by submitting a funding setup request, which can
40
+ # be sent either via email or via an embedded HTML widget.
41
+ # When the funding configuration is submitted to Avalara, it will be reviewed by treasury team members
42
+ # before approval.
43
+ # This API checks the status on an existing funding request.
44
+ # This API requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
45
+ #
46
+ # ### Security Policies
47
+ #
48
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
49
+ # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
50
+ # @param id [Integer] The unique ID number of this funding request
51
+ # @return [Object]
52
+ def funding_request_status(id)
53
+ path = "/api/v2/fundingrequests/#{id}"
54
+ get(path)
55
+ end
56
+
57
+ end
58
+ end
59
59
  end
@@ -1,481 +1,481 @@
1
- module AvaTax
2
- class Client
3
- module Items
4
-
5
-
6
- # Delete all classifications for an item
7
- #
8
- # Delete all the classifications for a given item.
9
- #
10
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
11
- #
12
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
13
- #
14
- # ### Security Policies
15
- #
16
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
17
- # @param companyId [Integer] The ID of the company that owns this item.
18
- # @param itemId [Integer] The ID of the item you wish to delete the classifications.
19
- # @return [ErrorDetail[]]
20
- def batch_delete_item_classifications(companyId, itemId)
21
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
22
- delete(path)
23
- end
24
-
25
-
26
- # Delete all parameters for an item
27
- #
28
- # Delete all the parameters for a given item.
29
- #
30
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
31
- #
32
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
33
- #
34
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
35
- #
36
- # ### Security Policies
37
- #
38
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
39
- # @param companyId [Integer] The ID of the company that owns this item.
40
- # @param itemId [Integer] The ID of the item you wish to delete the parameters.
41
- # @return [ErrorDetail[]]
42
- def batch_delete_item_parameters(companyId, itemId)
43
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
44
- delete(path)
45
- end
46
-
47
-
48
- # Add classifications to an item.
49
- #
50
- # Add classifications to an item.
51
- #
52
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
53
- #
54
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
55
- #
56
- # An item may only have one classification per tax system.
57
- #
58
- # ### Security Policies
59
- #
60
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
61
- # @param companyId [Integer] The company id.
62
- # @param itemId [Integer] The item id.
63
- # @param model [ItemClassificationInputModel[]] The item classifications you wish to create.
64
- # @return [ItemClassificationOutputModel[]]
65
- def create_item_classifications(companyId, itemId, model)
66
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
67
- post(path, model)
68
- end
69
-
70
-
71
- # Add parameters to an item.
72
- #
73
- # Add parameters to an item.
74
- #
75
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
76
- #
77
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
78
- #
79
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
80
- #
81
- # To see available parameters for this item, call `/api/v2/definitions/parameters?$filter=attributeType eq Product`
82
- #
83
- # Some parameters are only available for use if you have subscribed to specific AvaTax services. To see which parameters you are able to use, add the query parameter "$showSubscribed=true" to the parameter definition call above.
84
- #
85
- # ### Security Policies
86
- #
87
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
88
- # @param companyId [Integer] The ID of the company that owns this item parameter.
89
- # @param itemId [Integer] The item id.
90
- # @param model [ItemParameterModel[]] The item parameters you wish to create.
91
- # @return [ItemParameterModel[]]
92
- def create_item_parameters(companyId, itemId, model)
93
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
94
- post(path, model)
95
- end
96
-
97
-
98
- # Create a new item
99
- #
100
- # Creates one or more new item objects attached to this company.
101
- #
102
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
103
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
104
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
105
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
106
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
107
- #
108
- # The tax code takes precedence over the tax code id if both are provided.
109
- #
110
- # ### Security Policies
111
- #
112
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
113
- # @param companyId [Integer] The ID of the company that owns this item.
114
- # @param model [ItemModel[]] The item you wish to create.
115
- # @return [ItemModel[]]
116
- def create_items(companyId, model)
117
- path = "/api/v2/companies/#{companyId}/items"
118
- post(path, model)
119
- end
120
-
121
-
122
- # Delete a single item
123
- #
124
- # Deletes the item object at this URL.
125
- #
126
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
127
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
128
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
129
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
130
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
131
- #
132
- # Deleting an item will also delete the parameters and classifications associated with that item.
133
- #
134
- # ### Security Policies
135
- #
136
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
137
- # @param companyId [Integer] The ID of the company that owns this item.
138
- # @param id [Integer] The ID of the item you wish to delete.
139
- # @return [ErrorDetail[]]
140
- def delete_item(companyId, id)
141
- path = "/api/v2/companies/#{companyId}/items/#{id}"
142
- delete(path)
143
- end
144
-
145
-
146
- # Delete a single item classification.
147
- #
148
- # Delete a single item classification.
149
- #
150
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
151
- #
152
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
153
- #
154
- # ### Security Policies
155
- #
156
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
157
- # @param companyId [Integer] The company id.
158
- # @param itemId [Integer] The item id.
159
- # @param id [Integer] The item classification id.
160
- # @return [ErrorDetail[]]
161
- def delete_item_classification(companyId, itemId, id)
162
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
163
- delete(path)
164
- end
165
-
166
-
167
- # Delete a single item parameter
168
- #
169
- # Delete a single item parameter.
170
- #
171
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
172
- #
173
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
174
- #
175
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
176
- #
177
- # ### Security Policies
178
- #
179
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
180
- # @param companyId [Integer] The company id
181
- # @param itemId [Integer] The item id
182
- # @param id [Integer] The parameter id
183
- # @return [ErrorDetail[]]
184
- def delete_item_parameter(companyId, itemId, id)
185
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
186
- delete(path)
187
- end
188
-
189
-
190
- # Retrieve a single item
191
- #
192
- # Get the `Item` object identified by this URL.
193
- #
194
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
195
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
196
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
197
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
198
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
199
- #
200
- # ### Security Policies
201
- #
202
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
203
- # @param companyId [Integer] The ID of the company that owns this item object
204
- # @param id [Integer] The primary key of this item
205
- # @param include [String] A comma separated list of additional data to retrieve.
206
- # @return [Object]
207
- def get_item(companyId, id, options={})
208
- path = "/api/v2/companies/#{companyId}/items/#{id}"
209
- get(path, options)
210
- end
211
-
212
-
213
- # Retrieve a single item classification.
214
- #
215
- # Retrieve a single item classification.
216
- #
217
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
218
- #
219
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
220
- #
221
- # ### Security Policies
222
- #
223
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
224
- # @param companyId [Integer] The company id.
225
- # @param itemId [Integer] The item id.
226
- # @param id [Integer] The item classification id.
227
- # @return [Object]
228
- def get_item_classification(companyId, itemId, id)
229
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
230
- get(path)
231
- end
232
-
233
-
234
- # Retrieve a single item parameter
235
- #
236
- # Retrieve a single item parameter.
237
- #
238
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
239
- #
240
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
241
- #
242
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
243
- #
244
- # ### Security Policies
245
- #
246
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
247
- # @param companyId [Integer] The company id
248
- # @param itemId [Integer] The item id
249
- # @param id [Integer] The parameter id
250
- # @return [Object]
251
- def get_item_parameter(companyId, itemId, id)
252
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
253
- get(path)
254
- end
255
-
256
-
257
- # Retrieve classifications for an item.
258
- #
259
- # List classifications for an item.
260
- #
261
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
262
- #
263
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
264
- #
265
- # Search for specific objects using the criteria in the `$filter` classification; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
266
- # Paginate your results using the `$top`, `$skip`, and `$orderby` classifications.
267
- #
268
- # ### Security Policies
269
- #
270
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
271
- # @param companyId [Integer] The company id.
272
- # @param itemId [Integer] The item id.
273
- # @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:* productCode, systemCode
274
- # @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.
275
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
276
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
277
- # @return [FetchResult]
278
- def list_item_classifications(companyId, itemId, options={})
279
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
280
- get(path, options)
281
- end
282
-
283
-
284
- # Retrieve parameters for an item
285
- #
286
- # List parameters for an item.
287
- #
288
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
289
- #
290
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
291
- #
292
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
293
- #
294
- # 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/) .
295
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
296
- #
297
- # ### Security Policies
298
- #
299
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
300
- # @param companyId [Integer] The company id
301
- # @param itemId [Integer] The item id
302
- # @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:* name, unit
303
- # @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.
304
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
305
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
306
- # @return [FetchResult]
307
- def list_item_parameters(companyId, itemId, options={})
308
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
309
- get(path, options)
310
- end
311
-
312
-
313
- # Retrieve items for this company
314
- #
315
- # List all items defined for the current company.
316
- #
317
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
318
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
319
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
320
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
321
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
322
- #
323
- # 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/) .
324
- #
325
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
326
- #
327
- # 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:
328
- #
329
- # * Parameters
330
- # * Classifications
331
- #
332
- # ### Security Policies
333
- #
334
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
335
- # @param companyId [Integer] The ID of the company that defined these items
336
- # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* taxCode, classifications, parameters
337
- # @param include [String] A comma separated list of additional data to retrieve.
338
- # @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.
339
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
340
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
341
- # @return [FetchResult]
342
- def list_items_by_company(companyId, options={})
343
- path = "/api/v2/companies/#{companyId}/items"
344
- get(path, options)
345
- end
346
-
347
-
348
- # Retrieve all items
349
- #
350
- # Get multiple item objects across all companies.
351
- #
352
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
353
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
354
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
355
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
356
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
357
- #
358
- # 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/) .
359
- #
360
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
361
- #
362
- # ### Security Policies
363
- #
364
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
365
- # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* taxCode, classifications, parameters
366
- # @param include [String] A comma separated list of additional data to retrieve.
367
- # @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.
368
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
369
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
370
- # @return [FetchResult]
371
- def query_items(options={})
372
- path = "/api/v2/items"
373
- get(path, options)
374
- end
375
-
376
-
377
- # Sync items from a product catalog
378
- #
379
- # Syncs a list of items with AvaTax without waiting for them to be created. It is ideal for syncing large product catalogs
380
- # with AvaTax.
381
- #
382
- # Any invalid or duplicate items will be ignored. To diagnose why an item is not created, use the normal create transaction API to receive validation information.
383
- #
384
- # This API is currently limited to 1000 items per call (the limit is subject to change).
385
- #
386
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
387
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
388
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
389
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
390
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
391
- #
392
- # ### Security Policies
393
- #
394
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
395
- # @param companyId [Integer] The ID of the company that owns this item.
396
- # @param model [Object] The request object.
397
- # @return [Object]
398
- def sync_items(companyId, model)
399
- path = "/api/v2/companies/#{companyId}/items/sync"
400
- post(path, model)
401
- end
402
-
403
-
404
- # Update a single item
405
- #
406
- # Replace the existing `Item` object at this URL with an updated object.
407
- #
408
- # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
409
- # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
410
- # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
411
- # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
412
- # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
413
- #
414
- # All data from the existing object will be replaced with data in the object you PUT. To set a field's value to null,
415
- # you may either set its value to null or omit that field from the object you post.
416
- #
417
- # The tax code takes precedence over the tax code id if both are provided.
418
- #
419
- # ### Security Policies
420
- #
421
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
422
- # @param companyId [Integer] The ID of the company that this item belongs to.
423
- # @param id [Integer] The ID of the item you wish to update
424
- # @param model [Object] The item object you wish to update.
425
- # @return [Object]
426
- def update_item(companyId, id, model)
427
- path = "/api/v2/companies/#{companyId}/items/#{id}"
428
- put(path, model)
429
- end
430
-
431
-
432
- # Update an item classification.
433
- #
434
- # Update an item classification.
435
- #
436
- # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
437
- #
438
- # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
439
- #
440
- # An item may only have one classification per tax system.
441
- #
442
- # ### Security Policies
443
- #
444
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
445
- # @param companyId [Integer] The company id.
446
- # @param itemId [Integer] The item id.
447
- # @param id [Integer] The item classification id.
448
- # @param model [Object] The item object you wish to update.
449
- # @return [Object]
450
- def update_item_classification(companyId, itemId, id, model)
451
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
452
- put(path, model)
453
- end
454
-
455
-
456
- # Update an item parameter
457
- #
458
- # Update an item parameter.
459
- #
460
- # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
461
- #
462
- # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
463
- #
464
- # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
465
- #
466
- # ### Security Policies
467
- #
468
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
469
- # @param companyId [Integer] The company id.
470
- # @param itemId [Integer] The item id
471
- # @param id [Integer] The item parameter id
472
- # @param model [Object] The item object you wish to update.
473
- # @return [Object]
474
- def update_item_parameter(companyId, itemId, id, model)
475
- path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
476
- put(path, model)
477
- end
478
-
479
- end
480
- end
1
+ module AvaTax
2
+ class Client
3
+ module Items
4
+
5
+
6
+ # Delete all classifications for an item
7
+ #
8
+ # Delete all the classifications for a given item.
9
+ #
10
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
11
+ #
12
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
13
+ #
14
+ # ### Security Policies
15
+ #
16
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
17
+ # @param companyId [Integer] The ID of the company that owns this item.
18
+ # @param itemId [Integer] The ID of the item you wish to delete the classifications.
19
+ # @return [ErrorDetail[]]
20
+ def batch_delete_item_classifications(companyId, itemId)
21
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
22
+ delete(path)
23
+ end
24
+
25
+
26
+ # Delete all parameters for an item
27
+ #
28
+ # Delete all the parameters for a given item.
29
+ #
30
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
31
+ #
32
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
33
+ #
34
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
35
+ #
36
+ # ### Security Policies
37
+ #
38
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
39
+ # @param companyId [Integer] The ID of the company that owns this item.
40
+ # @param itemId [Integer] The ID of the item you wish to delete the parameters.
41
+ # @return [ErrorDetail[]]
42
+ def batch_delete_item_parameters(companyId, itemId)
43
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
44
+ delete(path)
45
+ end
46
+
47
+
48
+ # Add classifications to an item.
49
+ #
50
+ # Add classifications to an item.
51
+ #
52
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
53
+ #
54
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
55
+ #
56
+ # An item may only have one classification per tax system.
57
+ #
58
+ # ### Security Policies
59
+ #
60
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
61
+ # @param companyId [Integer] The company id.
62
+ # @param itemId [Integer] The item id.
63
+ # @param model [ItemClassificationInputModel[]] The item classifications you wish to create.
64
+ # @return [ItemClassificationOutputModel[]]
65
+ def create_item_classifications(companyId, itemId, model)
66
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
67
+ post(path, model)
68
+ end
69
+
70
+
71
+ # Add parameters to an item.
72
+ #
73
+ # Add parameters to an item.
74
+ #
75
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
76
+ #
77
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
78
+ #
79
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
80
+ #
81
+ # To see available parameters for this item, call `/api/v2/definitions/parameters?$filter=attributeType eq Product`
82
+ #
83
+ # Some parameters are only available for use if you have subscribed to specific AvaTax services. To see which parameters you are able to use, add the query parameter "$showSubscribed=true" to the parameter definition call above.
84
+ #
85
+ # ### Security Policies
86
+ #
87
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
88
+ # @param companyId [Integer] The ID of the company that owns this item parameter.
89
+ # @param itemId [Integer] The item id.
90
+ # @param model [ItemParameterModel[]] The item parameters you wish to create.
91
+ # @return [ItemParameterModel[]]
92
+ def create_item_parameters(companyId, itemId, model)
93
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
94
+ post(path, model)
95
+ end
96
+
97
+
98
+ # Create a new item
99
+ #
100
+ # Creates one or more new item objects attached to this company.
101
+ #
102
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
103
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
104
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
105
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
106
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
107
+ #
108
+ # The tax code takes precedence over the tax code id if both are provided.
109
+ #
110
+ # ### Security Policies
111
+ #
112
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
113
+ # @param companyId [Integer] The ID of the company that owns this item.
114
+ # @param model [ItemModel[]] The item you wish to create.
115
+ # @return [ItemModel[]]
116
+ def create_items(companyId, model)
117
+ path = "/api/v2/companies/#{companyId}/items"
118
+ post(path, model)
119
+ end
120
+
121
+
122
+ # Delete a single item
123
+ #
124
+ # Deletes the item object at this URL.
125
+ #
126
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
127
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
128
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
129
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
130
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
131
+ #
132
+ # Deleting an item will also delete the parameters and classifications associated with that item.
133
+ #
134
+ # ### Security Policies
135
+ #
136
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
137
+ # @param companyId [Integer] The ID of the company that owns this item.
138
+ # @param id [Integer] The ID of the item you wish to delete.
139
+ # @return [ErrorDetail[]]
140
+ def delete_item(companyId, id)
141
+ path = "/api/v2/companies/#{companyId}/items/#{id}"
142
+ delete(path)
143
+ end
144
+
145
+
146
+ # Delete a single item classification.
147
+ #
148
+ # Delete a single item classification.
149
+ #
150
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
151
+ #
152
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
153
+ #
154
+ # ### Security Policies
155
+ #
156
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
157
+ # @param companyId [Integer] The company id.
158
+ # @param itemId [Integer] The item id.
159
+ # @param id [Integer] The item classification id.
160
+ # @return [ErrorDetail[]]
161
+ def delete_item_classification(companyId, itemId, id)
162
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
163
+ delete(path)
164
+ end
165
+
166
+
167
+ # Delete a single item parameter
168
+ #
169
+ # Delete a single item parameter.
170
+ #
171
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
172
+ #
173
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
174
+ #
175
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
176
+ #
177
+ # ### Security Policies
178
+ #
179
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
180
+ # @param companyId [Integer] The company id
181
+ # @param itemId [Integer] The item id
182
+ # @param id [Integer] The parameter id
183
+ # @return [ErrorDetail[]]
184
+ def delete_item_parameter(companyId, itemId, id)
185
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
186
+ delete(path)
187
+ end
188
+
189
+
190
+ # Retrieve a single item
191
+ #
192
+ # Get the `Item` object identified by this URL.
193
+ #
194
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
195
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
196
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
197
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
198
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
199
+ #
200
+ # ### Security Policies
201
+ #
202
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
203
+ # @param companyId [Integer] The ID of the company that owns this item object
204
+ # @param id [Integer] The primary key of this item
205
+ # @param include [String] A comma separated list of additional data to retrieve.
206
+ # @return [Object]
207
+ def get_item(companyId, id, options={})
208
+ path = "/api/v2/companies/#{companyId}/items/#{id}"
209
+ get(path, options)
210
+ end
211
+
212
+
213
+ # Retrieve a single item classification.
214
+ #
215
+ # Retrieve a single item classification.
216
+ #
217
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
218
+ #
219
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
220
+ #
221
+ # ### Security Policies
222
+ #
223
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
224
+ # @param companyId [Integer] The company id.
225
+ # @param itemId [Integer] The item id.
226
+ # @param id [Integer] The item classification id.
227
+ # @return [Object]
228
+ def get_item_classification(companyId, itemId, id)
229
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
230
+ get(path)
231
+ end
232
+
233
+
234
+ # Retrieve a single item parameter
235
+ #
236
+ # Retrieve a single item parameter.
237
+ #
238
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
239
+ #
240
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
241
+ #
242
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
243
+ #
244
+ # ### Security Policies
245
+ #
246
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
247
+ # @param companyId [Integer] The company id
248
+ # @param itemId [Integer] The item id
249
+ # @param id [Integer] The parameter id
250
+ # @return [Object]
251
+ def get_item_parameter(companyId, itemId, id)
252
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
253
+ get(path)
254
+ end
255
+
256
+
257
+ # Retrieve classifications for an item.
258
+ #
259
+ # List classifications for an item.
260
+ #
261
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
262
+ #
263
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
264
+ #
265
+ # Search for specific objects using the criteria in the `$filter` classification; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
266
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` classifications.
267
+ #
268
+ # ### Security Policies
269
+ #
270
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
271
+ # @param companyId [Integer] The company id.
272
+ # @param itemId [Integer] The item id.
273
+ # @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:* productCode, systemCode
274
+ # @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.
275
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
276
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
277
+ # @return [FetchResult]
278
+ def list_item_classifications(companyId, itemId, options={})
279
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications"
280
+ get(path, options)
281
+ end
282
+
283
+
284
+ # Retrieve parameters for an item
285
+ #
286
+ # List parameters for an item.
287
+ #
288
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
289
+ #
290
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
291
+ #
292
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
293
+ #
294
+ # 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/) .
295
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
296
+ #
297
+ # ### Security Policies
298
+ #
299
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
300
+ # @param companyId [Integer] The company id
301
+ # @param itemId [Integer] The item id
302
+ # @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:* name, unit
303
+ # @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.
304
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
305
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
306
+ # @return [FetchResult]
307
+ def list_item_parameters(companyId, itemId, options={})
308
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters"
309
+ get(path, options)
310
+ end
311
+
312
+
313
+ # Retrieve items for this company
314
+ #
315
+ # List all items defined for the current company.
316
+ #
317
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
318
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
319
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
320
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
321
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
322
+ #
323
+ # 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/) .
324
+ #
325
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
326
+ #
327
+ # 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:
328
+ #
329
+ # * Parameters
330
+ # * Classifications
331
+ #
332
+ # ### Security Policies
333
+ #
334
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
335
+ # @param companyId [Integer] The ID of the company that defined these items
336
+ # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* taxCode, classifications, parameters
337
+ # @param include [String] A comma separated list of additional data to retrieve.
338
+ # @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.
339
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
340
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
341
+ # @return [FetchResult]
342
+ def list_items_by_company(companyId, options={})
343
+ path = "/api/v2/companies/#{companyId}/items"
344
+ get(path, options)
345
+ end
346
+
347
+
348
+ # Retrieve all items
349
+ #
350
+ # Get multiple item objects across all companies.
351
+ #
352
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
353
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
354
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
355
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
356
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
357
+ #
358
+ # 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/) .
359
+ #
360
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
361
+ #
362
+ # ### Security Policies
363
+ #
364
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
365
+ # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* taxCode, classifications, parameters
366
+ # @param include [String] A comma separated list of additional data to retrieve.
367
+ # @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.
368
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
369
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
370
+ # @return [FetchResult]
371
+ def query_items(options={})
372
+ path = "/api/v2/items"
373
+ get(path, options)
374
+ end
375
+
376
+
377
+ # Sync items from a product catalog
378
+ #
379
+ # Syncs a list of items with AvaTax without waiting for them to be created. It is ideal for syncing large product catalogs
380
+ # with AvaTax.
381
+ #
382
+ # Any invalid or duplicate items will be ignored. To diagnose why an item is not created, use the normal create transaction API to receive validation information.
383
+ #
384
+ # This API is currently limited to 1000 items per call (the limit is subject to change).
385
+ #
386
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
387
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
388
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
389
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
390
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
391
+ #
392
+ # ### Security Policies
393
+ #
394
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
395
+ # @param companyId [Integer] The ID of the company that owns this item.
396
+ # @param model [Object] The request object.
397
+ # @return [Object]
398
+ def sync_items(companyId, model)
399
+ path = "/api/v2/companies/#{companyId}/items/sync"
400
+ post(path, model)
401
+ end
402
+
403
+
404
+ # Update a single item
405
+ #
406
+ # Replace the existing `Item` object at this URL with an updated object.
407
+ #
408
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
409
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
410
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
411
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
412
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
413
+ #
414
+ # All data from the existing object will be replaced with data in the object you PUT. To set a field's value to null,
415
+ # you may either set its value to null or omit that field from the object you post.
416
+ #
417
+ # The tax code takes precedence over the tax code id if both are provided.
418
+ #
419
+ # ### Security Policies
420
+ #
421
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
422
+ # @param companyId [Integer] The ID of the company that this item belongs to.
423
+ # @param id [Integer] The ID of the item you wish to update
424
+ # @param model [Object] The item object you wish to update.
425
+ # @return [Object]
426
+ def update_item(companyId, id, model)
427
+ path = "/api/v2/companies/#{companyId}/items/#{id}"
428
+ put(path, model)
429
+ end
430
+
431
+
432
+ # Update an item classification.
433
+ #
434
+ # Update an item classification.
435
+ #
436
+ # A classification is the code for a product in a particular tax system. Classifications enable an item to be used in multiple tax systems which may have different tax rates for a product.
437
+ #
438
+ # When an item is used in a transaction, the applicable classification will be used to determine the appropriate tax rate.
439
+ #
440
+ # An item may only have one classification per tax system.
441
+ #
442
+ # ### Security Policies
443
+ #
444
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
445
+ # @param companyId [Integer] The company id.
446
+ # @param itemId [Integer] The item id.
447
+ # @param id [Integer] The item classification id.
448
+ # @param model [Object] The item object you wish to update.
449
+ # @return [Object]
450
+ def update_item_classification(companyId, itemId, id, model)
451
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/classifications/#{id}"
452
+ put(path, model)
453
+ end
454
+
455
+
456
+ # Update an item parameter
457
+ #
458
+ # Update an item parameter.
459
+ #
460
+ # Some items can be taxed differently depending on the properties of that item, such as the item grade or by a particular measurement of that item. In AvaTax, these tax-affecting properties are called "parameters".
461
+ #
462
+ # A parameter added to an item will be used by default in tax calculation but will not show on the transaction line referencing the item .
463
+ #
464
+ # A parameter specified on a transaction line will override an item parameter if they share the same parameter name.
465
+ #
466
+ # ### Security Policies
467
+ #
468
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
469
+ # @param companyId [Integer] The company id.
470
+ # @param itemId [Integer] The item id
471
+ # @param id [Integer] The item parameter id
472
+ # @param model [Object] The item object you wish to update.
473
+ # @return [Object]
474
+ def update_item_parameter(companyId, itemId, id, model)
475
+ path = "/api/v2/companies/#{companyId}/items/#{itemId}/parameters/#{id}"
476
+ put(path, model)
477
+ end
478
+
479
+ end
480
+ end
481
481
  end