avatax 17.12.0 → 18.1.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b243bcb1b50952e1aae1ffe36d1169a9048d7e71
4
- data.tar.gz: 053fee8c45e531196f13e9854ddbf36097f3c9da
2
+ SHA256:
3
+ metadata.gz: 457c4dafa0d29a7d825c3d1277ca28a49a0168f86f5c9d643392f1e4900a8609
4
+ data.tar.gz: e7ea4c2f210a60e04ffe4b4313e6a6127a58a1ce9bae38054b88276eeb8d3752
5
5
  SHA512:
6
- metadata.gz: d47dbf4dfe6f35453e071218abf4e0fb5fbfe857fbcd6cd6fba776ab8b420cd1fe18fc6815a8c03f0a5ae5dba3926382b2c73f24f3f5c7484cc091318f3f0090
7
- data.tar.gz: 581986d1507f38f63922e2b0e8c3c74972340cbc5ab7e6f0aa0d817a5c7bf78b72ba2cab7e71a5dfa3b754c47904af74548fe777bd78a56955e778a6a619781a
6
+ metadata.gz: 298f0645027870cd7f6e3730a79852d23b78646b5befa0850b3108ff572bc629b41215e5ffae24cdb50a0e085bdcb06d7548d14083d3cdeef1923503cd2ed6e0
7
+ data.tar.gz: d8ef94982822bb32bdb210cb3057f4b14dee22a610cf92c88ce99f45391255ab5da2b375210e6c9724712bc81a89e0faedad15bf4a990028e481e2af9a1f4242
@@ -15,6 +15,9 @@ module AvaTax
15
15
  # The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
16
16
  # Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
17
17
  # your company so that they can be used for tax exemptions.
18
+ #
19
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
20
+ # (as your account gets provisioned). Thank you for your patience.
18
21
  # @param companyId [Integer] The unique ID number of the company that will record certificates
19
22
  # @param customerCode [String] The number of the customer where the request is sent to
20
23
  # @param model [CreateCertExpressInvitationModel[]] the requests to send out to customers
@@ -37,6 +40,9 @@ module AvaTax
37
40
  # The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
38
41
  # Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
39
42
  # your company so that they can be used for tax exemptions.
43
+ #
44
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
45
+ # (as your account gets provisioned). Thank you for your patience.
40
46
  # @param companyId [Integer] The unique ID number of the company that issued this invitation
41
47
  # @param customerCode [String] The number of the customer where the request is sent to
42
48
  # @param id [Integer] The unique ID number of this CertExpress invitation
@@ -60,6 +66,9 @@ module AvaTax
60
66
  # The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
61
67
  # Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
62
68
  # your company so that they can be used for tax exemptions.
69
+ #
70
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
71
+ # (as your account gets provisioned). Thank you for your patience.
63
72
  # @param companyId [Integer] The unique ID number of the company that issued this invitation
64
73
  # @param include [String] OPTIONAL: A comma separated list of special fetch options. No options are defined at this time.
65
74
  # @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/) .
@@ -19,6 +19,9 @@ module AvaTax
19
19
  # * A list of exposure zones indicating where the certificate is valid
20
20
  # * A link to the customer that is allowed to use this certificate
21
21
  # * Your tax transaction must contain the correct customer code
22
+ #
23
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
24
+ # (as your account gets provisioned). Thank you for your patience.
22
25
  # @param companyId [Integer] The ID number of the company recording this certificate
23
26
  # @param model [CertificateModel[]] Certificates to be created
24
27
  # @return [CertificateModel[]]
@@ -38,6 +41,9 @@ module AvaTax
38
41
  # log onto the administrative website for the product you purchased.
39
42
  #
40
43
  # Revoked certificates can no longer be used.
44
+ #
45
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
46
+ # (as your account gets provisioned). Thank you for your patience.
41
47
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
42
48
  # @param id [Integer] The unique ID number of this certificate
43
49
  # @return [Object]
@@ -58,6 +64,9 @@ module AvaTax
58
64
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
59
65
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
60
66
  # log onto the administrative website for the product you purchased.
67
+ #
68
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
69
+ # (as your account gets provisioned). Thank you for your patience.
61
70
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
62
71
  # @param id [Integer] The unique ID number of this certificate
63
72
  # @param page [Integer] If you choose `$type`=`Jpeg`, you must specify which page number to retrieve.
@@ -83,6 +92,9 @@ module AvaTax
83
92
  # * Customers - Retrieves the list of customers linked to the certificate.
84
93
  # * PoNumbers - Retrieves all PO numbers tied to the certificate.
85
94
  # * Attributes - Retrieves all attributes applied to the certificate.
95
+ #
96
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
97
+ # (as your account gets provisioned). Thank you for your patience.
86
98
  # @param companyId [Integer] The ID number of the company that recorded this certificate
87
99
  # @param id [Integer] The unique ID number of this certificate
