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.
- Package version: 2.4.26
gem install avalara_sdk
Please follow the installation procedure and then run the following code:
require 'time'
require 'avalara_sdk'
# setup authorization
AvalaraSdk::Avatax.configure do |config|
# See Documentation for Authorization section for more auth examples.
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', # String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) .
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new # AddressValidationInfo | The address to resolve
}
begin
# Retrieve geolocation information for a specified address
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::Avatax::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
Authentication schemes defined for the API:
- Type: OAuth
- Flow: client_credentials
- Scopes:
- avatax_api: avatax_api scope.
require 'time'
require 'avalara_sdk'
# setup authorization
AvalaraSdk::Avatax.configure do |config|
# See [Authorization Section](#documentation-for-authorization) for more auth examples.
config.client_id='<Your Avalara Identity Client Id>'
# Make sure to never check-in this value, should be stored in a secrets manager
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', # String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) .
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new # AddressValidationInfo | The address to resolve
}
begin
# Retrieve geolocation information for a specified address
# OAuth2 Client Credentials Flow will be invoked to retrieve the Bearer Token and it will be appended
# to the request Authorization Header automaticaly by the SDK.
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
- Type: OAuth
- Flow: device_code
- Scopes:
- avatax_api: avatax_api scope.
require 'time'
require 'avalara_sdk'
# setup authorization
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
# Initiate device code flow for Authorization
device_auth_result = AvalaraSdk::Auth::OAuthHelper.initiate_device_authorization_flow("avatax_api", config)
# User Interaction needs to happen here - some polling logic is needed to wait for offline user to authenticate to verification_uri through browser
token_result = AvalaraSdk::Auth::OAuthHelper.get_access_token_for_device_flow(device_auth_result.device_code, config)
# Set bearer token into the config object which will be used by SDK to send Authorization header in requests.
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', # String | Identifies the software you are using to call this API. For more information on the client header, see [Client Headers](https://developer.avalara.com/avatax/client-headers/) .
body: AvalaraSdk::Avatax::V2::AddressValidationInfo.new # AddressValidationInfo | The address to resolve
}
begin
# Retrieve geolocation information for a specified address
# OAuth2 Client Credentials Flow will be invoked to retrieve the Bearer Token and it will be appended
# to the request Authorization Header automaticaly by the SDK.
result = api_instance.resolve_address_post(opts)
p result
rescue AvalaraSdk::ApiError => e
puts "Error when calling AddressesApi->resolve_address_post: #{e}"
end
Class | Method | HTTP request | Description |
---|---|---|---|
DataInputFieldsApi | get_data_input_fields | GET /data-input-fields | Returns the optionality of document fields for different country mandates |
DocumentsApi | download_document | GET /documents/{documentId}/$download | Returns a copy of the document |
DocumentsApi | fetch_documents | POST /documents/$fetch | Fetch the inbound document from a tax authority |
DocumentsApi | get_document_list | GET /documents | Returns a summary of documents for a date range |
DocumentsApi | get_document_status | GET /documents/{documentId}/status | Checks the status of a document |
DocumentsApi | submit_document | POST /documents | Submits a document to Avalara E-Invoicing API |
InteropApi | submit_interop_document | POST /interop/documents | Submit a document |
MandatesApi | get_mandate_data_input_fields | GET /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version |
MandatesApi | get_mandates | GET /mandates | List country mandates that are supported by the Avalara E-Invoicing platform |
TradingPartnersApi | batch_search_participants | POST /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. |
TradingPartnersApi | download_batch_search_report | GET /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. |
TradingPartnersApi | get_batch_search_detail | GET /trading-partners/batch-searches/{id} | Get the batch search details for a given id. |
TradingPartnersApi | list_batch_searches | GET /trading-partners/batch-searches | List all batch searches that were previously submitted. |
TradingPartnersApi | search_participants | GET /trading-partners | Returns a list of participants matching the input query. |
- models.BadDownloadRequest
- models.BadRequest
- models.BatchSearch
- models.BatchSearchListResponse
- models.ConditionalForField
- models.DataInputField
- models.DataInputFieldNotUsedFor
- models.DataInputFieldOptionalFor
- models.DataInputFieldRequiredFor
- models.DataInputFieldsResponse
- models.DirectorySearchResponse
- models.DirectorySearchResponseValueInner
- models.DirectorySearchResponseValueInnerAddressesInner
- models.DirectorySearchResponseValueInnerIdentifiersInner
- models.DirectorySearchResponseValueInnerSupportedDocumentTypesInner
- models.DocumentFetch
- models.DocumentFetchRequest
- models.DocumentFetchRequestDataInner
- models.DocumentFetchRequestMetadata
- models.DocumentListResponse
- models.DocumentStatusResponse
- models.DocumentSubmissionError
- models.DocumentSubmitResponse
- models.DocumentSummary
- models.ErrorResponse
- models.ForbiddenError
- models.InputDataFormats
- models.InternalServerError
- models.Mandate
- models.MandateDataInputField
- models.MandateDataInputFieldNamespace
- models.MandatesResponse
- models.NotFoundError
- models.NotUsedForField
- models.RequiredWhenField
- models.StatusEvent
- models.SubmitDocumentMetadata
- models.SubmitInteropDocument202Response
- models.WorkflowIds