Washington Sales Tax Rate library (source code)

The Washington Sales Tax Rate Library (WSRL) source code provides a sales tax rate lookup feature using the Department of Revenue's downloadable address and rate files. Its purpose is to provide a means of looking up tax rates using our downloadable files and can be used as a starting point for adding destination-based sales tax rate lookups to your application. For web applications such as shopping carts, you will need to develop a rate lookup service or extend the library to use a disk-based indexing scheme.

Requirements

  • The following data files are required:
    • address file
    • ZIP+4 file short version
    • rate file

    Note: These files are available on our Download Sales Tax GIS Data page.

  • NUnit, a test framework used by the library, is also required. NUnit can be downloaded and installed at http://nunit.org/documentation/.

Setup

Follow these steps to add the library to your Microsoft Visual Studio solution:

  1. From the File menu, add the library project to your solution by choosing File->Add->Add Existing Project.
  2. Navigate to the directory containing the WaRateFiles library and select the project file.
  3. In the Solution Explorer, right click on your project and select "Add Reference".
  4. Click on the project tab and add the WaRateFiles project.

To use the rate lookup library in your program, add "using WaRateFiles" to the file header. The rate lookup class is constructed as follows:

RateLookup lookup = new RateLookup(addressfileName, ratefileName, zipfileName, RateLookupEngine.STANDARDIZER, useShortcutEval);

Parameters

addressfileName The path and filename of the address file.
ratefileName The path and filename of the rate file.
zipfileName The path and filename of the ZIP+4 file
RateLookupEngine This enumeration has the values of SCAN, INDEX, or STANDARIZER. For SCAN and INDEX, the input address must be standardized to USPS format.
useShortcutEval If true, the STANDARIZER lookup engine will not fully evaluate an address if all of the data for a ZIP or street have the same location code.

Download WaRateFileLookup

Version 1.05

8/5/2011
Size: 832K

The check for available updated database files is now case insensitive.

Download

 

Version 1.04

8/8/2008
Size: 321K

An optimization was made with the file updates check to reduce the number of calls to the file download page.

Download

 

Version 1.03

7/31/2008
Size: 833K

The service will no longer halt if there is a problem with the update thread contacting the DOR GIS data download web page. ZIP codes of the form "-3" now return invalid argument instead of throwing an exception.

Download

 

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.