88
100
  # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: * Customers - Retrieves the list of customers linked to the certificate. * PoNumbers - Retrieves all PO numbers tied to the certificate. * Attributes - Retrieves all attributes applied to the certificate.
@@ -104,6 +116,9 @@ module AvaTax
104
116
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
105
117
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
106
118
  # log onto the administrative website for the product you purchased.
119
+ #
120
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
121
+ # (as your account gets provisioned). Thank you for your patience.
107
122
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
108
123
  # @param id [Integer] The unique ID number of this certificate
109
124
  # @param model [CertificateAttributeModel[]] The list of attributes to link to this certificate.
@@ -126,6 +141,9 @@ module AvaTax
126
141
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
127
142
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
128
143
  # log onto the administrative website for the product you purchased.
144
+ #
145
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
146
+ # (as your account gets provisioned). Thank you for your patience.
129
147
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
130
148
  # @param id [Integer] The unique ID number of this certificate
131
149
  # @param model [Object] The list of customers needed be added to the Certificate for exemption
@@ -147,6 +165,9 @@ module AvaTax
147
165
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
148
166
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
149
167
  # log onto the administrative website for the product you purchased.
168
+ #
169
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
170
+ # (as your account gets provisioned). Thank you for your patience.
150
171
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
151
172
  # @param id [Integer] The unique ID number of this certificate
152
173
  # @return [FetchResult]
@@ -167,6 +188,9 @@ module AvaTax
167
188
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
168
189
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
169
190
  # log onto the administrative website for the product you purchased.
191
+ #
192
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
193
+ # (as your account gets provisioned). Thank you for your patience.
170
194
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
171
195
  # @param id [Integer] The unique ID number of this certificate
172
196
  # @param include [String] OPTIONAL: A comma separated list of special fetch options. No options are currently available when fetching customers.
@@ -191,6 +215,9 @@ module AvaTax
191
215
  # * Customers - Retrieves the list of customers linked to the certificate.
192
216
  # * PoNumbers - Retrieves all PO numbers tied to the certificate.
193
217
  # * Attributes - Retrieves all attributes applied to the certificate.
218
+ #
219
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
220
+ # (as your account gets provisioned). Thank you for your patience.
194
221
  # @param companyId [Integer] The ID number of the company to search
195
222
  # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: * Customers - Retrieves the list of customers linked to the certificate. * PoNumbers - Retrieves all PO numbers tied to the certificate. * Attributes - Retrieves all attributes applied to the certificate.
196
223
  # @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/) .
@@ -215,6 +242,9 @@ module AvaTax
215
242
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
216
243
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
217
244
  # log onto the administrative website for the product you purchased.
245
+ #
246
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
247
+ # (as your account gets provisioned). Thank you for your patience.
218
248
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
219
249
  # @param id [Integer] The unique ID number of this certificate
220
250
  # @param model [CertificateAttributeModel[]] The list of attributes to unlink from this certificate.
@@ -238,6 +268,9 @@ module AvaTax
238
268
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
239
269
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
240
270
  # log onto the administrative website for the product you purchased.
271
+ #
272
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
273
+ # (as your account gets provisioned). Thank you for your patience.
241
274
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
242
275
  # @param id [Integer] The unique ID number of this certificate
243
276
  # @param model [Object] The list of customers to unlink from this certificate
@@ -256,6 +289,9 @@ module AvaTax
256
289
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
257
290
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
258
291
  # log onto the administrative website for the product you purchased.
292
+ #
293
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
294
+ # (as your account gets provisioned). Thank you for your patience.
259
295
  # @param companyId [Integer] The ID number of the company that recorded this certificate
260
296
  # @param id [Integer] The unique ID number of this certificate
261
297
  # @param model [Object] The new certificate object that will replace the existing one
@@ -277,6 +313,9 @@ module AvaTax
277
313
  # can contain information about a customer's eligibility for exemption from sales or use taxes based on
278
314
  # criteria you specify when you store the certificate. To view or manage your certificates directly, please
279
315
  # log onto the administrative website for the product you purchased.
316
+ #
317
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
318
+ # (as your account gets provisioned). Thank you for your patience.
280
319
  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
281
320
  # @param id [Integer] The unique ID number of this certificate
282
321
  # @param file [Object] The exemption certificate file you wanted to upload. Accepted formats are: PDF, JPEG, TIFF, PNG.
@@ -108,6 +108,21 @@ module AvaTax
108
108
  end
109
109
 
110
110
 
111
+ # Check the funding configuration of a company
112
+ #
113
+ # This API is available by invitation only.
114
+ # Requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
115
+ # Returns the funding configuration of the requested company.
116
+ # .
117
+ # @param companyId [Integer] The unique identifier of the company
118
+ # @param currency [String] The currency of the funding. USD and CAD are the only valid currencies
119
+ # @return [FundingConfigurationModel[]]
120
+ def funding_configurations_by_company_and_currency(companyId, options={})
121
+ path = "/api/v2/companies/#{companyId}/funding/configurations"
122
+ get(path, options)
123
+ end
124
+
125
+
111
126
  # Retrieve a single company
