-
Notifications
You must be signed in to change notification settings - Fork 32
/
client_methods.py
10318 lines (9096 loc) · 761 KB
/
client_methods.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import requests
from _str_version import str_type
from ava_logger import decorate_all_methods, ava_log
@decorate_all_methods(ava_log) # class decorator to implement logging
class Mixin:
"""Mixin class contain methods attached to Client class."""
r"""
Swagger Name: AvaTaxClient
Reset this account's license key
Resets the existing license key for this account to a new key.
To reset your account, you must specify the ID of the account you wish to reset and confirm the action.
This API is only available to account administrators for the account in question, and may only be called after
an account has been activated by reading and accepting Avalara's terms and conditions. To activate your account
please log onto the AvaTax website or call the `ActivateAccount` API.
You can only reset license with 'Default' license key name.
Resetting a license key cannot be undone. Any previous license keys will immediately cease to work when a new key is created.
When you call this API, all account administrators for this account will receive an email with the newly updated license key.
The email will specify which user reset the license key and it will contain the new key to use to update your connectors.
Note: The reset license key functionality will only be available for existing active license key i.e. when you reset license key for the account, the Default license key will be reset.The reset license key functionality is not available for newly created license keys i.e. license keys other than Default
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
:param id_ [int] The ID of the account you wish to update.
:param model [ResetLicenseKeyModel] A request confirming that you wish to reset the license key of this account.
:return LicenseKeyModel
"""
def account_reset_license_key(self, id_, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/accounts/{}/resetlicensekey'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Activate an account by accepting terms and conditions
Activate the account specified by the unique accountId number.
This activation request can only be called by account administrators. You must indicate
that you have read and accepted Avalara's terms and conditions to call this API.
Once you have activated your account, use the `AccountResetLicenseKey` API to generate
a license key for your account.
If you have not read or accepted the terms and conditions, this API call will return the
unchanged account model.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
:param id_ [int] The ID of the account to activate
:param model [ActivateAccountModel] The activation request
:return AccountModel
"""
def activate_account(self, id_, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/accounts/{}/activate'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve audit history for an account.
Retrieve audit trace history for an account.
Your audit trace history contains a record of all API calls made against the AvaTax REST API that returned an error. You can use this API to investigate
problems and see exactly what information was sent back and forth between your code and AvaTax.
When specifying a start and end datetime, please include a valid timezone indicator, such as the "Z" present in the examples for the start and end query parameters.
You can learn more about valid time zone designators at https://en.wikipedia.org/wiki/ISO_8601#Time_zone_designators.
This API enforces limits to the amount of data retrieved. These limits are subject to change.
* You may request data from a maximum of a one-hour time period.
* The amount of data and number of API calls returned by this API are limited and may be adjusted at any time.
* Old records may be migrated out of immediately available storage. To request older data, please contact your account manager.
* New records must migrate to available storage before they can be retrieved. You may need to wait a period of time before newly created records can be fetched.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:param id_ [int] The ID of the account you wish to audit.
:param start [datetime] The start datetime of audit history you with to retrieve, e.g. "2018-06-08T17:00:00Z". Defaults to the past 15 minutes.
:param end [datetime] The end datetime of audit history you with to retrieve, e.g. "2018-06-08T17:15:00Z. Defaults to the current time. Maximum of an hour after the start time.
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:return FetchResult
"""
def audit_account(self, id_, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/{}/audit'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create license key for this account
Creates a new license key for this account.
To create a license key for your account, you must specify the ID of the account and license key name.
This API is only available to account administrators for the account in question, and may only be called after
an account has been activated by reading and accepting Avalara's terms and conditions. To activate your account
please log onto the AvaTax website or call the `ActivateAccount` API.
You will reference this key using license key name. The existing license key will be using 'Default' as license key name.
Hence make sure that the license key name is unique per account considering the existing license key name 'Default'
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
:param id_ [int] The ID of the account you wish to update.
:param model [AccountLicenseKeyModel]
:return LicenseKeyModel
"""
def create_license_key(self, id_, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/accounts/{}/licensekey'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Delete license key for this account by license key name
Deletes the license key for this account using license key name.
To delete a license key for your account, you must specify the accountID of the account and license key name.
This API is only available to account administrators for the account in question.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
:param id_ [int] The ID of the account you wish to update.
:param licensekeyname [string] The license key name you wish to update.
:return ErrorDetail
"""
def delete_license_key(self, id_, licensekeyname):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.delete('{}/api/v2/accounts/{}/licensekey/{}'.format(self.base_url, id_, licensekeyname),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a single account
Get the account object identified by this URL.
You may use the '$include' parameter to fetch additional nested data:
* Subscriptions
* Users
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:param id_ [int] The ID of the account to retrieve
:param include [string] A comma separated list of special fetch options
:return AccountModel
"""
def get_account(self, id_, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/{}'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Get configuration settings for this account
Retrieve a list of all configuration settings tied to this account.
Configuration settings provide you with the ability to control features of your account and of your
tax software. The category names `TaxServiceConfig` and `AddressServiceConfig` are reserved for
Avalara internal software configuration values; to store your own account-level settings, please
create a new category name that begins with `X-`, for example, `X-MyCustomCategory`.
Account settings are permanent settings that cannot be deleted. You can set the value of an
account setting to null if desired.
Avalara-based account settings for `TaxServiceConfig` and `AddressServiceConfig` affect your account's
tax calculation and address resolution, and should only be changed with care.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
:param id_ [int]
:return AccountConfigurationModel
"""
def get_account_configuration(self, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/{}/configuration'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve license key by license key name
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:param id_ [int] The ID of the account to retrieve
:param licensekeyname [string] The ID of the account to retrieve
:return AccountLicenseKeyModel
"""
def get_license_key(self, id_, licensekeyname):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/{}/licensekey/{}'.format(self.base_url, id_, licensekeyname),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all license keys for this account
Gets list of all the license keys used by the account.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:param id_ [int] The ID of the account to retrieve
:return AccountLicenseKeyModel
"""
def get_license_keys(self, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/{}/licensekeys'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a list of MRS Accounts
This API is available by invitation only.
Get a list of accounts with an active MRS service.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:return FetchResult
"""
def list_mrs_accounts(self):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts/mrs'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all accounts
List all account objects that can be seen by the current user.
This API lists all accounts you are allowed to see. In general, most users will only be able to see their own account.
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/) .
Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
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:
* Subscriptions
* Users
For more information about filtering in REST, please see the documentation at http://developer.avalara.com/avatax/filtering-in-rest/ .
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, ECMAccountUser, ECMCompanyUser, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
:param include [string] A comma separated list of objects to fetch underneath this account. Any object with a URL path underneath this account can be fetched by specifying its name.
: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:* subscriptions, users
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def query_accounts(self, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/accounts'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Change configuration settings for this account
Update configuration settings tied to this account.
Configuration settings provide you with the ability to control features of your account and of your
tax software. The category names `TaxServiceConfig` and `AddressServiceConfig` are reserved for
Avalara internal software configuration values; to store your own account-level settings, please
create a new category name that begins with `X-`, for example, `X-MyCustomCategory`.
Account settings are permanent settings that cannot be deleted. You can set the value of an
account setting to null if desired.
Avalara-based account settings for `TaxServiceConfig` and `AddressServiceConfig` affect your account's
tax calculation and address resolution, and should only be changed with care.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
:param id_ [int]
:param model [AccountConfigurationModel]
:return AccountConfigurationModel
"""
def set_account_configuration(self, id_, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/accounts/{}/configuration'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve geolocation information for a specified US or Canadian address
Resolve a US or Canadian address against Avalara's address validation system. Note that this API is
valid for US and Canadian addresses only.
If the address can be resolved, this API provides the latitude and longitude of the resolved location.
The value `resolutionQuality` can be used to identify how closely this address can be located. If the
address cannot be clearly located, use the `messages` structure to learn more about problems with this address.
This is the same API as the POST /api/v2/addresses/resolve endpoint.
Both verbs are supported to provide for flexible implementation.
In order to get any evaluation for an address, please provide at least one of the following fields/pairs:
1. postal code
2. line1 + city + region
3. line1 + postal code
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AutoAddress.
:param line1 [string] Line 1
:param line2 [string] Line 2
:param line3 [string] Line 3
:param city [string] City
:param region [string] State / Province / Region
:param postalCode [string] Postal Code / Zip Code
:param country [string] Two character ISO 3166 Country Code (see /api/v2/definitions/countries for a full list)
:param textCase [TextCase] selectable text case for address validation (See TextCase::* for a list of allowable values)
:return AddressResolutionModel
"""
def resolve_address(self, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/addresses/resolve'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve geolocation information for a specified US or Canadian address
Resolve a US or Canadian address against Avalara's address validation system. Note that this API is
valid for US and Canadian addresses only.
If the address can be resolved, this API provides the latitude and longitude of the resolved location.
The value `resolutionQuality` can be used to identify how closely this address can be located. If the
address cannot be clearly located, use the `messages` structure to learn more about problems with this
address. This is the same API as the GET /api/v2/addresses/resolve endpoint.
Both verbs are supported to provide for flexible implementation.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AutoAddress.
:param model [AddressValidationInfo] The address to resolve
:return AddressResolutionModel
"""
def resolve_address_post(self, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/addresses/resolve'.format(self.base_url),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create new rule
:param companyid [int] The ID of the company that owns this AP Config Setting object
:param model [APConfigSettingRequestModel] The AP Config Setting you wish to create.
:return APConfigSettingSuccessResponseModel
"""
def create_a_p_config_setting(self, companyid, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/apconfigsetting'.format(self.base_url, companyid),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve rule for this company
:param companyid [int] The ID of the company that defined this rule
: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:* meta, amount, varianceForIgnore, varianceForAccrue, variancePercent, apConfigToleranceType, payAsBilledNoAccrual, payAsBilledAccrueUndercharge, shortPayItemsAccrueUndercharge, markForReviewUndercharge, rejectUndercharge, payAsBilledOvercharge, shortPayAvalaraCalculated, shortPayItemsAccrueOvercharge, markForReviewOvercharge, rejectOvercharge, isActive
:param include [string] A comma separated list of additional data to retrieve.
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def get_a_p_config_setting_by_company(self, companyid, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/apconfigsetting'.format(self.base_url, companyid),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all rules
: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:* meta, amount, varianceForIgnore, varianceForAccrue, variancePercent, apConfigToleranceType, payAsBilledNoAccrual, payAsBilledAccrueUndercharge, shortPayItemsAccrueUndercharge, markForReviewUndercharge, rejectUndercharge, payAsBilledOvercharge, shortPayAvalaraCalculated, shortPayItemsAccrueOvercharge, markForReviewOvercharge, rejectOvercharge, isActive
:param include [string] A comma separated list of additional data to retrieve.
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def query_a_p_config_setting(self, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/apconfigsetting'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Update a AP config setting
:param companyid [int] The ID of the company that owns this AP config setting object
:param model [APConfigSettingRequestModel] The AP config setting object you wish to update.
:return APConfigSettingSuccessResponseModel
"""
def update_a_p_config_setting(self, companyid, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.put('{}/api/v2/companies/{}/apconfigsetting'.format(self.base_url, companyid),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create a new AvaFileForm
Create one or more AvaFileForms
A 'AvaFileForm' represents a form supported by our returns team
### Security Policies
* This API requires the user role Compliance Root User.
* This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
:param model [AvaFileFormModel] The AvaFileForm you wish to create.
:return AvaFileFormModel
"""
def create_ava_file_forms(self, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/avafileforms'.format(self.base_url),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Delete a single AvaFileForm
Marks the existing AvaFileForm object at this URL as deleted.
### Security Policies
* This API requires one of the following user roles: Compliance Root User, ComplianceUser, FirmAdmin.
* This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
:param id_ [int] The ID of the AvaFileForm you wish to delete.
:return ErrorDetail
"""
def delete_ava_file_form(self, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.delete('{}/api/v2/avafileforms/{}'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a single AvaFileForm
Get the AvaFileForm object identified by this URL.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
* This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
:param id_ [int] The primary key of this AvaFileForm
:return AvaFileFormModel
"""
def get_ava_file_form(self, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/avafileforms/{}'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all AvaFileForms
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/) .
Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CompanyUser, Compliance Root User, Compliance Temp User, ComplianceAdmin, ComplianceUser, FirmAdmin, FirmUser, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin.
* This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
: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:* outletTypeId
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def query_ava_file_forms(self, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/avafileforms'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Update a AvaFileForm
All data from the existing object will be replaced with data in the object you PUT.
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.
### Security Policies
* This API requires the user role Compliance Root User.
* This API depends on the following active services:*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
:param id_ [int] The ID of the AvaFileForm you wish to update
:param model [AvaFileFormModel] The AvaFileForm model you wish to update.
:return AvaFileFormModel
"""
def update_ava_file_form(self, id_, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.put('{}/api/v2/avafileforms/{}'.format(self.base_url, id_),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Cancel an in progress batch
Marks the in progress batch identified by this URL as cancelled.
Only JSON batches can be cancelled. If you attempt to cancel a file batch, you will receive an error message.
Only in progress batches can be cancelled. If you attempt to cancel a batch that its status is not Waiting or Processing, you will receive an error message.
Cancelling an in progress batch does not delete any transactions that were created before the cancellation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
:param companyId [int] The ID of the company that owns this batch.
:param id_ [int] The ID of the batch to cancel.
:return BatchModel
"""
def cancel_batch(self, companyId, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/batches/{}/cancel'.format(self.base_url, companyId, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create a new batch
Create one or more new batch objects attached to this company.
Each batch object may have one or more file objects (currently only one file is supported).
When a batch is created, it is added to the AvaTax Batch Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
The maximum content length of the request body is limited to 28.6 MB. If this limit
is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if
the API is called from a browser). In this situation, please split the request into
smaller batches.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
:param companyId [int] The ID of the company that owns this batch.
:param model [BatchModel] The batch you wish to create.
:return BatchModel
"""
def create_batches(self, companyId, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/batches'.format(self.base_url, companyId),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create a new transaction batch
Create a new transaction batch objects attached to this company.
When a transaction batch is created, it is added to the AvaTax Batch v2 Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
The maximum content length of the request body is limited to 28.6 MB. If this limit
is exceeded, a 404 Not Found status will be returned (possibly with a CORS error if
the API is called from a browser). In this situation, please split the request into
smaller batches.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, BatchServiceAdmin, CompanyAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
:param companyId [int] The ID of the company that owns this batch.
:param model [CreateTransactionBatchRequestModel] The transaction batch you wish to create.
:return CreateTransactionBatchResponseModel
"""
def create_transaction_batch(self, companyId, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/batches/transactions'.format(self.base_url, companyId),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Delete a single batch
Marks the batch identified by this URL as deleted.
If you attempt to delete a batch that is being processed, you will receive an error message.
Deleting a batch does not delete any transactions that were created by importing the batch.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
### Security Policies
* This API requires one of the following user roles: BatchServiceAdmin, CSPAdmin, CSPTester, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin.
:param companyId [int] The ID of the company that owns this batch.
:param id_ [int] The ID of the batch to delete.
:return ErrorDetail
"""
def delete_batch(self, companyId, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.delete('{}/api/v2/companies/{}/batches/{}'.format(self.base_url, companyId, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Download a single batch file
Download a single batch file identified by this URL.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
:param companyId [int] The ID of the company that owns this batch
:param batchId [int] The ID of the batch object
:param id_ [int] The primary key of this batch file object
:return String
"""
def download_batch(self, companyId, batchId, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/batches/{}/files/{}/attachment'.format(self.base_url, companyId, batchId, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a single batch
Get the batch object identified by this URL. A batch object is a large
collection of API calls stored in a compact file.
Use this endpoint to retrieve the results or check the status of a batch.
When a batch is created, it is added to the AvaTax Batch Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
:param companyId [int] The ID of the company that owns this batch
:param id_ [int] The primary key of this batch
:return BatchModel
"""
def get_batch(self, companyId, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/batches/{}'.format(self.base_url, companyId, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all batches for this company
List all batch objects attached to the specified company.
A batch object is a large collection of API calls stored in a compact file.
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/) .
Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
Use [GetBatch](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Batches/GetBatch/)
to retrieve the results, or check the status, of an individual batch.
When a batch is created, it is added to the AvaTax Batch Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
:param companyId [int] The ID of the company that owns these batches
: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:* files
:param include [string] A comma separated list of additional data to retrieve.
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def list_batches_by_company(self, companyId, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/batches'.format(self.base_url, companyId),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve all batches
Get multiple batch objects across all companies.
A batch object is a large collection of API calls stored in a compact file.
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/) .
Paginate results using the `$top`, `$skip`, and `$orderby` parameters.
When a batch is created, it is added to the AvaTax Batch Queue and will be
processed as quickly as possible in the order it was received. To check the
status of a batch, fetch the batch and retrieve the results of the batch
operation.
Because the batch system processes with a degree of concurrency, and
because of batch sizes in the queue vary, AvaTax API is unable to accurately
predict when a batch will complete. If high performance processing is
required, please use the
[CreateTransaction API](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateTransaction/).
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser.
: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:* files
:param include [string] A comma separated list of additional data to retrieve.
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def query_batches(self, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/batches'.format(self.base_url),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create a CertExpress invitation
Creates an invitation for a customer to self-report certificates using the CertExpress website.
This invitation is delivered by your choice of method, or you can present a hyperlink to the user
directly in your connector. Your customer will be redirected to https://app.certexpress.com/ where
they can follow a step-by-step guide to enter information about their exemption certificates. The
certificates entered will be recorded and automatically linked to their customer record.
The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
your company so that they can be used for tax exemptions.
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The unique ID number of the company that will record certificates
:param customerCode [string] The number of the customer where the request is sent to
:param model [CreateCertExpressInvitationModel] the requests to send out to customers
:return CertExpressInvitationStatusModel
"""
def create_cert_express_invitation(self, companyId, customerCode, model):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/customers/{}/certexpressinvites'.format(self.base_url, companyId, customerCode),
auth=self.auth, headers=self.client_header, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a single CertExpress invitation
Retrieve an existing CertExpress invitation sent to a customer.
A CertExpression invitation allows a customer to follow a helpful step-by-step guide to provide information
about their certificates. This step by step guide allows the customer to complete and upload the full
certificate in a convenient, friendly web browser experience. When the customer completes their certificates,
they will automatically be recorded to your company and linked to the customer record.
The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
your company so that they can be used for tax exemptions.
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The unique ID number of the company that issued this invitation
:param customerCode [string] The number of the customer where the request is sent to
:param id_ [int] The unique ID number of this CertExpress invitation
:param include [string] OPTIONAL: A comma separated list of special fetch options. No options are defined at this time.
:return CertExpressInvitationModel
"""
def get_cert_express_invitation(self, companyId, customerCode, id_, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/customers/{}/certexpressinvites/{}'.format(self.base_url, companyId, customerCode, id_),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
List CertExpress invitations
Retrieve CertExpress invitations sent by this company.
A CertExpression invitation allows a customer to follow a helpful step-by-step guide to provide information
about their certificates. This step by step guide allows the customer to complete and upload the full
certificate in a convenient, friendly web browser experience. When the customer completes their certificates,
they will automatically be recorded to your company and linked to the customer record.
The [CertExpress website](https://app.certexpress.com/home) is available for customers to use at any time.
Using CertExpress with this API will ensure that your certificates are automatically linked correctly into
your company so that they can be used for tax exemptions.
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The unique ID number of the company that issued this invitation
:param include [string] OPTIONAL: A comma separated list of special fetch options. No options are defined at this time.
: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:* companyId, customer, coverLetter, exposureZones, exemptReasons, requestLink
:param top [int] 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.
:param skip [int] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
:param orderBy [string] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
:return FetchResult
"""
def list_cert_express_invitations(self, companyId, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/certexpressinvites'.format(self.base_url, companyId),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Create certificates for this company
Record one or more certificates document for this company.
A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
can contain information about a customer's eligibility for exemption from sales or use taxes based on
criteria you specify when you store the certificate. To view or manage your certificates directly, please
log onto the administrative website for the product you purchased.
When you create a certificate, it will be processed by Avalara and will become available for use in
calculating tax exemptions when processing is complete. For a certificate to be used in calculating exemptions,
it must have the following:
* An exposure zone indicating where the certificate is valid
* A link to the customer that is allowed to use this certificate
* Your tax transaction must contain the correct customer code
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
If the users specified in the certificates do not exist, the API will create the user and link them to the certificate
### Security Policies
* This API requires one of the following user roles: AccountAdmin, BatchServiceAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The ID number of the company recording this certificate
:param preValidatedExemptionReason [boolean] If set to true, the certificate will bypass the human verification process.
:param model [CertificateModel] Certificates to be created
:return CertificateModel
"""
def create_certificates(self, companyId, model, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.post('{}/api/v2/companies/{}/certificates'.format(self.base_url, companyId),
auth=self.auth, headers=self.client_header, params=include, json=model,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Revoke and delete a certificate
Revoke the certificate identified by this URL, then delete it.
A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
can contain information about a customer's eligibility for exemption from sales or use taxes based on
criteria you specify when you store the certificate. To view or manage your certificates directly, please
log onto the administrative website for the product you purchased.
Revoked certificates can no longer be used.
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The unique ID number of the company that recorded this certificate
:param id_ [int] The unique ID number of this certificate
:return ErrorDetail
"""
def delete_certificate(self, companyId, id_):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.delete('{}/api/v2/companies/{}/certificates/{}'.format(self.base_url, companyId, id_),
auth=self.auth, headers=self.client_header, params=None,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Download an image for this certificate
Download an image or PDF file for this certificate.
This API can be used to download either a single-page preview of the certificate or a full PDF document.
To retrieve a preview image, set the `$type` parameter to `Jpeg` and the `$page` parameter to `1`.
A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
can contain information about a customer's eligibility for exemption from sales or use taxes based on
criteria you specify when you store the certificate. To view or manage your certificates directly, please
log onto the administrative website for the product you purchased.
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The unique ID number of the company that recorded this certificate
:param id_ [int] The unique ID number of this certificate
:param page [int] If you choose `$type`=`Jpeg`, you must specify which page number to retrieve.
:param type [CertificatePreviewType] The data format in which to retrieve the certificate image (See CertificatePreviewType::* for a list of allowable values)
:return String
"""
def download_certificate_image(self, companyId, id_, include=None):
if ('X-Avalara-Client' in self.client_header):
self.client_header['X-Avalara-Client']=self.client_id.replace("API_VERSION","24.12.0")
return requests.get('{}/api/v2/companies/{}/certificates/{}/attachment'.format(self.base_url, companyId, id_),
auth=self.auth, headers=self.client_header, params=include,
timeout=self.timeout_limit if self.timeout_limit else 1200)
r"""
Swagger Name: AvaTaxClient
Retrieve a single certificate
Get the current certificate identified by this URL.
A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
can contain information about a customer's eligibility for exemption from sales or use taxes based on
criteria you specify when you store the certificate. To view or manage your certificates directly, please
log onto the administrative website for the product you purchased.
You can use the `$include` parameter to fetch the following additional objects for expansion:
* 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.
* histories - Retrieves the certificate update history
* jobs - Retrieves the jobs for this certificate
* logs - Retrieves the certificate log
* invalid_reasons - Retrieves invalid reasons for this certificate if the certificate is invalid
* custom_fields - Retrieves custom fields set for this certificate
Before you can use any exemption certificates endpoints, you must set up your company for exemption certificate data storage.
Companies that do not have this storage system set up will see `CertCaptureNotConfiguredError` when they call exemption
certificate related APIs. To check if this is set up for a company, call `GetCertificateSetup`. To request setup of exemption
certificate storage for this company, call `RequestCertificateSetup`.
### Security Policies
* This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, BatchServiceAdmin, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
* This API depends on the following active services:*Required* (all): AvaTaxPro, ECMEssentials, ECMPro, ECMPremium, VEMPro, VEMPremium, ECMProComms, ECMPremiumComms.
:param companyId [int] The ID number of the company that recorded this certificate