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.
Installation
gem install avalara_sdk
Getting Started
Please follow the installation procedure and then run the following code:
require 'time'
require 'avalara_sdk'
AvalaraSdk::Avatax.configure do |config|
config.bearer_token='<Your Avalara Identity Access Token>'
config.environment='sandbox'
config.app_name='testApp'
config.app_version='1.2.3'
config.machine_name='testMachine'
end
api_client = AvalaraSdk::ApiClient.new config
api_instance = AvalaraSdk::Avatax::V2::AddressesApi.new api_client
opts = {
x_avalara_client: 'x_avalara_client_example',
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new
}
begin
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::Avatax::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
Documentation for Authorization
Authentication schemes defined for the API:
OAuth Client Credentials
- Type: OAuth
- Flow: client_credentials
- Scopes:
- avatax_api: avatax_api scope.
require 'time'
require 'avalara_sdk'
AvalaraSdk::Avatax.configure do |config|
config.client_id='<Your Avalara Identity Client Id>'
config.client_secret='<Your Avalara Identity Client Secret>'
config.environment='sandbox'
config.app_name='testApp'
config.app_version='1.2.3'
config.machine_name='testMachine'
end
api_client = AvalaraSdk::ApiClient.new config
api_instance = AvalaraSdk::Avatax::V2::AddressesApi.new api_client
opts = {
x_avalara_client: 'x_avalara_client_example',
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new
}
begin
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
OAuth Device Code
- Type: OAuth
- Flow: device_code
- Scopes:
- avatax_api: avatax_api scope.
require 'time'
require 'avalara_sdk'
AvalaraSdk::Avatax.configure do |config|
config.client_id='<Your Avalara Identity Client Id>'
config.environment='sandbox'
config.app_name='testApp'
config.app_version='1.2.3'
config.machine_name='testMachine'
end
device_auth_result = AvalaraSdk::Auth::OAuthHelper.initiate_device_authorization_flow("avatax_api", config)
token_result = AvalaraSdk::Auth::OAuthHelper.get_access_token_for_device_flow(device_auth_result.device_code, config)
config.bearer_token = token_result.access_token;
api_client = AvalaraSdk::ApiClient.new config
api_instance = AvalaraSdk::Avatax::V2::AddressesApi.new api_client
opts = {
x_avalara_client: 'x_avalara_client_example',
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new
}
begin
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
Documentation for API Endpoints
EInvoicing V1 API Documentation
Class | Method | HTTP request | Description |
---|
DataInputFieldsApi | get_data_input_fields | GET /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates |
DocumentsApi | download_document | GET /documents/{documentId}/$download | Returns a copy of the document |
DocumentsApi | get_document_list | GET /documents | Returns a summary of documents for a date range |
DocumentsApi | get_document_status | GET /document/{documentId}/status | Checks the status of a document |
DocumentsApi | submit_document | POST /documents | Submits a document to Avalara E-Invoicing API |
MandatesApi | get_mandates | GET /mandates | List country mandates that are supported by the Avalara E-Invoicing platform |
Documentation for Models
EInvoicing V1 Model Documentation