112
127
  #
113
128
  # Get the company object identified by this URL.
@@ -12,6 +12,9 @@ module AvaTax
12
12
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
13
13
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
14
14
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
15
+ #
16
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
17
+ # (as your account gets provisioned). Thank you for your patience.
15
18
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
16
19
  # @param model [CustomerModel[]] The list of customer objects to be created
17
20
  # @return [CustomerModel[]]
@@ -30,6 +33,9 @@ module AvaTax
30
33
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
31
34
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
32
35
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
36
+ #
37
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
38
+ # (as your account gets provisioned). Thank you for your patience.
33
39
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
34
40
  # @param customerCode [String] The unique code representing this customer
35
41
  # @return [Object]
@@ -52,6 +58,9 @@ module AvaTax
52
58
  # You can use the `$include` parameter to fetch the following additional objects for expansion:
53
59
  #
54
60
  # * Certificates - Fetch a list of certificates linked to this customer.
61
+ #
62
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
63
+ # (as your account gets provisioned). Thank you for your patience.
55
64
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
56
65
  # @param customerCode [String] The unique code representing this customer
57
66
  # @param include [String] Specify optional additional objects to include in this fetch request
@@ -71,6 +80,9 @@ module AvaTax
71
80
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
72
81
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
73
82
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
83
+ #
84
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
85
+ # (as your account gets provisioned). Thank you for your patience.
74
86
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
75
87
  # @param customerCode [String] The unique code representing this customer
76
88
  # @param model [Object] The list of certificates to link to this customer
@@ -90,6 +102,9 @@ module AvaTax
90
102
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
91
103
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
92
104
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
105
+ #
106
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
107
+ # (as your account gets provisioned). Thank you for your patience.
93
108
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
94
109
  # @param customerCode [String] The unique code representing this customer
95
110
  # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: * Customers - Retrieves the list of customers linked to the certificate. * PoNumbers - Retrieves all PO numbers tied to the certificate. * Attributes - Retrieves all attributes applied to the certificate.
@@ -116,6 +131,9 @@ module AvaTax
116
131
  # If a customer does not have a certificate on file and they wish to provide one, you should send the customer
117
132
  # a CertExpress invitation link so that the customer can upload proof of their exemption certificate. Please
118
133
  # see the `CreateCertExpressInvitation` API to create an invitation link for this customer.
134
+ #
135
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
136
+ # (as your account gets provisioned). Thank you for your patience.
119
137
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
120
138
  # @param customerCode [String] The unique code representing this customer
121
139
  # @param country [String] Search for certificates matching this country. Uses the ISO 3166 two character country code.
@@ -140,6 +158,9 @@ module AvaTax
140
158
  # You can use the `$include` parameter to fetch the following additional objects for expansion:
141
159
  #
142
160
  # * Certificates - Fetch a list of certificates linked to this customer.
161
+ #
162
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
163
+ # (as your account gets provisioned). Thank you for your patience.
143
164
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
144
165
  # @param include [String] OPTIONAL - You can specify the value `certificates` to fetch information about certificates linked to the customer.
145
166
  # @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/) .
@@ -162,6 +183,9 @@ module AvaTax
162
183
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
163
184
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
164
185
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
186
+ #
187
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
188
+ # (as your account gets provisioned). Thank you for your patience.
165
189
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
166
190
  # @param customerCode [String] The unique code representing this customer
167
191
  # @param model [Object] The list of certificates to link to this customer
@@ -181,6 +205,9 @@ module AvaTax
181
205
  # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
182
206
  # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
183
207
  # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
208
+ #
209
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
210
+ # (as your account gets provisioned). Thank you for your patience.
184
211
  # @param companyId [Integer] The unique ID number of the company that recorded this customer
185
212
  # @param customerCode [String] The unique code representing this customer
186
213
  # @param model [Object] The new customer model that will replace the existing record at this URL
@@ -3,6 +3,27 @@ module AvaTax
3
3
  module Definitions
4
4
 
5
5
 
6
+ # Lists all parents of an HS Code.
7
+ #
8
+ # Retrieves the specified HS code and all of its parents, reflecting all sections, chapters, headings, and subheadings
9
+ #
10
+ # a list of HS Codes that are the parents and information branches of the HS Code for the given
11
+ # destination country, if lower detail is available.
12
+ #
13
+ # This API will include information branches if applicable. These do not have HS Codes and cannot be referenced,
14
+ # but can contain information relevant to deciding the correct HS Code.
15
+ #
16
+ # This API is intended to be useful to review the descriptive hierarchy of an HS Code, which can be particularly helpful
17
+ # when HS Codes can have multiple levels of generic descriptions.
18
+ # @param country [String] The name or code of the destination country.
19
+ # @param hsCode [String] The partial or full HS Code for which you would like to view all of the parents.
20
+ # @return [FetchResult]
21
+ def get_cross_border_code(country, hsCode)
22
+ path = "/api/v2/definitions/crossborder/#{country}/#{hsCode}/hierarchy"
23
+ get(path)
24
+ end
25
+
26
+
6
27
  # Test whether a form supports online login verification
