Disclaimer: This website requires Please enable JavaScript in your browser settings for the best experience.

Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

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
<CompanyCode>
Document TypeStatic Value = 'SalesOrder'<DocType>
Document CodeCustomerOrder.OrderNumber<DocCode>
Document DateCustomerOrder.OrderDate<DocDate>
Customer #CustomerOrder. CustomerNumber<CustomerNumber>
DiscountCustomerOrder.PromotionOrderDiscountTotal +

CustomerOrder.Promotion.ShippingDiscountTotal
<Discount>
Order Lines
Line Discounted<Discounted>
Line #OrderLine.Line<No>
ERP Item #OrderLine.ProductName<ItemCode>
QTY OrderedOrderLine.QtyOrdered<Qty>
Extended PriceOrderLine.ExtendedActualPrice<Amount>
Tax CodeOrderLine.TaxCode1<TaxCode>
DescriptionProduct.ShortDescription<Description>
Order Line - Freight (Created if Freight is Applied to Order)
Line DiscountedCustomerOrder. PromotionShippingDiscountTotal<Discounted>
Line #StaticValue ='Freight'<No>
ERP Item #StaticValue ='Freight'<ItemCode>
QTY OrderedStaticValue ='1'<Qty>
Extended PriceCustomerOrder.FullShippingCharge - CustomerOrder. PromotionShippingDiscountTotal<Amount>
Tax CodeApplication Setting ='TaxCalculator_Avalara_FreightTaxCode'<TaxCode>
DescriptionProduct.ShortDescription<Description>
Origin Address
Address Line 1Warehouse.Address1<Line1>FOR Warehouse.*

JOIN CustomerOrder.Warehouse = Warehouse.Name



NOTE: Dependent on 'User Order Warehouse for Tax Origin Address'
Address Line 2Warehouse.Address2<Line2>
CityWarehouse.City<City>
StateWarehouse.State<Region>
ZipWarehouse.Zip<PostalCode>
CountryWarehouse.ShipSite<Country>
Destination Address
Address Line 1CustomerOrder.STAddress1<Line1>IF Ship Via = Store Pick-Up

THEN Replicate Origin Address in Destination Address

ELSE use CustomerOrder.ST*
Address Line 2CustomerOrder.STAddress2<Line2>
Address Line 3CustomerOrder.STAddress3<Line3>
CityCustomerOrder.STCity<City>
StateCustomerOrder.STState<Region>
ZipCustomerOrder.STZip<PostalCode>
CountryCustomerOrder.STCountry<Country>