Platform foundation consists of services on top of which the Avalara Compliance Cloud platform is built. These services are foundational and provide functionality such as common organization, tenant and user management for the rest of the compliance platform.
- .NET Core >=1.0
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- Json.NET - 12.0.3 or later
- JsonSubTypes - 1.8.0 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.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Avalara.SDK.Api.Avatax;
using Avalara.SDK.Client;
using Avalara.SDK.Model.Avatax;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.Environment = AvalaraEnvironment.Sandbox;
config.BearerToken = "<Your Bearer Token>";
ApiClient apiClient= new ApiClient(config);
var apiInstance = new AddressesApi(apiClient);
var requestParameters = new ResolveAddressPostRequest();
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")
requestParameters.body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve (optional)
try
{
// Retrieve geolocation information for a specified address
AddressResolutionModel result = apiInstance.ResolveAddressPost(requestParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressesApi.ResolveAddressPost: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
- Type: OAuth
- Flow: client_credentials
- Scopes:
- avatax_api: avatax_api scope.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Avalara.SDK.Api.IAMDS;
using Avalara.SDK.Client;
using Avalara.SDK.Model.IAMDS;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration configuration = new Configuration();
configuration.Environment = AvalaraEnvironment.Sandbox;
// Avalara Identity Client ID, it can be hard coded or stored as an environment variable as per the example.
configuration.ClientID = Environment.GetEnvironmentVariable("CLIENT_ID");
// Avalara Identity Client Secret, do not check in this value to source control.
configuration.ClientSecret = Environment.GetEnvironmentVariable("CLIENT_SECRET");
configuration.AppName = "Test";
configuration.AppVersion = "1.0";
configuration.MachineName = "LocalBox";
apiclient = new ApiClient(configuration);
var apiInstance = new AddressesApi(apiClient);
var requestParameters = new ResolveAddressPostRequest();
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")
requestParameters.body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve (optional)
try
{
// OAuth 2 Client Credential Flow will automatically be invoked, retrieve the JWT token from Avalara Identity,
// and append the token into the Authorization header of the request.
AddressResolutionModel result = apiInstance.ResolveAddressPost(requestParameters);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AddressesApi.ResolveAddressPost: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
- Type: OAuth
- Flow: device_code
- Scopes:
- avatax_api: avatax_api scope.
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Avalara.SDK.Api.IAMDS;
using Avalara.SDK.Client;
using Avalara.SDK.Model.IAMDS;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration configuration = new Configuration();
configuration.Environment = AvalaraEnvironment.Sandbox;
// Avalara Identity Client ID, it can be hard coded or stored as an environment variable as per the example.
configuration.ClientID = Environment.GetEnvironmentVariable("CLIENT_ID");
configuration.AppName = "Test";
configuration.AppVersion = "1.0";
configuration.MachineName = "LocalBox";
// Pass in the scope (avatax_api in this instance), and the configuration object, clientID is a required property for the flow.
// Fetches the device code and verification url required for the user part of the flow (where they open the URI in their web browser and authenticate)
var deviceResponse = OAuthHelper.initiateDeviceAuthorizationFlow("avatax_api", configuration);
// Retrieves the accessToken and other metadata relating to the auth request.
var tokenResponse = OAuthHelper.getAccessTokenForDeviceFlow(deviceResponse.DeviceCode, configuration);
// Token retrieved from the device code flow will be used in the Authorization header for the requests.
configuration.BearerToken = tokenResponse.AccessToken;
apiclient = new ApiClient(configuration);
var apiInstance = new AddressesApi(apiClient);
var requestParameters = new ResolveAddressPostRequest();
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")
requestParameters.body = new AddressValidationInfo(); // AddressValidationInfo | The address to resolve (optional)
try
{
// OAuth 2 Client Credential Flow will automatically be invoked, retrieve the JWT token from Avalara Identity,
// and append the token into the Authorization header of the request.
AddressResolutionModel result = apiInstance.ResolveAddressPost(requestParameters);
Debug.WriteLine(result);
}
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 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 |
- Model.EInvoicing.V1.BadDownloadRequest
- Model.EInvoicing.V1.BadRequest
- 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.DocumentListResponse
- Model.EInvoicing.V1.DocumentStatusResponse
- Model.EInvoicing.V1.DocumentSubmissionError
- Model.EInvoicing.V1.DocumentSubmitResponse
- Model.EInvoicing.V1.DocumentSummary
- Model.EInvoicing.V1.ForbiddenError
- Model.EInvoicing.V1.InputDataFormats
- Model.EInvoicing.V1.InternalServerError
- Model.EInvoicing.V1.Mandate
- Model.EInvoicing.V1.MandatesResponse
- Model.EInvoicing.V1.NotFoundError
- Model.EInvoicing.V1.NotUsedForField
- Model.EInvoicing.V1.RequiredWhenField
- Model.EInvoicing.V1.StatusEvent
- Model.EInvoicing.V1.SubmitDocumentData
- Model.EInvoicing.V1.SubmitDocumentMetadata
- Model.EInvoicing.V1.WorkflowIds