7
28
  #
8
29
  # This API is intended to be useful to identify whether the user should be allowed
@@ -21,6 +42,10 @@ module AvaTax
21
42
 
22
43
  # Retrieve the full list of the AvaFile Forms available
23
44
  #
45
+ # This API is deprecated.
46
+ #
47
+ # Please use the ListTaxForms API.
48
+ #
24
49
  # Returns the full list of Avalara-supported AvaFile Forms
25
50
  # This API is intended to be useful to identify all the different AvaFile Forms
26
51
  # @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/) .
@@ -40,6 +65,9 @@ module AvaTax
40
65
  #
41
66
  # A certificate may have multiple attributes that control its behavior. You may apply or remove attributes to a
42
67
  # certificate at any time.
68
+ #
69
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
70
+ # (as your account gets provisioned). Thank you for your patience.
43
71
  # @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/) .
44
72
  # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
45
73
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
@@ -57,6 +85,9 @@ module AvaTax
57
85
  #
58
86
  # An exemption reason defines why a certificate allows a customer to be exempt
59
87
  # for purposes of tax calculation.
88
+ #
89
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
90
+ # (as your account gets provisioned). Thank you for your patience.
60
91
  # @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/) .
61
92
  # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
62
93
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
@@ -74,6 +105,9 @@ module AvaTax
74
105
  #
75
106
  # An exposure zone is a location where a certificate can be valid. Exposure zones may indicate a taxing
76
107
  # authority or other legal entity to which a certificate may apply.
108
+ #
109
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
110
+ # (as your account gets provisioned). Thank you for your patience.
77
111
  # @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/) .
78
112
  # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
79
113
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
@@ -154,6 +188,9 @@ module AvaTax
154
188
  # The CoverLetter model represents a message sent along with an invitation to use CertExpress to
155
189
  # upload certificates. An invitation allows customers to use CertExpress to upload their exemption
156
190
  # certificates directly; this cover letter explains why the invitation was sent.
191
+ #
192
+ # You may experience up to a three minute delay on your very first call to the exemption related endpoints
193
+ # (as your account gets provisioned). Thank you for your patience.
157
194
  # @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/) .
158
195
  # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
159
196
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
@@ -165,6 +202,40 @@ module AvaTax
165
202
  end
166
203
 
167
204
 
205
+ # Lists the next level of HS Codes given a destination country and HS Code prefix.
206
+ #
207
+ # Retrieves a list of HS Codes that are the children of the prefix for the given destination country, if
208
+ # additional children are available.
209
+ #
210
+ # HS Code is interchangeable with "tariff code" and definitions are generally unique to a destination country.
211
+ # An HS Code describes an item and its eligibility/rate for tariffs. HS Codes are organized by
212
+ # Section/Chapter/Heading/Subheading/Classification.
213
+ #
214
+ # This API is intended to be useful to identify the correct HS Code to use for your item.
215
+ # @param country [String] The name or code of the destination country.
216
+ # @param hsCode [String] The Section or partial HS Code for which you would like to view the next level of HS Code detail, if more detail is available.
217
+ # @return [FetchResult]
218
+ def list_cross_border_codes(country, hsCode)
219
+ path = "/api/v2/definitions/crossborder/#{country}/#{hsCode}"
220
+ get(path)
221
+ end
222
+
223
+
224
+ # List top level HS Code Sections.
225
+ #
226
+ # Returns the full list of top level HS Code Sections. Sections are the broadest level of detail for
227
+ # classifying tariff codes and the items to which they apply. HS Codes are organized
228
+ # by Section/Chapter/Heading/Subheading/Classification.
229
+ #
230
+ # This API is intended to be useful to identify the top level Sections for
231
+ # further LandedCost HS Code lookups.
232
+ # @return [FetchResult]
233
+ def list_cross_border_sections()
234
+ path = "/api/v2/definitions/crossborder/sections"
235
+ get(path)
236
+ end
237
+
238
+
168
239
  # Retrieve the full list of Avalara-supported entity use codes
169
240
  #
170
241
  # Returns the full list of Avalara-supported entity use codes.
@@ -568,6 +639,20 @@ module AvaTax
568
639
  end
569
640
 
570
641
 
