taxQuery
A function which returns an array of tax names corresponding to the work and home addresses.
value = taxQuery ( $work_address, $home_address, $url, $nexus )
- value - A string array result.
- $work_address - A string indicating the employee's workplace address.
- $home_address - A string indicating the employee's residence address.
- $url - A string indicating the location of the Docker TaxQuery container. For example 'https://example.com:8443' or 'localhost:8000'.
- $nexus - A string expression indicating the states where the employer has nexus (loosely, a physical presence, such as office space). This should be in the form of a space-delimited list of 2-letter USPS state abbreviations. For example, 'OH KY PA'. Default value is the workplace state.
For some (especially local) tax jurisdictions, the taxNamesForZip function does not provide enough granularity to precisely identify tax names. For such situations, this function invokes the TaxQuery Docker container, which returns a string array like taxNamesForZip, but with greater precision.
Note: This function requires a running instance of the TaxQuery Docker container:
See the TaxQuery page on the Docker hub for more information.
Once you have a running container, set the $url parameter to the address of your instance. For the docker invocation above, this would be localhost:8000
or http://localhost:8000
.
Example
Get the taxes for an employee based on addresses:
Note: If you are using the demo PHP software or have a Level 1 subscription, this method may return local tax names for Ohio or Pennsylvania which are not included in the taxList() array.