avatax 17.9.1 → 17.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avatax/client/companies.rb +16 -2
- data/lib/avatax/client/definitions.rb +5 -2
- data/lib/avatax/client/filings.rb +4 -3
- data/lib/avatax/client/free.rb +6 -4
- data/lib/avatax/client/multidocument.rb +291 -0
- data/lib/avatax/client/registrar.rb +1 -17
- data/lib/avatax/client/taxcontent.rb +25 -0
- data/lib/avatax/client/transactions.rb +38 -19
- data/lib/avatax/client/users.rb +20 -0
- data/lib/avatax/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b243bcb1b50952e1aae1ffe36d1169a9048d7e71
|
4
|
+
data.tar.gz: 053fee8c45e531196f13e9854ddbf36097f3c9da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d47dbf4dfe6f35453e071218abf4e0fb5fbfe857fbcd6cd6fba776ab8b420cd1fe18fc6815a8c03f0a5ae5dba3926382b2c73f24f3f5c7484cc091318f3f0090
|
7
|
+
data.tar.gz: 581986d1507f38f63922e2b0e8c3c74972340cbc5ab7e6f0aa0d817a5c7bf78b72ba2cab7e71a5dfa3b754c47904af74548fe777bd78a56955e778a6a619781a
|
@@ -94,6 +94,20 @@ module AvaTax
|
|
94
94
|
end
|
95
95
|
|
96
96
|
|
97
|
+
# Check the funding configuration of a company
|
98
|
+
#
|
99
|
+
# This API is available by invitation only.
|
100
|
+
# Requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
|
101
|
+
# Returns the funding configuration of the requested company.
|
102
|
+
# .
|
103
|
+
# @param companyId [Integer] The unique identifier of the company
|
104
|
+
# @return [Object]
|
105
|
+
def funding_configuration_by_company(companyId)
|
106
|
+
path = "/api/v2/companies/#{companyId}/funding/configuration"
|
107
|
+
get(path)
|
108
|
+
end
|
109
|
+
|
110
|
+
|
97
111
|
# Retrieve a single company
|
98
112
|
#
|
99
113
|
# Get the company object identified by this URL.
|
@@ -162,12 +176,12 @@ module AvaTax
|
|
162
176
|
end
|
163
177
|
|
164
178
|
|
165
|
-
# Check managed returns funding
|
179
|
+
# Check managed returns funding status for a company
|
166
180
|
#
|
167
181
|
# This API is available by invitation only.
|
168
182
|
# Requires a subscription to Avalara Managed Returns or SST Certified Service Provider.
|
169
183
|
# Returns a list of funding setup requests and their current status.
|
170
|
-
# Each object in the result is a request that was made to setup or adjust funding
|
184
|
+
# Each object in the result is a request that was made to setup or adjust funding status for this company.
|
171
185
|
# @param id [Integer] The unique identifier of the company
|
172
186
|
# @return [FundingStatusModel[]]
|
173
187
|
def list_funding_requests_by_company(id)
|
@@ -289,6 +289,7 @@ module AvaTax
|
|
289
289
|
# Retrieve the full list of Avalara-supported nexus for all countries and regions.
|
290
290
|
#
|
291
291
|
# Returns the full list of all Avalara-supported nexus for all countries and regions.
|
292
|
+
#
|
292
293
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus.
|
293
294
|
# @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/) .
|
294
295
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
|
@@ -312,9 +313,9 @@ module AvaTax
|
|
312
313
|
# @param line2 [String] The first address line portion of this address.
|
313
314
|
# @param line3 [String] The first address line portion of this address.
|
314
315
|
# @param city [String] The city portion of this address.
|
315
|
-
# @param region [String]
|
316
|
+
# @param region [String] Name or ISO 3166 code identifying the region portion of the address. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
|
316
317
|
# @param postalCode [String] The postal code or zip code portion of this address.
|
317
|
-
# @param country [String]
|
318
|
+
# @param country [String] Name or ISO 3166 code identifying the country portion of this address. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
318
319
|
# @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/) .
|
319
320
|
# @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
|
320
321
|
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
|
@@ -329,6 +330,7 @@ module AvaTax
|
|
329
330
|
# Retrieve the full list of Avalara-supported nexus for a country.
|
330
331
|
#
|
331
332
|
# Returns all Avalara-supported nexus for the specified country.
|
333
|
+
#
|
332
334
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country.
|
333
335
|
# @param country [String] The country in which you want to fetch the system nexus
|
334
336
|
# @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/) .
|
@@ -345,6 +347,7 @@ module AvaTax
|
|
345
347
|
# Retrieve the full list of Avalara-supported nexus for a country and region.
|
346
348
|
#
|
347
349
|
# Returns all Avalara-supported nexus for the specified country and region.
|
350
|
+
#
|
348
351
|
# This API is intended to be useful if your user interface needs to display a selectable list of nexus filtered by country and region.
|
349
352
|
# @param country [String] The two-character ISO-3166 code for the country.
|
350
353
|
# @param region [String] The two or three character region code for the region.
|
@@ -210,11 +210,11 @@ module AvaTax
|
|
210
210
|
#
|
211
211
|
# This API is available by invitation only.
|
212
212
|
# @param companyId [Integer] The ID of the company that owns the filings.
|
213
|
-
# @param
|
213
|
+
# @param filingReturnId [Integer] The unique id of the worksheet return.
|
214
214
|
# @param fileId [Integer] The unique id of the document you are downloading
|
215
215
|
# @return [Object]
|
216
|
-
def get_filing_attachment(companyId,
|
217
|
-
path = "/api/v2/companies/#{companyId}/filings/#{
|
216
|
+
def get_filing_attachment(companyId, filingReturnId, options={})
|
217
|
+
path = "/api/v2/companies/#{companyId}/filings/#{filingReturnId}/attachment"
|
218
218
|
get(path, options)
|
219
219
|
end
|
220
220
|
|
@@ -340,6 +340,7 @@ module AvaTax
|
|
340
340
|
# @param status [String] The status of the return(s) you are trying to retrieve (See FilingStatusId::* for a list of allowable values)
|
341
341
|
# @param country [String] The country of the return(s) you are trying to retrieve
|
342
342
|
# @param region [String] The region of the return(s) you are trying to retrieve
|
343
|
+
# @param filingCalendarId [Integer] The filing calendar id of the return you are trying to retrieve
|
343
344
|
# @return [FetchResult]
|
344
345
|
def get_filings_returns(companyId, options={})
|
345
346
|
path = "/api/v2/companies/#{companyId}/filings/returns"
|
data/lib/avatax/client/free.rb
CHANGED
@@ -56,9 +56,9 @@ module AvaTax
|
|
56
56
|
# @param line2 [String] The street address of the location.
|
57
57
|
# @param line3 [String] The street address of the location.
|
58
58
|
# @param city [String] The city name of the location.
|
59
|
-
# @param region [String]
|
59
|
+
# @param region [String] Name or ISO 3166 code identifying the region within the country. This field supports many different region identifiers: * Two and three character ISO 3166 region codes * Fully spelled out names of the region in ISO supported languages * Common alternative spellings for many regions For a full list of all supported codes and names, please see the Definitions API `ListRegions`.
|
60
60
|
# @param postalCode [String] The postal code of the location.
|
61
|
-
# @param country [String]
|
61
|
+
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
62
62
|
# @return [Object]
|
63
63
|
def tax_rates_by_address(options={})
|
64
64
|
path = "/api/v2/taxrates/byaddress"
|
@@ -66,10 +66,12 @@ module AvaTax
|
|
66
66
|
end
|
67
67
|
|
68
68
|
|
69
|
-
# FREE API - Sales tax rates for a specified country and postal code
|
69
|
+
# FREE API - Sales tax rates for a specified country and postal code. This API is only available for US postal codes.
|
70
70
|
#
|
71
71
|
# # Free-To-Use
|
72
72
|
#
|
73
|
+
# This API is only available for a US postal codes.
|
74
|
+
#
|
73
75
|
# The TaxRates API is a free-to-use, no cost option for estimating sales tax rates.
|
74
76
|
# Any customer can request a free AvaTax account and make use of the TaxRates API.
|
75
77
|
#
|
@@ -93,7 +95,7 @@ module AvaTax
|
|
93
95
|
#
|
94
96
|
# Please see [Estimating Tax with REST v2](http://developer.avalara.com/blog/2016/11/04/estimating-tax-with-rest-v2/)
|
95
97
|
# for information on how to upgrade to the full AvaTax CreateTransaction API.
|
96
|
-
# @param country [String]
|
98
|
+
# @param country [String] Name or ISO 3166 code identifying the country. This field supports many different country identifiers: * Two character ISO 3166 codes * Three character ISO 3166 codes * Fully spelled out names of the country in ISO supported languages * Common alternative spellings for many countries For a full list of all supported codes and names, please see the Definitions API `ListCountries`.
|
97
99
|
# @param postalCode [String] The postal code of the location.
|
98
100
|
# @return [Object]
|
99
101
|
def tax_rates_by_postal_code(options={})
|
@@ -0,0 +1,291 @@
|
|
1
|
+
module AvaTax
|
2
|
+
class Client
|
3
|
+
module MultiDocument
|
4
|
+
|
5
|
+
|
6
|
+
# Adjust a MultiDocument transaction
|
7
|
+
#
|
8
|
+
# Adjusts the current MultiDocument transaction uniquely identified by this URL.
|
9
|
+
#
|
10
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
11
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
12
|
+
#
|
13
|
+
# When you adjust a transaction, that transaction's status is recorded as `Adjusted`.
|
14
|
+
#
|
15
|
+
# Both the revisions will be available for retrieval based on their code and ID numbers. Only transactions in Committed status can be reported on a tax filing by Avalara's Managed Returns Service.
|
16
|
+
#
|
17
|
+
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns are considered locked and are no longer available for adjustments.
|
18
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
19
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
20
|
+
# @param include [String] Specifies objects to include in this fetch call
|
21
|
+
# @param model [Object] The adjust request you wish to execute
|
22
|
+
# @return [Object]
|
23
|
+
def adjust_multi_document_transaction(code, type, model, options={})
|
24
|
+
path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/adjust"
|
25
|
+
post(path, model, options)
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
# Get audit information about a MultiDocument transaction
|
30
|
+
#
|
31
|
+
# Retrieve audit information about a MultiDocument transaction stored in AvaTax.
|
32
|
+
#
|
33
|
+
# The audit API retrieves audit information related to a specific MultiDocument transaction. This audit
|
34
|
+
# information includes the following:
|
35
|
+
#
|
36
|
+
# * The `code` of the MultiDocument transaction
|
37
|
+
# * The `type` of the MultiDocument transaction
|
38
|
+
# * The server timestamp representing the exact server time when the transaction was created
|
39
|
+
# * The server duration - how long it took to process this transaction
|
40
|
+
# * Whether exact API call details were logged
|
41
|
+
# * A reconstructed API call showing what the original create call looked like
|
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
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
46
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
47
|
+
# @return [Object]
|
48
|
+
def audit_multi_document_transaction(code, type)
|
49
|
+
path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/audit"
|
50
|
+
get(path)
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
# Commit a MultiDocument transaction
|
55
|
+
#
|
56
|
+
# Marks a list of transactions by changing its status to `Committed`.
|
57
|
+
#
|
58
|
+
# Transactions that are committed are available to be reported to a tax authority by Avalara Managed Returns.
|
59
|
+
#
|
60
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
61
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
62
|
+
#
|
63
|
+
# Any changes made to a committed transaction will generate a transaction history.
|
64
|
+
# @param model [Object] The commit request you wish to execute
|
65
|
+
# @return [Object]
|
66
|
+
def commit_multi_document_transaction(model)
|
67
|
+
path = "/api/v2/transactions/multidocument/commit"
|
68
|
+
post(path, model)
|
69
|
+
end
|
70
|
+
|
71
|
+
|
72
|
+
# Create a new MultiDocument transaction
|
73
|
+
#
|
74
|
+
# Records a new MultiDocument transaction in AvaTax.
|
75
|
+
#
|
76
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
77
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
78
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
79
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
80
|
+
#
|
81
|
+
# This API will report an error if you attempt to create a transaction when one already exists with the specified `code`.
|
82
|
+
# If you would like the API to automatically update the transaction when it already exists, please set the `allowAdjust`
|
83
|
+
# value to `true`.
|
84
|
+
#
|
85
|
+
# To generate a refund for a transaction, use the `RefundTransaction` API.
|
86
|
+
#
|
87
|
+
# The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
|
88
|
+
# a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
|
89
|
+
#
|
90
|
+
# The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
|
91
|
+
# provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
|
92
|
+
# information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
|
93
|
+
# using the best available address location information.
|
94
|
+
#
|
95
|
+
# 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:
|
96
|
+
#
|
97
|
+
# * Lines
|
98
|
+
# * Details (implies lines)
|
99
|
+
# * Summary (implies details)
|
100
|
+
# * Addresses
|
101
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
102
|
+
# * LinesOnly (omit details - reduces API response size)
|
103
|
+
# * 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.
|
104
|
+
#
|
105
|
+
# If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
|
106
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
107
|
+
# @param model [Object] the multi document transaction model
|
108
|
+
# @return [Object]
|
109
|
+
def create_multi_document_transaction(model, options={})
|
110
|
+
path = "/api/v2/transactions/multidocument"
|
111
|
+
post(path, model, options)
|
112
|
+
end
|
113
|
+
|
114
|
+
|
115
|
+
# Retrieve a MultiDocument transaction
|
116
|
+
#
|
117
|
+
# Get the current MultiDocument transaction identified by this URL.
|
118
|
+
#
|
119
|
+
# If this transaction was adjusted, the return value of this API will be the current transaction with this code.
|
120
|
+
#
|
121
|
+
# 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:
|
122
|
+
#
|
123
|
+
# * Lines
|
124
|
+
# * Details (implies lines)
|
125
|
+
# * Summary (implies details)
|
126
|
+
# * Addresses
|
127
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
128
|
+
# * LinesOnly (omit details - reduces API response size)
|
129
|
+
# @param code [String]
|
130
|
+
# @param type [String] (See DocumentType::* for a list of allowable values)
|
131
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
132
|
+
# @return [Object]
|
133
|
+
def get_multi_document_transaction_by_code_and_type(code, type, options={})
|
134
|
+
path = "/api/v2/transactions/multidocument/#{code}/type/#{type}"
|
135
|
+
get(path, options)
|
136
|
+
end
|
137
|
+
|
138
|
+
|
139
|
+
# Retrieve a MultiDocument transaction by ID
|
140
|
+
#
|
141
|
+
# Get the unique MultiDocument transaction identified by this URL.
|
142
|
+
#
|
143
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
144
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
145
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
146
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
147
|
+
#
|
148
|
+
# This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
|
149
|
+
# by using the `AdjustTransaction` endpoint.
|
150
|
+
#
|
151
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
152
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
153
|
+
#
|
154
|
+
# 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:
|
155
|
+
#
|
156
|
+
# * Lines
|
157
|
+
# * Details (implies lines)
|
158
|
+
# * Summary (implies details)
|
159
|
+
# * Addresses
|
160
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
161
|
+
# * LinesOnly (omit details - reduces API response size)
|
162
|
+
# @param id [Integer] The unique ID number of the MultiDocument transaction to retrieve
|
163
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
164
|
+
# @return [Object]
|
165
|
+
def get_multi_document_transaction_by_id(id, options={})
|
166
|
+
path = "/api/v2/transactions/multidocument/#{id}"
|
167
|
+
get(path, options)
|
168
|
+
end
|
169
|
+
|
170
|
+
|
171
|
+
# Retrieve all MultiDocument transactions
|
172
|
+
#
|
173
|
+
# List all MultiDocument transactions within this account.
|
174
|
+
#
|
175
|
+
# This endpoint is limited to returning 1,000 MultiDocument transactions at a time. To retrieve more than 1,000 MultiDocument
|
176
|
+
# transactions, please use the pagination features of the API.
|
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
|
+
# 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/) .
|
182
|
+
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
|
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
|
+
# @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/) .
|
193
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
194
|
+
# @param top [Integer] If nonzero, return no more than this number of results. Used with $skip to provide pagination for large datasets.
|
195
|
+
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with $top to provide pagination for large datasets.
|
196
|
+
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
|
197
|
+
# @return [FetchResult]
|
198
|
+
def list_multi_document_transactions(options={})
|
199
|
+
path = "/api/v2/transactions/multidocument"
|
200
|
+
get(path, options)
|
201
|
+
end
|
202
|
+
|
203
|
+
|
204
|
+
# Create a refund for a MultiDocument transaction
|
205
|
+
#
|
206
|
+
# Create a refund for a MultiDocument transaction.
|
207
|
+
#
|
208
|
+
# A traditional transaction requires exactly two parties: a seller and a buyer. MultiDocument transactions can
|
209
|
+
# involve a marketplace of vendors, each of which contributes some portion of the final transaction. Within
|
210
|
+
# a MultiDocument transaction, each individual buyer and seller pair are matched up and converted to a separate
|
211
|
+
# document. This separation of documents allows each seller to file their taxes separately.
|
212
|
+
#
|
213
|
+
# The `RefundTransaction` API allows you to quickly and easily create a `ReturnInvoice` representing a refund
|
214
|
+
# for a previously created `SalesInvoice` transaction. You can choose to create a full or partial refund, and
|
215
|
+
# specify individual line items from the original sale for refund.
|
216
|
+
#
|
217
|
+
# The `RefundTransaction` API ensures that the tax amount you refund to the customer exactly matches the tax that
|
218
|
+
# was calculated during the original transaction, regardless of any changes to your company's configuration, rules,
|
219
|
+
# nexus, or any other setting.
|
220
|
+
#
|
221
|
+
# This API is intended to be a shortcut to allow you to quickly and accurately generate a refund for the following
|
222
|
+
# common refund scenarios:
|
223
|
+
#
|
224
|
+
# * A full refund of a previous sale
|
225
|
+
# * Refunding the tax that was charged on a previous sale, when the customer provides an exemption certificate after the purchase
|
226
|
+
# * Refunding one or more items (lines) from a previous sale
|
227
|
+
# * Granting a customer a percentage refund of a previous sale
|
228
|
+
#
|
229
|
+
# For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
|
230
|
+
# create a custom refund transaction.
|
231
|
+
#
|
232
|
+
# 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:
|
233
|
+
#
|
234
|
+
# * Lines
|
235
|
+
# * Details (implies lines)
|
236
|
+
# * Summary (implies details)
|
237
|
+
# * Addresses
|
238
|
+
# * SummaryOnly (omit lines and details - reduces API response size)
|
239
|
+
# * LinesOnly (omit details - reduces API response size)
|
240
|
+
#
|
241
|
+
# If you omit the `$include` parameter, the API will assume you want `Summary,Addresses`.
|
242
|
+
# @param code [String] The code of this MultiDocument transaction
|
243
|
+
# @param type [String] The type of this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
244
|
+
# @param include [String] Specifies objects to include in the response after transaction is created
|
245
|
+
# @param model [Object] Information about the refund to create
|
246
|
+
# @return [Object]
|
247
|
+
def refund_multi_document_transaction(code, type, model, options={})
|
248
|
+
path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/refund"
|
249
|
+
post(path, model, options)
|
250
|
+
end
|
251
|
+
|
252
|
+
|
253
|
+
# Verify a MultiDocument transaction
|
254
|
+
#
|
255
|
+
# Verifies that the MultiDocument transaction uniquely identified by this URL matches certain expected values.
|
256
|
+
#
|
257
|
+
# If the transaction does not match these expected values, this API will return an error code indicating which value did not match.
|
258
|
+
#
|
259
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
260
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
261
|
+
# @param model [Object] Information from your accounting system to verify against this MultiDocument transaction as it is stored in AvaTax
|
262
|
+
# @return [Object]
|
263
|
+
def verify_multi_document_transaction(model)
|
264
|
+
path = "/api/v2/transactions/multidocument/verify"
|
265
|
+
post(path, model)
|
266
|
+
end
|
267
|
+
|
268
|
+
|
269
|
+
# Void a MultiDocument transaction
|
270
|
+
#
|
271
|
+
# Voids the current transaction uniquely identified by this URL.
|
272
|
+
#
|
273
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
274
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
275
|
+
#
|
276
|
+
# When you void a transaction, that transaction's status is recorded as `DocVoided`.
|
277
|
+
#
|
278
|
+
# Transactions that have been previously reported to a tax authority by Avalara Managed Returns Service are considered `locked`,
|
279
|
+
# and they are no longer available to be voided.
|
280
|
+
# @param code [String] The transaction code for this MultiDocument transaction
|
281
|
+
# @param type [String] The transaction type for this MultiDocument transaction (See DocumentType::* for a list of allowable values)
|
282
|
+
# @param model [Object] The void request you wish to execute
|
283
|
+
# @return [Object]
|
284
|
+
def void_multi_document_transaction(code, type, model)
|
285
|
+
path = "/api/v2/transactions/multidocument/#{code}/type/#{type}/void"
|
286
|
+
post(path, model)
|
287
|
+
end
|
288
|
+
|
289
|
+
end
|
290
|
+
end
|
291
|
+
end
|
@@ -51,22 +51,6 @@ module AvaTax
|
|
51
51
|
end
|
52
52
|
|
53
53
|
|
54
|
-
# Create new users
|
55
|
-
#
|
56
|
-
# # For Registrar Use Only
|
57
|
-
# This API is for use by Avalara Registrar administrative users only.
|
58
|
-
#
|
59
|
-
# Create one or more new user objects attached to this account.
|
60
|
-
# A user represents one person with access privileges to make API calls and work with a specific account.
|
61
|
-
# @param accountId [Integer] The unique ID number of the account where these users will be created.
|
62
|
-
# @param model [UserModel[]] The user or array of users you wish to create.
|
63
|
-
# @return [UserModel[]]
|
64
|
-
def create_users(accountId, model)
|
65
|
-
path = "/api/v2/accounts/#{accountId}/users"
|
66
|
-
post(path, model)
|
67
|
-
end
|
68
|
-
|
69
|
-
|
70
54
|
# Delete a single account
|
71
55
|
#
|
72
56
|
# # For Registrar Use Only
|
@@ -191,4 +175,4 @@ module AvaTax
|
|
191
175
|
|
192
176
|
end
|
193
177
|
end
|
194
|
-
end
|
178
|
+
end
|
@@ -53,6 +53,31 @@ module AvaTax
|
|
53
53
|
get(path, options)
|
54
54
|
end
|
55
55
|
|
56
|
+
|
57
|
+
# Download a file listing tax rates by postal code
|
58
|
+
#
|
59
|
+
# Download a CSV file containing all five digit postal codes in the United States and their sales
|
60
|
+
# and use tax rates for tangible personal property.
|
61
|
+
#
|
62
|
+
# This rates file is intended to be used as a default for tax calculation when your software cannot
|
63
|
+
# call the `CreateTransaction` API call. When using this file, your software will be unable to
|
64
|
+
# handle complex tax rules such as:
|
65
|
+
#
|
66
|
+
# * Zip+9 - This tax file does not contain
|
67
|
+
# * Different product types - This tax file contains tangible personal property tax rates only.
|
68
|
+
# * Mixed sourcing - This tax file cannot be used to resolve origin-based taxes.
|
69
|
+
# * Threshold-based taxes - This tax file does not contain information about thresholds.
|
70
|
+
#
|
71
|
+
# If you use this file to provide default tax rates, please ensure that your software calls `CreateTransaction`
|
72
|
+
# to reconcile the actual transaction and determine the difference between the estimated general tax
|
73
|
+
# rate and the final transaction tax.
|
74
|
+
# @param date [DateTime] The date for which point-of-sale data would be calculated (today by default). Example input: 2016-12-31
|
75
|
+
# @return [Object]
|
76
|
+
def download_tax_rates_by_zip_code(date)
|
77
|
+
path = "/api/v2/taxratesbyzipcode/download/#{date}"
|
78
|
+
get(path)
|
79
|
+
end
|
80
|
+
|
56
81
|
end
|
57
82
|
end
|
58
83
|
end
|
@@ -15,7 +15,7 @@ module AvaTax
|
|
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
|
-
# You may specify one or more of the following values in the
|
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)
|
@@ -129,8 +129,13 @@ module AvaTax
|
|
129
129
|
|
130
130
|
# Change a transaction's code
|
131
131
|
#
|
132
|
-
# Renames a transaction uniquely identified by this URL by changing its code
|
133
|
-
#
|
132
|
+
# Renames a transaction uniquely identified by this URL by changing its `code` value.
|
133
|
+
#
|
134
|
+
# This API is available as long as the transaction is in `saved` or `posted` status. When a transaction
|
135
|
+
# is `committed`, it can be modified by using the [AdjustTransaction](https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/AdjustTransaction/) method.
|
136
|
+
#
|
137
|
+
# After this API call succeeds, the transaction will have a new URL matching its new `code`.
|
138
|
+
#
|
134
139
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
135
140
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
136
141
|
# @param companyCode [String] The company code of the company that recorded this transaction
|
@@ -179,7 +184,7 @@ module AvaTax
|
|
179
184
|
#
|
180
185
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
181
186
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
182
|
-
# You may specify one or more of the following values in the
|
187
|
+
# 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:
|
183
188
|
#
|
184
189
|
# * Lines
|
185
190
|
# * Details (implies lines)
|
@@ -203,8 +208,11 @@ module AvaTax
|
|
203
208
|
#
|
204
209
|
# Records a new transaction in AvaTax.
|
205
210
|
#
|
206
|
-
#
|
207
|
-
#
|
211
|
+
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
212
|
+
# sales, purchases, inventory transfer, and returns (also called refunds).
|
213
|
+
#
|
214
|
+
# The `CreateTransaction` endpoint uses the tax profile of your company to identify the correct tax rules
|
215
|
+
# 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
|
208
216
|
# company's configuration and the data provided in this API call.
|
209
217
|
#
|
210
218
|
# The `CreateTransaction` API will report an error if a committed transaction already exists with the same `code`. To
|
@@ -213,11 +221,15 @@ module AvaTax
|
|
213
221
|
#
|
214
222
|
# To generate a refund for a transaction, use the `RefundTransaction` API.
|
215
223
|
#
|
216
|
-
#
|
224
|
+
# The field `type` identifies the kind of transaction - for example, a sale, purchase, or refund. If you do not specify
|
225
|
+
# a `type` value, you will receive an estimate of type `SalesOrder`, which will not be recorded.
|
217
226
|
#
|
218
|
-
#
|
219
|
-
#
|
220
|
-
#
|
227
|
+
# The origin and destination locations for a transaction must be identified by either address or geocode. For address-based transactions, please
|
228
|
+
# provide addresses in the fields `line`, `city`, `region`, `country` and `postalCode`. For geocode-based transactions, please provide the geocode
|
229
|
+
# information in the fields `latitude` and `longitude`. If either `latitude` or `longitude` or both are null, the transaction will be calculated
|
230
|
+
# using the best available address location information.
|
231
|
+
#
|
232
|
+
# 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:
|
221
233
|
#
|
222
234
|
# * Lines
|
223
235
|
# * Details (implies lines)
|
@@ -246,7 +258,7 @@ module AvaTax
|
|
246
258
|
#
|
247
259
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
248
260
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
249
|
-
# You may specify one or more of the following values in the
|
261
|
+
# 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:
|
250
262
|
#
|
251
263
|
# * Lines
|
252
264
|
# * Details (implies lines)
|
@@ -271,8 +283,7 @@ module AvaTax
|
|
271
283
|
#
|
272
284
|
# To fetch other kinds of transactions, use `GetTransactionByCodeAndType`.
|
273
285
|
#
|
274
|
-
# If this transaction was adjusted, the return value of this API will be the current transaction with this code
|
275
|
-
# the transaction will be attached to the `history` data field.
|
286
|
+
# If this transaction was adjusted, the return value of this API will be the current transaction with this code.
|
276
287
|
#
|
277
288
|
# 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:
|
278
289
|
#
|
@@ -296,8 +307,7 @@ module AvaTax
|
|
296
307
|
#
|
297
308
|
# Get the current transaction identified by this URL.
|
298
309
|
#
|
299
|
-
# If this transaction was adjusted, the return value of this API will be the current transaction with this code
|
300
|
-
# the transaction will be attached to the `history` data field.
|
310
|
+
# If this transaction was adjusted, the return value of this API will be the current transaction with this code.
|
301
311
|
#
|
302
312
|
# 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:
|
303
313
|
#
|
@@ -321,11 +331,14 @@ module AvaTax
|
|
321
331
|
# Retrieve a single transaction by ID
|
322
332
|
#
|
323
333
|
# Get the unique transaction identified by this URL.
|
334
|
+
#
|
324
335
|
# This endpoint retrieves the exact transaction identified by this ID number even if that transaction was later adjusted
|
325
|
-
# by using the
|
336
|
+
# by using the `AdjustTransaction` endpoint.
|
337
|
+
#
|
326
338
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
327
339
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
328
|
-
#
|
340
|
+
#
|
341
|
+
# 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:
|
329
342
|
#
|
330
343
|
# * Lines
|
331
344
|
# * Details (implies lines)
|
@@ -345,12 +358,18 @@ module AvaTax
|
|
345
358
|
# Retrieve all transactions
|
346
359
|
#
|
347
360
|
# List all transactions attached to this company.
|
361
|
+
#
|
348
362
|
# This endpoint is limited to returning 1,000 transactions at a time maximum.
|
363
|
+
#
|
364
|
+
# When listing transactions, you must specify a `date` range filter. If you do not specify a `$filter` that includes a `date` field
|
365
|
+
# criteria, the query will default to looking at only those transactions with `date` in the past 30 days.
|
366
|
+
#
|
349
367
|
# A transaction represents a unique potentially taxable action that your company has recorded, and transactions include actions like
|
350
368
|
# sales, purchases, inventory transfer, and returns (also called refunds).
|
351
369
|
#
|
352
370
|
# 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/) .
|
353
371
|
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
|
372
|
+
#
|
354
373
|
# 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:
|
355
374
|
#
|
356
375
|
# * Lines
|
@@ -416,7 +435,7 @@ module AvaTax
|
|
416
435
|
# For more complex scenarios than the ones above, please use `CreateTransaction` with document type `ReturnInvoice` to
|
417
436
|
# create a custom refund transaction.
|
418
437
|
#
|
419
|
-
# You may specify one or more of the following values in the
|
438
|
+
# 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:
|
420
439
|
#
|
421
440
|
# * Lines
|
422
441
|
# * Details (implies lines)
|
@@ -484,4 +503,4 @@ module AvaTax
|
|
484
503
|
|
485
504
|
end
|
486
505
|
end
|
487
|
-
end
|
506
|
+
end
|
data/lib/avatax/client/users.rb
CHANGED
@@ -3,6 +3,26 @@ module AvaTax
|
|
3
3
|
module Users
|
4
4
|
|
5
5
|
|
6
|
+
# Create new users
|
7
|
+
#
|
8
|
+
# Create one or more new user objects attached to this account.
|
9
|
+
#
|
10
|
+
# A user represents one person with access privileges to make API calls and work with a specific account.
|
11
|
+
#
|
12
|
+
# Users who are account administrators or company users are permitted to create user records to invite
|
13
|
+
# additional team members to work with AvaTax.
|
14
|
+
#
|
15
|
+
# A newly created user will receive an email inviting them to create their password. This means that you
|
16
|
+
# must provide a valid email address for all user accounts created.
|
17
|
+
# @param accountId [Integer] The unique ID number of the account where these users will be created.
|
18
|
+
# @param model [UserModel[]] The user or array of users you wish to create.
|
19
|
+
# @return [UserModel[]]
|
20
|
+
def create_users(accountId, model)
|
21
|
+
path = "/api/v2/accounts/#{accountId}/users"
|
22
|
+
post(path, model)
|
23
|
+
end
|
24
|
+
|
25
|
+
|
6
26
|
# Retrieve a single user
|
7
27
|
#
|
8
28
|
# Get the user object identified by this URL.
|
data/lib/avatax/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avatax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 17.
|
4
|
+
version: 17.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Vorwaller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -159,6 +159,7 @@ files:
|
|
159
159
|
- lib/avatax/client/items.rb
|
160
160
|
- lib/avatax/client/jurisdictionoverrides.rb
|
161
161
|
- lib/avatax/client/locations.rb
|
162
|
+
- lib/avatax/client/multidocument.rb
|
162
163
|
- lib/avatax/client/nexus.rb
|
163
164
|
- lib/avatax/client/notices.rb
|
164
165
|
- lib/avatax/client/onboarding.rb
|
@@ -216,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
217
|
version: 2.0.0
|
217
218
|
requirements: []
|
218
219
|
rubyforge_project:
|
219
|
-
rubygems_version: 2.
|
220
|
+
rubygems_version: 2.5.2
|
220
221
|
signing_key:
|
221
222
|
specification_version: 4
|
222
223
|
summary: Ruby wrapper for the AvaTax API
|