642
+ # Retrieve the full list of Avalara-supported postal codes.
643
+ #
644
+ # Retrieves the list of Avalara-supported postal codes.
645
+ # @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/) .
646
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
647
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
648
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
649
+ # @return [FetchResult]
650
+ def list_postal_codes(options={})
651
+ path = "/api/v2/definitions/postalcodes"
652
+ get(path, options)
653
+ end
654
+
655
+
571
656
  # Retrieve the full list of rate types for each country
572
657
  #
573
658
  # Returns the full list of Avalara-supported rate type file types
@@ -746,6 +831,21 @@ module AvaTax
746
831
  end
747
832
 
748
833
 
834
+ # Retrieve the full list of the Tax Forms available
835
+ #
836
+ # Returns the full list of Avalara-supported Tax Forms
837
+ # This API is intended to be useful to identify all the different Tax Forms
838
+ # @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/) .
839
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
840
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
841
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
842
+ # @return [FetchResult]
843
+ def list_tax_forms(options={})
844
+ path = "/api/v2/definitions/taxforms"
845
+ get(path, options)
846
+ end
847
+
848
+
749
849
  # Retrieve the full list of tax sub types
750
850
  #
751
851
  # Returns the full list of Avalara-supported tax sub-types
@@ -775,6 +875,22 @@ module AvaTax
775
875
  get(path, options)
776
876
  end
777
877
 
878
+
879
+ # List all defined units of measurement
880
+ #
881
+ # List all units of measurement systems defined by Avalara.
882
+ #
883
+ # A unit of measurement system is a method of measuring a quantity, such as distance, mass, or others.
884
+ # @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/) .
885
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
886
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
887
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
888
+ # @return [FetchResult]
889
+ def list_unit_of_measurement(options={})
890
+ path = "/api/v2/definitions/unitofmeasurements"
891
+ get(path, options)
892
+ end
893
+
778
894
  end
779
895
  end
780
896
  end
@@ -0,0 +1,117 @@
1
+ module AvaTax
2
+ class Client
3
+ module DistanceThresholds
4
+
5
+
6
+ # Create one or more DistanceThreshold objects
7
+ #
8
+ # Create one or more DistanceThreshold objects for this company.
9
+ #
10
+ # A company-distance-threshold model indicates the distance between a company
11
+ # and the taxing borders of various countries. Distance thresholds are necessary
12
+ # to correctly calculate some value-added taxes.
13
+ # @param companyId [Integer] The unique ID number of the company that owns this DistanceThreshold
14
+ # @param model [CompanyDistanceThresholdModel[]] The DistanceThreshold object or objects you wish to create.
15
+ # @return [CompanyDistanceThresholdModel[]]
16
+ def create_distance_threshold(companyId, model)
17
+ path = "/api/v2/companies/#{companyId}/distancethresholds"
18
+ post(path, model)
19
+ end
20
+
21
+
22
+ # Delete a single DistanceThreshold object
23
+ #
24
+ # Marks the DistanceThreshold object identified by this URL as deleted.
25
+ #
26
+ # A company-distance-threshold model indicates the distance between a company
27
+ # and the taxing borders of various countries. Distance thresholds are necessary
28
+ # to correctly calculate some value-added taxes.
29
+ # @param companyId [Integer] The unique ID number of the company that owns this DistanceThreshold
30
+ # @param id [Integer] The unique ID number of the DistanceThreshold object you wish to delete.
31
+ # @return [ErrorDetail[]]
32
+ def delete_distance_threshold(companyId, id)
33
+ path = "/api/v2/companies/#{companyId}/distancethresholds/#{id}"
34
+ delete(path)
35
+ end
36
+
37
+
38
+ # Retrieve a single DistanceThreshold
39
+ #
40
+ # Retrieves a single DistanceThreshold object defined by this URL.
41
+ #
42
+ # A company-distance-threshold model indicates the distance between a company
43
+ # and the taxing borders of various countries. Distance thresholds are necessary
44
+ # to correctly calculate some value-added taxes.
45
+ # @param companyId [Integer] The ID of the company that owns this DistanceThreshold object
46
+ # @param id [Integer] The unique ID number referring to this DistanceThreshold object
47
+ # @return [Object]
48
+ def get_distance_threshold(companyId, id)
49
+ path = "/api/v2/companies/#{companyId}/distancethresholds/#{id}"
50
+ get(path)
51
+ end
52
+
53
+
54
+ # Retrieve all DistanceThresholds for this company.
55
+ #
56
+ # Lists all DistanceThreshold objects that belong to this company.
57
+ #
58
+ # A company-distance-threshold model indicates the distance between a company
59
+ # and the taxing borders of various countries. Distance thresholds are necessary
60
+ # to correctly calculate some value-added taxes.
61
+ # @param companyId [Integer] The ID of the company whose DistanceThreshold objects you wish to list.
62
+ # @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/) .
63
+ # @param include [String] A comma separated list of additional data to retrieve.
64
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
65
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
66
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
67
+ # @return [FetchResult]
68
+ def list_distance_thresholds(companyId, options={})
69
+ path = "/api/v2/companies/#{companyId}/distancethresholds"
70
+ get(path, options)
71
+ end
72
+
73
+
74
+ # Retrieve all DistanceThreshold objects
75
+ #
76
+ # Lists all DistanceThreshold objects that belong to this company.
77
+ #
78
+ # A company-distance-threshold model indicates the distance between a company
79
+ # and the taxing borders of various countries. Distance thresholds are necessary
80
+ # to correctly calculate some value-added taxes.
81
+ #
82
+ # 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/) .
83
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
84
+ # @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/) .
85
+ # @param include [String] A comma separated list of additional data to retrieve.
86
+ # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
87
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
88
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
89
+ # @return [FetchResult]
90
+ def query_distance_thresholds(options={})
91
+ path = "/api/v2/distancethresholds"
92
+ get(path, options)
93
+ end
94
+
95
+
96
+ # Update a DistanceThreshold object
97
+ #
98
+ # Replace the existing DistanceThreshold object at this URL with an updated object.
99
+ #
100
+ # A company-distance-threshold model indicates the distance between a company
101
+ # and the taxing borders of various countries. Distance thresholds are necessary
102
+ # to correctly calculate some value-added taxes.
103
+ #
104
+ # All data from the existing object will be replaced with data in the object you PUT.
105
+ # To set a field's value to null, you may either set its value to null or omit that field from the object you post.
106
+ # @param companyId [Integer] The unique ID number of the company that owns this DistanceThreshold object.
107
+ # @param id [Integer] The unique ID number of the DistanceThreshold object to replace.
108
+ # @param model [Object] The new DistanceThreshold object to store.
109
+ # @return [Object]
110
+ def update_distance_threshold(companyId, id, model)
111
+ path = "/api/v2/companies/#{companyId}/distancethresholds/#{id}"
112
+ put(path, model)
113
+ end
114
+
115
+ end
116
+ end
117
+ end
@@ -6,6 +6,12 @@ module AvaTax
6
6
  # Create a new item
