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.
- .NET Core >=1.0
- .NET Framework >=4.6
- Json.NET - 13.0.1 or later
- JsonSubTypes - 1.8.0 or later
- Polly - 7.2.2 or later
- System.ComponentModel.Annotations - 5.0.0 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
using System;
using Avalara.SDK.Client;
using Avalara.SDK.Helpers;
using Avalara.SDK.Api.EInvoicing.V1;
using System.Threading.Tasks;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration configuration = new Configuration
{
Environment = AvalaraEnvironment.Sandbox,
BearerToken = Environment.GetEnvironmentVariable("BEARER_TOKEN"), // Your Bearer token to connect to Avalara
AppName = "Test",
AppVersion = "1.0",
MachineName = "LocalBox"
};
ApiClient apiClient = new ApiClient(configuration);
var mandatesApi = new MandatesApi(apiClient);
var requestParameters = new GetMandatesRequest();
requestParameters.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/) . (optional) (default to "Swagger UI; 22.7.0; Custom; 1.0")
try
{
// Retrieve the list of Mandates
var response = await mandatesApi.GetMandatesAsync(requestParameters);
Debug.WriteLine(response);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressesApi.ResolveAddressPost: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
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. |
Class | Method | HTTP request | Description |
---|---|---|---|
Class1099FormsApi | BulkUpsert1099Forms | POST /1099/forms/$bulk | Create/Update 1099 forms |
Class1099FormsApi | Call1099FormsPost | POST /1099/forms | Create a new 1099 form |
Class1099FormsApi | Delete1099Form | DELETE /1099/forms/{formId} | Delete a 1099 form |
Class1099FormsApi | Download1099FormPDF | POST /1099/forms/$initiate-download | Submit a download job to retrieve PDF forms |
Class1099FormsApi | Get1099Form | GET /1099/forms/{formId} | Get a single 1099 form |
Class1099FormsApi | List1099Forms | GET /1099/forms | List 1099 forms |
Class1099FormsApi | Update1099Form | PUT /1099/forms/{formId} | Update an existing form. |
Class1099IssuersApi | CreateIssuer | POST /1099/issuers | Create a new issuer |
Class1099IssuersApi | DeleteIssuer | DELETE /1099/issuers/{issuerId} | Delete an issuer |
Class1099IssuersApi | GetIssuer | GET /1099/issuers/{issuerId} | Get a single issuer |
Class1099IssuersApi | ListIssuers | GET /1099/issuers | List issuers |
Class1099IssuersApi | UpdateIssuer | PUT /1099/issuers/{issuerId} | Update an issuer |
JobsApi | GetJob | GET /jobs/{jobId} | Get status of an existing job |
W4W8W9FormsApi | CreateW9Form | POST /w9/forms | Create a new W9/W8/W4 form |
W4W8W9FormsApi | GetW9Form | GET /w9/forms/{formId} | Retrieve a W9/W8/W4 form |
W4W8W9FormsApi | GetW9Forms | GET /w9/forms | List W9/W4/W8 forms. |
W4W8W9FormsApi | W9FormRequestsFormRequestIdGet | GET /w9/form-requests/{formRequestId} | Get form request TODO-I Don't think this API should exist and instead we need POST /w9/{id}/request . |
W9CompaniesApi | CreateW9Company | POST /w9/companies | Creates a new company |
- Model.EInvoicing.V1.BadDownloadRequest
- Model.EInvoicing.V1.BadRequest
- Model.EInvoicing.V1.BatchSearch
- Model.EInvoicing.V1.BatchSearchListResponse
- Model.EInvoicing.V1.ConditionalForField
- Model.EInvoicing.V1.DataInputField
- Model.EInvoicing.V1.DataInputFieldNotUsedFor
- Model.EInvoicing.V1.DataInputFieldOptionalFor
- Model.EInvoicing.V1.DataInputFieldRequiredFor
- Model.EInvoicing.V1.DataInputFieldsResponse
- Model.EInvoicing.V1.DirectorySearchResponse
- Model.EInvoicing.V1.DirectorySearchResponseValueInner
- Model.EInvoicing.V1.DirectorySearchResponseValueInnerAddressesInner
- Model.EInvoicing.V1.DirectorySearchResponseValueInnerIdentifiersInner
- Model.EInvoicing.V1.DirectorySearchResponseValueInnerSupportedDocumentTypesInner
- Model.EInvoicing.V1.DocumentFetch
- Model.EInvoicing.V1.DocumentListResponse
- Model.EInvoicing.V1.DocumentStatusResponse
- Model.EInvoicing.V1.DocumentSubmissionError
- Model.EInvoicing.V1.DocumentSubmitResponse
- Model.EInvoicing.V1.DocumentSummary
- Model.EInvoicing.V1.ErrorResponse
- Model.EInvoicing.V1.FetchDocumentsRequest
- Model.EInvoicing.V1.FetchDocumentsRequestDataInner
- Model.EInvoicing.V1.FetchDocumentsRequestMetadata
- Model.EInvoicing.V1.ForbiddenError
- Model.EInvoicing.V1.InputDataFormats
- Model.EInvoicing.V1.InternalServerError
- Model.EInvoicing.V1.Mandate
- Model.EInvoicing.V1.MandateDataInputField
- Model.EInvoicing.V1.MandateDataInputFieldNamespace
- Model.EInvoicing.V1.MandatesResponse
- Model.EInvoicing.V1.NotFoundError
- Model.EInvoicing.V1.NotUsedForField
- Model.EInvoicing.V1.RequiredWhenField
- Model.EInvoicing.V1.StatusEvent
- Model.EInvoicing.V1.SubmitDocumentMetadata
- Model.EInvoicing.V1.SubmitInteropDocument202Response
- Model.EInvoicing.V1.WorkflowIds
- Model.A1099.V2.AddressVerificationStatus
- Model.A1099.V2.AuthorizedApiRequestModel
- Model.A1099.V2.AuthorizedApiRequestV2DataModel
- Model.A1099.V2.BaseFormDataModel
- Model.A1099.V2.BulkUpsert1099FormsRequest
- Model.A1099.V2.CompanyModel
- Model.A1099.V2.ErrorModel
- Model.A1099.V2.FederalEfileStatus
- Model.A1099.V2.Form1099BaseModel
- Model.A1099.V2.Form1099BaseModelFederalEfileStatus
- Model.A1099.V2.Form1099BaseModelPostalMailStatus
- Model.A1099.V2.Form1099MiscModel
- Model.A1099.V2.Form1099NecModel
- Model.A1099.V2.Form1099OneOf
- Model.A1099.V2.FormRequestModel
- Model.A1099.V2.GenericPaginatedModel
- Model.A1099.V2.GetW9Form200Response
- Model.A1099.V2.HttpValidationProblemDetails
- Model.A1099.V2.InitiateDownloadInputModel
- Model.A1099.V2.InitiateDownloadInputModelStateEfileStatus
- Model.A1099.V2.InititateDownloadOutputModel
- Model.A1099.V2.IssuerModel
- Model.A1099.V2.IssuerModelPaginatedQueryResultModel
- Model.A1099.V2.JobModel
- Model.A1099.V2.JobModelData
- Model.A1099.V2.JobModelDataOneOf
- Model.A1099.V2.JobModelDataOneOfBulkDownload
- Model.A1099.V2.JobModelDataOneOfUpsert
- Model.A1099.V2.List1099Forms200Response
- Model.A1099.V2.PaginatedQueryResultModel
- Model.A1099.V2.PaginatedW9FormsModel
- Model.A1099.V2.PostalMailStatus
- Model.A1099.V2.ProblemDetails
- Model.A1099.V2.StateEfileStatusesInner
- Model.A1099.V2.StateWithholding
- Model.A1099.V2.TinMatchStatus
- Model.A1099.V2.W4FormDataModel
- Model.A1099.V2.W8BenFormDataModel
- Model.A1099.V2.W8BeneFormDataModel
- Model.A1099.V2.W8ImyFormDataModel
- Model.A1099.V2.W9FormDataModel
- Model.A1099.V2.W9FormDataModelsOneOf