Woocommerce-services: City Tax rate not getting calculated

Created on 28 Mar 2018  路  19Comments  路  Source: Automattic/woocommerce-services

1047195-zd-woothemes

City Tax rate not getting calculated with automated tax.

  1. Set up automated taxes for, say, Springdale, Arkansas 72764
  2. check out a product also in Springdale. The combined state, county and city tax should be a 9.75%, but only showing 7.5%

{"from_country":"US","from_state":"AR","from_city":"Springdale","from_zip":"72764","to_country":"US","to_state":"AR","to_city":"Springdale","to_zip":"72764","shipping":"0.00","line_items":[{"id":"588-daca41214b39c5dc66674d09081940f0","quantity":1,"product_tax_code":"","unit_price":"60.00","discount":"0"}],"plugin":"woo"}

Response:

{"order_total_amount":60.0,"shipping":0.0,"taxable_amount":60.0,"amount_to_collect":4.5,"rate":0.075,"has_nexus":true,"freight_taxable":true,"tax_source":"destination","breakdown":{"taxable_amount":60.0,"tax_collectable":4.5,"combined_tax_rate":0.075,"state_taxable_amount":60.0,"state_tax_rate":0.065,"state_tax_collectable":3.9,"county_taxable_amount":60.0,"county_tax_rate":0.01,"county_tax_collectable":0.6,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_tax_collectable":0.0,"special_district_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_tax_collectable":0.0,"shipping":{"taxable_amount":0.0,"tax_collectable":0.0,"combined_tax_rate":0.075,"state_taxable_amount":0.0,"state_sales_tax_rate":0.065,"state_amount":0.0,"county_taxable_amount":0.0,"county_tax_rate":0.01,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_amount":0.0},"line_items":[{"id":"588-daca41214b39c5dc66674d09081940f0","taxable_amount":60.0,"tax_collectable":4.5,"combined_tax_rate":0.075,"state_taxable_amount":60.0,"state_sales_tax_rate":0.065,"state_amount":3.9,"county_taxable_amount":60.0,"county_tax_rate":0.01,"county_amount":0.6,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_district_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_amount":0.0}]}}} (WCS Tax)

Taxes

Most helpful comment

@iMazed @billrobbins We got clarification from TaxJar.

Colorado has "Home Rule" jurisdictions. That means that merchants will only need to pay city tax if the destination address is also in their same home rule jurisdiction. So, for example:

  • A merchant has an economic Nexus in Louisville, CO. He gets an order from Denver, CO. Denver and Louisville are in different Home Rule jurisdictions, so that order doesn't have city tax.
  • A merchant has an economic Nexus in Louisville, CO. He gets an order from Louisville, CO. That order does have city tax, and that tax will be collected directly by the city, not the state.
  • A merchant has an economic nexus in San Francisco, CA. He gets an order from Louisville, CO. That order doesn't have city tax (or any kind of tax, really).
  • A merchant has an economic nexus in San Francisco, CA. He also has a lot of clients from Colorado, so he has also an economic nexus in Colorado as a whole. He gets an order from Louisville, CO. That order doesn't have city tax.

So, the TaxJat demo calculator can't account for these cases, because it doesn't allow to specify the origin address. But what the API (and our plugin) is returning is indeed correct. Hope that helps :)

All 19 comments

Looks like a solution is being tested by the TaxJar folks: https://github.com/taxjar/taxjar-woocommerce-plugin/pull/33

Another report of this in 1270326-zd-woothemes fwiw. Looks like the fix is merged into master over there in TaxJar land, so hopefully the fix will be rolled out soon :)

@dsmithweb, the original PR was closed without being merged - the current work is being done here: https://github.com/taxjar/taxjar-woocommerce-plugin/pull/75

The City Tax rate not getting calculated is affecting me too and I cannot use auto calculations as it's pulling the wrong tax rate for my base location. I had to revert to manual calculations for my city but if/when the full US tax in every state goes into effect I will need to open a TaxJar account and revert back to auto. I hope this gets fixed soon.

Bounce...

One more report - 1560593 zen.

I checked this on my test site with Louisville 80027 both as the shop address and the billing address. I've got a total of 4%.

screenshot Image Link: http://cld.wthms.co/AtU6yO

screenshot Image Link: http://cld.wthms.co/NVfYDf

According to this and confirmed by this I'm guessing that the Colorado and District taxes are there but the county and city tax rates are omitted:

screenshot Image Link: http://cld.wthms.co/9je6jF

We chatted with @marcinbot and he suggested adding an actual Louisville address (I used 141-299 Polk Ave) but that didn't help on both mine and Marcin's test sites.

So it seems that not only the city tax, but the county tax might not be working.

Another report of a different location but same issue: 1666995-zen

Sales tax calculator gives the following taxes, for Arvada 80003 US:

CO STATE | 2.900%
JEFFERSON COUNTY | 0.500%
ARVADA | 3.460%
DISTRICT(S) | 1.100%
Total Sales Tax Rate: 7.960%

But in WooCommerce we only get a total tax rate of 4%, which is State + District Tax. County tax and city tax are not included. If we have a look at the log we see the following request and reply:

12-31-2018 @ 10:58:17 - :::: TaxJar Plugin requested :::: (WCS Tax)
12-31-2018 @ 10:58:17 - :::: TaxJar API called :::: (WCS Tax)
12-31-2018 @ 10:58:17 - Requesting: taxjar/v2/taxes - {"from_country":"US","from_state":"CO","from_zip":"80117","from_city":"Kiowa","from_street":"Street","to_country":"US","to_state":"CO","to_zip":"80003","to_city":"Arvada","to_street":"7220 W 61st Ave","shipping":"5.00","plugin":"woo","line_items":[{"id":"7-8f14e45fceea167a5a36dedd4bea2543","quantity":1,"product_tax_code":"","unit_price":"10","discount":"0"}]} (WCS Tax)
12-31-2018 @ 10:58:18 - Received: {"tax":{"order_total_amount":15.0,"shipping":5.0,"taxable_amount":15.0,"amount_to_collect":0.6,"rate":0.04,"has_nexus":true,"freight_taxable":true,"tax_source":"modified-origin","jurisdictions":{"country":"US","state":"CO","county":"JEFFERSON","city":"ARVADA"},"breakdown":{"taxable_amount":15.0,"tax_collectable":0.6,"combined_tax_rate":0.04,"state_taxable_amount":15.0,"state_tax_rate":0.029,"state_tax_collectable":0.44,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_tax_collectable":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_tax_collectable":0.0,"special_district_taxable_amount":15.0,"special_tax_rate":0.011,"special_district_tax_collectable":0.17,"shipping":{"taxable_amount":5.0,"tax_collectable":0.2,"combined_tax_rate":0.04,"state_taxable_amount":5.0,"state_sales_tax_rate":0.029,"state_amount":0.15,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_taxable_amount":5.0,"special_tax_rate":0.011,"special_district_amount":0.06},"line_items":[{"id":"7-8f14e45fceea167a5a36dedd4bea2543","taxable_amount":10.0,"tax_collectable":0.4,"combined_tax_rate":0.04,"state_taxable_amount":10.0,"state_sales_tax_rate":0.029,"state_amount":0.29,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_district_taxable_amount":10.0,"special_tax_rate":0.011,"special_district_amount":0.11}]}}} (WCS Tax)

