avatax 19.12.0 → 20.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/avatax.gemspec +0 -1
- data/lib/avatax/client/accounts.rb +269 -193
- data/lib/avatax/client/addresses.rb +60 -60
- data/lib/avatax/client/advancedrules.rb +81 -162
- data/lib/avatax/client/avafileforms.rb +93 -93
- data/lib/avatax/client/batches.rb +247 -188
- data/lib/avatax/client/certexpressinvites.rb +106 -106
- data/lib/avatax/client/certificates.rb +469 -469
- data/lib/avatax/client/companies.rb +400 -398
- data/lib/avatax/client/compliance.rb +18 -18
- data/lib/avatax/client/contacts.rb +124 -124
- data/lib/avatax/client/customers.rb +415 -415
- data/lib/avatax/client/datasources.rb +117 -117
- data/lib/avatax/client/definitions.rb +1039 -1007
- data/lib/avatax/client/distancethresholds.rb +140 -140
- data/lib/avatax/client/filingcalendars.rb +23 -508
- data/lib/avatax/client/filings.rb +29 -29
- data/lib/avatax/client/firmclientlinkages.rb +150 -150
- data/lib/avatax/client/free.rb +109 -109
- data/lib/avatax/client/fundingrequests.rb +58 -58
- data/lib/avatax/client/items.rb +480 -480
- data/lib/avatax/client/jurisdictionoverrides.rb +136 -136
- data/lib/avatax/client/locations.rb +163 -160
- data/lib/avatax/client/multidocument.rb +420 -340
- data/lib/avatax/client/nexus.rb +240 -225
- data/lib/avatax/client/notifications.rb +84 -84
- data/lib/avatax/client/provisioning.rb +55 -55
- data/lib/avatax/client/registrar.rb +228 -228
- data/lib/avatax/client/reports.rb +109 -109
- data/lib/avatax/client/settings.rb +174 -174
- data/lib/avatax/client/subscriptions.rb +71 -71
- data/lib/avatax/client/taxcodes.rb +138 -138
- data/lib/avatax/client/taxcontent.rb +142 -142
- data/lib/avatax/client/taxrules.rb +188 -188
- data/lib/avatax/client/transactions.rb +899 -854
- data/lib/avatax/client/upcs.rb +129 -129
- data/lib/avatax/client/users.rb +207 -207
- data/lib/avatax/client/utilities.rb +70 -70
- data/lib/avatax/connection.rb +3 -3
- data/lib/avatax/request.rb +2 -0
- data/lib/avatax/version.rb +1 -1
- metadata +4 -25
@@ -1,470 +1,470 @@
|
|
1
|
-
module AvaTax
|
2
|
-
class Client
|
3
|
-
module Certificates
|
4
|
-
|
5
|
-
|
6
|
-
# Create certificates for this company
|
7
|
-
#
|
8
|
-
# Record one or more certificates document for this company.
|
9
|
-
#
|
10
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
11
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
12
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
13
|
-
# log onto the administrative website for the product you purchased.
|
14
|
-
#
|
15
|
-
# When you create a certificate, it will be processed by Avalara and will become available for use in
|
16
|
-
# calculating tax exemptions when processing is complete. For a certificate to be used in calculating exemptions,
|
17
|
-
# it must have the following:
|
18
|
-
#
|
19
|
-
# *
|
20
|
-
# * A link to the customer that is allowed to use this certificate
|
21
|
-
# * Your tax transaction must contain the correct customer code
|
22
|
-
#
|
23
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
24
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
25
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
26
|
-
# storage for this company, call `RequestCertificateSetup`.
|
27
|
-
#
|
28
|
-
# If the users specified in the certificates do not exist, the API will create the user and link them to the certificate
|
29
|
-
#
|
30
|
-
# ### Security Policies
|
31
|
-
#
|
32
|
-
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
33
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
34
|
-
# @param companyId [Integer] The ID number of the company recording this certificate
|
35
|
-
# @param preValidatedExemptionReason [Boolean] If set to true, the certificate will bypass the human verification process.
|
36
|
-
# @param model [CertificateModel[]] Certificates to be created
|
37
|
-
# @return [CertificateModel[]]
|
38
|
-
def create_certificates(companyId, model, options={})
|
39
|
-
path = "/api/v2/companies/#{companyId}/certificates"
|
40
|
-
post(path, model, options)
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
# Revoke and delete a certificate
|
45
|
-
#
|
46
|
-
# Revoke the certificate identified by this URL, then delete it.
|
47
|
-
#
|
48
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
49
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
50
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
51
|
-
# log onto the administrative website for the product you purchased.
|
52
|
-
#
|
53
|
-
# Revoked certificates can no longer be used.
|
54
|
-
#
|
55
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
56
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
57
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
58
|
-
# storage for this company, call `RequestCertificateSetup`.
|
59
|
-
#
|
60
|
-
# ### Security Policies
|
61
|
-
#
|
62
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
63
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
64
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
65
|
-
# @param id [Integer] The unique ID number of this certificate
|
66
|
-
# @return [ErrorDetail[]]
|
67
|
-
def delete_certificate(companyId, id)
|
68
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
69
|
-
delete(path)
|
70
|
-
end
|
71
|
-
|
72
|
-
|
73
|
-
# Download an image for this certificate
|
74
|
-
#
|
75
|
-
# Download an image or PDF file for this certificate.
|
76
|
-
#
|
77
|
-
# This API can be used to download either a single-page preview of the certificate or a full PDF document.
|
78
|
-
# To retrieve a preview image, set the `$type` parameter to `Jpeg` and the `$page` parameter to `1`.
|
79
|
-
#
|
80
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
81
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
82
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
83
|
-
# log onto the administrative website for the product you purchased.
|
84
|
-
#
|
85
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
86
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
87
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
88
|
-
# storage for this company, call `RequestCertificateSetup`.
|
89
|
-
#
|
90
|
-
# ### Security Policies
|
91
|
-
#
|
92
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
93
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
94
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
95
|
-
# @param id [Integer] The unique ID number of this certificate
|
96
|
-
# @param page [Integer] If you choose `$type`=`Jpeg`, you must specify which page number to retrieve.
|
97
|
-
# @param type [String] The data format in which to retrieve the certificate image (See CertificatePreviewType::* for a list of allowable values)
|
98
|
-
# @return [Object]
|
99
|
-
def download_certificate_image(companyId, id, options={})
|
100
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
|
101
|
-
get(path, options)
|
102
|
-
end
|
103
|
-
|
104
|
-
|
105
|
-
# Retrieve a single certificate
|
106
|
-
#
|
107
|
-
# Get the current certificate identified by this URL.
|
108
|
-
#
|
109
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
110
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
111
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
112
|
-
# log onto the administrative website for the product you purchased.
|
113
|
-
#
|
114
|
-
# You can use the `$include` parameter to fetch the following additional objects for expansion:
|
115
|
-
#
|
116
|
-
# * customers - Retrieves the list of customers linked to the certificate.
|
117
|
-
# * po_numbers - Retrieves all PO numbers tied to the certificate.
|
118
|
-
# * attributes - Retrieves all attributes applied to the certificate.
|
119
|
-
#
|
120
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
121
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
122
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
123
|
-
# storage for this company, call `RequestCertificateSetup`.
|
124
|
-
#
|
125
|
-
# ### Security Policies
|
126
|
-
#
|
127
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
128
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
129
|
-
# @param companyId [Integer] The ID number of the company that recorded this certificate
|
130
|
-
# @param id [Integer] The unique ID number of this certificate
|
131
|
-
# @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. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
|
132
|
-
# @return [Object]
|
133
|
-
def get_certificate(companyId, id, options={})
|
134
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
135
|
-
get(path, options)
|
136
|
-
end
|
137
|
-
|
138
|
-
|
139
|
-
# Check a company's exemption certificate status.
|
140
|
-
#
|
141
|
-
# Checks whether this company is configured to use exemption certificates in AvaTax.
|
142
|
-
#
|
143
|
-
# Exemption certificates are tracked through a different auditable data store than the one that
|
144
|
-
# holds AvaTax transactions. To use the AvaTax exemption certificate document store, please call
|
145
|
-
# `GetCertificateSetup` to see if your company is configured to use the exemption certificate
|
146
|
-
# document store. To request setup, please call `RequestCertificateSetup` and your company will
|
147
|
-
# be configured with data storage in the auditable certificate system.
|
148
|
-
#
|
149
|
-
# ### Security Policies
|
150
|
-
#
|
151
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
152
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
153
|
-
# @param companyId [Integer] The company ID to check
|
154
|
-
# @return [Object]
|
155
|
-
def get_certificate_setup(companyId)
|
156
|
-
path = "/api/v2/companies/#{companyId}/certificates/setup"
|
157
|
-
get(path)
|
158
|
-
end
|
159
|
-
|
160
|
-
|
161
|
-
# Link attributes to a certificate
|
162
|
-
#
|
163
|
-
# Link one or many attributes to a certificate.
|
164
|
-
#
|
165
|
-
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
166
|
-
# certificate at any time. The full list of defined attributes may be found using `ListCertificateAttributes`.
|
167
|
-
#
|
168
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
169
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
170
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
171
|
-
# log onto the administrative website for the product you purchased.
|
172
|
-
#
|
173
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
174
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
175
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
176
|
-
# storage for this company, call `RequestCertificateSetup`.
|
177
|
-
#
|
178
|
-
# ### Security Policies
|
179
|
-
#
|
180
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
181
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
182
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
183
|
-
# @param id [Integer] The unique ID number of this certificate
|
184
|
-
# @param model [CertificateAttributeModel[]] The list of attributes to link to this certificate.
|
185
|
-
# @return [FetchResult]
|
186
|
-
def link_attributes_to_certificate(companyId, id, model)
|
187
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/link"
|
188
|
-
post(path, model)
|
189
|
-
end
|
190
|
-
|
191
|
-
|
192
|
-
# Link customers to a certificate
|
193
|
-
#
|
194
|
-
# Link one or more customers to an existing certificate.
|
195
|
-
#
|
196
|
-
# Customers and certificates must be linked before a customer can make use of a certificate to obtain
|
197
|
-
# a tax exemption in AvaTax. Since some certificates may cover more than one business entity, a certificate
|
198
|
-
# can be connected to multiple customer records using the `LinkCustomersToCertificate` API.
|
199
|
-
#
|
200
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
201
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
202
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
203
|
-
# log onto the administrative website for the product you purchased.
|
204
|
-
#
|
205
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
206
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
207
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
208
|
-
# storage for this company, call `RequestCertificateSetup`.
|
209
|
-
#
|
210
|
-
# ### Security Policies
|
211
|
-
#
|
212
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
213
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
214
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
215
|
-
# @param id [Integer] The unique ID number of this certificate
|
216
|
-
# @param model [Object] The list of customers needed be added to the Certificate for exemption
|
217
|
-
# @return [FetchResult]
|
218
|
-
def link_customers_to_certificate(companyId, id, model)
|
219
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/link"
|
220
|
-
post(path, model)
|
221
|
-
end
|
222
|
-
|
223
|
-
|
224
|
-
# List all attributes applied to this certificate
|
225
|
-
#
|
226
|
-
# Retrieve the list of attributes that are linked to this certificate.
|
227
|
-
#
|
228
|
-
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
229
|
-
# certificate at any time. The full list of defined attributes may be found using [ListCertificateAttributes](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListCertificateAttributes/) API.
|
230
|
-
#
|
231
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
232
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
233
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
234
|
-
# log onto the administrative website for the product you purchased.
|
235
|
-
#
|
236
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
237
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
238
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
239
|
-
# storage for this company, call `RequestCertificateSetup`.
|
240
|
-
#
|
241
|
-
# ### Security Policies
|
242
|
-
#
|
243
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
244
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
245
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
246
|
-
# @param id [Integer] The unique ID number of this certificate
|
247
|
-
# @return [FetchResult]
|
248
|
-
def list_attributes_for_certificate(companyId, id)
|
249
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes"
|
250
|
-
get(path)
|
251
|
-
end
|
252
|
-
|
253
|
-
|
254
|
-
# List customers linked to this certificate
|
255
|
-
#
|
256
|
-
# List all customers linked to this certificate.
|
257
|
-
#
|
258
|
-
# Customers must be linked to a certificate in order to make use of its tax exemption features. You
|
259
|
-
# can link or unlink customers to a certificate at any time.
|
260
|
-
#
|
261
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
262
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
263
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
264
|
-
# log onto the administrative website for the product you purchased.
|
265
|
-
#
|
266
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
267
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
268
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
269
|
-
# storage for this company, call `RequestCertificateSetup`.
|
270
|
-
#
|
271
|
-
# ### Security Policies
|
272
|
-
#
|
273
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
274
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
275
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
276
|
-
# @param id [Integer] The unique ID number of this certificate
|
277
|
-
# @param include [String] OPTIONAL: A comma separated list of special fetch options. No options are currently available when fetching customers.
|
278
|
-
# @return [FetchResult]
|
279
|
-
def list_customers_for_certificate(companyId, id, options={})
|
280
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers"
|
281
|
-
get(path, options)
|
282
|
-
end
|
283
|
-
|
284
|
-
|
285
|
-
# List all certificates for a company
|
286
|
-
#
|
287
|
-
# List all certificates recorded by a company
|
288
|
-
#
|
289
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
290
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
291
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
292
|
-
# log onto the administrative website for the product you purchased.
|
293
|
-
#
|
294
|
-
# You can use the `$include` parameter to fetch the following additional objects for expansion:
|
295
|
-
#
|
296
|
-
# * customers - Retrieves the list of customers linked to the certificate.
|
297
|
-
# * po_numbers - Retrieves all PO numbers tied to the certificate.
|
298
|
-
# * attributes - Retrieves all attributes applied to the certificate.
|
299
|
-
#
|
300
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
301
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
302
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
303
|
-
# storage for this company, call `RequestCertificateSetup`.
|
304
|
-
#
|
305
|
-
# ### Security Policies
|
306
|
-
#
|
307
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
308
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
309
|
-
# @param companyId [Integer] The ID number of the company to search
|
310
|
-
# @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. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
|
311
|
-
# @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:* exemptionNumber, status, ecmsId, ecmsStatus, pdf, pages
|
312
|
-
# @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.
|
313
|
-
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
314
|
-
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
315
|
-
# @return [FetchResult]
|
316
|
-
def query_certificates(companyId, options={})
|
317
|
-
path = "/api/v2/companies/#{companyId}/certificates"
|
318
|
-
get(path, options)
|
319
|
-
end
|
320
|
-
|
321
|
-
|
322
|
-
# Request setup of exemption certificates for this company.
|
323
|
-
#
|
324
|
-
# Requests the setup of exemption certificates for this company.
|
325
|
-
#
|
326
|
-
# Exemption certificates are tracked through a different auditable data store than the one that
|
327
|
-
# holds AvaTax transactions. To use the AvaTax exemption certificate document store, please call
|
328
|
-
# `GetCertificateSetup` to see if your company is configured to use the exemption certificate
|
329
|
-
# document store. To request setup, please call `RequestCertificateSetup` and your company will
|
330
|
-
# be configured with data storage in the auditable certificate system.
|
331
|
-
#
|
332
|
-
# This API will return the current status of exemption certificate setup for this company.
|
333
|
-
#
|
334
|
-
# ### Security Policies
|
335
|
-
#
|
336
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
337
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
338
|
-
# @param companyId [Integer]
|
339
|
-
# @return [Object]
|
340
|
-
def request_certificate_setup(companyId)
|
341
|
-
path = "/api/v2/companies/#{companyId}/certificates/setup"
|
342
|
-
post(path)
|
343
|
-
end
|
344
|
-
|
345
|
-
|
346
|
-
# Unlink attributes from a certificate
|
347
|
-
#
|
348
|
-
# Unlink one or many attributes from a certificate.
|
349
|
-
#
|
350
|
-
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
351
|
-
# certificate at any time. The full list of defined attributes may be found using `ListCertificateAttributes`.
|
352
|
-
#
|
353
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
354
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
355
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
356
|
-
# log onto the administrative website for the product you purchased.
|
357
|
-
#
|
358
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
359
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
360
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
361
|
-
# storage for this company, call `RequestCertificateSetup`.
|
362
|
-
#
|
363
|
-
# ### Security Policies
|
364
|
-
#
|
365
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
366
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
367
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
368
|
-
# @param id [Integer] The unique ID number of this certificate
|
369
|
-
# @param model [CertificateAttributeModel[]] The list of attributes to unlink from this certificate.
|
370
|
-
# @return [FetchResult]
|
371
|
-
def unlink_attributes_from_certificate(companyId, id, model)
|
372
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/unlink"
|
373
|
-
post(path, model)
|
374
|
-
end
|
375
|
-
|
376
|
-
|
377
|
-
# Unlink customers from a certificate
|
378
|
-
#
|
379
|
-
# Unlinks one or more customers from a certificate.
|
380
|
-
#
|
381
|
-
# Unlinking a certificate from a customer will prevent the certificate from being used to generate
|
382
|
-
# tax exemptions for the customer in the future. If any previous transactions for this customer had
|
383
|
-
# used this linked certificate, those transactions will be unchanged and will still have a link to the
|
384
|
-
# exemption certificate in question.
|
385
|
-
#
|
386
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
387
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
388
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
389
|
-
# log onto the administrative website for the product you purchased.
|
390
|
-
#
|
391
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
392
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
393
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
394
|
-
# storage for this company, call `RequestCertificateSetup`.
|
395
|
-
#
|
396
|
-
# ### Security Policies
|
397
|
-
#
|
398
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
399
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
400
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
401
|
-
# @param id [Integer] The unique ID number of this certificate
|
402
|
-
# @param model [Object] The list of customers to unlink from this certificate
|
403
|
-
# @return [FetchResult]
|
404
|
-
def unlink_customers_from_certificate(companyId, id, model)
|
405
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/unlink"
|
406
|
-
post(path, model)
|
407
|
-
end
|
408
|
-
|
409
|
-
|
410
|
-
# Update a single certificate
|
411
|
-
#
|
412
|
-
# Replace the certificate identified by this URL with a new one.
|
413
|
-
#
|
414
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
415
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
416
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
417
|
-
# log onto the administrative website for the product you purchased.
|
418
|
-
#
|
419
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
420
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
421
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
422
|
-
# storage for this company, call `RequestCertificateSetup`.
|
423
|
-
#
|
424
|
-
# ### Security Policies
|
425
|
-
#
|
426
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
427
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
428
|
-
# @param companyId [Integer] The ID number of the company that recorded this certificate
|
429
|
-
# @param id [Integer] The unique ID number of this certificate
|
430
|
-
# @param model [Object] The new certificate object that will replace the existing one
|
431
|
-
# @return [Object]
|
432
|
-
def update_certificate(companyId, id, model)
|
433
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
434
|
-
put(path, model)
|
435
|
-
end
|
436
|
-
|
437
|
-
|
438
|
-
# Upload an image or PDF attachment for this certificate
|
439
|
-
#
|
440
|
-
# Upload an image or PDF attachment for this certificate.
|
441
|
-
#
|
442
|
-
# Image attachments can be of the format `PDF`, `JPEG`, `TIFF`, or `PNG`. To upload a multi-page image, please
|
443
|
-
# use the `PDF` data type.
|
444
|
-
#
|
445
|
-
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
446
|
-
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
447
|
-
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
448
|
-
# log onto the administrative website for the product you purchased.
|
449
|
-
#
|
450
|
-
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
451
|
-
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
452
|
-
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
453
|
-
# storage for this company, call `RequestCertificateSetup`.
|
454
|
-
#
|
455
|
-
# ### Security Policies
|
456
|
-
#
|
457
|
-
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
458
|
-
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
459
|
-
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
460
|
-
# @param id [Integer] The unique ID number of this certificate
|
461
|
-
# @param file [Object] The exemption certificate file you wanted to upload. Accepted formats are: PDF, JPEG, TIFF, PNG.
|
462
|
-
# @return [String]
|
463
|
-
def upload_certificate_image(companyId, id)
|
464
|
-
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
|
465
|
-
post(path)
|
466
|
-
end
|
467
|
-
|
468
|
-
end
|
469
|
-
end
|
1
|
+
module AvaTax
|
2
|
+
class Client
|
3
|
+
module Certificates
|
4
|
+
|
5
|
+
|
6
|
+
# Create certificates for this company
|
7
|
+
#
|
8
|
+
# Record one or more certificates document for this company.
|
9
|
+
#
|
10
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
11
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
12
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
13
|
+
# log onto the administrative website for the product you purchased.
|
14
|
+
#
|
15
|
+
# When you create a certificate, it will be processed by Avalara and will become available for use in
|
16
|
+
# calculating tax exemptions when processing is complete. For a certificate to be used in calculating exemptions,
|
17
|
+
# it must have the following:
|
18
|
+
#
|
19
|
+
# * An exposure zone indicating where the certificate is valid
|
20
|
+
# * A link to the customer that is allowed to use this certificate
|
21
|
+
# * Your tax transaction must contain the correct customer code
|
22
|
+
#
|
23
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
24
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
25
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
26
|
+
# storage for this company, call `RequestCertificateSetup`.
|
27
|
+
#
|
28
|
+
# If the users specified in the certificates do not exist, the API will create the user and link them to the certificate
|
29
|
+
#
|
30
|
+
# ### Security Policies
|
31
|
+
#
|
32
|
+
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
|
33
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
34
|
+
# @param companyId [Integer] The ID number of the company recording this certificate
|
35
|
+
# @param preValidatedExemptionReason [Boolean] If set to true, the certificate will bypass the human verification process.
|
36
|
+
# @param model [CertificateModel[]] Certificates to be created
|
37
|
+
# @return [CertificateModel[]]
|
38
|
+
def create_certificates(companyId, model, options={})
|
39
|
+
path = "/api/v2/companies/#{companyId}/certificates"
|
40
|
+
post(path, model, options)
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
# Revoke and delete a certificate
|
45
|
+
#
|
46
|
+
# Revoke the certificate identified by this URL, then delete it.
|
47
|
+
#
|
48
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
49
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
50
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
51
|
+
# log onto the administrative website for the product you purchased.
|
52
|
+
#
|
53
|
+
# Revoked certificates can no longer be used.
|
54
|
+
#
|
55
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
56
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
57
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
58
|
+
# storage for this company, call `RequestCertificateSetup`.
|
59
|
+
#
|
60
|
+
# ### Security Policies
|
61
|
+
#
|
62
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
63
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
64
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
65
|
+
# @param id [Integer] The unique ID number of this certificate
|
66
|
+
# @return [ErrorDetail[]]
|
67
|
+
def delete_certificate(companyId, id)
|
68
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
69
|
+
delete(path)
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
# Download an image for this certificate
|
74
|
+
#
|
75
|
+
# Download an image or PDF file for this certificate.
|
76
|
+
#
|
77
|
+
# This API can be used to download either a single-page preview of the certificate or a full PDF document.
|
78
|
+
# To retrieve a preview image, set the `$type` parameter to `Jpeg` and the `$page` parameter to `1`.
|
79
|
+
#
|
80
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
81
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
82
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
83
|
+
# log onto the administrative website for the product you purchased.
|
84
|
+
#
|
85
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
86
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
87
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
88
|
+
# storage for this company, call `RequestCertificateSetup`.
|
89
|
+
#
|
90
|
+
# ### Security Policies
|
91
|
+
#
|
92
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
93
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
94
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
95
|
+
# @param id [Integer] The unique ID number of this certificate
|
96
|
+
# @param page [Integer] If you choose `$type`=`Jpeg`, you must specify which page number to retrieve.
|
97
|
+
# @param type [String] The data format in which to retrieve the certificate image (See CertificatePreviewType::* for a list of allowable values)
|
98
|
+
# @return [Object]
|
99
|
+
def download_certificate_image(companyId, id, options={})
|
100
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
|
101
|
+
get(path, options)
|
102
|
+
end
|
103
|
+
|
104
|
+
|
105
|
+
# Retrieve a single certificate
|
106
|
+
#
|
107
|
+
# Get the current certificate identified by this URL.
|
108
|
+
#
|
109
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
110
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
111
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
112
|
+
# log onto the administrative website for the product you purchased.
|
113
|
+
#
|
114
|
+
# You can use the `$include` parameter to fetch the following additional objects for expansion:
|
115
|
+
#
|
116
|
+
# * customers - Retrieves the list of customers linked to the certificate.
|
117
|
+
# * po_numbers - Retrieves all PO numbers tied to the certificate.
|
118
|
+
# * attributes - Retrieves all attributes applied to the certificate.
|
119
|
+
#
|
120
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
121
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
122
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
123
|
+
# storage for this company, call `RequestCertificateSetup`.
|
124
|
+
#
|
125
|
+
# ### Security Policies
|
126
|
+
#
|
127
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
128
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
129
|
+
# @param companyId [Integer] The ID number of the company that recorded this certificate
|
130
|
+
# @param id [Integer] The unique ID number of this certificate
|
131
|
+
# @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. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
|
132
|
+
# @return [Object]
|
133
|
+
def get_certificate(companyId, id, options={})
|
134
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
135
|
+
get(path, options)
|
136
|
+
end
|
137
|
+
|
138
|
+
|
139
|
+
# Check a company's exemption certificate status.
|
140
|
+
#
|
141
|
+
# Checks whether this company is configured to use exemption certificates in AvaTax.
|
142
|
+
#
|
143
|
+
# Exemption certificates are tracked through a different auditable data store than the one that
|
144
|
+
# holds AvaTax transactions. To use the AvaTax exemption certificate document store, please call
|
145
|
+
# `GetCertificateSetup` to see if your company is configured to use the exemption certificate
|
146
|
+
# document store. To request setup, please call `RequestCertificateSetup` and your company will
|
147
|
+
# be configured with data storage in the auditable certificate system.
|
148
|
+
#
|
149
|
+
# ### Security Policies
|
150
|
+
#
|
151
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
152
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
153
|
+
# @param companyId [Integer] The company ID to check
|
154
|
+
# @return [Object]
|
155
|
+
def get_certificate_setup(companyId)
|
156
|
+
path = "/api/v2/companies/#{companyId}/certificates/setup"
|
157
|
+
get(path)
|
158
|
+
end
|
159
|
+
|
160
|
+
|
161
|
+
# Link attributes to a certificate
|
162
|
+
#
|
163
|
+
# Link one or many attributes to a certificate.
|
164
|
+
#
|
165
|
+
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
166
|
+
# certificate at any time. The full list of defined attributes may be found using `ListCertificateAttributes`.
|
167
|
+
#
|
168
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
169
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
170
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
171
|
+
# log onto the administrative website for the product you purchased.
|
172
|
+
#
|
173
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
174
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
175
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
176
|
+
# storage for this company, call `RequestCertificateSetup`.
|
177
|
+
#
|
178
|
+
# ### Security Policies
|
179
|
+
#
|
180
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
181
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
182
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
183
|
+
# @param id [Integer] The unique ID number of this certificate
|
184
|
+
# @param model [CertificateAttributeModel[]] The list of attributes to link to this certificate.
|
185
|
+
# @return [FetchResult]
|
186
|
+
def link_attributes_to_certificate(companyId, id, model)
|
187
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/link"
|
188
|
+
post(path, model)
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
# Link customers to a certificate
|
193
|
+
#
|
194
|
+
# Link one or more customers to an existing certificate.
|
195
|
+
#
|
196
|
+
# Customers and certificates must be linked before a customer can make use of a certificate to obtain
|
197
|
+
# a tax exemption in AvaTax. Since some certificates may cover more than one business entity, a certificate
|
198
|
+
# can be connected to multiple customer records using the `LinkCustomersToCertificate` API.
|
199
|
+
#
|
200
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
201
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
202
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
203
|
+
# log onto the administrative website for the product you purchased.
|
204
|
+
#
|
205
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
206
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
207
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
208
|
+
# storage for this company, call `RequestCertificateSetup`.
|
209
|
+
#
|
210
|
+
# ### Security Policies
|
211
|
+
#
|
212
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
213
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
214
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
215
|
+
# @param id [Integer] The unique ID number of this certificate
|
216
|
+
# @param model [Object] The list of customers needed be added to the Certificate for exemption
|
217
|
+
# @return [FetchResult]
|
218
|
+
def link_customers_to_certificate(companyId, id, model)
|
219
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/link"
|
220
|
+
post(path, model)
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
# List all attributes applied to this certificate
|
225
|
+
#
|
226
|
+
# Retrieve the list of attributes that are linked to this certificate.
|
227
|
+
#
|
228
|
+
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
229
|
+
# certificate at any time. The full list of defined attributes may be found using [ListCertificateAttributes](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Definitions/ListCertificateAttributes/) API.
|
230
|
+
#
|
231
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
232
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
233
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
234
|
+
# log onto the administrative website for the product you purchased.
|
235
|
+
#
|
236
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
237
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
238
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
239
|
+
# storage for this company, call `RequestCertificateSetup`.
|
240
|
+
#
|
241
|
+
# ### Security Policies
|
242
|
+
#
|
243
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
244
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
245
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
246
|
+
# @param id [Integer] The unique ID number of this certificate
|
247
|
+
# @return [FetchResult]
|
248
|
+
def list_attributes_for_certificate(companyId, id)
|
249
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes"
|
250
|
+
get(path)
|
251
|
+
end
|
252
|
+
|
253
|
+
|
254
|
+
# List customers linked to this certificate
|
255
|
+
#
|
256
|
+
# List all customers linked to this certificate.
|
257
|
+
#
|
258
|
+
# Customers must be linked to a certificate in order to make use of its tax exemption features. You
|
259
|
+
# can link or unlink customers to a certificate at any time.
|
260
|
+
#
|
261
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
262
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
263
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
264
|
+
# log onto the administrative website for the product you purchased.
|
265
|
+
#
|
266
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
267
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
268
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
269
|
+
# storage for this company, call `RequestCertificateSetup`.
|
270
|
+
#
|
271
|
+
# ### Security Policies
|
272
|
+
#
|
273
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
274
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
275
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
276
|
+
# @param id [Integer] The unique ID number of this certificate
|
277
|
+
# @param include [String] OPTIONAL: A comma separated list of special fetch options. No options are currently available when fetching customers.
|
278
|
+
# @return [FetchResult]
|
279
|
+
def list_customers_for_certificate(companyId, id, options={})
|
280
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers"
|
281
|
+
get(path, options)
|
282
|
+
end
|
283
|
+
|
284
|
+
|
285
|
+
# List all certificates for a company
|
286
|
+
#
|
287
|
+
# List all certificates recorded by a company
|
288
|
+
#
|
289
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
290
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
291
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
292
|
+
# log onto the administrative website for the product you purchased.
|
293
|
+
#
|
294
|
+
# You can use the `$include` parameter to fetch the following additional objects for expansion:
|
295
|
+
#
|
296
|
+
# * customers - Retrieves the list of customers linked to the certificate.
|
297
|
+
# * po_numbers - Retrieves all PO numbers tied to the certificate.
|
298
|
+
# * attributes - Retrieves all attributes applied to the certificate.
|
299
|
+
#
|
300
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
301
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
302
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
303
|
+
# storage for this company, call `RequestCertificateSetup`.
|
304
|
+
#
|
305
|
+
# ### Security Policies
|
306
|
+
#
|
307
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
308
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
309
|
+
# @param companyId [Integer] The ID number of the company to search
|
310
|
+
# @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. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
|
311
|
+
# @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:* exemptionNumber, status, ecmsId, ecmsStatus, pdf, pages
|
312
|
+
# @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.
|
313
|
+
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
|
314
|
+
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
315
|
+
# @return [FetchResult]
|
316
|
+
def query_certificates(companyId, options={})
|
317
|
+
path = "/api/v2/companies/#{companyId}/certificates"
|
318
|
+
get(path, options)
|
319
|
+
end
|
320
|
+
|
321
|
+
|
322
|
+
# Request setup of exemption certificates for this company.
|
323
|
+
#
|
324
|
+
# Requests the setup of exemption certificates for this company.
|
325
|
+
#
|
326
|
+
# Exemption certificates are tracked through a different auditable data store than the one that
|
327
|
+
# holds AvaTax transactions. To use the AvaTax exemption certificate document store, please call
|
328
|
+
# `GetCertificateSetup` to see if your company is configured to use the exemption certificate
|
329
|
+
# document store. To request setup, please call `RequestCertificateSetup` and your company will
|
330
|
+
# be configured with data storage in the auditable certificate system.
|
331
|
+
#
|
332
|
+
# This API will return the current status of exemption certificate setup for this company.
|
333
|
+
#
|
334
|
+
# ### Security Policies
|
335
|
+
#
|
336
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
337
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
338
|
+
# @param companyId [Integer]
|
339
|
+
# @return [Object]
|
340
|
+
def request_certificate_setup(companyId)
|
341
|
+
path = "/api/v2/companies/#{companyId}/certificates/setup"
|
342
|
+
post(path)
|
343
|
+
end
|
344
|
+
|
345
|
+
|
346
|
+
# Unlink attributes from a certificate
|
347
|
+
#
|
348
|
+
# Unlink one or many attributes from a certificate.
|
349
|
+
#
|
350
|
+
# A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
|
351
|
+
# certificate at any time. The full list of defined attributes may be found using `ListCertificateAttributes`.
|
352
|
+
#
|
353
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
354
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
355
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
356
|
+
# log onto the administrative website for the product you purchased.
|
357
|
+
#
|
358
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
359
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
360
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
361
|
+
# storage for this company, call `RequestCertificateSetup`.
|
362
|
+
#
|
363
|
+
# ### Security Policies
|
364
|
+
#
|
365
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
366
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
367
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
368
|
+
# @param id [Integer] The unique ID number of this certificate
|
369
|
+
# @param model [CertificateAttributeModel[]] The list of attributes to unlink from this certificate.
|
370
|
+
# @return [FetchResult]
|
371
|
+
def unlink_attributes_from_certificate(companyId, id, model)
|
372
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/unlink"
|
373
|
+
post(path, model)
|
374
|
+
end
|
375
|
+
|
376
|
+
|
377
|
+
# Unlink customers from a certificate
|
378
|
+
#
|
379
|
+
# Unlinks one or more customers from a certificate.
|
380
|
+
#
|
381
|
+
# Unlinking a certificate from a customer will prevent the certificate from being used to generate
|
382
|
+
# tax exemptions for the customer in the future. If any previous transactions for this customer had
|
383
|
+
# used this linked certificate, those transactions will be unchanged and will still have a link to the
|
384
|
+
# exemption certificate in question.
|
385
|
+
#
|
386
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
387
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
388
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
389
|
+
# log onto the administrative website for the product you purchased.
|
390
|
+
#
|
391
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
392
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
393
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
394
|
+
# storage for this company, call `RequestCertificateSetup`.
|
395
|
+
#
|
396
|
+
# ### Security Policies
|
397
|
+
#
|
398
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
399
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
400
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
401
|
+
# @param id [Integer] The unique ID number of this certificate
|
402
|
+
# @param model [Object] The list of customers to unlink from this certificate
|
403
|
+
# @return [FetchResult]
|
404
|
+
def unlink_customers_from_certificate(companyId, id, model)
|
405
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/unlink"
|
406
|
+
post(path, model)
|
407
|
+
end
|
408
|
+
|
409
|
+
|
410
|
+
# Update a single certificate
|
411
|
+
#
|
412
|
+
# Replace the certificate identified by this URL with a new one.
|
413
|
+
#
|
414
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
415
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
416
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
417
|
+
# log onto the administrative website for the product you purchased.
|
418
|
+
#
|
419
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
420
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
421
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
422
|
+
# storage for this company, call `RequestCertificateSetup`.
|
423
|
+
#
|
424
|
+
# ### Security Policies
|
425
|
+
#
|
426
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
|
427
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
428
|
+
# @param companyId [Integer] The ID number of the company that recorded this certificate
|
429
|
+
# @param id [Integer] The unique ID number of this certificate
|
430
|
+
# @param model [Object] The new certificate object that will replace the existing one
|
431
|
+
# @return [Object]
|
432
|
+
def update_certificate(companyId, id, model)
|
433
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}"
|
434
|
+
put(path, model)
|
435
|
+
end
|
436
|
+
|
437
|
+
|
438
|
+
# Upload an image or PDF attachment for this certificate
|
439
|
+
#
|
440
|
+
# Upload an image or PDF attachment for this certificate.
|
441
|
+
#
|
442
|
+
# Image attachments can be of the format `PDF`, `JPEG`, `TIFF`, or `PNG`. To upload a multi-page image, please
|
443
|
+
# use the `PDF` data type.
|
444
|
+
#
|
445
|
+
# A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
|
446
|
+
# can contain information about a customer's eligibility for exemption from sales or use taxes based on
|
447
|
+
# criteria you specify when you store the certificate. To view or manage your certificates directly, please
|
448
|
+
# log onto the administrative website for the product you purchased.
|
449
|
+
#
|
450
|
+
# Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
|
451
|
+
# Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
|
452
|
+
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
|
453
|
+
# storage for this company, call `RequestCertificateSetup`.
|
454
|
+
#
|
455
|
+
# ### Security Policies
|
456
|
+
#
|
457
|
+
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
|
458
|
+
# * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
|
459
|
+
# @param companyId [Integer] The unique ID number of the company that recorded this certificate
|
460
|
+
# @param id [Integer] The unique ID number of this certificate
|
461
|
+
# @param file [Object] The exemption certificate file you wanted to upload. Accepted formats are: PDF, JPEG, TIFF, PNG.
|
462
|
+
# @return [String]
|
463
|
+
def upload_certificate_image(companyId, id)
|
464
|
+
path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
|
465
|
+
post(path)
|
466
|
+
end
|
467
|
+
|
468
|
+
end
|
469
|
+
end
|
470
470
|
end
|