7
7
  #
8
8
  # Creates one or more new item objects attached to this company.
9
+ #
10
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
11
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
12
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
13
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
14
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
9
15
  # @param companyId [Integer] The ID of the company that owns this item.
10
16
  # @param model [ItemModel[]] The item you wish to create.
11
17
  # @return [ItemModel[]]
@@ -18,6 +24,12 @@ module AvaTax
18
24
  # Delete a single item
19
25
  #
20
26
  # Marks the item object at this URL as deleted.
27
+ #
28
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
29
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
30
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
31
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
32
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
21
33
  # @param companyId [Integer] The ID of the company that owns this item.
22
34
  # @param id [Integer] The ID of the item you wish to delete.
23
35
  # @return [ErrorDetail[]]
@@ -30,7 +42,12 @@ module AvaTax
30
42
  # Retrieve a single item
31
43
  #
32
44
  # Get the item object identified by this URL.
33
- # An 'Item' represents a product or service that your company offers for sale.
45
+ #
46
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
47
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
48
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
49
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
50
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
34
51
  # @param companyId [Integer] The ID of the company that owns this item object
35
52
  # @param id [Integer] The primary key of this item
36
53
  # @return [Object]
@@ -44,10 +61,18 @@ module AvaTax
44
61
  #
45
62
  # List all items defined for the current company.
46
63
  #
47
- # An 'Item' represents a product or service that your company offers for sale.
64
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
65
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
66
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
67
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
68
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
48
69
  #
49
70
  # 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/) .
50
71
  # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
72
+ #
73
+ # 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:
74
+ #
75
+ # * Attributes
51
76
  # @param companyId [Integer] The ID of the company that defined these items
52
77
  # @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/) .
53
78
  # @param include [String] A comma separated list of additional data to retrieve.
@@ -64,10 +89,19 @@ module AvaTax
64
89
  # Retrieve all items
65
90
  #
66
91
  # Get multiple item objects across all companies.
67
- # An 'Item' represents a product or service that your company offers for sale.
92
+ #
93
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
94
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
95
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
96
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
97
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
68
98
  #
69
99
  # 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/) .
70
100
  # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
101
+ #
102
+ # 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:
103
+ #
104
+ # * Attributes
71
105
  # @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/) .
72
106
  # @param include [String] A comma separated list of additional data to retrieve.
73
107
  # @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
@@ -82,7 +116,14 @@ module AvaTax
82
116
 
83
117
  # Update a single item
84
118
  #
