public class

AvalaraModule

extends Object
java.lang.Object
   ↳ org.mule.modules.avalara.AvalaraModule
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Avalara provides automated sales tax solutions to streamline cumbersome, error-prone tax compliance processes and reduce the risk of loss or penalty in case of an audit. Their automated solutions automatically perform address validation, jurisdiction research and rate calculation and allow you to manage even the most complicated tax issues, such as situs, nexus, tax tiers, tax holidays, exemptions, certificate management and product taxability rules.

Summary

Fields
private AvalaraClient apiClient Avalara's application client.
private final MapObjectMapper mom
Public Constructors
AvalaraModule()
Public Methods
CancelTaxResult cancelTax(String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, CancelCodeType cancelCode)
Cancel tax, indicating the document that should be cancelled and the reason for the operation.
CommitTaxResult commitTax(String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, String newDocCode)
Commit Tax processor
GetTaxResult getTax(String account, String license, String avalaraClient, String companyCode, AvalaraDocumentType docType, String docCode, Date docDate, String salespersonCode, String customerCode, String customerUsageType, String discount, String purchaseOrderNo, String exemptionNo, String originCode, String destinationCode, List<Map<String, Object>> baseAddresses, List<Map<String, Object>> lines, DetailLevelType detailLevel, String referenceCode, String locationCode, boolean commit, String batchCode, Map<String, Object> taxOverride, String currencyCode, ServiceModeType serviceMode, Date paymentDate, String exchangeRate, Date exchangeRateEffDate)
Get Tax processor.
GetTaxHistoryResult getTaxHistory(String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, DetailLevelType detailLevel)
Get Tax History processor
void init()
PingResult ping(String account, String license, String avalaraClient, String message)
PostTaxResult postTax(String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, Date docDate, String totalAmount, String totalTax, boolean commit, String newDocCode)
Post Tax processor
void setClient(AvalaraClient client)
Sets the apiClient.
ValidateResult validateAddress(String account, String license, String avalaraClient, String line1, String line2, String line3, String city, String region, String country, String postalCode, String addressCode, int taxRegionId, String latitude, String longitude, TextCaseType textCase, boolean coordinates, boolean taxability, Date date)
Validate Address processor.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private AvalaraClient apiClient

Avalara's application client. By default uses DefaultAvalaraClient class.

private final MapObjectMapper mom

Public Constructors

public AvalaraModule ()

Public Methods

public CancelTaxResult cancelTax (String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, CancelCodeType cancelCode)

Cancel tax, indicating the document that should be cancelled and the reason for the operation.

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
docId The original document's type, such as Sales Invoice or Purchase Invoice.
companyCode Client application company reference code. If docId is specified, this is not needed.
docType The document type specifies the category of the document and affects how the document is treated after a tax calculation; see AvalaraDocumentType for more information about the specific document types.
docCode The internal reference code used by the client application.
cancelCode A code indicating the reason the document is getting canceled.
Returns

public CommitTaxResult commitTax (String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, String newDocCode)

Commit Tax processor

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
docId The original document's type, such as Sales Invoice or Purchase Invoice.
companyCode Client application company reference code. If docId is specified, this is not needed.
docType The document type specifies the category of the document and affects how the document is treated after a tax calculation; see AvalaraDocumentType for more information about the specific document types.
docCode The internal reference code used by the client application.
newDocCode The new document code value.
Returns

public GetTaxResult getTax (String account, String license, String avalaraClient, String companyCode, AvalaraDocumentType docType, String docCode, Date docDate, String salespersonCode, String customerCode, String customerUsageType, String discount, String purchaseOrderNo, String exemptionNo, String originCode, String destinationCode, List<Map<String, Object>> baseAddresses, List<Map<String, Object>> lines, DetailLevelType detailLevel, String referenceCode, String locationCode, boolean commit, String batchCode, Map<String, Object> taxOverride, String currencyCode, ServiceModeType serviceMode, Date paymentDate, String exchangeRate, Date exchangeRateEffDate)

Get Tax processor.

The Get Tax operation calculates tax for one or more invoiced items and displays details describing the calculation of tax for each line item.

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
companyCode Client application company reference code
docType The document type specifies the category of the document and affects how the document is treated after a tax calculation; see AvalaraDocumentType for more information about the specific document types.
docCode The internal reference code used by the client application.
docDate Date of invoice, purchase order, etc.
salespersonCode The client application salesperson reference code.
customerCode Client application customer reference code
customerUsageType Client application customer or usage type. CustomerUsageType determines the exempt status of the transaction based on the exemption tax rules for the jurisdictions involved. CustomerUsageType may also be set at the line item level.

