---
title: Avalara tax calculation API call
slug: configured-commerce/sdk/avalara-tax-calculation-api-call
docTags: 
createdAt: 2026-08-05T19:24:02.747Z
---

Optimizely \{user\["product-name"]} 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 \{user\["product-name"]} 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                                                    | Table.Field                                                                                    | Avalara Element   | Notes                                                                                                                                         |
| **Order Header**                                              |                                                                                                |                   |                                                                                                                                               |
| Company Code                                                  | Application Setting ='TaxCalculator\_Avalara\_CompanyCode'                                     | \<CompanyCode>    |                                                                                                                                               |
| Document Type                                                 | Static Value = 'SalesOrder'                                                                    | \<DocType>        |                                                                                                                                               |
| Document Code                                                 | CustomerOrder.OrderNumber                                                                      | \<DocCode>        |                                                                                                                                               |
| Document Date                                                 | CustomerOrder.OrderDate                                                                        | \<DocDate>        |                                                                                                                                               |
| Customer #                                                    | CustomerOrder. CustomerNumber                                                                  | \<CustomerNumber> |                                                                                                                                               |
| Discount                                                      | CustomerOrder.PromotionOrderDiscountTotal +<br />CustomerOrder.Promotion.ShippingDiscountTotal | \<Discount>       |                                                                                                                                               |
| **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.\*<br />JOIN CustomerOrder.Warehouse = Warehouse.Name<br />**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<br />THEN Replicate Origin Address in Destination Address<br />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>        |                                                                                                                                               |