In the reply we can see it did detect the right location:

"jurisdictions":{"country":"US","state":"CO","county":"JEFFERSON","city":"ARVADA"}

But the tax rates don't match the calculator:

"state_tax_rate":0.029
"county_tax_rate":0.0
"city_tax_rate":0.0
"special_tax_rate":0.011
"combined_tax_rate":0.04

@jeffstieler Is this an issue with the rates being returned from TaxJar? Should it be reported there directly? It doesn't seem like it's being addressed by any of the previous issues which were linked here.

I had a look at the issues listed here and found the following:

The initial issue by @yukikatayama of Springdale, AR tax rates has been fixed when we added street-level accuracy and the taxes from AR to AR are now 9.75%.

The issues reported by @grigorijurasov and @mikkamp both relate to the state of Colorado. I ran the original plugin and raw requests to the API and they also returned tax rates only for state+special. But then I had a look at https://www.taxjar.com/states/colorado-sales-tax-online/#how-to-register-for-a-sales-tax-permit-in-colorado which mentions:

Colorado is divided into districts. If you make a sale to someone in your district, you collect the full combined sales tax rate at your buyer鈥檚 ship to address.

Which seems to imply that if the seller and customer are located in different districts then the county+city rates do not apply. I checked and if the same postcode is used then the plugin does return all the rates (state, county, city, special) as expected. Also this seems to have been fixed since @grigorijurasov's report where we tested with the same postcode.

