avatax 20.1.0 → 20.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/avatax.gemspec +0 -1
  3. data/lib/avatax/client/accounts.rb +236 -172
  4. data/lib/avatax/client/addresses.rb +54 -54
  5. data/lib/avatax/client/advancedrules.rb +63 -162
  6. data/lib/avatax/client/avafileforms.rb +78 -78
  7. data/lib/avatax/client/batches.rb +223 -170
  8. data/lib/avatax/client/certexpressinvites.rb +97 -97
  9. data/lib/avatax/client/certificates.rb +424 -424
  10. data/lib/avatax/client/companies.rb +457 -350
  11. data/lib/avatax/client/compliance.rb +15 -15
  12. data/lib/avatax/client/contacts.rb +106 -106
  13. data/lib/avatax/client/customers.rb +376 -376
  14. data/lib/avatax/client/datasources.rb +99 -99
  15. data/lib/avatax/client/definitions.rb +862 -847
  16. data/lib/avatax/client/distancethresholds.rb +122 -122
  17. data/lib/avatax/client/ecommercetoken.rb +37 -0
  18. data/lib/avatax/client/filingcalendars.rb +20 -508
  19. data/lib/avatax/client/filings.rb +37 -26
  20. data/lib/avatax/client/firmclientlinkages.rb +123 -123
  21. data/lib/avatax/client/free.rb +100 -100
  22. data/lib/avatax/client/fundingrequests.rb +52 -52
  23. data/lib/avatax/client/items.rb +423 -423
  24. data/lib/avatax/client/jurisdictionoverrides.rb +118 -118
  25. data/lib/avatax/client/locations.rb +253 -139
  26. data/lib/avatax/client/multidocument.rb +390 -310
  27. data/lib/avatax/client/nexus.rb +341 -201
  28. data/lib/avatax/client/notifications.rb +75 -75
  29. data/lib/avatax/client/provisioning.rb +49 -49
  30. data/lib/avatax/client/registrar.rb +198 -198
  31. data/lib/avatax/client/reports.rb +97 -97
  32. data/lib/avatax/client/settings.rb +156 -156
  33. data/lib/avatax/client/subscriptions.rb +62 -62
  34. data/lib/avatax/client/taxcodes.rb +120 -120
  35. data/lib/avatax/client/taxcontent.rb +133 -133
  36. data/lib/avatax/client/taxrules.rb +170 -170
  37. data/lib/avatax/client/transactions.rb +836 -791
  38. data/lib/avatax/client/upcs.rb +111 -111
  39. data/lib/avatax/client/users.rb +183 -183
  40. data/lib/avatax/client/utilities.rb +61 -61
  41. data/lib/avatax/connection.rb +3 -3
  42. data/lib/avatax/request.rb +2 -0
  43. data/lib/avatax/version.rb +1 -1
  44. metadata +4 -17
@@ -1,16 +1,16 @@
1
- module AvaTax
2
- class Client
3
- module Compliance
4
-
5
-
6
- # API to modify the reference fields at the document and the line level.
7
- #
8
- #
9
- # @param companyId [Integer]
10
- # @param model [TransactionReferenceFieldModel[]]
11
- # @return [FetchResult]
12
- def tag_transaction(companyId, model) path = "/api/v2/companies/#{companyId}/transactions/tag"
13
- put(path, model) end
14
- end
15
- end
1
+ module AvaTax
2
+ class Client
3
+ module Compliance
4
+
5
+
6
+ # API to modify the reference fields at the document and the line level.
7
+ #
8
+ #
9
+ # @param companyId [Integer]
10
+ # @param model [TransactionReferenceFieldModel[]]
11
+ # @return [FetchResult]
12
+ def tag_transaction(companyId, model) path = "/api/v2/companies/#{companyId}/transactions/tag"
13
+ put(path, model) end
14
+ end
15
+ end
16
16
  end
