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

Avalara tax calculation API call

Describes the Avalara tax calculation API call elements in Optimizely Configured Commerce.

Optimizely Configured Commerce 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 NameTable.FieldAvalara ElementNotes
Order Header
Company Code

Application Setting ='TaxCalculator_Avalara_CompanyCode'

<CompanyCode>
Document TypeStatic Value = 'SalesOrder'<DocType>
Document CodeCustomerOrder.OrderNumber<DocCode>
Document DateCustomerOrder.OrderDate<DocDate>
Customer #CustomerOrder. CustomerNumber<CustomerNumber>
Discount

CustomerOrder.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>