database – How to Programatically Import WooCommerce Tax Rates (SQL)


How can I automatically download and import international tax rates into WooCommerce in a sane programmatic fashion?

I have an e-commerce store selling physical goods on my WordPress site using WooCommerce. I sell to customers on 6 continents in almost all countries in the world (except where legally prohibited).

I’m no tax expert, but so far I’ve learned that the EU is comprised of 27 member states (as of 2022), each with their own VAT. Europe is fairly simple. If you were just selling to European States, then perhaps it would be sufficient to use the WooCommerce WUI and manually enter the VAT rates.

Canada is a bit more complicated. It has 10 provinces, 3 territories, and somehow 18 distinct tax regions. Fortunately, you can download a CSV and upload it to the WooCommerce WUI. That works.

The US, however, is insane. I found a list of 39,632 tax regions in the US. Not only is that insane to enter manually, but attempting to import the csv with the WordPress WUI caused resource exhaustion in both memory space and time.

I have root ssh access to my sever.

Is there some script I can run that will download international tax rates and upload them directly to my WordPress DB?

Michael Altfield 1 year 2022-01-08T14:01:53-05:00 0 Answers 0 views 0

Leave an answer