avalara_sdk
AvalaraSdk - the Ruby gem for the Avalara Shipping Verification only
API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations.
This API is currently in beta.
This SDK is automatically generated by the OpenAPI Generator project:
- API version: 3.1.0
- Package version: 2.4.5.6
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
Installation
Build a gem
To build the Ruby code into a gem:
gem build avalara_sdk.gemspec
Then either install the gem locally:
gem install ./avalara_sdk-2.4.5.6.gem
(for development, run gem install --dev ./avalara_sdk-2.4.5.6.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'avalara_sdk', '~> 2.4.5.6'
Install from Git
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'avalara_sdk', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Getting Started
Please follow the installation procedure and then run the following code:
# Load the gem
require 'avalara_sdk'
# Setup authorization
AvalaraSdk.configure do |config|
# Configure HTTP basic authorization: BasicAuth
config.username = 'YOUR_USERNAME'
config.password = 'YOUR_PASSWORD'
# Configure API key authorization: Bearer
config.api_key['Bearer'] = 'YOUR API KEY'
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
# config.api_key_prefix['Bearer'] = 'Bearer'
end
api_instance = AvalaraSdk::AgeVerificationApi.new
age_verify_request = AvalaraSdk::AgeVerifyRequest.new # AgeVerifyRequest | Information about the individual whose age is being verified.
opts = {
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.
}
begin
#Determines whether an individual meets or exceeds the minimum legal drinking age.
result = api_instance.verify_age(age_verify_request, opts)
p result
rescue AvalaraSdk::ApiError => e
puts "Exception when calling AgeVerificationApi->verify_age: #{e}"
end
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
AvalaraSdk::AgeVerificationApi | verify_age | POST /api/v2/ageverification/verify | Determines whether an individual meets or exceeds the minimum legal drinking age. |
AvalaraSdk::ShippingVerificationApi | deregister_shipment | DELETE /api/v2/companies/companyCode/transactions/transactionCode/shipment/registration | Removes the transaction from consideration when evaluating regulations that span multiple transactions. |
AvalaraSdk::ShippingVerificationApi | 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. |
AvalaraSdk::ShippingVerificationApi | 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. |
AvalaraSdk::ShippingVerificationApi | verify_shipment | GET /api/v2/companies/companyCode/transactions/transactionCode/shipment/verify | Evaluates a transaction against a set of direct-to-consumer shipping regulations. |
Documentation for Models
- AvalaraSdk::AgeVerifyFailureCode
- AvalaraSdk::AgeVerifyRequest
- AvalaraSdk::AgeVerifyRequestAddress
- AvalaraSdk::AgeVerifyResult
- AvalaraSdk::ErrorDetails
- AvalaraSdk::ErrorDetailsError
- AvalaraSdk::ErrorDetailsErrorDetails
- AvalaraSdk::ShippingVerifyResult
- AvalaraSdk::ShippingVerifyResultLines
Documentation for Authorization
BasicAuth
- Type: HTTP basic authentication
Bearer
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header