So this seems to have been fixed for AR and by design for CO. I'm going to close this, but feel free reopen or create a new issue if needed.

We had a user in the WP.org forum reporting that local taxes were not being collected properly in Colorado.

@shaunkuschel and I ran some tests on my test site to see if we could reproduce it. What we discovered was whenever someone makes a purchase from the same location in Colorado, the state tax in the Standard Rates table would reset and no city tax would be added.

Here is the rate after a Denver to Denver calculation:

Denver Only

This is what happens a quote to Louisville, CO
Louisville

Neither one pulled local rates. For Denver it should be:

TaxJar Denver Rates

The only way we could get accurate calculations was to manually add in Denver. After that the calculation there was correct:

Manual Denver Tax

Checkout to Denver


These tests were run with:

  • Jetpack 6.9
  • WooCommerce 3.5.3
  • WooCommerce Services 1.18.0

Looks like the issue is in TaxJar's API logic. For this API request:

POST https://api.taxjar.com/v2/taxes
{
    "from_country":"US",
    "from_state":"CO",
    "from_zip":"80027",
    "from_city":"Louisville",
    "to_country":"US",
    "to_state":"CO",
    "to_zip":"80212",
    "to_city":"Denver",
    "shipping":"9.99",
    "plugin":"woo",
    "line_items":[{"id":"28-3ba078c0b65793fa4fd1dba24b21c5c8","quantity":1,"product_tax_code":"","unit_price":"18","discount":"0"}]
}

I'm getting this response:

{ tax:
   { order_total_amount: 27.99,
     shipping: 9.99,
     taxable_amount: 27.99,
     amount_to_collect: 1.12,
     rate: 0.04,
     has_nexus: true,
     freight_taxable: true,
     tax_source: 'destination',
     jurisdictions: { country: 'US', state: 'CO', county: 'DENVER', city: 'DENVER' },
     breakdown:
      { taxable_amount: 27.99,
        tax_collectable: 1.12,
        combined_tax_rate: 0.04,
        state_taxable_amount: 27.99,
        state_tax_rate: 0.029,
        state_tax_collectable: 0.81,
        county_taxable_amount: 0,
        county_tax_rate: 0,
        county_tax_collectable: 0,
        city_taxable_amount: 0,
        city_tax_rate: 0,
        city_tax_collectable: 0,
        special_district_taxable_amount: 27.99,
        special_tax_rate: 0.011,
        special_district_tax_collectable: 0.31,
        shipping: [Object],
        line_items: [Array] } } }

Note that the city_tax_rate is set to 0%. Somehow, TaxJar's own "sales tax calculator" is returning different results than their API.

I've sent them an email, I'll update this issue as soon as they reply.

Hey @DanReyLop, did you get a response yet? We've had another report from a user (1756083-zen) mentioning the same issue.

@iMazed I got a reponse, but we couldn't make heads or tails of it :(
The reply and discussion is here: p7bbVw-2Xp-p2

We have a call next Tuesday with TaxJar, we'll get this issue clarified then.

The gist of the problem is the new Colorado tax laws, and that you need to declare city tax to each jurisdiction individualy, and that's not something TaxJar is equipped to do at this moment. But I'll get a concrete response and best way to proceed next Tuesday.

@iMazed @billrobbins We got clarification from TaxJar.

Colorado has "Home Rule" jurisdictions. That means that merchants will only need to pay city tax if the destination address is also in their same home rule jurisdiction. So, for example:

  • A merchant has an economic Nexus in Louisville, CO. He gets an order from Denver, CO. Denver and Louisville are in different Home Rule jurisdictions, so that order doesn't have city tax.
  • A merchant has an economic Nexus in Louisville, CO. He gets an order from Louisville, CO. That order does have city tax, and that tax will be collected directly by the city, not the state.
  • A merchant has an economic nexus in San Francisco, CA. He gets an order from Louisville, CO. That order doesn't have city tax (or any kind of tax, really).
  • A merchant has an economic nexus in San Francisco, CA. He also has a lot of clients from Colorado, so he has also an economic nexus in Colorado as a whole. He gets an order from Louisville, CO. That order doesn't have city tax.

So, the TaxJat demo calculator can't account for these cases, because it doesn't allow to specify the origin address. But what the API (and our plugin) is returning is indeed correct. Hope that helps :)

Thanks for following up on this, @DanReyLop!

I just tested this with current versions of WP (5.0.3), WC (3.5.4), and Services (1.18.0), using Denver, CO 80202 as both my store location and shipping destination, but I still only see a state tax of 4% being applied- nothing for City (either in taxable amount or tax rate).

I also used real addresses (from hotels) to test this, that were only 2 blocks apart, to help ensure they are in the same jurisdiction:

1450 Glenarm Pl, Denver, CO 80202
1550 Court Pl, Denver, CO 80202


