Area: Optimizely B2B Commerce

Avalara Tax calculation API call

Recommended reading 

Method: Real-time call Avalara API

ISC 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 B2B 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 Name ISC Table.Field Avalara Element Notes
Order Header
Company Code

Application Setting ='TaxCalculator_Avalara_CompanyCode'

Setting = Company Code

Document Type Static Value = 'SalesOrder' <DocType>
Document Code CustomerOrder.OrderNumber <DocCode>
Document Date CustomerOrder.OrderDate <DocDate>
Customer # CustomerOrder. CustomerNumber <CustomerNumber>

CustomerOrder.PromotionOrderDiscountTotal +


Order Lines
Line Discounted <Discounted>
Line # OrderLine.Line <No>
ERP Item # OrderLine.ProductName <ItemCode>
QTY Ordered OrderLine.QtyOrdered <Qty>
Extended Price OrderLine.ExtendedActualPrice <Amount>
Tax Code OrderLine.TaxCode1 <TaxCode>
Description Product.ShortDescription <Description>
Order Line - Freight (Created if Freight is Applied to Order)
Line Discounted CustomerOrder. PromotionShippingDiscountTotal <Discounted>
Line # StaticValue ='Freight' <No>
ERP Item # StaticValue ='Freight' <ItemCode>
QTY Ordered StaticValue ='1' <Qty>
Extended Price CustomerOrder.FullShippingCharge - CustomerOrder. PromotionShippingDiscountTotal <Amount>
Tax Code Application Setting ='TaxCalculator_Avalara_FreightTaxCode' <TaxCode>
Description Product.ShortDescription <Description>
Origin Address
Address Line 1 Warehouse.Address1 <Line1>

FOR Warehouse.*

JOIN CustomerOrder.Warehouse = Warehouse.Name

NOTE: Dependent on 'User Order Warehouse for Tax Origin Address'

Address Line 2 Warehouse.Address2 <Line2>
City Warehouse.City <City>
State Warehouse.State <Region>
Zip Warehouse.Zip <PostalCode>
Country Warehouse.ShipSite <Country>
Destination Address
Address Line 1 CustomerOrder.STAddress1 <Line1>

IF Ship Via = Store Pick-Up

THEN Replicate Origin Address in Destination Address

ELSE use CustomerOrder.ST*

Address Line 2 CustomerOrder.STAddress2 <Line2>
Address Line 3 CustomerOrder.STAddress3 <Line3>
City CustomerOrder.STCity <City>
State CustomerOrder.STState <Region>
Zip CustomerOrder.STZip <PostalCode>
Country CustomerOrder.STCountry <Country>
Do you find this information helpful? Please log in to provide feedback.

Last updated: Dec 11, 2020

Recommended reading