avatax 19.12.0 → 20.7.0

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