Avalara Shipping Verification only
- API version: 3.1.0
API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations.
This API is currently in beta.
Building the API client library requires:
- Java 1.7+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependency>
<groupId>Avalara.SDK</groupId>
<artifactId>Avalara.SDK</artifactId>
<version>2.4.29</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
repositories {
mavenCentral() // Needed if the 'Avalara.SDK' jar has been published to maven central.
mavenLocal() // Needed if the 'Avalara.SDK' jar has been published to the local maven repo.
}
dependencies {
implementation "Avalara.SDK:Avalara.SDK:2.4.29"
}
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/Avalara.SDK-2.4.29.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import Avalara.SDK.*;
import Avalara.SDK.auth.*;
import Avalara.SDK.model.Avatax.*;
import Avalara.SDK.api.Avatax.AddressesApi;
public class AddressesApiExample {
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.setAppName("Test");
configuration.setAppVersion("1.0");
configuration.setMachineName("LocalBox");
configuration.setTimeout(5000);
configuration.setEnvironment(AvaTaxEnvironment.Sandbox);
// Configure HTTP basic authorization
configuration.setUsername("YOUR USERNAME");
configuration.setPassword("YOUR PASSWORD");
// Configure OAuth2 access token for authorization
configuration.setBearerToken("YOUR ACCESS TOKEN");
ApiClient apiClient = new ApiClient(configuration);
AddressesApi apiInstance = new AddressesApi(apiClient);
String xAvalaraClient = "Swagger UI; 22.7.0; Custom; 1.0"; // 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/) .
AddressValidationInfo body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve
try {
AddressResolutionModel result = apiInstance.resolveAddressPost(xAvalaraClient, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AddressesApi#resolveAddressPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Authentication schemes defined for the API:
- Type: OAuth
- Flow: client_credentials
- Scopes:
- avatax_api: avatax_api scope.
import Avalara.SDK.*;
import Avalara.SDK.auth.*;
import Avalara.SDK.model.Avatax.*;
import Avalara.SDK.api.Avatax.AddressesApi;
public class AddressesApiExample {
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.setAppName("Test");
configuration.setAppVersion("1.0");
configuration.setMachineName("LocalBox");
configuration.setTimeout(5000);
configuration.setEnvironment(AvaTaxEnvironment.Sandbox);
// Configure OAUTH2 Client Credentials flow
configuration.setClientId("YOUR CLIENT_ID");
configuration.setClientSecret("YOUR CLIENT_SECRET");
ApiClient apiClient = new ApiClient(configuration);
AddressesApi apiInstance = new AddressesApi(apiClient);
String xAvalaraClient = "Swagger UI; 22.7.0; Custom; 1.0"; // 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/) .
AddressValidationInfo body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve
try {
// SDK will fetch OAuth token using client creds flow with Avalara Identity and append Authorization header to the request with the access token.
AddressResolutionModel result = apiInstance.resolveAddressPost(xAvalaraClient, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AddressesApi#resolveAddressPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
- Type: OAuth
- Flow: device_code
- Scopes:
- avatax_api: avatax_api scope.
import Avalara.SDK.*;
import Avalara.SDK.auth.*;
import Avalara.SDK.model.Avatax.*;
import Avalara.SDK.api.Avatax.AddressesApi;
public class AddressesApiExample {
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.setAppName("Test");
configuration.setAppVersion("1.0");
configuration.setMachineName("LocalBox");
configuration.setTimeout(5000);
configuration.setEnvironment(AvaTaxEnvironment.Sandbox);
// Configure OAUTH2 Device code flow
configuration.setClientId("YOUR CLIENT_ID");
DeviceAuthResponse response = ApiClientHelper.initiateDeviceAuthorizationOAuth(null, configuration);
DeviceAccessTokenResponse tokenResponse = ApiClientHelper.getAccessTokenForDeviceFlow(response.getDeviceCode(), configuration);
configuration.setBearerToken(tokenResponse.getAccessToken());
ApiClient apiClient = new ApiClient(configuration);
AddressesApi apiInstance = new AddressesApi(apiClient);
String xAvalaraClient = "Swagger UI; 22.7.0; Custom; 1.0"; // 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/) .
AddressValidationInfo body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve
try {
// SDK will fetch OAuth token using client creds flow with Avalara Identity and append Authorization header to the request with the access token.
AddressResolutionModel result = apiInstance.resolveAddressPost(xAvalaraClient, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AddressesApi#resolveAddressPost");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.
Class | Method | HTTP request | Description |
---|---|---|---|
DataInputFieldsApi | getDataInputFields | GET /data-input-fields | Returns the mandatory and conditional invoice or creditnote input fields for different country mandates |
DocumentsApi | downloadDocument | GET /documents/{documentId}/$download | Returns a copy of the document |
DocumentsApi | getDocumentList | GET /documents | Returns a summary of documents for a date range |
DocumentsApi | getDocumentStatus | GET /document/{documentId}/status | Checks the status of a document |
DocumentsApi | submitDocument | POST /documents | Submits a document to Avalara E-Invoicing API |
MandatesApi | getMandates | GET /mandates | List country mandates that are supported by the Avalara E-Invoicing platform |
- Avalara.SDK.model.EInvoicing.V1.BadDownloadRequest
- Avalara.SDK.model.EInvoicing.V1.BadRequest
- Avalara.SDK.model.EInvoicing.V1.ConditionalForField
- Avalara.SDK.model.EInvoicing.V1.DataInputField
- Avalara.SDK.model.EInvoicing.V1.DataInputFieldNotUsedFor
- Avalara.SDK.model.EInvoicing.V1.DataInputFieldOptionalFor
- Avalara.SDK.model.EInvoicing.V1.DataInputFieldRequiredFor
- Avalara.SDK.model.EInvoicing.V1.DataInputFieldsResponse
- Avalara.SDK.model.EInvoicing.V1.DocumentListResponse
- Avalara.SDK.model.EInvoicing.V1.DocumentStatusResponse
- Avalara.SDK.model.EInvoicing.V1.DocumentSubmissionError
- Avalara.SDK.model.EInvoicing.V1.DocumentSubmitResponse
- Avalara.SDK.model.EInvoicing.V1.DocumentSummary
- Avalara.SDK.model.EInvoicing.V1.ForbiddenError
- Avalara.SDK.model.EInvoicing.V1.InputDataFormats
- Avalara.SDK.model.EInvoicing.V1.InternalServerError
- Avalara.SDK.model.EInvoicing.V1.Mandate
- Avalara.SDK.model.EInvoicing.V1.MandatesResponse
- Avalara.SDK.model.EInvoicing.V1.NotFoundError
- Avalara.SDK.model.EInvoicing.V1.NotUsedForField
- Avalara.SDK.model.EInvoicing.V1.RequiredWhenField
- Avalara.SDK.model.EInvoicing.V1.StatusEvent
- Avalara.SDK.model.EInvoicing.V1.SubmitDocumentData
- Avalara.SDK.model.EInvoicing.V1.SubmitDocumentMetadata
- Avalara.SDK.model.EInvoicing.V1.WorkflowIds