85
- # Replace the existing item object at this URL with an updated object.
119
+ # Replace the existing `Item` object at this URL with an updated object.
120
+ #
121
+ # Items are a way of separating your tax calculation process from your tax configuration details. If you choose, you
122
+ # can provide `itemCode` values for each `CreateTransaction()` API call rather than specifying tax codes, parameters, descriptions,
123
+ # and other data fields. AvaTax will automatically look up each `itemCode` and apply the correct tax codes and parameters
124
+ # from the item table instead. This allows your CreateTransaction call to be as simple as possible, and your tax compliance
125
+ # team can manage your item catalog and adjust the tax behavior of items without having to modify your software.
126
+ #
86
127
  # All data from the existing object will be replaced with data in the object you PUT.
87
128
  # To set a field's value to null, you may either set its value to null or omit that field from the object you post.
88
129
  # @param companyId [Integer] The ID of the company that this item belongs to.
@@ -136,32 +136,41 @@ module AvaTax
136
136
  #
137
137
  # After this API call succeeds, the transaction will have a new URL matching its new `code`.
138
138
  #
139
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
140
+ #
139
141
  # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
140
142
  # sales, purchases, inventory transfer, and returns (also called refunds).
141
143
  # @param companyCode [String] The company code of the company that recorded this transaction
142
144
  # @param transactionCode [String] The transaction code to change
145
+ # @param documentType [String] (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
143
146
  # @param model [Object] The code change request you wish to execute
144
147
  # @return [Object]
145
- def change_transaction_code(companyCode, transactionCode, model)
148
+ def change_transaction_code(companyCode, transactionCode, model, options={})
146
149
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
147
- post(path, model)
150
+ post(path, model, options)
148
151
  end
149
152
 
150
153
 
151
154
  # Commit a transaction for reporting
152
155
  #
153
- # Marks a transaction by changing its status to 'Committed'.
156
+ # Marks a transaction by changing its status to `Committed`.
157
+ #
154
158
  # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
159
+ #
155
160
  # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
156
161
  # sales, purchases, inventory transfer, and returns (also called refunds).
162
+ #
163
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
164
+ #
157
165
  # Any changes made to a committed transaction will generate a transaction history.
158
166
  # @param companyCode [String] The company code of the company that recorded this transaction
159
167
  # @param transactionCode [String] The transaction code to commit
168
+ # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
160
169
  # @param model [Object] The commit request you wish to execute
161
170
  # @return [Object]
162
- def commit_transaction(companyCode, transactionCode, model)
171
+ def commit_transaction(companyCode, transactionCode, model, options={})
163
172
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
164
- post(path, model)
173
+ post(path, model, options)
165
174
  end
166
175
 
167
176
 
@@ -400,15 +409,18 @@ module AvaTax
400
409
  #
401
410
  # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
402
411
  #
412
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
413
+ #
403
414
  # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
404
415
  # sales, purchases, inventory transfer, and returns (also called refunds).
405
416
  # @param companyCode [String] The company code of the company that recorded this transaction
406
417
  # @param transactionCode [String] The transaction code to lock
418
+ # @param documentType [String] (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
407
419
  # @param model [Object] The lock request you wish to execute
408
420
  # @return [Object]
409
- def lock_transaction(companyCode, transactionCode, model)
421
+ def lock_transaction(companyCode, transactionCode, model, options={})
410
422
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
411
- post(path, model)
423
+ post(path, model, options)
412
424
  end
413
425
 
414
426
 
@@ -448,6 +460,7 @@ module AvaTax
448
460
  # @param companyCode [String] The code of the company that made the original sale
449
461
  # @param transactionCode [String] The transaction code of the original sale
450
462
  # @param include [String] Specifies objects to include in the response after transaction is created
463
+ # @param documentType [String] (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
451
464
  # @param model [Object] Information about the refund to create
452
465
  # @return [Object]
453
466
  def refund_transaction(companyCode, transactionCode, model, options={})
@@ -458,47 +471,68 @@ module AvaTax
458
471
 
459
472
  # Perform multiple actions on a transaction
460
473
  #
461
- # Performs the same functions as /verify, /changecode, and /commit. You may specify one or many actions in each call to this endpoint.
474
+ # Performs one or more actions against the current transaction uniquely identified by this URL.
475
+ #
476
+ # The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`.
477
+ #
478
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
479
+ # sales, purchases, inventory transfer, and returns (also called refunds).
480
+ #
481
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
482
+ #
483
+ # This API is available for users who want to execute more than one action at a time.
462
484
  # @param companyCode [String] The company code of the company that recorded this transaction
463
485
  # @param transactionCode [String] The transaction code to settle
464
- # @param model [Object] The settle request containing the actions you wish to execute
486
+ # @param documentType [String] (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
487
+ # @param model [Object] The data from an external system to reconcile against AvaTax
465
488
  # @return [Object]
466
- def settle_transaction(companyCode, transactionCode, model)
489
+ def settle_transaction(companyCode, transactionCode, model, options={})
467
490
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
468
- post(path, model)
491
+ post(path, model, options)
469
492
  end
