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
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 |
TaxIdentifiersApi | taxIdentifierSchemaByCountry | GET /tax-identifiers/schema | Returns the tax identifier request & response schema for a specific country. |
TaxIdentifiersApi | validateTaxIdentifier | POST /tax-identifiers/validate | Validates a tax identifier. |
TradingPartnersApi | batchSearchParticipants | POST /trading-partners/batch-searches | Handles batch search requests by uploading a file containing search parameters. |
TradingPartnersApi | createTradingPartner | POST /trading-partners | Creates a new trading partner. |
TradingPartnersApi | createTradingPartnersBatch | POST /trading-partners/batch | Creates a batch of multiple trading partners. |
TradingPartnersApi | deleteTradingPartner | DELETE /trading-partners/{id} | Deletes a trading partner using ID. |
TradingPartnersApi | downloadBatchSearchReport | GET /trading-partners/batch-searches/{id}/$download-results | Downloads batch search results in a csv file. |
TradingPartnersApi | getBatchSearchDetail | GET /trading-partners/batch-searches/{id} | Returns the batch search details using ID. |
TradingPartnersApi | listBatchSearches | GET /trading-partners/batch-searches | Lists all batch searches that were previously submitted. |
TradingPartnersApi | searchParticipants | GET /trading-partners | Returns a list of participants matching the input query. |
TradingPartnersApi | updateTradingPartner | PUT /trading-partners/{id} | Updates a trading partner using ID. |
Class | Method | HTTP request | Description |
---|---|---|---|
CompaniesW9Api | createCompany | POST /w9/companies | Create a company |
CompaniesW9Api | deleteCompany | DELETE /w9/companies/{id} | Delete 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 | Create or update multiple 1099/1095/W2/1042S forms |
Forms1099Api | create1099Form | POST /1099/forms | Create a 1099/1095/W2/1042S form |
Forms1099Api | delete1099Form | DELETE /1099/forms/{id} | Delete a 1099/1095/W2/1042S form |
Forms1099Api | get1099Form | GET /1099/forms/{id} | Retrieve a 1099/1095/W2/1042S form |
Forms1099Api | get1099FormPdf | GET /1099/forms/{id}/pdf | Retrieve the PDF file for a 1099/1095/W2/1042S form |
Forms1099Api | list1099Forms | GET /1099/forms | List 1099/1095/W2/1042S forms |
Forms1099Api | update1099Form | PUT /1099/forms/{id} | Update a 1099/1095/W2/1042S form |
FormsW9Api | createW9Form | POST /w9/forms | Create a W9/W4/W8 form |
FormsW9Api | deleteW9Form | DELETE /w9/forms/{id} | Delete a W9/W4/W8 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 | Send an email to the vendor/payee requesting they fill out a W9/W4/W8 form |
FormsW9Api | updateW9Form | PUT /w9/forms/{id} | Update a W9/W4/W8 form |
FormsW9Api | uploadW9Files | POST /w9/forms/{id}/attachment | Replace the PDF file 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} | Retrieve 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 |
- EInvoicing.V1.Address
- EInvoicing.V1.BadDownloadRequest
- EInvoicing.V1.BadRequest
- EInvoicing.V1.BatchErrorDetail
- EInvoicing.V1.BatchSearch
- EInvoicing.V1.BatchSearchListResponse
- EInvoicing.V1.BatchSearchParticipants202Response
- EInvoicing.V1.ConditionalForField
- EInvoicing.V1.Consents
- EInvoicing.V1.CreateTradingPartner201Response
- EInvoicing.V1.CreateTradingPartnersBatch200Response
- EInvoicing.V1.CreateTradingPartnersBatch200ResponseValueInner
- EInvoicing.V1.CreateTradingPartnersBatchRequest
- EInvoicing.V1.DataInputField
- EInvoicing.V1.DataInputFieldNotUsedFor
- EInvoicing.V1.DataInputFieldOptionalFor
- EInvoicing.V1.DataInputFieldRequiredFor
- EInvoicing.V1.DataInputFieldsResponse
- EInvoicing.V1.DocumentFetch
- EInvoicing.V1.DocumentListResponse
- EInvoicing.V1.DocumentStatusResponse
- EInvoicing.V1.DocumentSubmissionError
- EInvoicing.V1.DocumentSubmitResponse
- EInvoicing.V1.DocumentSummary
- EInvoicing.V1.ErrorResponse
- EInvoicing.V1.EventId
- EInvoicing.V1.EventMessage
- EInvoicing.V1.EventPayload
- EInvoicing.V1.EventSubscription
- EInvoicing.V1.Extension
- EInvoicing.V1.FetchDocumentsRequest
- EInvoicing.V1.FetchDocumentsRequestDataInner
- EInvoicing.V1.FetchDocumentsRequestMetadata
- EInvoicing.V1.ForbiddenError
- EInvoicing.V1.HmacSignature
- EInvoicing.V1.HmacSignatureValue
- EInvoicing.V1.Id
- EInvoicing.V1.Identifier
- 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.OutputDataFormats
- EInvoicing.V1.Pagination
- EInvoicing.V1.RequiredWhenField
- EInvoicing.V1.SearchParticipants200Response
- EInvoicing.V1.Signature
- EInvoicing.V1.SignatureSignature
- EInvoicing.V1.SignatureValue
- EInvoicing.V1.SignatureValueSignature
- EInvoicing.V1.StatusEvent
- EInvoicing.V1.SubmitDocumentMetadata
- EInvoicing.V1.SubmitInteropDocument202Response
- EInvoicing.V1.SubscriptionCommon
- EInvoicing.V1.SubscriptionDetail
- EInvoicing.V1.SubscriptionListResponse
- EInvoicing.V1.SubscriptionRegistration
- EInvoicing.V1.SuccessResponse
- EInvoicing.V1.SupportedDocumentTypes
- EInvoicing.V1.TaxIdentifierRequest
- EInvoicing.V1.TaxIdentifierResponse
- EInvoicing.V1.TaxIdentifierResponseValue
- EInvoicing.V1.TaxIdentifierSchemaByCountry200Response
- EInvoicing.V1.TradingPartner
- EInvoicing.V1.UpdateTradingPartner200Response
- EInvoicing.V1.ValidationError
- EInvoicing.V1.WebhookInvocation
- EInvoicing.V1.WebhooksErrorInfo
- EInvoicing.V1.WebhooksErrorResponse
- EInvoicing.V1.WorkflowIds
- A1099.V2.Attribute
- A1099.V2.AuthorizedApiRequestModel
- A1099.V2.AuthorizedApiRequestV2DataModel
- A1099.V2.BaseCompanyModel
- A1099.V2.BaseFormListRequest
- A1099.V2.BulkUpsert1099FormsRequest
- A1099.V2.CompanyCreateUpdateRequestModel
- A1099.V2.CompanyModel
- A1099.V2.CompanyResponse
- A1099.V2.CompanyResponseModel
- A1099.V2.CoveredIndividualReferenceResponse
- A1099.V2.CoveredIndividualRequest
- A1099.V2.Create1099Form201Response
- A1099.V2.CreateW9Form201Response
- A1099.V2.CreateW9FormRequest
- A1099.V2.Data
- A1099.V2.ErrorModel
- A1099.V2.ErrorResponse
- A1099.V2.ErrorResponseErrorsInner
- A1099.V2.Form1042SList
- A1099.V2.Form1042SListItem
- A1099.V2.Form1042SListItemResponse
- A1099.V2.Form1042SRequest
- A1099.V2.Form1042SResponse
- A1099.V2.Form1095BList
- A1099.V2.Form1095BListItem
- A1099.V2.Form1095BListItemResponse
- A1099.V2.Form1095BRequest
- A1099.V2.Form1095CList
- A1099.V2.Form1095CListItem
- A1099.V2.Form1099BaseResponse
- A1099.V2.Form1099DivList
- A1099.V2.Form1099DivListItem
- A1099.V2.Form1099DivListItemResponse
- A1099.V2.Form1099DivRequest
- A1099.V2.Form1099DivResponse
- A1099.V2.Form1099KList
- A1099.V2.Form1099KListItem
- A1099.V2.Form1099KListItemResponse
- A1099.V2.Form1099KRequest
- A1099.V2.Form1099KResponse
- A1099.V2.Form1099ListResponse
- A1099.V2.Form1099ListResponseValueInner
- A1099.V2.Form1099MiscList
- A1099.V2.Form1099MiscListItem
- A1099.V2.Form1099MiscListItemResponse
- A1099.V2.Form1099MiscRequest
- A1099.V2.Form1099MiscResponse
- A1099.V2.Form1099NecList
- A1099.V2.Form1099NecListItem
- A1099.V2.Form1099NecListItemResponse
- A1099.V2.Form1099NecRequest
- A1099.V2.Form1099NecResponse
- A1099.V2.Form1099ProccessResult
- A1099.V2.Form1099RList
- A1099.V2.Form1099RListItem
- A1099.V2.Form1099RListItemResponse
- A1099.V2.Form1099RRequest
- A1099.V2.FormRequestBase
- A1099.V2.FormRequestListItemBase
- A1099.V2.FormResponseBase
- A1099.V2.FormSingleRequestBase
- A1099.V2.Get1099Form200Response
- A1099.V2.HttpValidationProblemDetails
- A1099.V2.ICreateForm1099Request
- A1099.V2.IUpdateForm1099Request
- A1099.V2.IW9FormDataModelsOneOf
- A1099.V2.IntermediaryOrFlowThrough
- A1099.V2.IntermediaryOrFlowThroughRequest
- A1099.V2.IntermediaryOrFlowThroughResponse
- A1099.V2.IrsResponse
- A1099.V2.IssuerCommand
- A1099.V2.IssuerResponse
- A1099.V2.JobResult
- A1099.V2.Link
- A1099.V2.OfferAndCoverageRequest
- A1099.V2.PaginatedQueryResultModel
- A1099.V2.PaginatedQueryResultModelCompanyResponse
- A1099.V2.PaginatedQueryResultModelIssuerResponse
- A1099.V2.PaginatedW9FormsModel
- A1099.V2.PrimaryWithholdingAgent
- A1099.V2.PrimaryWithholdingAgentRequest
- A1099.V2.PrimaryWithholdingAgentResponse
- A1099.V2.ProblemDetails
- A1099.V2.StateAndLocalWithholdingRequest
- A1099.V2.StateAndLocalWithholdingResponse
- A1099.V2.StateEfileStatusDetailResponse
- A1099.V2.StatusDetail
- A1099.V2.SubstantialUsOwnerRequest
- A1099.V2.SubstantialUsOwnerResponse
- A1099.V2.TinMatchStatusResponse
- A1099.V2.Update1099Form200Response
- A1099.V2.ValidationErrorResponse
- A1099.V2.W4FormDataModel
- A1099.V2.W4FormRequest
- A1099.V2.W4FormResponse
- A1099.V2.W8BenEFormRequest
- A1099.V2.W8BenEFormResponse
- A1099.V2.W8BenESubstantialUsOwnerDataModel
- A1099.V2.W8BenFormDataModel
- A1099.V2.W8BenFormRequest
- A1099.V2.W8BenFormResponse
- A1099.V2.W8BeneFormDataModel
- A1099.V2.W8ImyFormDataModel
- A1099.V2.W8ImyFormRequest
- A1099.V2.W8ImyFormResponse
- A1099.V2.W9FormBaseRequest
- A1099.V2.W9FormBaseResponse
- A1099.V2.W9FormDataModel
- A1099.V2.W9FormRequest
- A1099.V2.W9FormResponse