avatax 20.1.0 → 20.5.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avatax/client/accounts.rb +180 -116
  3. data/lib/avatax/client/addresses.rb +34 -34
  4. data/lib/avatax/client/advancedrules.rb +33 -142
  5. data/lib/avatax/client/avafileforms.rb +37 -37
  6. data/lib/avatax/client/batches.rb +122 -122
  7. data/lib/avatax/client/certexpressinvites.rb +70 -70
  8. data/lib/avatax/client/certificates.rb +313 -313
  9. data/lib/avatax/client/companies.rb +234 -232
  10. data/lib/avatax/client/compliance.rb +2 -2
  11. data/lib/avatax/client/contacts.rb +58 -58
  12. data/lib/avatax/client/customers.rb +279 -279
  13. data/lib/avatax/client/datasources.rb +51 -51
  14. data/lib/avatax/client/definitions.rb +448 -435
  15. data/lib/avatax/client/distancethresholds.rb +74 -74
  16. data/lib/avatax/client/filingcalendars.rb +10 -498
  17. data/lib/avatax/client/filings.rb +13 -13
  18. data/lib/avatax/client/firmclientlinkages.rb +54 -54
  19. data/lib/avatax/client/free.rb +73 -73
  20. data/lib/avatax/client/fundingrequests.rb +32 -32
  21. data/lib/avatax/client/items.rb +284 -284
  22. data/lib/avatax/client/jurisdictionoverrides.rb +70 -70
  23. data/lib/avatax/client/locations.rb +87 -84
  24. data/lib/avatax/client/multidocument.rb +294 -234
  25. data/lib/avatax/client/nexus.rb +283 -143
  26. data/lib/avatax/client/notifications.rb +48 -48
  27. data/lib/avatax/client/provisioning.rb +29 -29
  28. data/lib/avatax/client/registrar.rb +122 -122
  29. data/lib/avatax/client/reports.rb +63 -63
  30. data/lib/avatax/client/settings.rb +108 -108
  31. data/lib/avatax/client/subscriptions.rb +35 -35
  32. data/lib/avatax/client/taxcodes.rb +72 -72
  33. data/lib/avatax/client/taxcontent.rb +106 -106
  34. data/lib/avatax/client/taxrules.rb +122 -122
  35. data/lib/avatax/client/transactions.rb +654 -639
  36. data/lib/avatax/client/upcs.rb +63 -63
  37. data/lib/avatax/client/users.rb +121 -121
  38. data/lib/avatax/client/utilities.rb +34 -34
  39. data/lib/avatax/connection.rb +1 -1
  40. data/lib/avatax/request.rb +2 -0
  41. data/lib/avatax/version.rb +1 -1
  42. metadata +3 -3
@@ -5,785 +5,800 @@ module AvaTax
5
5
 
6
6
  # Add lines to an existing unlocked transaction
7
7
  #
8
- # Add lines to an existing unlocked transaction.
9
- #
10
- # The `AddLines` API allows you to add additional transaction lines to existing transaction, so that customer will
11
- # be able to append multiple calls together and form an extremely large transaction. If customer does not specify line number
12
- # in the lines to be added, a new random Guid string will be generated for line number. If customer are not satisfied with
13
- # the line number for the transaction lines, they can turn on the renumber switch to have REST v2 automatically renumber all
14
- # transaction lines for them, in this case, the line number becomes: "1", "2", "3", ...
15
- #
16
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
17
- # sales, purchases, inventory transfer, and returns (also called refunds).
18
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
19
- #
20
- # * Lines
21
- # * Details (implies lines)
22
- # * Summary (implies details)
23
- # * Addresses
24
- # * SummaryOnly (omit lines and details - reduces API response size)
25
- # * LinesOnly (omit details - reduces API response size)
26
- #
27
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
28
- #
29
- # ### Security Policies
30
- #
31
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
8
+ # Add lines to an existing unlocked transaction.
9
+ #
10
+ # The `AddLines` API allows you to add additional transaction lines to existing transaction, so that customer will
11
+ # be able to append multiple calls together and form an extremely large transaction. If customer does not specify line number
12
+ # in the lines to be added, a new random Guid string will be generated for line number. If customer are not satisfied with
13
+ # the line number for the transaction lines, they can turn on the renumber switch to have REST v2 automatically renumber all
14
+ # transaction lines for them, in this case, the line number becomes: "1", "2", "3", ...
15
+ #
16
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
17
+ # sales, purchases, inventory transfer, and returns (also called refunds).
18
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
19
+ #
20
+ # * Lines
21
+ # * Details (implies lines)
22
+ # * Summary (implies details)
23
+ # * Addresses
24
+ # * SummaryOnly (omit lines and details - reduces API response size)
25
+ # * LinesOnly (omit details - reduces API response size)
26
+ #
27
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
28
+ #
29
+ # ### Security Policies
30
+ #
31
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
32
32
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
33
- # @param include [String] Specifies objects to include in the response after transaction is created
34
- # @param model [Object] information about the transaction and lines to be added
33
+ # @param include [String] Specifies objects to include in the response after transaction is created
34
+ # @param model [Object] information about the transaction and lines to be added
35
35
  # @return [Object]
36
36
  def add_lines(model, options={}) path = "/api/v2/companies/transactions/lines/add"
37
37
  post(path, model, options) end
38
38
 
39
39
  # Correct a previously created transaction
40
40
  #
41
- # Replaces the current transaction uniquely identified by this URL with a new transaction.
42
- #
43
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
44
- # sales, purchases, inventory transfer, and returns (also called refunds).
45
- #
46
- # When you adjust a committed transaction, the original transaction will be updated with the status code `Adjusted`, and
47
- # both revisions will be available for retrieval based on their code and ID numbers.
48
- # Only transactions in `Committed` status are reported by Avalara Managed Returns.
49
- #
50
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
51
- # no longer available for adjustments.
52
- #
53
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
54
- #
55
- # * Lines
56
- # * Details (implies lines)
57
- # * Summary (implies details)
58
- # * Addresses
59
- # * SummaryOnly (omit lines and details - reduces API response size)
60
- # * LinesOnly (omit details - reduces API response size)
61
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
62
- #
63
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
64
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
65
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
66
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
67
- #
68
- # ### Security Policies
69
- #
70
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
41
+ # Replaces the current transaction uniquely identified by this URL with a new transaction.
42
+ #
43
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
44
+ # sales, purchases, inventory transfer, and returns (also called refunds).
45
+ #
46
+ # When you adjust a committed transaction, the original transaction will be updated with the status code `Adjusted`, and
47
+ # both revisions will be available for retrieval based on their code and ID numbers.
48
+ # Only transactions in `Committed` status are reported by Avalara Managed Returns.
49
+ #
50
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
51
+ # no longer available for adjustments.
52
+ #
53
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
54
+ #
55
+ # * Lines
56
+ # * Details (implies lines)
57
+ # * Summary (implies details)
58
+ # * Addresses
59
+ # * SummaryOnly (omit lines and details - reduces API response size)
60
+ # * LinesOnly (omit details - reduces API response size)
61
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
62
+ #
63
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
64
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
65
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
66
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
67
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
68
+ #
69
+ # ### Security Policies
70
+ #
71
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
71
72
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
72
- # @param companyCode [String] The company code of the company that recorded this transaction
73
- # @param transactionCode [String] The transaction code to adjust
74
- # @param documentType [String] (Optional): The document type of the transaction to adjust. (See DocumentType::* for a list of allowable values)
75
- # @param include [String] Specifies objects to include in this fetch call
76
- # @param model [Object] The adjustment you wish to make
73
+ # @param companyCode [String] The company code of the company that recorded this transaction
74
+ # @param transactionCode [String] The transaction code to adjust
75
+ # @param documentType [String] (Optional): The document type of the transaction to adjust. (See DocumentType::* for a list of allowable values)
76
+ # @param include [String] Specifies objects to include in this fetch call
77
+ # @param model [Object] The adjustment you wish to make
77
78
  # @return [Object]
78
79
  def adjust_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
79
80
  post(path, model, options) end
80
81
 
81
82
  # Get audit information about a transaction
82
83
  #
83
- # Retrieve audit information about a transaction stored in AvaTax.
84
- #
85
- # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
86
- # information includes the following:
87
- #
88
- # * The `CompanyId` of the company that created the transaction
89
- # * The server timestamp representing the exact server time when the transaction was created
90
- # * The server duration - how long it took to process this transaction
91
- # * Whether exact API call details were logged
92
- # * A reconstructed API call showing what the original CreateTransaction call looked like
93
- #
94
- # This API can be used to examine information about a previously created transaction.
95
- #
96
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
97
- # sales, purchases, inventory transfer, and returns (also called refunds).
98
- #
99
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
100
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
101
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
102
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
103
- #
104
- # ### Security Policies
105
- #
106
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
84
+ # Retrieve audit information about a transaction stored in AvaTax.
85
+ #
86
+ # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
87
+ # information includes the following:
88
+ #
89
+ # * The `CompanyId` of the company that created the transaction
90
+ # * The server timestamp representing the exact server time when the transaction was created
91
+ # * The server duration - how long it took to process this transaction
92
+ # * Whether exact API call details were logged
93
+ # * A reconstructed API call showing what the original CreateTransaction call looked like
94
+ #
95
+ # This API can be used to examine information about a previously created transaction.
96
+ #
97
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
98
+ # sales, purchases, inventory transfer, and returns (also called refunds).
99
+ #
100
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
101
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
102
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
103
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
104
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
105
+ #
106
+ # ### Security Policies
107
+ #
108
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
107
109
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
108
- # @param companyCode [String] The code identifying the company that owns this transaction
109
- # @param transactionCode [String] The code identifying the transaction
110
+ # @param companyCode [String] The code identifying the company that owns this transaction
111
+ # @param transactionCode [String] The code identifying the transaction
110
112
  # @return [Object]
111
113
  def audit_transaction(companyCode, transactionCode) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
112
114
  get(path) end
113
115
 
114
116
  # Get audit information about a transaction
115
117
  #
116
- # Retrieve audit information about a transaction stored in AvaTax.
117
- #
118
- # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
119
- # information includes the following:
120
- #
121
- # * The `CompanyId` of the company that created the transaction
122
- # * The server timestamp representing the exact server time when the transaction was created
123
- # * The server duration - how long it took to process this transaction
124
- # * Whether exact API call details were logged
125
- # * A reconstructed API call showing what the original CreateTransaction call looked like
126
- #
127
- # This API can be used to examine information about a previously created transaction.
128
- #
129
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
130
- # sales, purchases, inventory transfer, and returns (also called refunds).
131
- #
132
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
133
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
134
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
135
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
136
- #
137
- # ### Security Policies
138
- #
139
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
118
+ # Retrieve audit information about a transaction stored in AvaTax.
119
+ #
120
+ # The `AuditTransaction` API retrieves audit information related to a specific transaction. This audit
121
+ # information includes the following:
122
+ #
123
+ # * The `CompanyId` of the company that created the transaction
124
+ # * The server timestamp representing the exact server time when the transaction was created
125
+ # * The server duration - how long it took to process this transaction
126
+ # * Whether exact API call details were logged
127
+ # * A reconstructed API call showing what the original CreateTransaction call looked like
128
+ #
129
+ # This API can be used to examine information about a previously created transaction.
130
+ #
131
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
132
+ # sales, purchases, inventory transfer, and returns (also called refunds).
133
+ #
134
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
135
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
136
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
137
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
138
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
139
+ #
140
+ # ### Security Policies
141
+ #
142
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
140
143
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
141
- # @param companyCode [String] The code identifying the company that owns this transaction
142
- # @param transactionCode [String] The code identifying the transaction
143
- # @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
144
+ # @param companyCode [String] The code identifying the company that owns this transaction
145
+ # @param transactionCode [String] The code identifying the transaction
146
+ # @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
144
147
  # @return [Object]
145
148
  def audit_transaction_with_type(companyCode, transactionCode, documentType) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
146
149
  get(path) end
147
150
 
148
151
  # Lock a set of documents
149
152
  #
150
- # This API is available by invitation only.
151
- #
152
- # Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
153
- # After this API call succeeds, documents will be locked and can't be voided.
154
- #
155
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
156
- # sales, purchases, inventory transfer, and returns (also called refunds).
157
- #
158
- # ### Security Policies
159
- #
160
- # * This API requires the user role Compliance Root User.
153
+ # This API is available by invitation only.
154
+ #
155
+ # Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
156
+ # After this API call succeeds, documents will be locked and can't be voided.
157
+ #
158
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
159
+ # sales, purchases, inventory transfer, and returns (also called refunds).
160
+ #
161
+ # ### Security Policies
162
+ #
163
+ # * This API requires the user role Compliance Root User.
161
164
  # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
162
- # @param model [Object] bulk lock request
165
+ # @param model [Object] bulk lock request
163
166
  # @return [Object]
164
167
  def bulk_lock_transaction(model) path = "/api/v2/transactions/lock"
