Unified SDK consists of services on top of which the Avalara Compliance Cloud platform is built. These services are foundational and provide functionality such as einvoicing.
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>net.avalara</groupId>
<artifactId>avalara-sdk</artifactId>
<version>24.12.0</version>
<scope>compile</scope>
</dependency>
Add this dependency to your project's build file:
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
implementation 'net.avalara:avalara-sdk:24.12.0'
}
Please follow the installation instruction and execute the following Java code:
import Avalara.SDK.*;
import Avalara.SDK.api.EInvoicing.V1.*;
import Avalara.SDK.model.EInvoicing.V1.*;
public class MandatesApiExample {
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 access token for authorization
configuration.setBearerToken("YOUR ACCESS TOKEN");
try {
ApiClient apiClient = new ApiClient(configuration);
Avalara.SDK.api.EInvoicing.V1.MandatesApi apiInstance = new MandatesApi(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/) .
MandatesApi.GetMandatesRequest request = apiInstance.getGetMandatesRequest();
request.setXAvalaraClient(xAvalaraClient);
MandatesResponse result = apiInstance.getMandates(request);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MandatesAPI#getMandates");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
} catch (Exception e) {
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 optionality of document fields for different country mandates |
DocumentsApi | downloadDocument | GET /documents/{documentId}/$download | Returns a copy of the document |
DocumentsApi | fetchDocuments | POST /documents/$fetch | Fetch the inbound document from a tax authority |
DocumentsApi | getDocumentList | GET /documents | Returns a summary of documents for a date range |
DocumentsApi | getDocumentStatus | GET /documents/{documentId}/status | Checks the status of a document |
DocumentsApi | submitDocument | POST /documents | Submits a document to Avalara E-Invoicing API |
InteropApi | submitInteropDocument | POST /interop/documents | Submit a document |
MandatesApi | getMandateDataInputFields | GET /mandates/{mandateId}/data-input-fields | Returns document field information for a country mandate, a selected document type, and its version |
MandatesApi | getMandates | GET /mandates | List country mandates that are supported by the Avalara E-Invoicing platform |
TradingPartnersApi | batchSearchParticipants | POST /trading-partners/batch-searches | Creates a batch search and performs a batch search in the directory for participants in the background. |
TradingPartnersApi | downloadBatchSearchReport | GET /trading-partners/batch-searches/{id}/$download-results | Download batch search results in a csv file. |
TradingPartnersApi | getBatchSearchDetail | GET /trading-partners/batch-searches/{id} | Get the batch search details for a given id. |
TradingPartnersApi | listBatchSearches | GET /trading-partners/batch-searches | List all batch searches that were previously submitted. |
TradingPartnersApi | searchParticipants | GET /trading-partners | Returns a list of participants matching the input query. |
- Avalara.SDK.model.EInvoicing.V1.BadDownloadRequest
- Avalara.SDK.model.EInvoicing.V1.BadRequest
- Avalara.SDK.model.EInvoicing.V1.BatchSearch
- Avalara.SDK.model.EInvoicing.V1.BatchSearchListResponse
- 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.DirectorySearchResponse
- Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInner
- Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerAddressesInner
- Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerIdentifiersInner
- Avalara.SDK.model.EInvoicing.V1.DirectorySearchResponseValueInnerSupportedDocumentTypesInner
- Avalara.SDK.model.EInvoicing.V1.DocumentFetch
- Avalara.SDK.model.EInvoicing.V1.DocumentFetchRequest
- Avalara.SDK.model.EInvoicing.V1.DocumentFetchRequestDataInner
- Avalara.SDK.model.EInvoicing.V1.DocumentFetchRequestMetadata
- 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.ErrorResponse
- 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.MandateDataInputField
- Avalara.SDK.model.EInvoicing.V1.MandateDataInputFieldNamespace
- 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.SubmitDocumentMetadata
- Avalara.SDK.model.EInvoicing.V1.SubmitInteropDocument202Response
- Avalara.SDK.model.EInvoicing.V1.WorkflowIds