Skip to content

avadev/Avalara-SDK-DotNet

Repository files navigation

Avalara.SDK - the Unified C# library for next gen Avalara services.

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.

Frameworks supported

  • .NET Core >=1.0
  • .NET Framework >=4.6

Dependencies

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

Getting Started

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);
            }

        }
    }
}

Documentation for API Endpoints

EInvoicing V1 API Documentation

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
SubscriptionsApi CreateWebhookSubscription POST /webhooks/subscriptions Create a subscription to events
SubscriptionsApi DeleteWebhookSubscription DELETE /webhooks/subscriptions/{subscription-id} Unsubscribe from events
SubscriptionsApi GetWebhookSubscription GET /webhooks/subscriptions/{subscription-id} Get details of a subscription
SubscriptionsApi ListWebhookSubscriptions GET /webhooks/subscriptions List all subscriptions
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.

A1099 V2 API Documentation

Class Method HTTP request Description
CompaniesW9Api CreateCompany POST /w9/companies Creates a new company
CompaniesW9Api DeleteCompany DELETE /w9/companies/{id} Deletes a company
CompaniesW9Api GetCompanies GET /w9/companies List companies
CompaniesW9Api GetCompany GET /w9/companies/{id} Retrieve a company
CompaniesW9Api UpdateCompany PUT /w9/companies/{id} Update a company
Forms1099Api BulkUpsert1099Forms POST /1099/forms/$bulk-upsert Creates or updates multiple 1099 forms.
Forms1099Api Create1099Form POST /1099/forms Creates a 1099 form.
Forms1099Api Delete1099Form DELETE /1099/forms/{id} Deletes a 1099 form.
Forms1099Api Get1099Form GET /1099/forms/{id} Retrieves a 1099 form.
Forms1099Api Get1099FormPdf GET /1099/forms/{id}/pdf Retrieves the PDF file for a single 1099 by form id.
Forms1099Api List1099Forms GET /1099/forms Retrieves a list of 1099 forms based on query parameters.
Forms1099Api Update1099Form PUT /1099/forms/{id} Updates a 1099 form.
FormsW9Api CreateW9Form POST /w9/forms Create a W9/W4/W8 form
FormsW9Api DeleteW9Form DELETE /w9/forms/{id} Delete a form
FormsW9Api GetW9Form GET /w9/forms/{id} Retrieve a W9/W4/W8 form
FormsW9Api ListW9Forms GET /w9/forms List W9/W4/W8 forms.
FormsW9Api SendW9FormEmail POST /w9/forms/{id}/$send-email Sends a W9 email request to a vendor/payee
FormsW9Api UpdateW9Form PUT /w9/forms/{id} Update a W9/W4/W8 form
FormsW9Api UploadW9Files PUT /w9/forms/{id}/attachment Upload files for a W9/W4/W8 form
Issuers1099Api CreateIssuer POST /1099/issuers Create an issuer
Issuers1099Api DeleteIssuer DELETE /1099/issuers/{id} Delete an issuer
Issuers1099Api GetIssuer GET /1099/issuers/{id} Get an issuer
Issuers1099Api GetIssuers GET /1099/issuers List issuers
Issuers1099Api UpdateIssuer PUT /1099/issuers/{id} Update an issuer
Jobs1099Api GetJob GET /1099/jobs/{id} Retrieves information about the job

Documentation for Models

EInvoicing V1 Model Documentation

A1099 V2 Model Documentation

About

Avalara-SDK-DotNet

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •