avatax 17.5.0 → 17.6.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.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/lib/avatax/client/accounts.rb +29 -39
- data/lib/avatax/client/addresses.rb +21 -25
- data/lib/avatax/client/batches.rb +33 -45
- data/lib/avatax/client/companies.rb +101 -72
- data/lib/avatax/client/contacts.rb +35 -47
- data/lib/avatax/client/definitions.rb +176 -218
- data/lib/avatax/client/filingcalendars.rb +172 -200
- data/lib/avatax/client/filings.rb +170 -194
- data/lib/avatax/client/free.rb +43 -41
- data/lib/avatax/client/fundingrequests.rb +11 -15
- data/lib/avatax/client/items.rb +36 -48
- data/lib/avatax/client/jurisdictionoverrides.rb +38 -50
- data/lib/avatax/client/locations.rb +39 -76
- data/lib/avatax/client/nexus.rb +43 -57
- data/lib/avatax/client/notices.rb +111 -111
- data/lib/avatax/client/onboarding.rb +3 -5
- data/lib/avatax/client/pointofsale.rb +3 -5
- data/lib/avatax/client/registrar.rb +60 -82
- data/lib/avatax/client/settings.rb +40 -52
- data/lib/avatax/client/subscriptions.rb +19 -25
- data/lib/avatax/client/taxcodes.rb +35 -47
- data/lib/avatax/client/taxcontent.rb +54 -0
- data/lib/avatax/client/taxrules.rb +35 -47
- data/lib/avatax/client/transactions.rb +141 -179
- data/lib/avatax/client/upcs.rb +35 -47
- data/lib/avatax/client/users.rb +36 -46
- data/lib/avatax/client/utilities.rb +8 -14
- data/lib/avatax/version.rb +1 -1
- metadata +3 -2
@@ -4,467 +4,429 @@ module AvaTax
|
|
4
4
|
|
5
5
|
|
6
6
|
# Add lines to an existing unlocked transaction
|
7
|
-
#
|
7
|
+
#
|
8
8
|
# Add lines to an existing unlocked transaction.
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# The `AddLines` API allows you to add additional transaction lines to existing transaction, so that customer will
|
11
11
|
# be able to append multiple calls together and form an extremely large transaction. If customer does not specify line number
|
12
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
|
13
|
+
# the line number for the transaction lines, they can turn on the renumber switch to have REST v2 automatically renumber all
|
14
14
|
# transaction lines for them, in this case, the line number becomes: "1", "2", "3", ...
|
15
|
-
#
|
15
|
+
#
|
16
16
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
17
17
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
18
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
|
-
#
|
19
|
+
#
|
20
20
|
# * Lines
|
21
21
|
# * Details (implies lines)
|
22
22
|
# * Summary (implies details)
|
23
23
|
# * Addresses
|
24
|
-
#
|
24
|
+
#
|
25
25
|
# If you don't specify '$include' parameter, it will include both details and addresses.
|
26
|
-
#
|
27
|
-
# @param
|
28
|
-
# @
|
29
|
-
# @return TransactionModel
|
26
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
27
|
+
# @param model [Object] information about the transaction and lines to be added
|
28
|
+
# @return [Object]
|
30
29
|
def add_lines(model, options={})
|
31
30
|
path = "/api/v2/companies/transactions/lines/add"
|
32
|
-
|
33
31
|
post(path, model, options)
|
34
32
|
end
|
35
33
|
|
36
34
|
|
37
35
|
# Correct a previously created transaction
|
38
|
-
#
|
36
|
+
#
|
39
37
|
# Replaces the current transaction uniquely identified by this URL with a new transaction.
|
40
|
-
#
|
38
|
+
#
|
41
39
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
42
40
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
43
|
-
#
|
41
|
+
#
|
44
42
|
# When you adjust a committed transaction, the original transaction will be updated with the status code `Adjusted`, and
|
45
43
|
# both revisions will be available for retrieval based on their code and ID numbers.
|
46
44
|
# Only transactions in `Committed` status are reported by Avalara Managed Returns.
|
47
|
-
#
|
48
|
-
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
|
45
|
+
#
|
46
|
+
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered `locked` and are
|
49
47
|
# no longer available for adjustments.
|
50
|
-
#
|
51
|
-
# @param
|
52
|
-
# @param
|
53
|
-
# @
|
54
|
-
# @return TransactionModel
|
48
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
49
|
+
# @param transactionCode [String] The transaction code to adjust
|
50
|
+
# @param model [Object] The adjustment you wish to make
|
51
|
+
# @return [Object]
|
55
52
|
def adjust_transaction(companyCode, transactionCode, model)
|
56
53
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/adjust"
|
57
|
-
|
58
54
|
post(path, model)
|
59
55
|
end
|
60
56
|
|
61
57
|
|
62
58
|
# Get audit information about a transaction
|
63
|
-
#
|
59
|
+
#
|
64
60
|
# Retrieve audit information about a transaction stored in AvaTax.
|
65
|
-
#
|
66
|
-
# The 'AuditTransaction' endpoint retrieves audit information related to a specific transaction. This audit
|
61
|
+
#
|
62
|
+
# The 'AuditTransaction' endpoint retrieves audit information related to a specific transaction. This audit
|
67
63
|
# information includes the following:
|
68
|
-
#
|
64
|
+
#
|
69
65
|
# * The `CompanyId` of the company that created the transaction
|
70
66
|
# * The server timestamp representing the exact server time when the transaction was created
|
71
67
|
# * The server duration - how long it took to process this transaction
|
72
68
|
# * Whether exact API call details were logged
|
73
69
|
# * A reconstructed API call showing what the original CreateTransaction call looked like
|
74
|
-
#
|
70
|
+
#
|
75
71
|
# This API can be used to examine information about a previously created transaction.
|
76
|
-
#
|
72
|
+
#
|
77
73
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
78
74
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
79
|
-
#
|
80
|
-
# @param
|
81
|
-
# @
|
82
|
-
# @return AuditTransactionModel
|
75
|
+
# @param companyCode [String] The code identifying the company that owns this transaction
|
76
|
+
# @param transactionCode [String] The code identifying the transaction
|
77
|
+
# @return [Object]
|
83
78
|
def audit_transaction(companyCode, transactionCode)
|
84
79
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/audit"
|
85
|
-
|
86
80
|
get(path)
|
87
81
|
end
|
88
82
|
|
89
83
|
|
90
84
|
# Get audit information about a transaction
|
91
|
-
#
|
85
|
+
#
|
92
86
|
# Retrieve audit information about a transaction stored in AvaTax.
|
93
|
-
#
|
94
|
-
# The 'AuditTransaction' endpoint retrieves audit information related to a specific transaction. This audit
|
87
|
+
#
|
88
|
+
# The 'AuditTransaction' endpoint retrieves audit information related to a specific transaction. This audit
|
95
89
|
# information includes the following:
|
96
|
-
#
|
90
|
+
#
|
97
91
|
# * The `CompanyId` of the company that created the transaction
|
98
92
|
# * The server timestamp representing the exact server time when the transaction was created
|
99
93
|
# * The server duration - how long it took to process this transaction
|
100
94
|
# * Whether exact API call details were logged
|
101
95
|
# * A reconstructed API call showing what the original CreateTransaction call looked like
|
102
|
-
#
|
96
|
+
#
|
103
97
|
# This API can be used to examine information about a previously created transaction.
|
104
|
-
#
|
98
|
+
#
|
105
99
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
106
100
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
107
|
-
#
|
108
|
-
# @param
|
109
|
-
# @param
|
110
|
-
# @
|
111
|
-
# @return AuditTransactionModel
|
101
|
+
# @param companyCode [String] The code identifying the company that owns this transaction
|
102
|
+
# @param transactionCode [String] The code identifying the transaction
|
103
|
+
# @param documentType [String] The document type of the original transaction (See DocumentType::* for a list of allowable values)
|
104
|
+
# @return [Object]
|
112
105
|
def audit_transaction_with_type(companyCode, transactionCode, documentType)
|
113
106
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}/audit"
|
114
|
-
|
115
107
|
get(path)
|
116
108
|
end
|
117
109
|
|
118
110
|
|
119
111
|
# Lock a set of documents
|
120
|
-
#
|
112
|
+
#
|
121
113
|
# This API is available by invitation only.
|
122
|
-
#
|
114
|
+
#
|
123
115
|
# Lock a set of transactions uniquely identified by DocumentIds provided. This API allows locking multiple documents at once.
|
124
116
|
# After this API call succeeds, documents will be locked and can't be voided.
|
125
|
-
#
|
117
|
+
#
|
126
118
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
127
119
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
128
|
-
#
|
129
|
-
# @
|
130
|
-
# @return BulkLockTransactionResult
|
120
|
+
# @param model [Object] bulk lock request
|
121
|
+
# @return [Object]
|
131
122
|
def bulk_lock_transaction(model)
|
132
123
|
path = "/api/v2/transactions/lock"
|
133
|
-
|
134
124
|
post(path, model)
|
135
125
|
end
|
136
126
|
|
137
127
|
|
138
128
|
# Change a transaction's code
|
139
|
-
#
|
129
|
+
#
|
140
130
|
# Renames a transaction uniquely identified by this URL by changing its code to a new code.
|
141
131
|
# After this API call succeeds, the transaction will have a new URL matching its new code.
|
142
132
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
143
133
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
144
|
-
#
|
145
|
-
# @param
|
146
|
-
# @param
|
147
|
-
# @
|
148
|
-
# @return TransactionModel
|
134
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
135
|
+
# @param transactionCode [String] The transaction code to change
|
136
|
+
# @param model [Object] The code change request you wish to execute
|
137
|
+
# @return [Object]
|
149
138
|
def change_transaction_code(companyCode, transactionCode, model)
|
150
139
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/changecode"
|
151
|
-
|
152
140
|
post(path, model)
|
153
141
|
end
|
154
142
|
|
155
143
|
|
156
144
|
# Commit a transaction for reporting
|
157
|
-
#
|
145
|
+
#
|
158
146
|
# Marks a transaction by changing its status to 'Committed'.
|
159
147
|
# Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
|
160
148
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
161
149
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
162
150
|
# Any changes made to a committed transaction will generate a transaction history.
|
163
|
-
#
|
164
|
-
# @param
|
165
|
-
# @param
|
166
|
-
# @
|
167
|
-
# @return TransactionModel
|
151
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
152
|
+
# @param transactionCode [String] The transaction code to commit
|
153
|
+
# @param model [Object] The commit request you wish to execute
|
154
|
+
# @return [Object]
|
168
155
|
def commit_transaction(companyCode, transactionCode, model)
|
169
156
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/commit"
|
170
|
-
|
171
157
|
post(path, model)
|
172
158
|
end
|
173
159
|
|
174
160
|
|
175
161
|
# Create a new transaction
|
176
|
-
#
|
162
|
+
#
|
177
163
|
# Records a new transaction or adjust an existing in AvaTax.
|
178
|
-
#
|
164
|
+
#
|
179
165
|
# The `CreateOrAdjustTransaction` endpoint is used to create a new transaction if the input transaction does not exist
|
180
|
-
# or if there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
|
166
|
+
# or if there exists a transaction identified by code, the original transaction will be adjusted by using the meta data
|
181
167
|
# in the input transaction
|
182
|
-
#
|
168
|
+
#
|
183
169
|
# If you don't specify type in the provided data, a new transaction with type of SalesOrder will be recorded by default.
|
184
|
-
#
|
170
|
+
#
|
185
171
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
186
172
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
187
173
|
# 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:
|
188
|
-
#
|
174
|
+
#
|
189
175
|
# * Lines
|
190
176
|
# * Details (implies lines)
|
191
177
|
# * Summary (implies details)
|
192
178
|
# * Addresses
|
193
|
-
#
|
179
|
+
#
|
194
180
|
# If you don't specify '$include' parameter, it will include both details and addresses.
|
195
|
-
#
|
196
|
-
# @param
|
197
|
-
# @
|
198
|
-
# @return TransactionModel
|
181
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
182
|
+
# @param model [Object] The transaction you wish to create
|
183
|
+
# @return [Object]
|
199
184
|
def create_or_adjust_transaction(model, options={})
|
200
185
|
path = "/api/v2/transactions/createoradjust"
|
201
|
-
|
202
186
|
post(path, model, options)
|
203
187
|
end
|
204
188
|
|
205
189
|
|
206
190
|
# Create a new transaction
|
207
|
-
#
|
191
|
+
#
|
208
192
|
# Records a new transaction in AvaTax.
|
209
|
-
#
|
193
|
+
#
|
210
194
|
# The `CreateTransaction` endpoint uses the configuration values specified by your company to identify the correct tax rules
|
211
195
|
# and rates to apply to all line items in this transaction, and reports the total tax calculated by AvaTax based on your
|
212
196
|
# company's configuration and the data provided in this API call.
|
213
|
-
#
|
197
|
+
#
|
214
198
|
# If you don't specify type in the provided data, a new transaction with type of SalesOrder will be recorded by default.
|
215
|
-
#
|
199
|
+
#
|
216
200
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
217
201
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
218
202
|
# 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:
|
219
|
-
#
|
203
|
+
#
|
220
204
|
# * Lines
|
221
205
|
# * Details (implies lines)
|
222
206
|
# * Summary (implies details)
|
223
207
|
# * Addresses
|
224
|
-
#
|
208
|
+
#
|
225
209
|
# If you don't specify '$include' parameter, it will include both details and addresses.
|
226
|
-
#
|
227
|
-
# @param
|
228
|
-
# @
|
229
|
-
# @return TransactionModel
|
210
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
211
|
+
# @param model [Object] The transaction you wish to create
|
212
|
+
# @return [Object]
|
230
213
|
def create_transaction(model, options={})
|
231
214
|
path = "/api/v2/transactions/create"
|
232
|
-
|
233
215
|
post(path, model, options)
|
234
216
|
end
|
235
217
|
|
236
218
|
|
237
219
|
# Remove lines from an existing unlocked transaction
|
238
|
-
#
|
220
|
+
#
|
239
221
|
# Remove lines to an existing unlocked transaction.
|
240
|
-
#
|
222
|
+
#
|
241
223
|
# The `DeleteLines` API allows you to remove transaction lines from existing unlocked transaction, so that customer will
|
242
224
|
# be able to delete transaction lines and adjust original transaction the way they like
|
243
|
-
#
|
225
|
+
#
|
244
226
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
245
227
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
246
228
|
# 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:
|
247
|
-
#
|
229
|
+
#
|
248
230
|
# * Lines
|
249
231
|
# * Details (implies lines)
|
250
232
|
# * Summary (implies details)
|
251
233
|
# * Addresses
|
252
|
-
#
|
234
|
+
#
|
253
235
|
# If you don't specify '$include' parameter, it will include both details and addresses.
|
254
|
-
#
|
255
|
-
# @param
|
256
|
-
# @
|
257
|
-
# @return TransactionModel
|
236
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
237
|
+
# @param model [Object] information about the transaction and lines to be removed
|
238
|
+
# @return [Object]
|
258
239
|
def delete_lines(model, options={})
|
259
240
|
path = "/api/v2/companies/transactions/lines/delete"
|
260
|
-
|
261
241
|
post(path, model, options)
|
262
242
|
end
|
263
243
|
|
264
244
|
|
265
245
|
# Retrieve a single transaction by code
|
266
|
-
#
|
246
|
+
#
|
267
247
|
# Get the current transaction identified by this URL.
|
268
248
|
# If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of
|
269
249
|
# the transaction will be attached to the 'history' data field.
|
270
250
|
# 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:
|
271
|
-
#
|
251
|
+
#
|
272
252
|
# * Lines
|
273
253
|
# * Details (implies lines)
|
274
254
|
# * Summary (implies details)
|
275
255
|
# * Addresses
|
276
|
-
#
|
277
|
-
# @param
|
278
|
-
# @param
|
279
|
-
# @
|
280
|
-
# @return TransactionModel
|
256
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
257
|
+
# @param transactionCode [String] The transaction code to retrieve
|
258
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
259
|
+
# @return [Object]
|
281
260
|
def get_transaction_by_code(companyCode, transactionCode, options={})
|
282
261
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}"
|
283
|
-
|
284
262
|
get(path, options)
|
285
263
|
end
|
286
264
|
|
287
265
|
|
288
266
|
# Retrieve a single transaction by code
|
289
|
-
#
|
267
|
+
#
|
290
268
|
# Get the current transaction identified by this URL.
|
291
269
|
# If this transaction was adjusted, the return value of this API will be the current transaction with this code, and previous revisions of
|
292
270
|
# the transaction will be attached to the 'history' data field.
|
293
271
|
# 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:
|
294
|
-
#
|
272
|
+
#
|
295
273
|
# * Lines
|
296
274
|
# * Details (implies lines)
|
297
275
|
# * Summary (implies details)
|
298
276
|
# * Addresses
|
299
|
-
#
|
300
|
-
# @param
|
301
|
-
# @param
|
302
|
-
# @param
|
303
|
-
# @
|
304
|
-
# @return TransactionModel
|
277
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
278
|
+
# @param transactionCode [String] The transaction code to retrieve
|
279
|
+
# @param documentType [String] The transaction type to retrieve (See DocumentType::* for a list of allowable values)
|
280
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
281
|
+
# @return [Object]
|
305
282
|
def get_transaction_by_code_and_type(companyCode, transactionCode, documentType, options={})
|
306
283
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/types/#{documentType}"
|
307
|
-
|
308
284
|
get(path, options)
|
309
285
|
end
|
310
286
|
|
311
287
|
|
312
288
|
# Retrieve a single transaction by ID
|
313
|
-
#
|
289
|
+
#
|
314
290
|
# Get the unique transaction identified by this URL.
|
315
291
|
# This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
|
316
292
|
# by using the 'Adjust Transaction' endpoint.
|
317
293
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
318
294
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
319
295
|
# 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:
|
320
|
-
#
|
296
|
+
#
|
321
297
|
# * Lines
|
322
298
|
# * Details (implies lines)
|
323
299
|
# * Summary (implies details)
|
324
300
|
# * Addresses
|
325
|
-
#
|
326
|
-
# @param
|
327
|
-
# @
|
328
|
-
# @return TransactionModel
|
301
|
+
# @param id [Integer] The unique ID number of the transaction to retrieve
|
302
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
303
|
+
# @return [Object]
|
329
304
|
def get_transaction_by_id(id, options={})
|
330
305
|
path = "/api/v2/transactions/#{id}"
|
331
|
-
|
332
306
|
get(path, options)
|
333
307
|
end
|
334
308
|
|
335
309
|
|
336
310
|
# Retrieve all transactions
|
337
|
-
#
|
311
|
+
#
|
338
312
|
# List all transactions attached to this company.
|
339
313
|
# This endpoint is limited to returning 1,000 transactions at a time maximum.
|
340
314
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
341
315
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
342
|
-
#
|
316
|
+
#
|
343
317
|
# 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/) .
|
344
318
|
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
|
345
319
|
# 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:
|
346
|
-
#
|
320
|
+
#
|
347
321
|
# * Lines
|
348
322
|
# * Details (implies lines)
|
349
323
|
# * Summary (implies details)
|
350
324
|
# * Addresses
|
351
|
-
#
|
352
|
-
# @param
|
353
|
-
# @param
|
354
|
-
# @param
|
355
|
-
# @param
|
356
|
-
# @param
|
357
|
-
# @
|
358
|
-
# @return FetchResult
|
325
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
326
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
327
|
+
# @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/) .
|
328
|
+
# @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
|
329
|
+
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
|
330
|
+
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
331
|
+
# @return [FetchResult]
|
359
332
|
def list_transactions_by_company(companyCode, options={})
|
360
333
|
path = "/api/v2/companies/#{companyCode}/transactions"
|
361
|
-
|
362
334
|
get(path, options)
|
363
335
|
end
|
364
336
|
|
365
337
|
|
366
338
|
# Lock a single transaction
|
367
|
-
#
|
368
|
-
# Lock a transaction uniquely identified by this URL.
|
369
|
-
#
|
339
|
+
#
|
340
|
+
# Lock a transaction uniquely identified by this URL.
|
341
|
+
#
|
370
342
|
# This API is mainly used for connector developer to simulate what happens when Returns product locks a document.
|
371
343
|
# After this API call succeeds, the document will be locked and can't be voided or adjusted.
|
372
|
-
#
|
344
|
+
#
|
373
345
|
# This API is only available to customers in Sandbox with AvaTaxPro subscription. On production servers, this API is available by invitation only.
|
374
|
-
#
|
346
|
+
#
|
375
347
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
376
348
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
377
|
-
#
|
378
|
-
# @param
|
379
|
-
# @param
|
380
|
-
# @
|
381
|
-
# @return TransactionModel
|
349
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
350
|
+
# @param transactionCode [String] The transaction code to lock
|
351
|
+
# @param model [Object] The lock request you wish to execute
|
352
|
+
# @return [Object]
|
382
353
|
def lock_transaction(companyCode, transactionCode, model)
|
383
354
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/lock"
|
384
|
-
|
385
355
|
post(path, model)
|
386
356
|
end
|
387
357
|
|
388
358
|
|
389
359
|
# Create a refund for a transaction
|
390
|
-
#
|
360
|
+
#
|
391
361
|
# Create a refund for a transaction.
|
392
|
-
#
|
362
|
+
#
|
393
363
|
# The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
|
394
364
|
# for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
|
395
365
|
# specify individual line items from the original sale for refund.
|
396
|
-
#
|
366
|
+
#
|
397
367
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
398
368
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
399
369
|
# 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:
|
400
|
-
#
|
370
|
+
#
|
401
371
|
# * Lines
|
402
372
|
# * Details (implies lines)
|
403
373
|
# * Summary (implies details)
|
404
374
|
# * Addresses
|
405
|
-
#
|
375
|
+
#
|
406
376
|
# If you don't specify '$include' parameter, it will include both details and addresses.
|
407
|
-
#
|
408
|
-
# @param
|
409
|
-
# @param
|
410
|
-
# @param
|
411
|
-
# @
|
412
|
-
# @return TransactionModel
|
377
|
+
# @param companyCode [String] The code of the company that made the original sale
|
378
|
+
# @param transactionCode [String] The transaction code of the original sale
|
379
|
+
# @param include [String] A comma separated list of child objects to return underneath the primary object.
|
380
|
+
# @param model [Object] Information about the refund to create
|
381
|
+
# @return [Object]
|
413
382
|
def refund_transaction(companyCode, transactionCode, model, options={})
|
414
383
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/refund"
|
415
|
-
|
416
384
|
post(path, model, options)
|
417
385
|
end
|
418
386
|
|
419
387
|
|
420
388
|
# Perform multiple actions on a transaction
|
421
|
-
#
|
389
|
+
#
|
422
390
|
# Performs the same functions as /verify, /changecode, and /commit. You may specify one or many actions in each call to this endpoint.
|
423
|
-
#
|
424
|
-
# @param
|
425
|
-
# @param
|
426
|
-
# @
|
427
|
-
# @return TransactionModel
|
391
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
392
|
+
# @param transactionCode [String] The transaction code to settle
|
393
|
+
# @param model [Object] The settle request containing the actions you wish to execute
|
394
|
+
# @return [Object]
|
428
395
|
def settle_transaction(companyCode, transactionCode, model)
|
429
396
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/settle"
|
430
|
-
|
431
397
|
post(path, model)
|
432
398
|
end
|
433
399
|
|
434
400
|
|
435
401
|
# Verify a transaction
|
436
|
-
#
|
402
|
+
#
|
437
403
|
# Verifies that the transaction uniquely identified by this URL matches certain expected values.
|
438
404
|
# If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
|
439
405
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
440
406
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
441
|
-
#
|
442
|
-
# @param
|
443
|
-
# @param
|
444
|
-
# @
|
445
|
-
# @return TransactionModel
|
407
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
408
|
+
# @param transactionCode [String] The transaction code to settle
|
409
|
+
# @param model [Object] The settle request you wish to execute
|
410
|
+
# @return [Object]
|
446
411
|
def verify_transaction(companyCode, transactionCode, model)
|
447
412
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/verify"
|
448
|
-
|
449
413
|
post(path, model)
|
450
414
|
end
|
451
415
|
|
452
416
|
|
453
417
|
# Void a transaction
|
454
|
-
#
|
418
|
+
#
|
455
419
|
# Voids the current transaction uniquely identified by this URL.
|
456
420
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
457
421
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
458
422
|
# When you void a transaction, that transaction's status is recorded as 'DocVoided'.
|
459
423
|
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are no longer available to be voided.
|
460
|
-
#
|
461
|
-
# @param
|
462
|
-
# @param
|
463
|
-
# @
|
464
|
-
# @return TransactionModel
|
424
|
+
# @param companyCode [String] The company code of the company that recorded this transaction
|
425
|
+
# @param transactionCode [String] The transaction code to void
|
426
|
+
# @param model [Object] The void request you wish to execute
|
427
|
+
# @return [Object]
|
465
428
|
def void_transaction(companyCode, transactionCode, model)
|
466
429
|
path = "/api/v2/companies/#{companyCode}/transactions/#{transactionCode}/void"
|
467
|
-
|
468
430
|
post(path, model)
|
469
431
|
end
|
470
432
|
|