Skip to main content
Avalara Help Center

How do I pass a RESTful GetTaxRequest using XML?

Overview

AvaTax RESTfull web service calls using an XML body is perfectly acceptable as long as you have them formatted correctly. This article will provide you with a typical AvaTax GetTaxRequest body that you can use in your integration.

Environment

REST
AvaTax GetTaxRequest

Resolution

 

Below is an XML body for you to modify to meet your needs.

 

Requirements:

  1. URL should be:  https://development.avalara.net/1.0/tax/get.xml   or https://avatax.avalara.net/1.0/tax/get.xml
  2. Method: POST
  3. Authorization in the Format: "Basic[account number]:[license key]"  encoded to Base64 
    Example: Basic U2FtcGxlQFVzZXIuTmFtZTpFbnRlcl9QYXNzd29yZF9IZXJl
  4. XML Body:

<GetTaxRequest>
 <DocType>SalesOrder</DocType>
 <CompanyCode>YourCompanyCode</CompanyCode>
 <DocDate>2014-09-24</DocDate>
 <DocCode>AB1234567890</DocCode>
 <CustomerCode>ABC123</CustomerCode>
 <Addresses>
  <BaseAddress>
   <AddressCode>001</AddressCode>
   <Line1>100 Ravine Lane</Line1>
   <Line2>Suite 200</Line2>
   <City>Bainbridge Island</City>
   <Region>WA</Region>
   <PostalCode>98110</PostalCode>
   <Country>US</Country>
   <TaxRegionId>0</TaxRegionId>
  </BaseAddress>
  <BaseAddress>
   <AddressCode>002</AddressCode>
   <Line1>5540 Centerview Drive</Line1>
   <Line2/>
   <City>Falls Church</City>
   <Region>VA</Region>
   <PostalCode>22046</PostalCode>
   <Country>US</Country>
   <TaxRegionId>0</TaxRegionId>
  </BaseAddress>
 </Addresses>
 <Lines>
  <Line>
   <LineNo>01</LineNo>
   <OriginCode>001</OriginCode>
   <DestinationCode>002</DestinationCode>
   <ItemCode>SKU001</ItemCode>
   <Qty>1</Qty>
   <Amount>100</Amount>
  </Line>
  <Line>
   <LineNo>02</LineNo>
   <OriginCode>001</OriginCode>
   <DestinationCode>002</DestinationCode>
   <ItemCode>FREIGHT</ItemCode>
   <TaxCode>FR</TaxCode>
   <Qty>10</Qty>
   <Amount>15</Amount>
  </Line>
 </Lines>
</GetTaxRequest>