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 Name | ISC Table.Field | Avalara Element | Notes |
--- | --- | --- | --- |
Order Header | |||
Company Code | Application Setting ='TaxCalculator_Avalara_CompanyCode' Setting = Company Code | ||
Document Type | Static Value = 'SalesOrder' | ||
Document Code | CustomerOrder.OrderNumber | ||
Document Date | CustomerOrder.OrderDate | ||
Customer # | CustomerOrder. CustomerNumber | ||
Discount | CustomerOrder.PromotionOrderDiscountTotal + CustomerOrder.Promotion.ShippingDiscountTotal | ||
Order Lines | |||
Line Discounted | |||
Line # | OrderLine.Line | ||
ERP Item # | OrderLine.ProductName | ||
QTY Ordered | OrderLine.QtyOrdered | ||
Extended Price | OrderLine.ExtendedActualPrice | ||
Tax Code | OrderLine.TaxCode1 | ||
Description | Product.ShortDescription | ||
Order Line - Freight (Created if Freight is Applied to Order) | |||
Line Discounted | CustomerOrder. PromotionShippingDiscountTotal | ||
Line # | StaticValue ='Freight' | ||
ERP Item # | StaticValue ='Freight' | ||
QTY Ordered | StaticValue ='1' | ||
Extended Price | CustomerOrder.FullShippingCharge - CustomerOrder. PromotionShippingDiscountTotal | ||
Tax Code | Application Setting ='TaxCalculator_Avalara_FreightTaxCode' | ||
Description | Product.ShortDescription | ||
Origin Address | |||
Address Line 1 | Warehouse.Address1 | FOR Warehouse.* JOIN CustomerOrder.Warehouse = Warehouse.Name NOTE: Dependent on 'User Order Warehouse for Tax Origin Address' | |
Address Line 2 | Warehouse.Address2 | ||
City | Warehouse.City | ||
State | Warehouse.State | ||
Zip | Warehouse.Zip | ||
Country | Warehouse.ShipSite | ||
Destination Address | |||
Address Line 1 | CustomerOrder.STAddress1 | IF Ship Via = Store Pick-Up THEN Replicate Origin Address in Destination Address ELSE use CustomerOrder.ST* | |
Address Line 2 | CustomerOrder.STAddress2 | ||
Address Line 3 | CustomerOrder.STAddress3 | ||
City | CustomerOrder.STCity | ||
State | CustomerOrder.STState | ||
Zip | CustomerOrder.STZip | ||
Country | CustomerOrder.STCountry |