This generator creates TypeScript/JavaScript client that utilizes Fetch API. The generated Node module can be used in the following environments:
Environment
- Node.js
- Webpack
- Browserify
Language level
- ES5 - you must have a Promises/A+ library installed
- ES6
Module system
- CommonJS
- ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via package.json
. (Reference)
navigate to the folder of your consuming project and run one of the following commands.
published:
npm install [email protected] --save
import * as AvalaraSdk from "avalara-sdk";
import { AvaTaxEnvironment } from "avalara-sdk/runtime";
const configParams: AvalaraSdk.Runtime.ConfigurationParameters = {
appName: "asv-sdk-test-app",
appVersion: "1.0",
environment: AvaTaxEnvironment.Sandbox,
machineName: "test-machine",
timeout: 3000,
bearerToken: "<YOUR BEARER TOKEN>",
testBasePath: "https://localhost:3000",
};
const config = new AvalaraSdk.Runtime.Configuration(configParams);
let client = new AvalaraSdk.Runtime.ApiClient(config);
let api = new AvalaraSdk.EInvoicing.V1.MandatesApi(client);
let requestParameters: AvalaraSdk.EInvoicing.V1.GetMandatesInterface = {
xAvalaraClient: "Swagger UI; 22.7.0; Custom; 1.0",
};
const result = await api.getMandates(requestParameters);
console.log(result);
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. |
- EInvoicing.V1.BadDownloadRequest
- EInvoicing.V1.BadRequest
- EInvoicing.V1.BatchSearch
- EInvoicing.V1.BatchSearchListResponse
- EInvoicing.V1.ConditionalForField
- EInvoicing.V1.DataInputField
- EInvoicing.V1.DataInputFieldNotUsedFor
- EInvoicing.V1.DataInputFieldOptionalFor
- EInvoicing.V1.DataInputFieldRequiredFor
- EInvoicing.V1.DataInputFieldsResponse
- EInvoicing.V1.DirectorySearchResponse
- EInvoicing.V1.DirectorySearchResponseValueInner
- EInvoicing.V1.DirectorySearchResponseValueInnerAddressesInner
- EInvoicing.V1.DirectorySearchResponseValueInnerIdentifiersInner
- EInvoicing.V1.DirectorySearchResponseValueInnerSupportedDocumentTypesInner
- EInvoicing.V1.DocumentFetch
- EInvoicing.V1.DocumentFetchRequest
- EInvoicing.V1.DocumentFetchRequestDataInner
- EInvoicing.V1.DocumentFetchRequestMetadata
- EInvoicing.V1.DocumentListResponse
- EInvoicing.V1.DocumentStatusResponse
- EInvoicing.V1.DocumentSubmissionError
- EInvoicing.V1.DocumentSubmitResponse
- EInvoicing.V1.DocumentSummary
- EInvoicing.V1.ErrorResponse
- EInvoicing.V1.ForbiddenError
- EInvoicing.V1.InputDataFormats
- EInvoicing.V1.InternalServerError
- EInvoicing.V1.Mandate
- EInvoicing.V1.MandateDataInputField
- EInvoicing.V1.MandateDataInputFieldNamespace
- EInvoicing.V1.MandatesResponse
- EInvoicing.V1.NotFoundError
- EInvoicing.V1.NotUsedForField
- EInvoicing.V1.RequiredWhenField
- EInvoicing.V1.StatusEvent
- EInvoicing.V1.SubmitDocumentMetadata
- EInvoicing.V1.SubmitInteropDocument202Response
- EInvoicing.V1.WorkflowIds