@@ -1,107 +1,107 @@
1
- module AvaTax
2
- class Client
3
- module Contacts
4
-
5
-
6
- # Create a new contact
7
- #
8
- # Create one or more new contact objects.
9
- # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
10
- # a tax collecting and filing entity.
11
- #
12
- # ### Security Policies
13
- #
14
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
15
- # @param companyId [Integer] The ID of the company that owns this contact.
16
- # @param model [ContactModel[]] The contacts you wish to create.
17
- # @return [ContactModel[]]
18
- def create_contacts(companyId, model) path = "/api/v2/companies/#{companyId}/contacts"
19
- post(path, model) end
20
-
21
- # Delete a single contact
22
- #
23
- # Mark the existing contact object at this URL as deleted.
24
- #
25
- # ### Security Policies
26
- #
27
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
28
- # @param companyId [Integer] The ID of the company that owns this contact.
29
- # @param id [Integer] The ID of the contact you wish to delete.
30
- # @return [ErrorDetail[]]
31
- def delete_contact(companyId, id) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
32
- delete(path) end
33
-
34
- # Retrieve a single contact
35
- #
36
- # Get the contact object identified by this URL.
37
- # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
38
- # a tax collecting and filing entity.
39
- #
40
- # ### Security Policies
41
- #
42
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
43
- # @param companyId [Integer] The ID of the company for this contact
44
- # @param id [Integer] The primary key of this contact
45
- # @return [Object]
46
- def get_contact(companyId, id) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
47
- get(path) end
48
-
49
- # Retrieve contacts for this company
50
- #
51
- # List all contact objects assigned to this company.
52
- #
53
- # 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/) .
54
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
55
- #
56
- # ### Security Policies
57
- #
58
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
59
- # @param companyId [Integer] The ID of the company that owns these contacts
60
- # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
61
- # @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.
62
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
63
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
64
- # @return [FetchResult]
65
- def list_contacts_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/contacts"
66
- get(path, options) end
67
-
68
- # Retrieve all contacts
69
- #
70
- # Get multiple contact objects across all companies.
71
- # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
72
- # a tax collecting and filing entity.
73
- #
74
- # 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/) .
75
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
76
- #
77
- # ### Security Policies
78
- #
79
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
80
- # @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/).
81
- # @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.
82
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
83
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
84
- # @return [FetchResult]
85
- def query_contacts(options={}) path = "/api/v2/contacts"
86
- get(path, options) end
87
-
88
- # Update a single contact
89
- #
90
- # Replace the existing contact object at this URL with an updated object.
91
- # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
92
- # a tax collecting and filing entity.
93
- # All data from the existing object will be replaced with data in the object you PUT.
94
- # 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.
95
- #
96
- # ### Security Policies
97
- #
98
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
99
- # @param companyId [Integer] The ID of the company that this contact belongs to.
100
- # @param id [Integer] The ID of the contact you wish to update
101
- # @param model [Object] The contact you wish to update.
102
- # @return [Object]
103
- def update_contact(companyId, id, model) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
104
- put(path, model) end
105
- end
106
- end
1
+ module AvaTax
2
+ class Client
3
+ module Contacts
4
+
5
+
6
+ # Create a new contact
7
+ #
8
+ # Create one or more new contact objects.
9
+ # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
10
+ # a tax collecting and filing entity.
11
+ #
12
+ # ### Security Policies
13
+ #
14
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
15
+ # @param companyId [Integer] The ID of the company that owns this contact.
16
+ # @param model [ContactModel[]] The contacts you wish to create.
17
+ # @return [ContactModel[]]
18
+ def create_contacts(companyId, model) path = "/api/v2/companies/#{companyId}/contacts"
19
+ post(path, model) end
20
+
21
+ # Delete a single contact
22
+ #
23
+ # Mark the existing contact object at this URL as deleted.
24
+ #
25
+ # ### Security Policies
26
+ #
27
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
28
+ # @param companyId [Integer] The ID of the company that owns this contact.
29
+ # @param id [Integer] The ID of the contact you wish to delete.
30
+ # @return [ErrorDetail[]]
31
+ def delete_contact(companyId, id) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
32
+ delete(path) end
33
+
34
+ # Retrieve a single contact
35
+ #
36
+ # Get the contact object identified by this URL.
37
+ # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
38
+ # a tax collecting and filing entity.
39
+ #
40
+ # ### Security Policies
41
+ #
42
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
43
+ # @param companyId [Integer] The ID of the company for this contact
44
+ # @param id [Integer] The primary key of this contact
45
+ # @return [Object]
46
+ def get_contact(companyId, id) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
47
+ get(path) end
48
+
49
+ # Retrieve contacts for this company
50
+ #
51
+ # List all contact objects assigned to this company.
52
+ #
53
+ # 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/) .
54
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
55
+ #
56
+ # ### Security Policies
57
+ #
58
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
59
+ # @param companyId [Integer] The ID of the company that owns these contacts
60
+ # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).
61
+ # @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.
62
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
63
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
64
+ # @return [FetchResult]
65
+ def list_contacts_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/contacts"
66
+ get(path, options) end
67
+
68
+ # Retrieve all contacts
69
+ #
70
+ # Get multiple contact objects across all companies.
71
+ # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
72
+ # a tax collecting and filing entity.
73
+ #
74
+ # 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/) .
75
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
76
+ #
77
+ # ### Security Policies
78
+ #
79
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, FirmAdmin, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
80
+ # @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/).
81
+ # @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.
82
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
83
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
84
+ # @return [FetchResult]
85
+ def query_contacts(options={}) path = "/api/v2/contacts"
86
+ get(path, options) end
87
+
88
+ # Update a single contact
89
+ #
90
+ # Replace the existing contact object at this URL with an updated object.
91
+ # A 'contact' is a person associated with a company who is designated to handle certain responsibilities of
92
+ # a tax collecting and filing entity.
93
+ # All data from the existing object will be replaced with data in the object you PUT.
94
+ # 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.
95
+ #
96
+ # ### Security Policies
97
+ #
98
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
99
+ # @param companyId [Integer] The ID of the company that this contact belongs to.
100
+ # @param id [Integer] The ID of the contact you wish to update
101
+ # @param model [Object] The contact you wish to update.
102
+ # @return [Object]
103
+ def update_contact(companyId, id, model) path = "/api/v2/companies/#{companyId}/contacts/#{id}"
104
+ put(path, model) end
105
+ end
106
+ end
107
107
  end
@@ -1,377 +1,377 @@
1
- module AvaTax
2
- class Client
3
- module Customers
4
-
5
-
6
- # Create customers for this company
7
- #
8
- # Create one or more customers for this company.
9
- #
10
- # A customer object defines information about a person or business that purchases products from your
11
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
12
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
13
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
14
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
15
- #
16
- # A nested object such as CustomFields could be specified and created along with the customer object. To fetch the
17
- # nested object, please call 'GetCustomer' API with appropriate $include parameters.
18
- #
19
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
20
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
21
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
22
- # storage for this company, call `RequestCertificateSetup`.
23
- #
24
- # ### Security Policies
25
- #
26
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
27
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
28
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
29
- # @param model [CustomerModel[]] The list of customer objects to be created
30
- # @return [CustomerModel[]]
31
- def create_customers(companyId, model) path = "/api/v2/companies/#{companyId}/customers"
32
- post(path, model) end
33
-
34
- # Delete a customer record
35
- #
36
- # Deletes the customer object referenced by this URL.
37
- #
38
- # A customer object defines information about a person or business that purchases products from your
39
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
40
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
41
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
42
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
43
- #
44
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
45
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
46
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
47
- # storage for this company, call `RequestCertificateSetup`.
48
- #
49
- # ### Security Policies
50
- #
51
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
52
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
53
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
54
- # @param customerCode [String] The unique code representing this customer
55
- # @return [Object]
56
- def delete_customer(companyId, customerCode) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
57
- delete(path) end
58
-
59
- # Retrieve a single customer
60
- #
61
- # Retrieve the customer identified by this URL.
62
- #
63
- # A customer object defines information about a person or business that purchases products from your
64
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
65
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
66
- # identify any certificates linked to this customer object. If any certificate applies to the transaction,
67
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
68
- #
69
- # You can use the `$include` parameter to fetch the following additional objects for expansion:
70
- #
71
- # * Certificates - Fetch a list of certificates linked to this customer.
72
- # * CustomFields - Fetch a list of custom fields associated to this customer.
73
- # * attributes - Retrieves all attributes applied to the customer.
74
- #
75
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
76
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
77
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
78
- # storage for this company, call `RequestCertificateSetup`.
79
- #
80
- # ### Security Policies
81
- #
82
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
83
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
84
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
85
- # @param customerCode [String] The unique code representing this customer
86
- # @param include [String] Specify optional additional objects to include in this fetch request
87
- # @return [Object]
88
- def get_customer(companyId, customerCode, options={}) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
89
- get(path, options) end
90
-
91
- # Link attributes to a customer
92
- #
93
- # Link one or many attributes to a customer.
94
- #
95
- # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
96
- # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
97
- #
98
- # A customer object defines information about a person or business that purchases products from your
99
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
100
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
101
- # identify any certificates linked to this customer object. If any certificate applies to the transaction,
102
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
103
- #
104
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
105
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
106
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
107
- # storage for this company, call `RequestCertificateSetup`.
108
- #
109
- # ### Security Policies
110
- #
111
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
112
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
113
- # @param companyId [Integer] The unique ID number of the company that recorded the provided customer
114
- # @param customerCode [String] The unique code representing the current customer
115
- # @param model [CustomerAttributeModel[]] The list of attributes to link to the customer.
116
- # @return [FetchResult]
117
- def link_attributes_to_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes/link"
118
- put(path, model) end
119
-
120
- # Link certificates to a customer
121
- #
122
- # Link one or more certificates to a customer.
123
- #
124
- # A customer object defines information about a person or business that purchases products from your
125
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
126
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
127
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
128
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
129
- #
130
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
131
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
132
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
133
- # storage for this company, call `RequestCertificateSetup`.
134
- #
135
- # ### Security Policies
136
- #
137
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
138
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
139
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
140
- # @param customerCode [String] The unique code representing this customer
141
- # @param model [Object] The list of certificates to link to this customer
142
- # @return [FetchResult]
143
- def link_certificates_to_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/link"
144
- post(path, model) end
145
-
146
- # Link two customer records together
147
- #
148
- # Links a Ship-To customer record with a Bill-To customer record.
149
- #
150
- # Customer records represent businesses or individuals who can provide exemption certificates. Some customers
151
- # may have certificates that are linked to their shipping address or their billing address. To group these
152
- # customer records together, you may link multiple bill-to and ship-to addresses together to represent a single
153
- # entity that has multiple different addresses of different kinds.
154
- #
155
- # In general, a customer will have only one primary billing address and multiple ship-to addresses, representing
156
- # all of the different locations where they receive goods. To facilitate this type of customer, you can send in
157
- # one bill-to customer code and multiple ship-to customer codes in a single API call.
158
- #
159
- # Note that you can only link a ship-to customer record to a bill-to customer record. You may not link two customers
160
- # of the same kind together.
161
- #
162
- # ### Security Policies
163
- #
164
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
165
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
166
- # @param companyId [Integer] The unique ID number of the company defining customers.
167
- # @param code [String] The code of the bill-to customer to link.
168
- # @param model [Object] A list of information about ship-to customers to link to this bill-to customer.
169
- # @return [Object]
170
- def link_ship_to_customers_to_bill_customer(companyId, code, model) path = "/api/v2/companies/#{companyId}/customers/billto/#{code}/shipto/link"
171
- post(path, model) end
172
-
173
- # Retrieve a customer's attributes
174
- #
175
- # Retrieve the attributes linked to the customer identified by this URL.
176
- #
177
- # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
178
- # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
179
- #
180
- # A customer object defines information about a person or business that purchases products from your
181
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
182
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
183
- # identify any certificates linked to this customer object. If any certificate applies to the transaction,
184
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
185
- #
186
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
187
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
188
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
189
- # storage for this company, call `RequestCertificateSetup`.
190
- #
191
- # ### Security Policies
192
- #
193
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
194
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
195
- # @param companyId [Integer] The unique ID number of the company that recorded the provided customer
196
- # @param customerCode [String] The unique code representing the current customer
197
- # @return [FetchResult]
198
- def list_attributes_for_customer(companyId, customerCode) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes"
199
- get(path) end
200
-
201
- # List certificates linked to a customer
202
- #
203
- # List all certificates linked to a customer.
204
- #
205
- # A customer object defines information about a person or business that purchases products from your
206
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
207
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
208
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
209
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
210
- #
211
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
212
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
213
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
214
- # storage for this company, call `RequestCertificateSetup`.
215
- #
216
- # ### Security Policies
217
- #
218
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
219
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
220
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
221
- # @param customerCode [String] The unique code representing this customer
222
- # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: * customers - Retrieves the list of customers linked to the certificate. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
223
- # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* exemptionNumber, status, ecmsId, ecmsStatus, pdf, pages
224
- # @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.
225
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
226
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
227
- # @return [FetchResult]
228
- def list_certificates_for_customer(companyId, customerCode, options={}) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates"
229
- get(path, options) end
230
-
231
- # List valid certificates for a location
232
- #
233
- # List valid certificates linked to a customer in a particular country and region.
234
- #
235
- # This API is intended to help identify whether a customer has already provided a certificate that
236
- # applies to a particular country and region. This API is intended to help you remind a customer
237
- # when they have or have not provided copies of their exemption certificates to you during the sales
238
- # order process.
239
- #
240
- # If a customer does not have a certificate on file and they wish to provide one, you should send the customer
241
- # a CertExpress invitation link so that the customer can upload proof of their exemption certificate. Please
242
- # see the `CreateCertExpressInvitation` API to create an invitation link for this customer.
243
- #
244
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
245
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
246
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
247
- # storage for this company, call `RequestCertificateSetup`.
248
- #
249
- # ### Security Policies
250
- #
251
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
252
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
253
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
254
- # @param customerCode [String] The unique code representing this customer
255
- # @param country [String] Search for certificates matching this country. Uses the ISO 3166 two character country code.
256
- # @param region [String] Search for certificates matching this region. Uses the ISO 3166 two or three character state, region, or province code.
257
- # @return [Object]
258
- def list_valid_certificates_for_customer(companyId, customerCode, country, region) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/#{country}/#{region}"
259
- get(path) end
260
-
261
- # List all customers for this company
262
- #
263
- # List all customers recorded by this company matching the specified criteria.
264
- #
265
- # A customer object defines information about a person or business that purchases products from your
266
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
267
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
268
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
269
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
270
- #
271
- # You can use the `$include` parameter to fetch the following additional objects for expansion:
272
- #
273
- # * Certificates - Fetch a list of certificates linked to this customer.
274
- # * attributes - Retrieves all attributes applied to the customer.
275
- #
276
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
277
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
278
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
279
- # storage for this company, call `RequestCertificateSetup`.
280
- #
281
- # ### Security Policies
282
- #
283
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
284
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
285
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
286
- # @param include [String] OPTIONAL - You can specify the value `certificates` to fetch information about certificates linked to the customer.
287
- # @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:* shipTos
288
- # @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.
289
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
290
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
291
- # @return [FetchResult]
292
- def query_customers(companyId, options={}) path = "/api/v2/companies/#{companyId}/customers"
293
- get(path, options) end
294
-
295
- # Unlink attributes from a customer
296
- #
297
- # Unlink one or many attributes from a customer.
298
- #
299
- # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
300
- # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
301
- #
302
- # A customer object defines information about a person or business that purchases products from your
303
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
304
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
305
- # identify any certificates linked to this customer object. If any certificate applies to the transaction,
306
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
307
- #
308
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
309
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
310
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
311
- # storage for this company, call `RequestCertificateSetup`.
312
- #
313
- # ### Security Policies
314
- #
315
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
316
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
317
- # @param companyId [Integer] The unique ID number of the company that recorded the customer
318
- # @param customerCode [String] The unique code representing the current customer
319
- # @param model [CustomerAttributeModel[]] The list of attributes to unlink from the customer.
320
- # @return [FetchResult]
321
- def unlink_attributes_from_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes/unlink"
322
- put(path, model) end
323
-
324
- # Unlink certificates from a customer
325
- #
326
- # Remove one or more certificates to a customer.
327
- #
328
- # A customer object defines information about a person or business that purchases products from your
329
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
330
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
331
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
332
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
333
- #
334
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
335
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
336
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
337
- # storage for this company, call `RequestCertificateSetup`.
338
- #
339
- # ### Security Policies
340
- #
341
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
342
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
343
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
344
- # @param customerCode [String] The unique code representing this customer
345
- # @param model [Object] The list of certificates to link to this customer
346
- # @return [FetchResult]
347
- def unlink_certificates_from_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/unlink"
348
- post(path, model) end
349
-
350
- # Update a single customer
351
- #
352
- # Replace the customer object at this URL with a new record.
353
- #
354
- # A customer object defines information about a person or business that purchases products from your
355
- # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
356
- # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
357
- # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
358
- # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
359
- #
360
- # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
361
- # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
362
- # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
363
- # storage for this company, call `RequestCertificateSetup`.
364
- #
365
- # ### Security Policies
366
- #
367
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
368
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
369
- # @param companyId [Integer] The unique ID number of the company that recorded this customer
370
- # @param customerCode [String] The unique code representing this customer
371
- # @param model [Object] The new customer model that will replace the existing record at this URL
372
- # @return [Object]
373
- def update_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
374
- put(path, model) end
375
- end
376
- end
1
+ module AvaTax
2
+ class Client
3
+ module Customers
4
+
5
+
6
+ # Create customers for this company
7
+ #
8
+ # Create one or more customers for this company.
9
+ #
10
+ # A customer object defines information about a person or business that purchases products from your
11
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
12
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
13
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
14
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
15
+ #
16
+ # A nested object such as CustomFields could be specified and created along with the customer object. To fetch the
17
+ # nested object, please call 'GetCustomer' API with appropriate $include parameters.
18
+ #
19
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
20
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
21
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
22
+ # storage for this company, call `RequestCertificateSetup`.
23
+ #
24
+ # ### Security Policies
25
+ #
26
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
27
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
28
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
29
+ # @param model [CustomerModel[]] The list of customer objects to be created
30
+ # @return [CustomerModel[]]
31
+ def create_customers(companyId, model) path = "/api/v2/companies/#{companyId}/customers"
32
+ post(path, model) end
33
+
34
+ # Delete a customer record
35
+ #
36
+ # Deletes the customer object referenced by this URL.
37
+ #
38
+ # A customer object defines information about a person or business that purchases products from your
39
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
40
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
41
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
42
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
43
+ #
44
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
45
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
46
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
47
+ # storage for this company, call `RequestCertificateSetup`.
48
+ #
49
+ # ### Security Policies
50
+ #
51
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
52
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
53
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
54
+ # @param customerCode [String] The unique code representing this customer
55
+ # @return [Object]
56
+ def delete_customer(companyId, customerCode) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
57
+ delete(path) end
58
+
59
+ # Retrieve a single customer
60
+ #
61
+ # Retrieve the customer identified by this URL.
62
+ #
63
+ # A customer object defines information about a person or business that purchases products from your
64
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
65
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
66
+ # identify any certificates linked to this customer object. If any certificate applies to the transaction,
67
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
68
+ #
69
+ # You can use the `$include` parameter to fetch the following additional objects for expansion:
70
+ #
71
+ # * Certificates - Fetch a list of certificates linked to this customer.
72
+ # * CustomFields - Fetch a list of custom fields associated to this customer.
73
+ # * attributes - Retrieves all attributes applied to the customer.
74
+ #
75
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
76
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
77
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
78
+ # storage for this company, call `RequestCertificateSetup`.
79
+ #
80
+ # ### Security Policies
81
+ #
82
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
83
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
84
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
85
+ # @param customerCode [String] The unique code representing this customer
86
+ # @param include [String] Specify optional additional objects to include in this fetch request
87
+ # @return [Object]
88
+ def get_customer(companyId, customerCode, options={}) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
89
+ get(path, options) end
90
+
91
+ # Link attributes to a customer
92
+ #
93
+ # Link one or many attributes to a customer.
94
+ #
95
+ # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
96
+ # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
97
+ #
98
+ # A customer object defines information about a person or business that purchases products from your
99
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
100
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
101
+ # identify any certificates linked to this customer object. If any certificate applies to the transaction,
102
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
103
+ #
104
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
105
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
106
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
107
+ # storage for this company, call `RequestCertificateSetup`.
108
+ #
109
+ # ### Security Policies
110
+ #
111
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
112
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
113
+ # @param companyId [Integer] The unique ID number of the company that recorded the provided customer
114
+ # @param customerCode [String] The unique code representing the current customer
115
+ # @param model [CustomerAttributeModel[]] The list of attributes to link to the customer.
116
+ # @return [FetchResult]
117
+ def link_attributes_to_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes/link"
118
+ put(path, model) end
119
+
120
+ # Link certificates to a customer
121
+ #
122
+ # Link one or more certificates to a customer.
123
+ #
124
+ # A customer object defines information about a person or business that purchases products from your
125
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
126
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
127
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
128
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
129
+ #
130
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
131
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
132
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
133
+ # storage for this company, call `RequestCertificateSetup`.
134
+ #
135
+ # ### Security Policies
136
+ #
137
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
138
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
139
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
140
+ # @param customerCode [String] The unique code representing this customer
141
+ # @param model [Object] The list of certificates to link to this customer
142
+ # @return [FetchResult]
143
+ def link_certificates_to_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/link"
144
+ post(path, model) end
145
+
146
+ # Link two customer records together
147
+ #
148
+ # Links a Ship-To customer record with a Bill-To customer record.
149
+ #
150
+ # Customer records represent businesses or individuals who can provide exemption certificates. Some customers
151
+ # may have certificates that are linked to their shipping address or their billing address. To group these
152
+ # customer records together, you may link multiple bill-to and ship-to addresses together to represent a single
153
+ # entity that has multiple different addresses of different kinds.
154
+ #
155
+ # In general, a customer will have only one primary billing address and multiple ship-to addresses, representing
156
+ # all of the different locations where they receive goods. To facilitate this type of customer, you can send in
157
+ # one bill-to customer code and multiple ship-to customer codes in a single API call.
158
+ #
159
+ # Note that you can only link a ship-to customer record to a bill-to customer record. You may not link two customers
160
+ # of the same kind together.
161
+ #
162
+ # ### Security Policies
163
+ #
164
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
165
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
166
+ # @param companyId [Integer] The unique ID number of the company defining customers.
167
+ # @param code [String] The code of the bill-to customer to link.
168
+ # @param model [Object] A list of information about ship-to customers to link to this bill-to customer.
169
+ # @return [Object]
170
+ def link_ship_to_customers_to_bill_customer(companyId, code, model) path = "/api/v2/companies/#{companyId}/customers/billto/#{code}/shipto/link"
171
+ post(path, model) end
172
+
173
+ # Retrieve a customer's attributes
174
+ #
175
+ # Retrieve the attributes linked to the customer identified by this URL.
176
+ #
177
+ # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
178
+ # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
179
+ #
180
+ # A customer object defines information about a person or business that purchases products from your
181
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
182
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
183
+ # identify any certificates linked to this customer object. If any certificate applies to the transaction,
184
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
185
+ #
186
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
187
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
188
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
189
+ # storage for this company, call `RequestCertificateSetup`.
190
+ #
191
+ # ### Security Policies
192
+ #
193
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
194
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
195
+ # @param companyId [Integer] The unique ID number of the company that recorded the provided customer
196
+ # @param customerCode [String] The unique code representing the current customer
197
+ # @return [FetchResult]
198
+ def list_attributes_for_customer(companyId, customerCode) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes"
199
+ get(path) end
200
+
201
+ # List certificates linked to a customer
202
+ #
203
+ # List all certificates linked to a customer.
204
+ #
205
+ # A customer object defines information about a person or business that purchases products from your
206
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
207
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
208
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
209
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
210
+ #
211
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
212
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
213
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
214
+ # storage for this company, call `RequestCertificateSetup`.
215
+ #
216
+ # ### Security Policies
217
+ #
218
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
219
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
220
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
221
+ # @param customerCode [String] The unique code representing this customer
222
+ # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following: * customers - Retrieves the list of customers linked to the certificate. * po_numbers - Retrieves all PO numbers tied to the certificate. * attributes - Retrieves all attributes applied to the certificate.
223
+ # @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* exemptionNumber, status, ecmsId, ecmsStatus, pdf, pages
224
+ # @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.
225
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
226
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
227
+ # @return [FetchResult]
228
+ def list_certificates_for_customer(companyId, customerCode, options={}) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates"
229
+ get(path, options) end
230
+
231
+ # List valid certificates for a location
232
+ #
233
+ # List valid certificates linked to a customer in a particular country and region.
234
+ #
235
+ # This API is intended to help identify whether a customer has already provided a certificate that
236
+ # applies to a particular country and region. This API is intended to help you remind a customer
237
+ # when they have or have not provided copies of their exemption certificates to you during the sales
238
+ # order process.
239
+ #
240
+ # If a customer does not have a certificate on file and they wish to provide one, you should send the customer
241
+ # a CertExpress invitation link so that the customer can upload proof of their exemption certificate. Please
242
+ # see the `CreateCertExpressInvitation` API to create an invitation link for this customer.
243
+ #
244
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
245
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
246
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
247
+ # storage for this company, call `RequestCertificateSetup`.
248
+ #
249
+ # ### Security Policies
250
+ #
251
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
252
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
253
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
254
+ # @param customerCode [String] The unique code representing this customer
255
+ # @param country [String] Search for certificates matching this country. Uses the ISO 3166 two character country code.
256
+ # @param region [String] Search for certificates matching this region. Uses the ISO 3166 two or three character state, region, or province code.
257
+ # @return [Object]
258
+ def list_valid_certificates_for_customer(companyId, customerCode, country, region) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/#{country}/#{region}"
259
+ get(path) end
260
+
261
+ # List all customers for this company
262
+ #
263
+ # List all customers recorded by this company matching the specified criteria.
264
+ #
265
+ # A customer object defines information about a person or business that purchases products from your
266
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
267
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
268
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
269
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
270
+ #
271
+ # You can use the `$include` parameter to fetch the following additional objects for expansion:
272
+ #
273
+ # * Certificates - Fetch a list of certificates linked to this customer.
274
+ # * attributes - Retrieves all attributes applied to the customer.
275
+ #
276
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
277
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
278
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
279
+ # storage for this company, call `RequestCertificateSetup`.
280
+ #
281
+ # ### Security Policies
282
+ #
283
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
284
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
285
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
286
+ # @param include [String] OPTIONAL - You can specify the value `certificates` to fetch information about certificates linked to the customer.
287
+ # @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:* shipTos
288
+ # @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.
289
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
290
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
291
+ # @return [FetchResult]
292
+ def query_customers(companyId, options={}) path = "/api/v2/companies/#{companyId}/customers"
293
+ get(path, options) end
294
+
295
+ # Unlink attributes from a customer
296
+ #
297
+ # Unlink one or many attributes from a customer.
298
+ #
299
+ # A customer may have multiple attributes that control its behavior. You may link or unlink attributes to a
300
+ # customer at any time. The full list of defined attributes may be found using `QueryCompanyCustomerAttributes` API.
301
+ #
302
+ # A customer object defines information about a person or business that purchases products from your
303
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
304
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
305
+ # identify any certificates linked to this customer object. If any certificate applies to the transaction,
306
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
307
+ #
308
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
309
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
310
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
311
+ # storage for this company, call `RequestCertificateSetup`.
312
+ #
313
+ # ### Security Policies
314
+ #
315
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
316
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
317
+ # @param companyId [Integer] The unique ID number of the company that recorded the customer
318
+ # @param customerCode [String] The unique code representing the current customer
319
+ # @param model [CustomerAttributeModel[]] The list of attributes to unlink from the customer.
320
+ # @return [FetchResult]
321
+ def unlink_attributes_from_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/attributes/unlink"
322
+ put(path, model) end
323
+
324
+ # Unlink certificates from a customer
325
+ #
326
+ # Remove one or more certificates to a customer.
327
+ #
328
+ # A customer object defines information about a person or business that purchases products from your
329
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
330
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
331
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
332
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
333
+ #
334
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
335
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
336
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
337
+ # storage for this company, call `RequestCertificateSetup`.
338
+ #
339
+ # ### Security Policies
340
+ #
341
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
342
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
343
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
344
+ # @param customerCode [String] The unique code representing this customer
345
+ # @param model [Object] The list of certificates to link to this customer
346
+ # @return [FetchResult]
347
+ def unlink_certificates_from_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}/certificates/unlink"
348
+ post(path, model) end
349
+
350
+ # Update a single customer
351
+ #
352
+ # Replace the customer object at this URL with a new record.
353
+ #
354
+ # A customer object defines information about a person or business that purchases products from your
355
+ # company. When you create a tax transaction in AvaTax, you can use the `customerCode` from this
356
+ # record in your `CreateTransaction` API call. AvaTax will search for this `customerCode` value and
357
+ # identify any certificates linked to this `customer` object. If any certificate applies to the transaction,
358
+ # AvaTax will record the appropriate elements of the transaction as exempt and link it to the `certificate`.
359
+ #
360
+ # Using exemption certificates endpoints requires setup of an auditable document storage for each company that will use certificates.
361
+ # Companies that do not have this storage system set up will receive the error `CertCaptureNotConfiguredError` when they call exemption
362
+ # certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
363
+ # storage for this company, call `RequestCertificateSetup`.
364
+ #
365
+ # ### Security Policies
366
+ #
367
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
368
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
369
+ # @param companyId [Integer] The unique ID number of the company that recorded this customer
370
+ # @param customerCode [String] The unique code representing this customer
371
+ # @param model [Object] The new customer model that will replace the existing record at this URL
372
+ # @return [Object]
373
+ def update_customer(companyId, customerCode, model) path = "/api/v2/companies/#{companyId}/customers/#{customerCode}"
374
+ put(path, model) end
375
+ end
376
+ end
377
377
  end