165
168
  post(path, model) end
166
169
 
167
170
  # Change a transaction's code
168
171
  #
169
- # Renames a transaction uniquely identified by this URL by changing its `code` value.
170
- #
171
- # This API is available as long as the transaction is in `saved` or `posted` status. When a transaction
172
- # is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method.
173
- #
174
- # After this API call succeeds, the transaction will have a new URL matching its new `code`.
175
- #
176
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
177
- #
178
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
179
- # sales, purchases, inventory transfer, and returns (also called refunds).
180
- #
181
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
182
- #
183
- # * Lines
184
- # * Details (implies lines)
185
- # * Summary (implies details)
186
- # * Addresses
187
- # * SummaryOnly (omit lines and details - reduces API response size)
188
- # * LinesOnly (omit details - reduces API response size)
189
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
190
- #
191
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
192
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
193
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
194
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
195
- #
196
- # ### Security Policies
197
- #
198
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
172
+ # Renames a transaction uniquely identified by this URL by changing its `code` value.
173
+ #
174
+ # This API is available as long as the transaction is in `saved` or `posted` status. When a transaction
175
+ # is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method.
176
+ #
177
+ # After this API call succeeds, the transaction will have a new URL matching its new `code`.
178
+ #
179
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
180
+ #
181
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
182
+ # sales, purchases, inventory transfer, and returns (also called refunds).
183
+ #
184
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
185
+ #
186
+ # * Lines
187
+ # * Details (implies lines)
188
+ # * Summary (implies details)
189
+ # * Addresses
190
+ # * SummaryOnly (omit lines and details - reduces API response size)
191
+ # * LinesOnly (omit details - reduces API response size)
192
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
193
+ #
194
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
195
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
196
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
197
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
198
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
199
+ #
200
+ # ### Security Policies
201
+ #
202
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
199
203
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
200
- # @param companyCode [String] The company code of the company that recorded this transaction
201
- # @param transactionCode [String] The transaction code to change
202
- # @param documentType [String] (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
203
- # @param include [String] Specifies objects to include in this fetch call
204
- # @param model [Object] The code change request you wish to execute
204
+ # @param companyCode [String] The company code of the company that recorded this transaction
205
+ # @param transactionCode [String] The transaction code to change
206
+ # @param documentType [String] (Optional): The document type of the transaction to change document code. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
207
+ # @param include [String] Specifies objects to include in this fetch call
208
+ # @param model [Object] The code change request you wish to execute
205
209
  # @return [Object]