470
493
 
471
494
 
472
495
  # Verify a transaction
473
496
  #
474
497
  # Verifies that the transaction uniquely identified by this URL matches certain expected values.
498
+ #
475
499
  # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
500
+ #
501
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
502
+ #
476
503
  # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
477
504
  # sales, purchases, inventory transfer, and returns (also called refunds).
478
505
  # @param companyCode [String] The company code of the company that recorded this transaction
479
506
  # @param transactionCode [String] The transaction code to settle
480
- # @param model [Object] The settle request you wish to execute
507
+ # @param documentType [String] (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
508
+ # @param model [Object] The data from an external system to reconcile against AvaTax
481
509
  # @return [Object]
482
- def verify_transaction(companyCode, transactionCode, model)
510
+ def verify_transaction(companyCode, transactionCode, model, options={})
483
511
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
484
- post(path, model)
512
+ post(path, model, options)
485
513
  end
486
514
 
487
515
 
488
516
  # Void a transaction
489
517
  #
490
518
  # Voids the current transaction uniquely identified by this URL.
519
+ #
491
520
  # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
492
521
  # sales, purchases, inventory transfer, and returns (also called refunds).
493
- # When you void a transaction, that transaction's status is recorded as 'DocVoided'.
522
+ #
523
+ # When you void a transaction, that transaction's status is recorded as `DocVoided`.
524
+ #
525
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
526
+ #
494
527
  # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
495
528
  # @param companyCode [String] The company code of the company that recorded this transaction
496
529
  # @param transactionCode [String] The transaction code to void
530
+ # @param documentType [String] (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
497
531
  # @param model [Object] The void request you wish to execute
498
532
  # @return [Object]
499
- def void_transaction(companyCode, transactionCode, model)
533
+ def void_transaction(companyCode, transactionCode, model, options={})
500
534
  path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
501
- post(path, model)
535
+ post(path, model, options)
502
536
  end
503
537
 
504
538
  end
@@ -19,9 +19,11 @@ module AvaTax
19
19
  }.merge(connection_options)
20
20
 
21
21
  Faraday.new(options) do |faraday|
22
- Oj.default_options = {
23
- bigdecimal_load: :bigdecimal
24
- }
22
+ if Gem::Version.new(RUBY_VERSION) > Gem::Version.new('2.2.2')
23
+ Oj.default_options = {
24
+ bigdecimal_load: :bigdecimal
25
+ }
26
+ end
25
27
 
26
28
  faraday.response :oj, content_type: /\bjson$/
27
29
  faraday.basic_auth(username, password)
@@ -1,3 +1,3 @@
1
1
  module AvaTax
2
- VERSION = '17.12.0'.freeze unless defined?(::AvaTax::VERSION)
2
+ VERSION = '18.1.2'.freeze unless defined?(::AvaTax::VERSION)
3
3
  end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path('../spec_helper', __FILE__)
2
- begin
2
+ if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
3
3
  credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
4
- rescue
4
+ else
5
5
  credentials = {
6
6
  "endpoint" => 'https://sandbox-rest.avatax.com',
7
7
  "username" => ENV['SANDBOX_USERNAME'],
@@ -4,12 +4,12 @@ require 'yaml'
4
4
 
5
5
 
6
6
  AvaTax.configure do |config|
7
- begin
7
+ if File.exist?(File.expand_path('../credentials.yaml', __FILE__))
8
8
  credentials = YAML.load_file(File.expand_path('../credentials.yaml', __FILE__))
9
9
  config.endpoint = credentials['endpoint']
10
10
  config.username = credentials['username']
11
11
  config.password = credentials['password']
12
- rescue
12
+ else
13
13
  config.endpoint = 'https://sandbox-rest.avatax.com'
14
14
  config.username = ENV['SANDBOX_USERNAME']
15
15
  config.password = ENV['SANDBOX_PASSWORD']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatax
3
3
  version: !ruby/object:Gem::Version
4
- version: 17.12.0
4
+ version: 18.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Vorwaller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-02 00:00:00.000000000 Z
11
+ date: 2018-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -152,6 +152,7 @@ files:
152
152
  - lib/avatax/client/contacts.rb
153
153
  - lib/avatax/client/customers.rb
154
154
  - lib/avatax/client/definitions.rb
155
+ - lib/avatax/client/distancethresholds.rb
155
156
  - lib/avatax/client/filingcalendars.rb
156
157
  - lib/avatax/client/filings.rb
157
158
  - lib/avatax/client/free.rb
@@ -217,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
218
  version: 2.0.0
218
219
  requirements: []
219
220
  rubyforge_project:
220
- rubygems_version: 2.5.2
221
+ rubygems_version: 2.7.3
221
222
  signing_key:
222
223
  specification_version: 4
223
224
  summary: Ruby wrapper for the AvaTax API