The standard values for the CustomerUsageType (A-L).
A Federal Government
B State/Local Govt.
C Tribal Government
D Foreign Diplomat
E Charitable Organization
F Religious/Education
G Resale
H Agricultural Production
I Industrial Prod/Mfg.
J Direct Pay Permit
K Direct Mail
L - Other

discount The discount amount to apply to the document. The string represents a BigDecimal.
purchaseOrderNo Purchase order identifier. PurchaseOrderNo is required for single use exemption certificates to match the order and invoice with the certificate.
exemptionNo Exemption number used for this transaction
originCode Code that refers one of the address of the baseAddress collection. It has to be the same code of one of the address's addressCode. It represents the origin address.
destinationCode Code that refers one of the address of the baseAddress collection. It has to be the same code of one of the address's addressCode. It represents the destination address.
baseAddresses Collection of physical addresses that will be referred to as the destination or origination of 1 or more invoice line entries
lines Collection of invoice lines requiring tax calculation
detailLevel Specifies the level of tax detail to return
referenceCode For returns (see AvalaraDocumentType), refers to the getDocCode() of the original invoice.
locationCode Location Code value. It is Also referred to as a Store Location, Outlet Id, or Outlet code is a number assigned by the State which identifies a Store location. Some state returns require taxes are broken out separately for Store Locations.
commit Commit flag. If Commit is set to true, tax for the transaction is saved, posted and committed as tax document.
batchCode The batchCode value.
taxOverride Indicates to apply tax override to the document.
currencyCode It is 3 character ISO 4217 currency code.
serviceMode This is only supported by AvaLocal servers. It provides the ability to controls whether tax is calculated locally or remotely when using an AvaLocal server. The default is Automatic which calculates locally unless remote is necessary for non-local addresses.
paymentDate The date on which payment was made.
exchangeRate The exchange rate value. The string represents a BigDecimal
exchangeRateEffDate The exchange rate effective date value.
Returns

public GetTaxHistoryResult getTaxHistory (String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, DetailLevelType detailLevel)

Get Tax History processor

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
docId The original document's type, such as Sales Invoice or Purchase Invoice.
companyCode Client application company reference code. If docId is specified, this is not needed.
docType The document type specifies the category of the document and affects how the document is treated after a tax calculation; see AvalaraDocumentType for more information about the specific document types.
docCode The internal reference code used by the client application.
detailLevel Specifies the level of detail to return. See DetailLevelType.
Returns

public void init ()

public PingResult ping (String account, String license, String avalaraClient, String message)

Parameters
account
license
avalaraClient
message

public PostTaxResult postTax (String account, String license, String avalaraClient, String docId, String companyCode, AvalaraDocumentType docType, String docCode, Date docDate, String totalAmount, String totalTax, boolean commit, String newDocCode)

Post Tax processor

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
docId The original document's type, such as Sales Invoice or Purchase Invoice.
companyCode Client application company reference code. If docId is specified, this is not needed.
docType The document type specifies the category of the document and affects how the document is treated after a tax calculation; see AvalaraDocumentType for more information about the specific document types.
docCode The internal reference code used by the client application.
docDate The date on the invoice, purchase order, etc
totalAmount The total amount (not including tax) for the document. This is used for verification and reconciliation. This should be the TotalAmount returned by GetTaxResult when tax was calculated for this document; otherwise the web service will return an error. The string represents a BigDecimal
totalTax The total tax for the document. This is used for verification and reconciliation. This should be the TotalTax returned by GetTaxResult when tax was calculated for this document; otherwise the web service will return an error. The string represents a BigDecimal
commit The commit value. This has been defaulted to false. If this has been set to true AvaTax will commit the document on this call. Seller's system who wants to Post and Commit the document on one call should use this flag.
newDocCode The new document code value.
Returns

public void setClient (AvalaraClient client)

Sets the apiClient.

Parameters
client

public ValidateResult validateAddress (String account, String license, String avalaraClient, String line1, String line2, String line3, String city, String region, String country, String postalCode, String addressCode, int taxRegionId, String latitude, String longitude, TextCaseType textCase, boolean coordinates, boolean taxability, Date date)

Validate Address processor.

This operation validates the supplied address, returning canonical form and additional delivery details if successfully validated.

Parameters
account Avalara's account
license Avalara's license
avalaraClient Avalara's client
line1 Address line 1
line2 Address line 2
line3 Address line 3
city City name. Required, when PostalCode is not specified.
region State or region name. Requirad, when PostalCode is not specified.
country Country code
postalCode Postal or ZIP code. Required, when City and Region are not specified
addressCode The address code.
taxRegionId The tax region id.
latitude Latitude.
longitude Longitude.
textCase The casing to apply to the validated address(es).
coordinates True, if you want in the result a not empty latitud and longitude.
taxability True, if you want the valid taxRegionId in the result.
date Date.
Returns