The URL Interface provides a direct access to the Washington Department of Revenue’s address based rate lookup technology platform. Using the URL interface we provide, you can access sales and use tax rate data using address or ZIP + 4 code information and tie the data into your shopping cart checkout process or accounting system in real time. The following information is the technical specifications to access the URL interface.
For technical questions or assistance with these interfaces, please contact our GIS team at email@example.com
1. The rate lookup URL is designed to return the current sales tax rates for an address. It is designed for use by XMLHttpRequest, Msxml2.XMLHTTP, libcurl, wget, HttpRequest, or similar HTTP protocol client. Requests can be made for ether XML or plain text responses.
2. The URL is formated as follows.
http: or https: //<servername>/webapi/AddressRates.aspx?output=&addr=&city=&zip Where <servername> ==> Host name where the service is running <format> ==> Either "xml" or "text". <addr> ==> The street address <city> ==> The city name <zip> ==> The 5 or 9 digit ZIP code. Examples: http://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=xml&addr=6500 Linderson way&city=&zip=98501 http://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=text&addr=6500 Linderson way&city=&zip=985011001 http://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=xml&addr=6500 Linderson way&city=&zip=98501-1001 or https://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=xml&addr=6500 Linderson way&city=&zip=98501 https://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=text&addr=6500 Linderson way&city=&zip=985011001 https://webgis.dor.wa.gov/webapi/AddressRates.aspx?output=xml&addr=6500 Linderson way&city=&zip=98501-1001
3. HTTP Status Codes
The service will normally return a HTTP status code of 200 OK. On internal error, it will return a 500 internal server error.
4. Result Codes
A result code will be returned for both XML and text response formats. The codes are defined as:
0: The address was found. 1: The address was not found, but the ZIP+4 was located. 2: The address was updated and found, the user should validate the address record 3: The address was updated and Zip+4 located, the user should validate the address record 4: The address was corrected and found, the user should validate the address record 5: Neither the address or ZIP+4 was found, but the 5-digit ZIP was located. 6: The address, ZIP+4, and ZIP could not be found. 7: Invalid Latitude/Longitude 9: Internal error
5. Plain Text Response Format
If the format requested is "text", a simple text string will be returned with the following format.
LocationCode=<location code> Rate=<rate> ResultCode=<result code> Where <location code> ==> The four digit DOR location code. <rate> ==> The total state and local tax rate. <result code> ==> The result code described above. Example LocationCode=3406 Rate=0.084 ResultCode=0
6. XML Response Format
Example <?xml version="1.0" encoding="UTF-8" ?> <response loccode="3406" localrate="0.019" rate="0.084" code="0" > <addressline houselow="0" househigh="0" evenodd="0" street="" state="WA" zip="98501" plus4="0000" period="Q22008" code="3406" rta="N" ptba="Thurston PTBA" cez="" /> <rate name="TUMWATER" code="3406" staterate="0.065" localrate="0.019" /> </response> Tags response ==> The response package. addressline ==> The standardized address and attributes located. If "short cut evaluation" is enabled on the server, the address attributes may be blank or zero. rate ==> The tax rate information. <response> Attributes loccode ==> The four digit DOR location code. localrate ==> The local tax rate. rate ==> The combined local and state tax rate. code ==> The result code as defined above. debughint ==> If the code is invalid argument, this attribute may contain information about the cause of the problem (like invalid ZIP). <addressline> Attributes houselow ==> Standardized address low house number. househigh ==> Standardized address high house number. evenodd ==> 'O' or 'E' street ==> Standardized address street. state ==> "WA" zip ==> Standardized address ZIP. plus4 ==> Standardized address ZIP plus four. period ==> Tax period in Q[1-4]YYYY format. code ==> The four digit DOR location code. rta ==> 'Y' or 'N' ptba ==> Public transportation benefit area name. cez ==> Community empowerment zone name. <rate> Attributes name ==> DOR location code name. code ==> The four digit DOR location code. staterate ==> The state portion of the sales tax rate. localrate ==> The local portion of the sales tax rate.
7. C# Example Call
WebClient wc = new WebClient() string urlPrefix = protocol + "://" + server + ":" + port.ToString() + "/AddressRates.aspx?format=xml"; string uri = urlPrefix + "&addr=" + UrlEncode(street) + "&city=" + UrlEncode(city) + "&zip=" + zip.ToString(); StreamReader reader = new StreamReader(wc.OpenRead(uri)); string xml = reader.ReadToEnd(); reader.Close(); // Now parse the XML // ...