206
210
  def change_transaction_code(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
207
211
  post(path, model, options) end
208
212
 
209
213
  # Commit a transaction for reporting
210
214
  #
211
- # Marks a transaction by changing its status to `Committed`.
212
- #
213
- # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
214
- #
215
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
216
- # sales, purchases, inventory transfer, and returns (also called refunds).
217
- #
218
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
219
- #
220
- # Any changes made to a committed transaction will generate a transaction history.
221
- #
222
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
223
- #
224
- # * Lines
225
- # * Details (implies lines)
226
- # * Summary (implies details)
227
- # * Addresses
228
- # * SummaryOnly (omit lines and details - reduces API response size)
229
- # * LinesOnly (omit details - reduces API response size)
230
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
231
- #
232
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
233
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
234
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
235
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
236
- #
237
- # ### Security Policies
238
- #
215
+ # Marks a transaction by changing its status to `Committed`.
216
+ #
217
+ # Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
218
+ #
219
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
220
+ # sales, purchases, inventory transfer, and returns (also called refunds).
221
+ #
222
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
223
+ #
224
+ # Any changes made to a committed transaction will generate a transaction history.
225
+ #
226
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
227
+ #
228
+ # * Lines
229
+ # * Details (implies lines)
230
+ # * Summary (implies details)
231
+ # * Addresses
232
+ # * SummaryOnly (omit lines and details - reduces API response size)
233
+ # * LinesOnly (omit details - reduces API response size)
234
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
235
+ #
236
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
237
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
238
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
239
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
240
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
241
+ #
242
+ # ### Security Policies
243
+ #
239
244
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
240
- # @param companyCode [String] The company code of the company that recorded this transaction
241
- # @param transactionCode [String] The transaction code to commit
242
- # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
243
- # @param include [String] Specifies objects to include in this fetch call
244
- # @param model [Object] The commit request you wish to execute
245
+ # @param companyCode [String] The company code of the company that recorded this transaction
246
+ # @param transactionCode [String] The transaction code to commit
247
+ # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
248
+ # @param include [String] Specifies objects to include in this fetch call
249
+ # @param model [Object] The commit request you wish to execute
245
250
  # @return [Object]
246
251
  def commit_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
247
252
  post(path, model, options) end
248
253
 
249
254
  # Create or adjust a transaction
250
255
  #
251
- # Records a new transaction or adjust an existing transaction in AvaTax.
252
- #
253
- # The `CreateOrAdjustTransaction` endpoint is used to create a new transaction or update an existing one. This API
254
- # can help you create an idempotent service that creates transactions
255
- # If there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
256
- # in the input transaction.
257
- #
258
- # The `CreateOrAdjustTransaction` API cannot modify any transaction that has been reported to a tax authority using
259
- # the Avalara Managed Returns Service or any other tax filing service. If you call this API to attempt to modify
260
- # a transaction that has been reported on a tax filing, you will receive the error `CannotModifyLockedTransaction`.
261
- #
262
- # To generate a refund for a transaction, use the `RefundTransaction` API.
263
- #
264
- # If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database.
265
- #
266
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
267
- # sales, purchases, inventory transfer, and returns (also called refunds).
268
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
269
- #
270
- # * Lines
271
- # * Details (implies lines)
272
- # * Summary (implies details)
273
- # * Addresses
274
- # * SummaryOnly (omit lines and details - reduces API response size)
275
- # * LinesOnly (omit details - reduces API response size)
276
- # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
277
- #
278
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
279
- #
280
- # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
281
- # * \_-ava2f-\_
282
- # * \_-ava2b-\_
283
- # * \_-ava3f-\_
284
- #
285
- # ### Security Policies
286
- #
287
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
256
+ # Records a new transaction or adjust an existing transaction in AvaTax.
257
+ #
258
+ # The `CreateOrAdjustTransaction` endpoint is used to create a new transaction or update an existing one. This API
259
+ # can help you create an idempotent service that creates transactions
260
+ # If there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
261
+ # in the input transaction.
262
+ #
263
+ # The `CreateOrAdjustTransaction` API cannot modify any transaction that has been reported to a tax authority using
264
+ # the Avalara Managed Returns Service or any other tax filing service. If you call this API to attempt to modify
265
+ # a transaction that has been reported on a tax filing, you will receive the error `CannotModifyLockedTransaction`.
266
+ #
267
+ # To generate a refund for a transaction, use the `RefundTransaction` API.
268
+ #
269
+ # If you don't specify the field `type` in your request, you will get an estimate of type `SalesOrder`, which will not be recorded in the database.
270
+ #
271
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
272
+ # sales, purchases, inventory transfer, and returns (also called refunds).
273
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
274
+ #
275
+ # * Lines
276
+ # * Details (implies lines)
277
+ # * Summary (implies details)
278
+ # * Addresses
279
+ # * SummaryOnly (omit lines and details - reduces API response size)
280
+ # * LinesOnly (omit details - reduces API response size)
281
+ # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
282
+ #
283
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
284
+ #
285
+ # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
286
+ # * \_-ava2f-\_
287
+ # * \_-ava2b-\_
288
+ # * \_-ava3f-\_
289
+ #
290
+ # ### Security Policies
291
+ #
292
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
288
293
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
289
- # @param include [String] Specifies objects to include in the response after transaction is created
290
- # @param model [Object] The transaction you wish to create or adjust
294
+ # @param include [String] Specifies objects to include in the response after transaction is created
295
+ # @param model [Object] The transaction you wish to create or adjust
291
296
  # @return [Object]
292
297
  def create_or_adjust_transaction(model, options={}) path = "/api/v2/transactions/createoradjust"
293
298
  post(path, model, options) end
294
299
 
295
300
  # Create a new transaction
296
301
  #
297
- # Records a new transaction in AvaTax.
298
- #
299
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
300
- # sales, purchases, inventory transfer, and returns (also called refunds).
301
- #
302
- # The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules
303
- # and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your
304
- # company's configuration and the data provided in this API call.
305
- #
306
- # The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To
307
- # avoid this error, use the `CreateOrAdjustTransaction` API - it will create the transaction if it does not exist, or
308
- # update it if it does exist.
309
- #
310
- # To generate a refund for a transaction, use the `RefundTransaction` API.
311
- #
312
- # The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
313
- # a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
314
- #
315
- # The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
316
- # provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
317
- # information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
318
- # using the best available address location information.
319
- #
320
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
321
- #
322
- # * Lines
323
- # * Details (implies lines)
324
- # * Summary (implies details)
325
- # * Addresses
326
- # * SummaryOnly (omit lines and details - reduces API response size)
327
- # * LinesOnly (omit details - reduces API response size)
328
- # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
329
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
330
- #
331
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
332
- #
333
- # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
334
- # * \_-ava2f-\_
335
- # * \_-ava2b-\_
336
- # * \_-ava3f-\_
337
- #
338
- # ### Security Policies
339
- #
340
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
302
+ # Records a new transaction in AvaTax.
303
+ #
304
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
305
+ # sales, purchases, inventory transfer, and returns (also called refunds).
306
+ #
307
+ # The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules
308
+ # and rates to apply to all line items in this transaction. The end result will be the total tax calculated by AvaTax based on your
309
+ # company's configuration and the data provided in this API call.
310
+ #
311
+ # The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To
312
+ # avoid this error, use the `CreateOrAdjustTransaction` API - it will create the transaction if it does not exist, or
313
+ # update it if it does exist.
314
+ #
315
+ # To generate a refund for a transaction, use the `RefundTransaction` API.
316
+ #
317
+ # The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
318
+ # a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
319
+ #
320
+ # The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
321
+ # provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
322
+ # information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
323
+ # using the best available address location information.
324
+ #
325
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
326
+ #
327
+ # * Lines
328
+ # * Details (implies lines)
329
+ # * Summary (implies details)
330
+ # * Addresses
331
+ # * SummaryOnly (omit lines and details - reduces API response size)
332
+ # * LinesOnly (omit details - reduces API response size)
333
+ # * ForceTimeout - Simulates a timeout. This adds a 30 second delay and error to your API call. This can be used to test your code to ensure it can respond correctly in the case of a dropped connection.
334
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
335
+ #
336
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
337
+ #
338
+ # NOTE: Avoid using the following strings in your transaction codes as they are encoding strings and will be interpreted differently:
339
+ # * \_-ava2f-\_
340
+ # * \_-ava2b-\_
341
+ # * \_-ava3f-\_
342
+ #
343
+ # ### Security Policies
344
+ #
345
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
341
346
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
342
- # @param include [String] Specifies objects to include in the response after transaction is created
343
- # @param model [Object] The transaction you wish to create
347
+ # @param include [String] Specifies objects to include in the response after transaction is created
348
+ # @param model [Object] The transaction you wish to create
344
349
  # @return [Object]
345
350
  def create_transaction(model, options={}) path = "/api/v2/transactions/create"
346
351
  post(path, model, options) end
347
352
 
348
353
  # Remove lines from an existing unlocked transaction
349
354
  #
350
- # Remove lines to an existing unlocked transaction.
351
- #
352
- # The `DeleteLines` API allows you to remove transaction lines from existing unlocked transaction, so that customer will
353
- # be able to delete transaction lines and adjust original transaction the way they like
354
- #
355
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
356
- # sales, purchases, inventory transfer, and returns (also called refunds).
357
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
358
- #
359
- # * Lines
360
- # * Details (implies lines)
361
- # * Summary (implies details)
362
- # * Addresses
363
- # * SummaryOnly (omit lines and details - reduces API response size)
364
- # * LinesOnly (omit details - reduces API response size)
365
- #
366
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
367
- #
368
- # ### Security Policies
369
- #
370
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
355
+ # Remove lines to an existing unlocked transaction.
356
+ #
357
+ # The `DeleteLines` API allows you to remove transaction lines from existing unlocked transaction, so that customer will
358
+ # be able to delete transaction lines and adjust original transaction the way they like
359
+ #
360
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
361
+ # sales, purchases, inventory transfer, and returns (also called refunds).
362
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
363
+ #
364
+ # * Lines
365
+ # * Details (implies lines)
366
+ # * Summary (implies details)
367
+ # * Addresses
368
+ # * SummaryOnly (omit lines and details - reduces API response size)
369
+ # * LinesOnly (omit details - reduces API response size)
370
+ #
371
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
372
+ #
373
+ # ### Security Policies
374
+ #
375
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
371
376
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
372
- # @param include [String] Specifies objects to include in the response after transaction is created
373
- # @param model [Object] information about the transaction and lines to be removed
377
+ # @param include [String] Specifies objects to include in the response after transaction is created
378
+ # @param model [Object] information about the transaction and lines to be removed
374
379
  # @return [Object]
375
380
  def delete_lines(model, options={}) path = "/api/v2/companies/transactions/lines/delete"
376
381
  post(path, model, options) end
377
382
 
378
383
  # Retrieve a single transaction by code
379
384
  #
380
- # Get the current transaction identified by this company code, transaction code, and document type.
381
- #
382
- # A transaction is uniquely identified by `companyCode`, `code` (often called Transaction Code), and `documentType`.
383
- #
384
- # For compatibility purposes, when this API finds multiple transactions with the same transaction code, and if you have not specified
385
- # the `type` parameter to this API, it will default to selecting the `SalesInvoices` transaction. To change this behavior, use the
386
- # optional `documentType` parameter to specify the specific document type you wish to find.
387
- #
388
- # If this transaction was adjusted, the return value of this API will be the current transaction with this code.
389
- #
390
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
391
- #
392
- # * Lines
393
- # * Details (implies lines)
394
- # * Summary (implies details)
395
- # * Addresses
396
- # * SummaryOnly (omit lines and details - reduces API response size)
397
- # * LinesOnly (omit details - reduces API response size)
398
- #
399
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
400
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
401
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
402
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
403
- #
404
- # ### Security Policies
405
- #
406
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
385
+ # Get the current transaction identified by this company code, transaction code, and document type.
386
+ #
387
+ # A transaction is uniquely identified by `companyCode`, `code` (often called Transaction Code), and `documentType`.
388
+ #
389
+ # For compatibility purposes, when this API finds multiple transactions with the same transaction code, and if you have not specified
390
+ # the `type` parameter to this API, it will default to selecting the `SalesInvoices` transaction. To change this behavior, use the
391
+ # optional `documentType` parameter to specify the specific document type you wish to find.
392
+ #
393
+ # If this transaction was adjusted, the return value of this API will be the current transaction with this code.
394
+ #
395
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
396
+ #
397
+ # * Lines
398
+ # * Details (implies lines)
399
+ # * Summary (implies details)
400
+ # * Addresses
401
+ # * SummaryOnly (omit lines and details - reduces API response size)
402
+ # * LinesOnly (omit details - reduces API response size)
403
+ #
404
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
405
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
406
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
407
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
408
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
409
+ #
410
+ # ### Security Policies
411
+ #
412
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
407
413
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
408
- # @param companyCode [String] The company code of the company that recorded this transaction
409
- # @param transactionCode [String] The transaction code to retrieve
410
- # @param documentType [String] (Optional): The document type of the transaction to retrieve (See DocumentType::* for a list of allowable values)
411
- # @param include [String] Specifies objects to include in this fetch call
414
+ # @param companyCode [String] The company code of the company that recorded this transaction
415
+ # @param transactionCode [String] The transaction code to retrieve
416
+ # @param documentType [String] (Optional): The document type of the transaction to retrieve (See DocumentType::* for a list of allowable values)
417
+ # @param include [String] Specifies objects to include in this fetch call
412
418
  # @return [Object]
413
419
  def get_transaction_by_code(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
414
420
  get(path, options) end
415
421
 
416
422
  # Retrieve a single transaction by code
417
423
  #
418
- # DEPRECATED: Please use the `GetTransactionByCode` API instead.
419
- #
420
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
421
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
422
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
423
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
424
- #
425
- # ### Security Policies
426
- #
427
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
424
+ # DEPRECATED: Please use the `GetTransactionByCode` API instead.
425
+ #
426
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
427
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
428
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
429
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
430
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
431
+ #
432
+ # ### Security Policies
433
+ #
434
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
428
435
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
429
- # @param companyCode [String] The company code of the company that recorded this transaction
430
- # @param transactionCode [String] The transaction code to retrieve
431
- # @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
432
- # @param include [String] Specifies objects to include in this fetch call
436
+ # @param companyCode [String] The company code of the company that recorded this transaction
437
+ # @param transactionCode [String] The transaction code to retrieve
438
+ # @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
439
+ # @param include [String] Specifies objects to include in this fetch call
433
440
  # @return [Object]
434
441
  def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
435
442
  get(path, options) end
436
443
 
437
444
  # Retrieve a single transaction by ID
438
445
  #
439
- # Get the unique transaction identified by this URL.
440
- #
441
- # This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
442
- # by using the `AdjustTransaction` endpoint.
443
- #
444
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
445
- # sales, purchases, inventory transfer, and returns (also called refunds).
446
- #
447
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
448
- #
449
- # * Lines
450
- # * Details (implies lines)
451
- # * Summary (implies details)
452
- # * Addresses
453
- # * SummaryOnly (omit lines and details - reduces API response size)
454
- # * LinesOnly (omit details - reduces API response size)
455
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
456
- #
457
- # ### Security Policies
458
- #
459
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
446
+ # Get the unique transaction identified by this URL.
447
+ #
448
+ # This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
449
+ # by using the `AdjustTransaction` endpoint.
450
+ #
451
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
452
+ # sales, purchases, inventory transfer, and returns (also called refunds).
453
+ #
454
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
455
+ #
456
+ # * Lines
457
+ # * Details (implies lines)
458
+ # * Summary (implies details)
459
+ # * Addresses
460
+ # * SummaryOnly (omit lines and details - reduces API response size)
461
+ # * LinesOnly (omit details - reduces API response size)
462
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
463
+ #
464
+ # ### Security Policies
465
+ #
466
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
460
467
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
461
- # @param id [Integer] The unique ID number of the transaction to retrieve
462
- # @param include [String] Specifies objects to include in this fetch call
468
+ # @param id [Integer] The unique ID number of the transaction to retrieve
469
+ # @param include [String] Specifies objects to include in this fetch call
463
470
  # @return [Object]
464
471
  def get_transaction_by_id(id, options={}) path = "/api/v2/transactions/#{id}"
465
472
  get(path, options) end
466
473
 
467
474
  # Retrieve all transactions
468
475
  #
469
- # List all transactions attached to this company.
470
- #
471
- # This endpoint is limited to returning 1,000 transactions at a time maximum.
472
- #
473
- # When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field
474
- # criteria, the query will default to looking at only those transactions with `date` in the past 30 days.
475
- #
476
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
477
- # sales, purchases, inventory transfer, and returns (also called refunds).
478
- #
479
- # 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/) .
480
- # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
481
- #
482
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
483
- #
484
- # * Lines
485
- # * Details (implies lines)
486
- # * Summary (implies details)
487
- # * Addresses
488
- # * SummaryOnly (omit lines and details - reduces API response size)
489
- # * LinesOnly (omit details - reduces API response size)
490
- #
491
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
492
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
493
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
494
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
495
- #
496
- # ### Security Policies
497
- #
498
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
476
+ # List all transactions attached to this company.
477
+ #
478
+ # This endpoint is limited to returning 1,000 transactions at a time maximum.
479
+ #
480
+ # When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field
481
+ # criteria, the query will default to looking at only those transactions with `date` in the past 30 days.
482
+ #
483
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
484
+ # sales, purchases, inventory transfer, and returns (also called refunds).
485
+ #
486
+ # 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/) .
487
+ # Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
488
+ #
489
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
490
+ #
491
+ # * Lines
492
+ # * Details (implies lines)
493
+ # * Summary (implies details)
494
+ # * Addresses
495
+ # * SummaryOnly (omit lines and details - reduces API response size)
496
+ # * LinesOnly (omit details - reduces API response size)
497
+ #
498
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
499
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
500
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
501
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
502
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
503
+ #
504
+ # ### Security Policies
505
+ #
506
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, ProStoresOperator, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
499
507
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
500
- # @param companyCode [String] The company code of the company that recorded this transaction
501
- # @param dataSourceId [Integer] Optionally filter transactions to those from a specific data source.
502
- # @param include [String] Specifies objects to include in this fetch call
503
- # @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:* totalDiscount, lines, addresses, locationTypes, summary, taxDetailsByTaxType, parameters, messages, invoiceMessages, isFakeTransaction
504
- # @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.
505
- # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
506
- # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
508
+ # @param companyCode [String] The company code of the company that recorded this transaction
509
+ # @param dataSourceId [Integer] Optionally filter transactions to those from a specific data source.
510
+ # @param include [String] Specifies objects to include in this fetch call
511
+ # @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:* totalDiscount, lines, addresses, locationTypes, summary, taxDetailsByTaxType, parameters, messages, invoiceMessages, isFakeTransaction
512
+ # @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.
513
+ # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
514
+ # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
507
515
  # @return [FetchResult]
508
516
  def list_transactions_by_company(companyCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions"
509
517
  get(path, options) end
510
518
 
511
519
  # Lock a single transaction
512
520
  #
513
- # Lock a transaction uniquely identified by this URL.
514
- #
515
- # This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
516
- # After this API call succeeds, the document will be locked and can't be voided or adjusted.
517
- #
518
- # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
519
- #
520
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
521
- #
522
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
523
- # sales, purchases, inventory transfer, and returns (also called refunds).
524
- #
525
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
526
- #
527
- # * Lines
528
- # * Details (implies lines)
529
- # * Summary (implies details)
530
- # * Addresses
531
- # * SummaryOnly (omit lines and details - reduces API response size)
532
- # * LinesOnly (omit details - reduces API response size)
533
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
534
- #
535
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
536
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
537
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
538
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
539
- #
540
- # ### Security Policies
541
- #
542
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
521
+ # Lock a transaction uniquely identified by this URL.
522
+ #
523
+ # This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
524
+ # After this API call succeeds, the document will be locked and can't be voided or adjusted.
525
+ #
526
+ # This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
527
+ #
528
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
529
+ #
530
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
531
+ # sales, purchases, inventory transfer, and returns (also called refunds).
532
+ #
533
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
534
+ #
535
+ # * Lines
536
+ # * Details (implies lines)
537
+ # * Summary (implies details)
538
+ # * Addresses
539
+ # * SummaryOnly (omit lines and details - reduces API response size)
540
+ # * LinesOnly (omit details - reduces API response size)
541
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
542
+ #
543
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
544
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
545
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
546
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
547
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
548
+ #
549
+ # ### Security Policies
550
+ #
551
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
543
552
  # * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
544
- # @param companyCode [String] The company code of the company that recorded this transaction
545
- # @param transactionCode [String] The transaction code to lock
546
- # @param documentType [String] (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
547
- # @param include [String] Specifies objects to include in this fetch call
548
- # @param model [Object] The lock request you wish to execute
553
+ # @param companyCode [String] The company code of the company that recorded this transaction
554
+ # @param transactionCode [String] The transaction code to lock
555
+ # @param documentType [String] (Optional): The document type of the transaction to lock. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
556
+ # @param include [String] Specifies objects to include in this fetch call
557
+ # @param model [Object] The lock request you wish to execute
549
558
  # @return [Object]
550
559
  def lock_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
551
560
  post(path, model, options) end
552
561
 
553
562
  # Create a refund for a transaction
554
563
  #
555
- # Create a refund for a transaction.
556
- #
557
- # The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
558
- # for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
559
- # specify individual line items from the original sale for refund.
560
- #
561
- # The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
562
- # was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
563
- # nexus, or any other setting.
564
- #
565
- # This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
566
- # common refund scenarios:
567
- #
568
- # * A full refund of a previous sale
569
- # * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
570
- # * Refunding one or more items (lines) from a previous sale
571
- # * Granting a customer a percentage refund of a previous sale
572
- #
573
- # For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
574
- # create a custom refund transaction.
575
- #
576
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
577
- #
578
- # * Lines
579
- # * Details (implies lines)
580
- # * Summary (implies details)
581
- # * Addresses
582
- # * SummaryOnly (omit lines and details - reduces API response size)
583
- # * LinesOnly (omit details - reduces API response size)
584
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
585
- # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
586
- #
587
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
588
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
589
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
590
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
591
- #
592
- # ### Security Policies
593
- #
594
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
564
+ # Create a refund for a transaction.
565
+ #
566
+ # The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
567
+ # for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
568
+ # specify individual line items from the original sale for refund.
569
+ #
570
+ # The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
571
+ # was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
572
+ # nexus, or any other setting.
573
+ #
574
+ # This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
575
+ # common refund scenarios:
576
+ #
577
+ # * A full refund of a previous sale
578
+ # * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
579
+ # * Refunding one or more items (lines) from a previous sale
580
+ # * Granting a customer a percentage refund of a previous sale
581
+ #
582
+ # For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
583
+ # create a custom refund transaction.
584
+ #
585
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
586
+ #
587
+ # * Lines
588
+ # * Details (implies lines)
589
+ # * Summary (implies details)
590
+ # * Addresses
591
+ # * SummaryOnly (omit lines and details - reduces API response size)
592
+ # * LinesOnly (omit details - reduces API response size)
593
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
594
+ # If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
595
+ #
596
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
597
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
598
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
599
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
600
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
601
+ #
602
+ # ### Security Policies
603
+ #
604
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
595
605
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
596
- # @param companyCode [String] The code of the company that made the original sale
597
- # @param transactionCode [String] The transaction code of the original sale
598
- # @param include [String] Specifies objects to include in the response after transaction is created
599
- # @param documentType [String] (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
600
- # @param useTaxDateOverride [Boolean] (Optional): If set to true, processes refund using taxDateOverride rather than taxAmountOverride (Note: taxAmountOverride is not allowed for SST states).
601
- # @param model [Object] Information about the refund to create
606
+ # @param companyCode [String] The code of the company that made the original sale
607
+ # @param transactionCode [String] The transaction code of the original sale
608
+ # @param include [String] Specifies objects to include in the response after transaction is created
609
+ # @param documentType [String] (Optional): The document type of the transaction to refund. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
610
+ # @param useTaxDateOverride [Boolean] (Optional): If set to true, processes refund using taxDateOverride rather than taxAmountOverride (Note: taxAmountOverride is not allowed for SST states).
611
+ # @param model [Object] Information about the refund to create
602
612
  # @return [Object]
603
613
  def refund_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
604
614
  post(path, model, options) end
605
615
 
606
616
  # Perform multiple actions on a transaction
607
617
  #
608
- # Performs one or more actions against the current transaction uniquely identified by this URL.
609
- #
610
- # The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`.
611
- #
612
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
613
- # sales, purchases, inventory transfer, and returns (also called refunds).
614
- #
615
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
616
- #
617
- # This API is available for users who want to execute more than one action at a time.
618
- #
619
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
620
- #
621
- # * Lines
622
- # * Details (implies lines)
623
- # * Summary (implies details)
624
- # * Addresses
625
- # * SummaryOnly (omit lines and details - reduces API response size)
626
- # * LinesOnly (omit details - reduces API response size)
627
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
628
- #
629
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
630
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
631
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
632
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
633
- #
634
- # ### Security Policies
635
- #
618
+ # Performs one or more actions against the current transaction uniquely identified by this URL.
619
+ #
620
+ # The `SettleTransaction` API call can perform the work of `ChangeCode`, `VerifyTransaction`, and `CommitTransaction`.
621
+ #
622
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
623
+ # sales, purchases, inventory transfer, and returns (also called refunds).
624
+ #
625
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
626
+ #
627
+ # This API is available for users who want to execute more than one action at a time.
628
+ #
629
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
630
+ #
631
+ # * Lines
632
+ # * Details (implies lines)
633
+ # * Summary (implies details)
634
+ # * Addresses
635
+ # * SummaryOnly (omit lines and details - reduces API response size)
636
+ # * LinesOnly (omit details - reduces API response size)
637
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
638
+ #
639
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
640
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
641
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
642
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
643
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
644
+ #
645
+ # ### Security Policies
646
+ #
636
647
  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
637
- # @param companyCode [String] The company code of the company that recorded this transaction
638
- # @param transactionCode [String] The transaction code to settle
639
- # @param documentType [String] (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
640
- # @param include [String] Specifies objects to include in this fetch call
641
- # @param model [Object] The data from an external system to reconcile against AvaTax
648
+ # @param companyCode [String] The company code of the company that recorded this transaction
649
+ # @param transactionCode [String] The transaction code to settle
650
+ # @param documentType [String] (Optional): The document type of the transaction to settle. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
651
+ # @param include [String] Specifies objects to include in this fetch call
652
+ # @param model [Object] The data from an external system to reconcile against AvaTax
642
653
  # @return [Object]
643
654
  def settle_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
644
655
  post(path, model, options) end
645
656
 
646
657
  # Uncommit a transaction for reporting
647
658
  #
648
- # Adjusts a transaction by changing it to an uncommitted status.
649
- #
650
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
651
- # no longer available to be uncommitted.
652
- #
653
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
654
- #
655
- # * Lines
656
- # * Details (implies lines)
657
- # * Summary (implies details)
658
- # * Addresses
659
- # * SummaryOnly (omit lines and details - reduces API response size)
660
- # * LinesOnly (omit details - reduces API response size)
661
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
662
- #
663
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
664
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
665
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
666
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
667
- #
668
- # ### Security Policies
669
- #
670
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
659
+ # Adjusts a transaction by changing it to an uncommitted status.
660
+ #
661
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
662
+ # no longer available to be uncommitted.
663
+ #
664
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
665
+ #
666
+ # * Lines
667
+ # * Details (implies lines)
668
+ # * Summary (implies details)
669
+ # * Addresses
670
+ # * SummaryOnly (omit lines and details - reduces API response size)
671
+ # * LinesOnly (omit details - reduces API response size)
672
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
673
+ #
674
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
675
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
676
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
677
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
678
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
679
+ #
680
+ # ### Security Policies
681
+ #
682
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
671
683
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
672
- # @param companyCode [String] The company code of the company that recorded this transaction
673
- # @param transactionCode [String] The transaction code to Uncommit
674
- # @param documentType [String] (Optional): The document type of the transaction to Uncommit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
675
- # @param include [String] Specifies objects to include in this fetch call
684
+ # @param companyCode [String] The company code of the company that recorded this transaction
685
+ # @param transactionCode [String] The transaction code to Uncommit
686
+ # @param documentType [String] (Optional): The document type of the transaction to Uncommit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
687
+ # @param include [String] Specifies objects to include in this fetch call
676
688
  # @return [Object]
677
689
  def uncommit_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/uncommit"
678
690
  post(path, options) end
679
691
 
680
692
  # Unvoids a transaction
681
693
  #
682
- # Unvoids a voided transaction
683
- #
684
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
685
- #
686
- # * Lines
687
- # * Details (implies lines)
688
- # * Summary (implies details)
689
- # * Addresses
690
- # * SummaryOnly (omit lines and details - reduces API response size)
691
- # * LinesOnly (omit details - reduces API response size)
692
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
693
- #
694
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
695
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
696
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
697
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
698
- #
699
- # ### Security Policies
700
- #
701
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
694
+ # Unvoids a voided transaction
695
+ #
696
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
697
+ #
698
+ # * Lines
699
+ # * Details (implies lines)
700
+ # * Summary (implies details)
701
+ # * Addresses
702
+ # * SummaryOnly (omit lines and details - reduces API response size)
703
+ # * LinesOnly (omit details - reduces API response size)
704
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
705
+ #
706
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
707
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
708
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
709
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
710
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
711
+ #
712
+ # ### Security Policies
713
+ #
714
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
702
715
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
703
- # @param companyCode [String] The company code of the company that recorded this transaction
704
- # @param transactionCode [String] The transaction code to commit
705
- # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
706
- # @param include [String] Specifies objects to include in this fetch call
716
+ # @param companyCode [String] The company code of the company that recorded this transaction
717
+ # @param transactionCode [String] The transaction code to commit
718
+ # @param documentType [String] (Optional): The document type of the transaction to commit. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
719
+ # @param include [String] Specifies objects to include in this fetch call
707
720
  # @return [Object]
708
721
  def unvoid_transaction(companyCode, transactionCode, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/unvoid"
709
722
  post(path, options) end
710
723
 
711
724
  # Verify a transaction
712
725
  #
713
- # Verifies that the transaction uniquely identified by this URL matches certain expected values.
714
- #
715
- # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
716
- #
717
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
718
- #
719
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
720
- # sales, purchases, inventory transfer, and returns (also called refunds).
721
- #
722
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
723
- #
724
- # * Lines
725
- # * Details (implies lines)
726
- # * Summary (implies details)
727
- # * Addresses
728
- # * SummaryOnly (omit lines and details - reduces API response size)
729
- # * LinesOnly (omit details - reduces API response size)
730
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
731
- #
732
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
733
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
734
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
735
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
736
- #
737
- # ### Security Policies
738
- #
739
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
726
+ # Verifies that the transaction uniquely identified by this URL matches certain expected values.
727
+ #
728
+ # If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
729
+ #
730
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
731
+ #
732
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
733
+ # sales, purchases, inventory transfer, and returns (also called refunds).
734
+ #
735
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
736
+ #
737
+ # * Lines
738
+ # * Details (implies lines)
739
+ # * Summary (implies details)
740
+ # * Addresses
741
+ # * SummaryOnly (omit lines and details - reduces API response size)
742
+ # * LinesOnly (omit details - reduces API response size)
743
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
744
+ #
745
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
746
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
747
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
748
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
749
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
750
+ #
751
+ # ### Security Policies
752
+ #
753
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
740
754
  # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
741
- # @param companyCode [String] The company code of the company that recorded this transaction
742
- # @param transactionCode [String] The transaction code to settle
743
- # @param documentType [String] (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
744
- # @param include [String] Specifies objects to include in this fetch call
745
- # @param model [Object] The data from an external system to reconcile against AvaTax
755
+ # @param companyCode [String] The company code of the company that recorded this transaction
756
+ # @param transactionCode [String] The transaction code to settle
757
+ # @param documentType [String] (Optional): The document type of the transaction to verify. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
758
+ # @param include [String] Specifies objects to include in this fetch call
759
+ # @param model [Object] The data from an external system to reconcile against AvaTax
746
760
  # @return [Object]
747
761
  def verify_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
748
762
  post(path, model, options) end
749
763
 
750
764
  # Void a transaction
751
765
  #
752
- # Voids the current transaction uniquely identified by this URL.
753
- #
754
- # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
755
- # sales, purchases, inventory transfer, and returns (also called refunds).
756
- #
757
- # When you void a transaction, that transaction's status is recorded as `DocVoided`.
758
- #
759
- # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
760
- #
761
- # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
762
- #
763
- # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
764
- #
765
- # * Lines
766
- # * Details (implies lines)
767
- # * Summary (implies details)
768
- # * Addresses
769
- # * SummaryOnly (omit lines and details - reduces API response size)
770
- # * LinesOnly (omit details - reduces API response size)
771
- # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
772
- #
773
- # NOTE: If your companyCode or transactionCode contains any of these characters /, + or ? please use the following encoding before making a request:
774
- # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
775
- # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
776
- # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
777
- #
778
- # ### Security Policies
779
- #
780
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
781
- # * This API depends on the following active services<br />*Required* (all): AvaTaxPro.
782
- # @param companyCode [String] The company code of the company that recorded this transaction
783
- # @param transactionCode [String] The transaction code to void
784
- # @param documentType [String] (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
785
- # @param include [String] Specifies objects to include in this fetch call
786
- # @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
766
+ # Voids the current transaction uniquely identified by this URL.
767
+ #
768
+ # A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
769
+ # sales, purchases, inventory transfer, and returns (also called refunds).
770
+ #
771
+ # When you void a transaction, that transaction's status is recorded as `DocVoided`.
772
+ #
773
+ # If you have more than one document with the same `code`, specify the `documentType` parameter to choose between them.
774
+ #
775
+ # Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
776
+ #
777
+ # You may specify one or more of the following values in the `$include` parameter to fetch additional nested data, using commas to separate multiple values:
778
+ #
779
+ # * Lines
780
+ # * Details (implies lines)
781
+ # * Summary (implies details)
782
+ # * Addresses
783
+ # * SummaryOnly (omit lines and details - reduces API response size)
784
+ # * LinesOnly (omit details - reduces API response size)
785
+ # * TaxDetailsByTaxType - Includes the aggregated tax, exempt tax, taxable and non-taxable for each tax type returned in the transaction summary.
786
+ #
787
+ # NOTE: If your companyCode or transactionCode contains any of these characters /, +, ? or a space please use the following encoding before making a request:
788
+ # * Replace '/' with '\_-ava2f-\_' For example: document/Code becomes document_-ava2f-_Code
789
+ # * Replace '+' with '\_-ava2b-\_' For example: document+Code becomes document_-ava2b-_Code
790
+ # * Replace '?' with '\_-ava3f-\_' For example: document?Code becomes document_-ava3f-_Code
791
+ # * Replace ' ' with '%20' For example: document Code becomes document%20Code
792
+ #
793
+ # ### Security Policies
794
+ #
795
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, CompanyAdmin, CSPTester, ProStoresOperator, SSTAdmin, TechnicalSupportAdmin.
796
+ # * This API depends on the following active services<br />*Required* (all): AvaTaxPro, BasicReturns.
797
+ # @param companyCode [String] The company code of the company that recorded this transaction
798
+ # @param transactionCode [String] The transaction code to void
799
+ # @param documentType [String] (Optional): The document type of the transaction to void. If not provided, the default is SalesInvoice. (See DocumentType::* for a list of allowable values)
800
+ # @param include [String] Specifies objects to include in this fetch call
801
+ # @param model [Object] The void request you wish to execute. To void a transaction the code must be set to 'DocVoided'
787
802
  # @return [Object]
788
803
  def void_transaction(companyCode, transactionCode, model, options={}) path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
789
804
  post(path, model, options) end