Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Avalara Tax calculation API call

This topic provides an overview of the Avalara API used to display a tax quote to the user before finalizing their checkout process.

Method: Real-time call Avalara API

Optimizely will make a real-time call to the Avalara API during the transition between the Addresses Page to the Review and Pay Page, but only if the Order Simulation call is bypassed or not made. This will allow Configured Commerce to display a tax quote to the user before finalizing their checkout process. The call to Avalara will only be a quote call; nothing will be written into the Avalara system.

Field Mapping: Avalara SOAP TaxSvc.GetTax API - Request
Field NameISC Table.FieldAvalara ElementNotes
------------
Order Header
Company CodeApplication Setting ='TaxCalculator_Avalara_CompanyCode'

Setting = Company Code
Document TypeStatic Value = 'SalesOrder'
Document CodeCustomerOrder.OrderNumber
Document DateCustomerOrder.OrderDate
Customer #CustomerOrder. CustomerNumber
DiscountCustomerOrder.PromotionOrderDiscountTotal +

CustomerOrder.Promotion.ShippingDiscountTotal
Order Lines
Line Discounted
Line #OrderLine.Line
ERP Item #OrderLine.ProductName
QTY OrderedOrderLine.QtyOrdered
Extended PriceOrderLine.ExtendedActualPrice
Tax CodeOrderLine.TaxCode1
DescriptionProduct.ShortDescription
Order Line - Freight (Created if Freight is Applied to Order)
Line DiscountedCustomerOrder. PromotionShippingDiscountTotal
Line #StaticValue ='Freight'
ERP Item #StaticValue ='Freight'
QTY OrderedStaticValue ='1'
Extended PriceCustomerOrder.FullShippingCharge - CustomerOrder. PromotionShippingDiscountTotal
Tax CodeApplication Setting ='TaxCalculator_Avalara_FreightTaxCode'
DescriptionProduct.ShortDescription
Origin Address
Address Line 1Warehouse.Address1FOR Warehouse.*

JOIN CustomerOrder.Warehouse = Warehouse.Name



NOTE: Dependent on 'User Order Warehouse for Tax Origin Address'
Address Line 2Warehouse.Address2
CityWarehouse.City
StateWarehouse.State
ZipWarehouse.Zip
CountryWarehouse.ShipSite
Destination Address
Address Line 1CustomerOrder.STAddress1IF Ship Via = Store Pick-Up

THEN Replicate Origin Address in Destination Address

ELSE use CustomerOrder.ST*
Address Line 2CustomerOrder.STAddress2
Address Line 3CustomerOrder.STAddress3
CityCustomerOrder.STCity
StateCustomerOrder.STState
ZipCustomerOrder.STZip
CountryCustomerOrder.STCountry