(Link to screenshot: http://cld.wthms.co/hm9KPe+)

Here are my settings:

General:


(Link to screenshot: http://cld.wthms.co/9yFQX1+)

Tax:


(Link to screenshot: http://cld.wthms.co/Db5tga+)

Checkout:


(Link to screenshot: http://cld.wthms.co/fcVPIt+)

And here are the logs:

02-06-2019 @ 19:05:11 - :::: TaxJar Plugin requested :::: (WCS Tax)
02-06-2019 @ 19:05:11 - :::: TaxJar API called :::: (WCS Tax)
02-06-2019 @ 19:05:11 - Requesting: taxjar/v2/taxes - {"from_country":"US","from_state":"CO","from_zip":"80202","from_city":"Denver","from_street":"1550 Court Pl","to_country":"US","to_state":"CO","to_zip":"80202","to_city":"Denver","to_street":"1450 Glenarm Pl","shipping":"0.00","plugin":"woo","line_items":[{"id":"54-a684eceee76fc522773286a895bc8436","quantity":5,"product_tax_code":"","unit_price":"20.00","discount":"0"}]} (WCS Tax)
02-06-2019 @ 19:05:12 - Received: {"tax":{"order_total_amount":100.0,"shipping":0.0,"taxable_amount":100.0,"amount_to_collect":4.0,"rate":0.04,"has_nexus":true,"freight_taxable":true,"tax_source":"destination","jurisdictions":{"country":"US","state":"CO","county":"DENVER","city":"DENVER"},"breakdown":{"taxable_amount":100.0,"tax_collectable":4.0,"combined_tax_rate":0.04,"state_taxable_amount":100.0,"state_tax_rate":0.029,"state_tax_collectable":2.9,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_tax_collectable":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_tax_collectable":0.0,"special_district_taxable_amount":100.0,"special_tax_rate":0.011,"special_district_tax_collectable":1.1,"shipping":{"taxable_amount":0.0,"tax_collectable":0.0,"combined_tax_rate":0.04,"state_taxable_amount":0.0,"state_sales_tax_rate":0.029,"state_amount":0.0,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_taxable_amount":0.0,"special_tax_rate":0.011,"special_district_amount":0.0},"line_items":[{"id":"54-a684eceee76fc522773286a895bc8436","taxable_amount":100.0,"tax_collectable":4.0,"combined_tax_rate":0.04,"state_taxable_amount":100.0,"state_sales_tax_rate":0.029,"state_amount":2.9,"county_taxable_amount":0.0,"county_tax_rate":0.0,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.0,"city_amount":0.0,"special_district_taxable_amount":100.0,"special_tax_rate":0.011,"special_district_amount":1.1}]}}} (WCS Tax)
02-06-2019 @ 19:05:12 - :: Tax Rate Found :: (WCS Tax)
02-06-2019 @ 19:05:12 - {"9":{"rate":4,"label":"CO Tax","shipping":"yes","compound":"no"}} (WCS Tax)
02-06-2019 @ 19:05:12 - :: Updating Tax Rate To :: (WCS Tax)
02-06-2019 @ 19:05:12 - {"tax_rate_country":"US","tax_rate_state":"CO","tax_rate_name":"CO Tax","tax_rate_priority":1,"tax_rate_compound":false,"tax_rate_shipping":1,"tax_rate":4,"tax_rate_class":""} (WCS Tax)
02-06-2019 @ 19:05:12 - Tax Rate ID Set for 9 (WCS Tax)
02-06-2019 @ 19:05:12 - :: Tax Rate Found :: (WCS Tax)
02-06-2019 @ 19:05:12 - {"9":{"rate":4,"label":"CO Tax","shipping":"yes","compound":"no"}} (WCS Tax)
02-06-2019 @ 19:05:12 - :: Updating Tax Rate To :: (WCS Tax)
02-06-2019 @ 19:05:12 - {"tax_rate_country":"US","tax_rate_state":"CO","tax_rate_name":"CO Tax","tax_rate_priority":1,"tax_rate_compound":false,"tax_rate_shipping":1,"tax_rate":4,"tax_rate_class":""} (WCS Tax)
02-06-2019 @ 19:05:12 - Tax Rate ID Set for 9 (WCS Tax)

It looks like the 'State' tax rate of 2.9% and the 'Special District' tax rate of 1.1% are correct (totaling 4%), but the Denver city rate of 4.31% isn't being included and the logs just show "city_taxable_amount":0.0,"city_tax_rate":0.0,"city_tax_collectable":0.0.

I also did testing with real addresses from Springdale, Arkansas 72764 (the original report at the top of this issue), but that location correctly calculates the city tax when real addresses are used (with the same approach I took above in Denver using hotel addresses). Here are the logs for that:

02-06-2019 @ 18:53:03 - :::: TaxJar Plugin requested :::: (WCS Tax)
02-06-2019 @ 18:53:03 - :::: TaxJar API called :::: (WCS Tax)
02-06-2019 @ 18:53:03 - Requesting: taxjar/v2/taxes - {"from_country":"US","from_state":"AR","from_zip":"72762","from_city":"Springdale","from_street":"1043 Rieff St","to_country":"US","to_state":"AR","to_zip":"72762","to_city":"Springdale","to_street":"1056 Rieff St","shipping":"0.00","plugin":"woo","line_items":[{"id":"54-a684eceee76fc522773286a895bc8436","quantity":5,"product_tax_code":"","unit_price":"20.00","discount":"0"}]} (WCS Tax)
02-06-2019 @ 18:53:03 - Received: {"tax":{"order_total_amount":100.0,"shipping":0.0,"taxable_amount":100.0,"amount_to_collect":9.75,"rate":0.0975,"has_nexus":true,"freight_taxable":true,"tax_source":"destination","jurisdictions":{"country":"US","state":"AR","county":"WASHINGTON","city":"SPRINGDALE"},"breakdown":{"taxable_amount":100.0,"tax_collectable":9.75,"combined_tax_rate":0.0975,"state_taxable_amount":100.0,"state_tax_rate":0.065,"state_tax_collectable":6.5,"county_taxable_amount":100.0,"county_tax_rate":0.0125,"county_tax_collectable":1.25,"city_taxable_amount":100.0,"city_tax_rate":0.02,"city_tax_collectable":2.0,"special_district_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_tax_collectable":0.0,"shipping":{"taxable_amount":0.0,"tax_collectable":0.0,"combined_tax_rate":0.0975,"state_taxable_amount":0.0,"state_sales_tax_rate":0.065,"state_amount":0.0,"county_taxable_amount":0.0,"county_tax_rate":0.0125,"county_amount":0.0,"city_taxable_amount":0.0,"city_tax_rate":0.02,"city_amount":0.0,"special_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_amount":0.0},"line_items":[{"id":"54-a684eceee76fc522773286a895bc8436","taxable_amount":100.0,"tax_collectable":9.75,"combined_tax_rate":0.0975,"state_taxable_amount":100.0,"state_sales_tax_rate":0.065,"state_amount":6.5,"county_taxable_amount":100.0,"county_tax_rate":0.0125,"county_amount":1.25,"city_taxable_amount":100.0,"city_tax_rate":0.02,"city_amount":2.0,"special_district_taxable_amount":0.0,"special_tax_rate":0.0,"special_district_amount":0.0}]}}} (WCS Tax)
02-06-2019 @ 18:53:03 - :: Tax Rate Found :: (WCS Tax)
02-06-2019 @ 18:53:03 - {"10":{"rate":7.5,"label":"AR Tax","shipping":"yes","compound":"no"}} (WCS Tax)
02-06-2019 @ 18:53:03 - :: Updating Tax Rate To :: (WCS Tax)
02-06-2019 @ 18:53:03 - {"tax_rate_country":"US","tax_rate_state":"AR","tax_rate_name":"AR Tax","tax_rate_priority":1,"tax_rate_compound":false,"tax_rate_shipping":1,"tax_rate":9.75,"tax_rate_class":""} (WCS Tax)
02-06-2019 @ 18:53:03 - Tax Rate ID Set for 10 (WCS Tax)
02-06-2019 @ 18:53:03 - :: Tax Rate Found :: (WCS Tax)
02-06-2019 @ 18:53:03 - {"10":{"rate":9.75,"label":"AR Tax","shipping":"yes","compound":"no"}} (WCS Tax)
02-06-2019 @ 18:53:03 - :: Updating Tax Rate To :: (WCS Tax)
02-06-2019 @ 18:53:03 - {"tax_rate_country":"US","tax_rate_state":"AR","tax_rate_name":"AR Tax","tax_rate_priority":1,"tax_rate_compound":false,"tax_rate_shipping":1,"tax_rate":9.75,"tax_rate_class":""} (WCS Tax)
02-06-2019 @ 18:53:03 - Tax Rate ID Set for 10 (WCS Tax)

Arkansas seems to be correct now, but I still can't get Colorado to calculate city taxes. Any insight here?

Noting to follow-up with 1756083-zen once the issue has been resolved.

One more user reporting this in 1877992-zen

This appears to be resolved now! :D

I just tested this bug again, using my example above for Denver that was only returning a 4% tax rate and it is now correctly returning 8.31%:

Yay 馃帀I'm going to close this, but feel free to reopen or create a new issue if the problem appears again.

Thanks for all your work on this, @marcinbot!

I'm going to follow up with all the customers included in the comments of this issue that were related to the CO tax problem, and let them know that this has been fixed. :D

Was this page helpful?
0 / 5 - 0 ratings