avalara_sdk 2.4.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Avalara.SDK.gemspec +38 -0
- data/Gemfile +9 -0
- data/README.md +129 -0
- data/Rakefile +10 -0
- data/TAGS +441 -0
- data/avalara_sdk.gemspec +36 -0
- data/docs/AgeVerificationApi.md +87 -0
- data/docs/AgeVerifyFailureCode.md +15 -0
- data/docs/AgeVerifyRequest.md +24 -0
- data/docs/AgeVerifyRequestAddress.md +26 -0
- data/docs/AgeVerifyResult.md +20 -0
- data/docs/ErrorDetails.md +18 -0
- data/docs/ErrorDetailsError.md +22 -0
- data/docs/ErrorDetailsErrorDetails.md +30 -0
- data/docs/ShippingVerificationApi.md +327 -0
- data/docs/ShippingVerifyResult.md +30 -0
- data/docs/ShippingVerifyResultLines.md +28 -0
- data/example/test.rb +25 -0
- data/git_push.sh +57 -0
- data/lib/avalara_sdk/api/age_verification_api.rb +95 -0
- data/lib/avalara_sdk/api/shipping_verification_api.rb +322 -0
- data/lib/avalara_sdk/api_client.rb +411 -0
- data/lib/avalara_sdk/api_error.rb +57 -0
- data/lib/avalara_sdk/configuration.rb +231 -0
- data/lib/avalara_sdk/models/age_verify_failure_code.rb +39 -0
- data/lib/avalara_sdk/models/age_verify_request.rb +245 -0
- data/lib/avalara_sdk/models/age_verify_request_address.rb +288 -0
- data/lib/avalara_sdk/models/age_verify_result.rb +230 -0
- data/lib/avalara_sdk/models/error_details.rb +217 -0
- data/lib/avalara_sdk/models/error_details_error.rb +271 -0
- data/lib/avalara_sdk/models/error_details_error_details.rb +324 -0
- data/lib/avalara_sdk/models/shipping_verify_result.rb +306 -0
- data/lib/avalara_sdk/models/shipping_verify_result_lines.rb +303 -0
- data/lib/avalara_sdk/version.rb +13 -0
- data/lib/avalara_sdk.rb +48 -0
- data/spec/api/age_verification_api_spec.rb +48 -0
- data/spec/api/shipping_verification_api_spec.rb +88 -0
- data/spec/api_client_spec.rb +224 -0
- data/spec/configuration_spec.rb +40 -0
- data/spec/models/age_verify_failure_code_spec.rb +28 -0
- data/spec/models/age_verify_request_address_spec.rb +62 -0
- data/spec/models/age_verify_request_spec.rb +52 -0
- data/spec/models/age_verify_result_spec.rb +40 -0
- data/spec/models/error_details_error_details_spec.rb +78 -0
- data/spec/models/error_details_error_spec.rb +50 -0
- data/spec/models/error_details_spec.rb +34 -0
- data/spec/models/shipping_verify_result_lines_spec.rb +72 -0
- data/spec/models/shipping_verify_result_spec.rb +78 -0
- data/spec/spec_helper.rb +108 -0
- metadata +147 -0
@@ -0,0 +1,87 @@
|
|
1
|
+
# AvalaraSdk::AgeVerificationApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**verify_age**](AgeVerificationApi.md#verify_age) | **POST** /api/v2/ageverification/verify | Determines whether an individual meets or exceeds the minimum legal drinking age. |
|
8
|
+
|
9
|
+
|
10
|
+
## verify_age
|
11
|
+
|
12
|
+
> <AgeVerifyResult> verify_age(age_verify_request, opts)
|
13
|
+
|
14
|
+
Determines whether an individual meets or exceeds the minimum legal drinking age.
|
15
|
+
|
16
|
+
The request must meet the following criteria in order to be evaluated: * *firstName*, *lastName*, and *address* are required fields. * One of the following sets of attributes are required for the *address*: * *line1, city, region* * *line1, postalCode* Optionally, the transaction and its lines may use the following parameters: * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21). * Beyond the required *address* fields above, a *country* field is permitted * The valid values for this attribute are [*US, USA*] **Security Policies** This API depends on the active subscription *AgeVerification*
|
17
|
+
|
18
|
+
### Examples
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'time'
|
22
|
+
require 'avalara_sdk'
|
23
|
+
# setup authorization
|
24
|
+
AvalaraSdk.configure do |config|
|
25
|
+
# Configure HTTP basic authorization: BasicAuth
|
26
|
+
config.username = 'YOUR USERNAME'
|
27
|
+
config.password = 'YOUR PASSWORD'
|
28
|
+
|
29
|
+
# Configure API key authorization: Bearer
|
30
|
+
config.api_key['Bearer'] = 'YOUR API KEY'
|
31
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
32
|
+
# config.api_key_prefix['Bearer'] = 'Bearer'
|
33
|
+
end
|
34
|
+
|
35
|
+
api_instance = AvalaraSdk::AgeVerificationApi.new
|
36
|
+
age_verify_request = AvalaraSdk::AgeVerifyRequest.new # AgeVerifyRequest | Information about the individual whose age is being verified.
|
37
|
+
opts = {
|
38
|
+
simulated_failure_code: AvalaraSdk::AgeVerifyFailureCode::NOT_FOUND # AgeVerifyFailureCode | (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.
|
39
|
+
}
|
40
|
+
|
41
|
+
begin
|
42
|
+
# Determines whether an individual meets or exceeds the minimum legal drinking age.
|
43
|
+
result = api_instance.verify_age(age_verify_request, opts)
|
44
|
+
p result
|
45
|
+
rescue AvalaraSdk::ApiError => e
|
46
|
+
puts "Error when calling AgeVerificationApi->verify_age: #{e}"
|
47
|
+
end
|
48
|
+
```
|
49
|
+
|
50
|
+
#### Using the verify_age_with_http_info variant
|
51
|
+
|
52
|
+
This returns an Array which contains the response data, status code and headers.
|
53
|
+
|
54
|
+
> <Array(<AgeVerifyResult>, Integer, Hash)> verify_age_with_http_info(age_verify_request, opts)
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
begin
|
58
|
+
# Determines whether an individual meets or exceeds the minimum legal drinking age.
|
59
|
+
data, status_code, headers = api_instance.verify_age_with_http_info(age_verify_request, opts)
|
60
|
+
p status_code # => 2xx
|
61
|
+
p headers # => { ... }
|
62
|
+
p data # => <AgeVerifyResult>
|
63
|
+
rescue AvalaraSdk::ApiError => e
|
64
|
+
puts "Error when calling AgeVerificationApi->verify_age_with_http_info: #{e}"
|
65
|
+
end
|
66
|
+
```
|
67
|
+
|
68
|
+
### Parameters
|
69
|
+
|
70
|
+
| Name | Type | Description | Notes |
|
71
|
+
| ---- | ---- | ----------- | ----- |
|
72
|
+
| **age_verify_request** | [**AgeVerifyRequest**](AgeVerifyRequest.md) | Information about the individual whose age is being verified. | |
|
73
|
+
| **simulated_failure_code** | [**AgeVerifyFailureCode**](.md) | (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes. | [optional] |
|
74
|
+
|
75
|
+
### Return type
|
76
|
+
|
77
|
+
[**AgeVerifyResult**](AgeVerifyResult.md)
|
78
|
+
|
79
|
+
### Authorization
|
80
|
+
|
81
|
+
[BasicAuth](../README.md#BasicAuth), [Bearer](../README.md#Bearer)
|
82
|
+
|
83
|
+
### HTTP request headers
|
84
|
+
|
85
|
+
- **Content-Type**: application/json
|
86
|
+
- **Accept**: application/json
|
87
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# AvalaraSdk::AgeVerifyFailureCode
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
|
8
|
+
## Example
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
require 'avalara_sdk'
|
12
|
+
|
13
|
+
instance = AvalaraSdk::AgeVerifyFailureCode.new()
|
14
|
+
```
|
15
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# AvalaraSdk::AgeVerifyRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **first_name** | **String** | | [optional] |
|
8
|
+
| **last_name** | **String** | | [optional] |
|
9
|
+
| **address** | [**AgeVerifyRequestAddress**](AgeVerifyRequestAddress.md) | | [optional] |
|
10
|
+
| **dob** | **String** | The value should be ISO-8601 compliant (e.g. 2020-07-21). | [optional] |
|
11
|
+
|
12
|
+
## Example
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
require 'avalara_sdk'
|
16
|
+
|
17
|
+
instance = AvalaraSdk::AgeVerifyRequest.new(
|
18
|
+
first_name: null,
|
19
|
+
last_name: null,
|
20
|
+
address: null,
|
21
|
+
dob: null
|
22
|
+
)
|
23
|
+
```
|
24
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# AvalaraSdk::AgeVerifyRequestAddress
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **line1** | **String** | | [optional] |
|
8
|
+
| **city** | **String** | | [optional] |
|
9
|
+
| **region** | **String** | The state code of the address. | [optional] |
|
10
|
+
| **country** | **String** | The country code of the address. | [optional] |
|
11
|
+
| **postal_code** | **String** | | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'avalara_sdk'
|
17
|
+
|
18
|
+
instance = AvalaraSdk::AgeVerifyRequestAddress.new(
|
19
|
+
line1: null,
|
20
|
+
city: null,
|
21
|
+
region: null,
|
22
|
+
country: null,
|
23
|
+
postal_code: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# AvalaraSdk::AgeVerifyResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **is_of_age** | **Boolean** | Describes whether the individual meets or exceeds the minimum legal drinking age. | [optional] |
|
8
|
+
| **failure_codes** | [**Array<AgeVerifyResult>**](AgeVerifyResult.md) | A list of failure codes describing why a *false* age determination was made. | [optional] |
|
9
|
+
|
10
|
+
## Example
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'avalara_sdk'
|
14
|
+
|
15
|
+
instance = AvalaraSdk::AgeVerifyResult.new(
|
16
|
+
is_of_age: null,
|
17
|
+
failure_codes: null
|
18
|
+
)
|
19
|
+
```
|
20
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# AvalaraSdk::ErrorDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **error** | [**ErrorDetailsError**](ErrorDetailsError.md) | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'avalara_sdk'
|
13
|
+
|
14
|
+
instance = AvalaraSdk::ErrorDetails.new(
|
15
|
+
error: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# AvalaraSdk::ErrorDetailsError
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **code** | **String** | Name of the error or message. | [optional] |
|
8
|
+
| **message** | **String** | Concise summary of the message, suitable for display in the caption of an alert box. | [optional] |
|
9
|
+
| **details** | [**ErrorDetailsErrorDetails**](ErrorDetailsErrorDetails.md) | | [optional] |
|
10
|
+
|
11
|
+
## Example
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'avalara_sdk'
|
15
|
+
|
16
|
+
instance = AvalaraSdk::ErrorDetailsError.new(
|
17
|
+
code: InvalidAddress,
|
18
|
+
message: The address is not deliverable.,
|
19
|
+
details: null
|
20
|
+
)
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# AvalaraSdk::ErrorDetailsErrorDetails
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **code** | **String** | Name of the error or message. | [optional] |
|
8
|
+
| **message** | **String** | Concise summary of the message, suitable for display in the caption of an alert box. | [optional] |
|
9
|
+
| **number** | **Integer** | Unique ID number referring to this error or message. | [optional] |
|
10
|
+
| **description** | **String** | A more detailed description of the problem referenced by this error message, suitable for display in the contents area of an alert box. | [optional] |
|
11
|
+
| **fault_code** | **String** | Indicates the SOAP Fault code, if this was related to an error that corresponded to AvaTax SOAP v1 behavior. | [optional] |
|
12
|
+
| **help_link** | **String** | URL to help for this message | [optional] |
|
13
|
+
| **severity** | **String** | Severity of the message | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'avalara_sdk'
|
19
|
+
|
20
|
+
instance = AvalaraSdk::ErrorDetailsErrorDetails.new(
|
21
|
+
code: InvalidAddress,
|
22
|
+
message: The address is not deliverable.,
|
23
|
+
number: 309,
|
24
|
+
description: The physical location exists but there are no homes on this street. One reason might be railroad tracks or rivers running alongside this street, as they would prevent construction of homes in this location.,
|
25
|
+
fault_code: Client,
|
26
|
+
help_link: http://developer.avalara.com/avatax/errors/InvalidAddress,
|
27
|
+
severity: Error
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,327 @@
|
|
1
|
+
# AvalaraSdk::ShippingVerificationApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://localhost*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**deregister_shipment**](ShippingVerificationApi.md#deregister_shipment) | **DELETE** /api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registration | Removes the transaction from consideration when evaluating regulations that span multiple transactions. |
|
8
|
+
| [**register_shipment**](ShippingVerificationApi.md#register_shipment) | **PUT** /api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registration | Registers the transaction so that it may be included when evaluating regulations that span multiple transactions. |
|
9
|
+
| [**register_shipment_if_compliant**](ShippingVerificationApi.md#register_shipment_if_compliant) | **PUT** /api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registerIfCompliant | Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions. |
|
10
|
+
| [**verify_shipment**](ShippingVerificationApi.md#verify_shipment) | **GET** /api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/verify | Evaluates a transaction against a set of direct-to-consumer shipping regulations. |
|
11
|
+
|
12
|
+
|
13
|
+
## deregister_shipment
|
14
|
+
|
15
|
+
> deregister_shipment(company_code, transaction_code, opts)
|
16
|
+
|
17
|
+
Removes the transaction from consideration when evaluating regulations that span multiple transactions.
|
18
|
+
|
19
|
+
### Examples
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
require 'time'
|
23
|
+
require 'avalara_sdk'
|
24
|
+
# setup authorization
|
25
|
+
AvalaraSdk.configure do |config|
|
26
|
+
# Configure HTTP basic authorization: BasicAuth
|
27
|
+
config.username = 'YOUR USERNAME'
|
28
|
+
config.password = 'YOUR PASSWORD'
|
29
|
+
|
30
|
+
# Configure API key authorization: Bearer
|
31
|
+
config.api_key['Bearer'] = 'YOUR API KEY'
|
32
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
33
|
+
# config.api_key_prefix['Bearer'] = 'Bearer'
|
34
|
+
end
|
35
|
+
|
36
|
+
api_instance = AvalaraSdk::ShippingVerificationApi.new
|
37
|
+
company_code = 'company_code_example' # String | The company code of the company that recorded the transaction
|
38
|
+
transaction_code = 'transaction_code_example' # String | The transaction code to retrieve
|
39
|
+
opts = {
|
40
|
+
document_type: 'SalesInvoice' # String | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
41
|
+
}
|
42
|
+
|
43
|
+
begin
|
44
|
+
# Removes the transaction from consideration when evaluating regulations that span multiple transactions.
|
45
|
+
api_instance.deregister_shipment(company_code, transaction_code, opts)
|
46
|
+
rescue AvalaraSdk::ApiError => e
|
47
|
+
puts "Error when calling ShippingVerificationApi->deregister_shipment: #{e}"
|
48
|
+
end
|
49
|
+
```
|
50
|
+
|
51
|
+
#### Using the deregister_shipment_with_http_info variant
|
52
|
+
|
53
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
54
|
+
|
55
|
+
> <Array(nil, Integer, Hash)> deregister_shipment_with_http_info(company_code, transaction_code, opts)
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
begin
|
59
|
+
# Removes the transaction from consideration when evaluating regulations that span multiple transactions.
|
60
|
+
data, status_code, headers = api_instance.deregister_shipment_with_http_info(company_code, transaction_code, opts)
|
61
|
+
p status_code # => 2xx
|
62
|
+
p headers # => { ... }
|
63
|
+
p data # => nil
|
64
|
+
rescue AvalaraSdk::ApiError => e
|
65
|
+
puts "Error when calling ShippingVerificationApi->deregister_shipment_with_http_info: #{e}"
|
66
|
+
end
|
67
|
+
```
|
68
|
+
|
69
|
+
### Parameters
|
70
|
+
|
71
|
+
| Name | Type | Description | Notes |
|
72
|
+
| ---- | ---- | ----------- | ----- |
|
73
|
+
| **company_code** | **String** | The company code of the company that recorded the transaction | |
|
74
|
+
| **transaction_code** | **String** | The transaction code to retrieve | |
|
75
|
+
| **document_type** | **String** | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\" | [optional] |
|
76
|
+
|
77
|
+
### Return type
|
78
|
+
|
79
|
+
nil (empty response body)
|
80
|
+
|
81
|
+
### Authorization
|
82
|
+
|
83
|
+
[BasicAuth](../README.md#BasicAuth), [Bearer](../README.md#Bearer)
|
84
|
+
|
85
|
+
### HTTP request headers
|
86
|
+
|
87
|
+
- **Content-Type**: Not defined
|
88
|
+
- **Accept**: application/json
|
89
|
+
|
90
|
+
|
91
|
+
## register_shipment
|
92
|
+
|
93
|
+
> register_shipment(company_code, transaction_code, opts)
|
94
|
+
|
95
|
+
Registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
96
|
+
|
97
|
+
### Examples
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
require 'time'
|
101
|
+
require 'avalara_sdk'
|
102
|
+
# setup authorization
|
103
|
+
AvalaraSdk.configure do |config|
|
104
|
+
# Configure HTTP basic authorization: BasicAuth
|
105
|
+
config.username = 'YOUR USERNAME'
|
106
|
+
config.password = 'YOUR PASSWORD'
|
107
|
+
|
108
|
+
# Configure API key authorization: Bearer
|
109
|
+
config.api_key['Bearer'] = 'YOUR API KEY'
|
110
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
111
|
+
# config.api_key_prefix['Bearer'] = 'Bearer'
|
112
|
+
end
|
113
|
+
|
114
|
+
api_instance = AvalaraSdk::ShippingVerificationApi.new
|
115
|
+
company_code = 'company_code_example' # String | The company code of the company that recorded the transaction
|
116
|
+
transaction_code = 'transaction_code_example' # String | The transaction code to retrieve
|
117
|
+
opts = {
|
118
|
+
document_type: 'SalesInvoice' # String | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
119
|
+
}
|
120
|
+
|
121
|
+
begin
|
122
|
+
# Registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
123
|
+
api_instance.register_shipment(company_code, transaction_code, opts)
|
124
|
+
rescue AvalaraSdk::ApiError => e
|
125
|
+
puts "Error when calling ShippingVerificationApi->register_shipment: #{e}"
|
126
|
+
end
|
127
|
+
```
|
128
|
+
|
129
|
+
#### Using the register_shipment_with_http_info variant
|
130
|
+
|
131
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
132
|
+
|
133
|
+
> <Array(nil, Integer, Hash)> register_shipment_with_http_info(company_code, transaction_code, opts)
|
134
|
+
|
135
|
+
```ruby
|
136
|
+
begin
|
137
|
+
# Registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
138
|
+
data, status_code, headers = api_instance.register_shipment_with_http_info(company_code, transaction_code, opts)
|
139
|
+
p status_code # => 2xx
|
140
|
+
p headers # => { ... }
|
141
|
+
p data # => nil
|
142
|
+
rescue AvalaraSdk::ApiError => e
|
143
|
+
puts "Error when calling ShippingVerificationApi->register_shipment_with_http_info: #{e}"
|
144
|
+
end
|
145
|
+
```
|
146
|
+
|
147
|
+
### Parameters
|
148
|
+
|
149
|
+
| Name | Type | Description | Notes |
|
150
|
+
| ---- | ---- | ----------- | ----- |
|
151
|
+
| **company_code** | **String** | The company code of the company that recorded the transaction | |
|
152
|
+
| **transaction_code** | **String** | The transaction code to retrieve | |
|
153
|
+
| **document_type** | **String** | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\" | [optional] |
|
154
|
+
|
155
|
+
### Return type
|
156
|
+
|
157
|
+
nil (empty response body)
|
158
|
+
|
159
|
+
### Authorization
|
160
|
+
|
161
|
+
[BasicAuth](../README.md#BasicAuth), [Bearer](../README.md#Bearer)
|
162
|
+
|
163
|
+
### HTTP request headers
|
164
|
+
|
165
|
+
- **Content-Type**: Not defined
|
166
|
+
- **Accept**: application/json
|
167
|
+
|
168
|
+
|
169
|
+
## register_shipment_if_compliant
|
170
|
+
|
171
|
+
> <ShippingVerifyResult> register_shipment_if_compliant(company_code, transaction_code, opts)
|
172
|
+
|
173
|
+
Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
174
|
+
|
175
|
+
### Examples
|
176
|
+
|
177
|
+
```ruby
|
178
|
+
require 'time'
|
179
|
+
require 'avalara_sdk'
|
180
|
+
# setup authorization
|
181
|
+
AvalaraSdk.configure do |config|
|
182
|
+
# Configure HTTP basic authorization: BasicAuth
|
183
|
+
config.username = 'YOUR USERNAME'
|
184
|
+
config.password = 'YOUR PASSWORD'
|
185
|
+
|
186
|
+
# Configure API key authorization: Bearer
|
187
|
+
config.api_key['Bearer'] = 'YOUR API KEY'
|
188
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
189
|
+
# config.api_key_prefix['Bearer'] = 'Bearer'
|
190
|
+
end
|
191
|
+
|
192
|
+
api_instance = AvalaraSdk::ShippingVerificationApi.new
|
193
|
+
company_code = 'company_code_example' # String | The company code of the company that recorded the transaction
|
194
|
+
transaction_code = 'transaction_code_example' # String | The transaction code to retrieve
|
195
|
+
opts = {
|
196
|
+
document_type: 'SalesInvoice' # String | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
197
|
+
}
|
198
|
+
|
199
|
+
begin
|
200
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
201
|
+
result = api_instance.register_shipment_if_compliant(company_code, transaction_code, opts)
|
202
|
+
p result
|
203
|
+
rescue AvalaraSdk::ApiError => e
|
204
|
+
puts "Error when calling ShippingVerificationApi->register_shipment_if_compliant: #{e}"
|
205
|
+
end
|
206
|
+
```
|
207
|
+
|
208
|
+
#### Using the register_shipment_if_compliant_with_http_info variant
|
209
|
+
|
210
|
+
This returns an Array which contains the response data, status code and headers.
|
211
|
+
|
212
|
+
> <Array(<ShippingVerifyResult>, Integer, Hash)> register_shipment_if_compliant_with_http_info(company_code, transaction_code, opts)
|
213
|
+
|
214
|
+
```ruby
|
215
|
+
begin
|
216
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
217
|
+
data, status_code, headers = api_instance.register_shipment_if_compliant_with_http_info(company_code, transaction_code, opts)
|
218
|
+
p status_code # => 2xx
|
219
|
+
p headers # => { ... }
|
220
|
+
p data # => <ShippingVerifyResult>
|
221
|
+
rescue AvalaraSdk::ApiError => e
|
222
|
+
puts "Error when calling ShippingVerificationApi->register_shipment_if_compliant_with_http_info: #{e}"
|
223
|
+
end
|
224
|
+
```
|
225
|
+
|
226
|
+
### Parameters
|
227
|
+
|
228
|
+
| Name | Type | Description | Notes |
|
229
|
+
| ---- | ---- | ----------- | ----- |
|
230
|
+
| **company_code** | **String** | The company code of the company that recorded the transaction | |
|
231
|
+
| **transaction_code** | **String** | The transaction code to retrieve | |
|
232
|
+
| **document_type** | **String** | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\" | [optional] |
|
233
|
+
|
234
|
+
### Return type
|
235
|
+
|
236
|
+
[**ShippingVerifyResult**](ShippingVerifyResult.md)
|
237
|
+
|
238
|
+
### Authorization
|
239
|
+
|
240
|
+
[BasicAuth](../README.md#BasicAuth), [Bearer](../README.md#Bearer)
|
241
|
+
|
242
|
+
### HTTP request headers
|
243
|
+
|
244
|
+
- **Content-Type**: Not defined
|
245
|
+
- **Accept**: application/json
|
246
|
+
|
247
|
+
|
248
|
+
## verify_shipment
|
249
|
+
|
250
|
+
> <ShippingVerifyResult> verify_shipment(company_code, transaction_code, opts)
|
251
|
+
|
252
|
+
Evaluates a transaction against a set of direct-to-consumer shipping regulations.
|
253
|
+
|
254
|
+
The transaction and its lines must meet the following criteria in order to be evaluated: * The transaction must be recorded. Using a type of *SalesInvoice* is recommended. * A parameter with the name *AlcoholRouteType* must be specified and the value must be one of the following: '*DTC*', '*Retailer DTC*' * A parameter with the name *RecipientName* must be specified and the value must be the name of the recipient. * Each alcohol line must include a *ContainerSize* parameter that describes the volume of a single container. Use the *unit* field to specify one of the following units: '*Litre*', '*Millilitre*', '*gallon (US fluid)*', '*quart (US fluid)*', '*ounce (fluid US customary)*' * Each alcohol line must include a *PackSize* parameter that describes the number of containers in a pack. Specify *Count* in the *unit* field. Optionally, the transaction and its lines may use the following parameters: * The *ShipDate* parameter may be used if the date of shipment is different than the date of the transaction. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *RecipientDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *PurchaserDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *SalesLocation* parameter may be used to describe whether the sale was made *OnSite* or *OffSite*. *OffSite* is the default value. * The *AlcoholContent* parameter may be used to describe the alcohol percentage by volume of the item. Specify *Percentage* in the *unit* field. **Security Policies** This API depends on all of the following active subscriptions: *AvaAlcohol, AutoAddress, AvaTaxPro*
|
255
|
+
|
256
|
+
### Examples
|
257
|
+
|
258
|
+
```ruby
|
259
|
+
require 'time'
|
260
|
+
require 'avalara_sdk'
|
261
|
+
# setup authorization
|
262
|
+
AvalaraSdk.configure do |config|
|
263
|
+
# Configure HTTP basic authorization: BasicAuth
|
264
|
+
config.username = 'YOUR USERNAME'
|
265
|
+
config.password = 'YOUR PASSWORD'
|
266
|
+
|
267
|
+
# Configure API key authorization: Bearer
|
268
|
+
config.api_key['Bearer'] = 'YOUR API KEY'
|
269
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
270
|
+
# config.api_key_prefix['Bearer'] = 'Bearer'
|
271
|
+
end
|
272
|
+
|
273
|
+
api_instance = AvalaraSdk::ShippingVerificationApi.new
|
274
|
+
company_code = 'company_code_example' # String | The company code of the company that recorded the transaction
|
275
|
+
transaction_code = 'transaction_code_example' # String | The transaction code to retrieve
|
276
|
+
opts = {
|
277
|
+
document_type: 'SalesInvoice' # String | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
278
|
+
}
|
279
|
+
|
280
|
+
begin
|
281
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations.
|
282
|
+
result = api_instance.verify_shipment(company_code, transaction_code, opts)
|
283
|
+
p result
|
284
|
+
rescue AvalaraSdk::ApiError => e
|
285
|
+
puts "Error when calling ShippingVerificationApi->verify_shipment: #{e}"
|
286
|
+
end
|
287
|
+
```
|
288
|
+
|
289
|
+
#### Using the verify_shipment_with_http_info variant
|
290
|
+
|
291
|
+
This returns an Array which contains the response data, status code and headers.
|
292
|
+
|
293
|
+
> <Array(<ShippingVerifyResult>, Integer, Hash)> verify_shipment_with_http_info(company_code, transaction_code, opts)
|
294
|
+
|
295
|
+
```ruby
|
296
|
+
begin
|
297
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations.
|
298
|
+
data, status_code, headers = api_instance.verify_shipment_with_http_info(company_code, transaction_code, opts)
|
299
|
+
p status_code # => 2xx
|
300
|
+
p headers # => { ... }
|
301
|
+
p data # => <ShippingVerifyResult>
|
302
|
+
rescue AvalaraSdk::ApiError => e
|
303
|
+
puts "Error when calling ShippingVerificationApi->verify_shipment_with_http_info: #{e}"
|
304
|
+
end
|
305
|
+
```
|
306
|
+
|
307
|
+
### Parameters
|
308
|
+
|
309
|
+
| Name | Type | Description | Notes |
|
310
|
+
| ---- | ---- | ----------- | ----- |
|
311
|
+
| **company_code** | **String** | The company code of the company that recorded the transaction | |
|
312
|
+
| **transaction_code** | **String** | The transaction code to retrieve | |
|
313
|
+
| **document_type** | **String** | (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\" | [optional] |
|
314
|
+
|
315
|
+
### Return type
|
316
|
+
|
317
|
+
[**ShippingVerifyResult**](ShippingVerifyResult.md)
|
318
|
+
|
319
|
+
### Authorization
|
320
|
+
|
321
|
+
[BasicAuth](../README.md#BasicAuth), [Bearer](../README.md#Bearer)
|
322
|
+
|
323
|
+
### HTTP request headers
|
324
|
+
|
325
|
+
- **Content-Type**: Not defined
|
326
|
+
- **Accept**: application/json
|
327
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# AvalaraSdk::ShippingVerifyResult
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **compliant** | **Boolean** | Whether every line in the transaction is compliant. | [optional] |
|
8
|
+
| **message** | **String** | A short description of the result of the compliance check. | [optional] |
|
9
|
+
| **success_messages** | **String** | A detailed description of the result of each of the passed checks made against this transaction, separated by line. | [optional] |
|
10
|
+
| **failure_messages** | **String** | A detailed description of the result of each of the failed checks made against this transaction, separated by line. | [optional] |
|
11
|
+
| **failure_codes** | **Array<String>** | An enumeration of all the failure codes received across all lines. | [optional] |
|
12
|
+
| **warning_codes** | **Array<String>** | An enumeration of all the warning codes received across all lines that a determination could not be made for. | [optional] |
|
13
|
+
| **lines** | [**Array<ShippingVerifyResultLines>**](ShippingVerifyResultLines.md) | Describes the results of the checks made for each line in the transaction. | [optional] |
|
14
|
+
|
15
|
+
## Example
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
require 'avalara_sdk'
|
19
|
+
|
20
|
+
instance = AvalaraSdk::ShippingVerifyResult.new(
|
21
|
+
compliant: null,
|
22
|
+
message: null,
|
23
|
+
success_messages: null,
|
24
|
+
failure_messages: null,
|
25
|
+
failure_codes: null,
|
26
|
+
warning_codes: null,
|
27
|
+
lines: null
|
28
|
+
)
|
29
|
+
```
|
30
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# AvalaraSdk::ShippingVerifyResultLines
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **result_code** | **String** | Describes whether the line is compliant or not. In cases where a determination could not be made, resultCode will provide the reason why. | [optional] |
|
8
|
+
| **line_number** | **String** | The lineNumber of the line evaluated. | [optional] |
|
9
|
+
| **message** | **String** | A short description of the result of the checks made against this line. | [optional] |
|
10
|
+
| **success_messages** | **String** | A detailed description of the result of each of the passed checks made against this line. | [optional] |
|
11
|
+
| **failure_messages** | **String** | A detailed description of the result of each of the failed checks made against this line. | [optional] |
|
12
|
+
| **failure_codes** | **Array<String>** | An enumeration of all the failure codes received for this line. | [optional] |
|
13
|
+
|
14
|
+
## Example
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'avalara_sdk'
|
18
|
+
|
19
|
+
instance = AvalaraSdk::ShippingVerifyResultLines.new(
|
20
|
+
result_code: null,
|
21
|
+
line_number: null,
|
22
|
+
message: null,
|
23
|
+
success_messages: null,
|
24
|
+
failure_messages: null,
|
25
|
+
failure_codes: null
|
26
|
+
)
|
27
|
+
```
|
28
|
+
|
data/example/test.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path('../../lib/avalara_sdk', __FILE__)
|
2
|
+
|
3
|
+
config = AvalaraSdk::Configuration.new
|
4
|
+
config.username = ''
|
5
|
+
config.password = ''
|
6
|
+
config.environment='test'
|
7
|
+
config.test_url='https://sandbox-rest.avatax.com'
|
8
|
+
config.verify_ssl=false
|
9
|
+
config.debugging=true
|
10
|
+
config.app_name="testApp"
|
11
|
+
config.app_version="2.3.1"
|
12
|
+
config.machine_name="AVL_WIN_007"
|
13
|
+
api_client = AvalaraSdk::ApiClient.new config
|
14
|
+
api_instance = AvalaraSdk::ShippingVerificationApi.new api_client
|
15
|
+
|
16
|
+
begin
|
17
|
+
result =api_instance.deregister_shipment('DEFAULT', '063e1af4-11d3-4489-b8ba-ae1149758df4')
|
18
|
+
p result
|
19
|
+
puts "Call Completed"
|
20
|
+
|
21
|
+
rescue AvalaraSdk::ApiError => e
|
22
|
+
puts "Exception #{e}"
|
23
|
+
end
|
24
|
+
|
25
|
+
puts "Success"
|