=== Tax Exempt Certificates for WooCommerce ===
Contributors: catcodestudio
Tags: sales tax, tax exempt, resale certificate, b2b, woocommerce
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Buyers upload a US resale or exemption certificate, you review it, and sales tax comes off only for approved, unexpired certificates.

== Description ==

If you sell to resellers, nonprofits, schools or government buyers in the United States, you need a certificate on file before you skip sales tax. This plugin collects the certificate, keeps it private, lets you review it, and removes tax only while it is valid.

**This plugin is not tax advice.** It keeps records and applies your decisions. It does not check certificates with any state, and it does not decide whether a certificate is acceptable or a sale is exempt. Ask the state or your tax adviser.

= What it does =

* Buyers upload a certificate (PDF, JPG or PNG) from My Account or at checkout, on the classic checkout and on the Checkout block.
* You review it on one screen: open the file, correct the details, set the expiration date, approve or reject with a reason. The buyer gets an email either way.
* Tax comes off only when the certificate is approved, is not past its date, and covers the state tax is worked out for. The check runs on every calculation, so a certificate stops working on its date even if WP-Cron does not run.
* Item tax and shipping tax come off together. Buyers can untick the certificate for an order that is not exempt, such as something for their own use.
* A certificate waiting for review does not remove tax. The order goes through with tax, and the order screen shows it.
* Multi-state certificates, and a "single purchase" option that stops after one order.
* Each order keeps a copy of the certificate details it relied on, which stays even if the certificate is later renewed or deleted.
* A reminder email before the date, and another when it has passed.
* A history for each certificate: submitted, approved, file opened, used on an order.

= Private file storage =

* Files are not added to the Media Library. They sit in a folder with a random name, under random file names, with server rules that deny direct access.
* Files are encrypted on disk, so they stay protected on servers that ignore .htaccess, such as nginx.
* Files open only for the buyer who uploaded them and for staff who can manage WooCommerce, through a permission check.
* The type of a file is judged by its content, and only PDF, JPG and PNG are accepted. Guest uploads are limited per hour.
* You can define `CATCODE_TAXCERT_DIR` in wp-config.php to move the folder out of the web root, and `CATCODE_TAXCERT_KEY` to keep the encryption key out of the database. Set these before the first upload: files stored under another key cannot be read.

Certificates contain tax numbers and signatures. Back up the database together with the uploads folder: the encryption key is stored in the database unless you set your own, and without it the files cannot be read.

= Guests =

Tax comes off only for a signed-in customer, because an email typed at checkout proves nothing. Guests can still upload at checkout: the certificate reaches you with the order, and on the review screen you connect it to a customer account or create one.

= Official forms named in the plugin =

The upload form lists four forms by name. Each was read at its official source on October 31, 2026. Buyers using any other form choose "Other form" and type its name.

* Streamlined Sales Tax Certificate of Exemption, SSTGB Form F0003, revised 12/21/2021. [Streamlined Sales Tax Governing Board](https://www.streamlinedsalestax.org/docs/default-source/forms/exemption-certificateb926a7ab4a0d43e1ad4fe8eb19e79cbb.pdf?sfvrsn=857843d_5). Its instructions say that without the single-purchase box it is a blanket certificate, effective until cancelled by the purchaser if purchases are no more than 12 months apart, unless a state allows a longer period.
* Uniform Sales & Use Tax Resale Certificate - Multijurisdiction, updated October 14, 2022. [Multistate Tax Commission](https://www.mtc.gov/resources/uniform-sales-use-tax-exemption-certificate). The Commission says 36 states have indicated it can be used as a resale certificate.
* California Resale Certificate, CDTFA-230, REV. 1 (8-17). [California Regulation 1668](https://cdtfa.ca.gov/lawguides/vol1/sutr/1668.html) says a resale certificate remains in effect until revoked in writing.
* New York Resale Certificate, Form ST-120 (1/26). [New York State Department of Taxation and Finance](https://www.tax.ny.gov/pdf/current_forms/st/st120_fill_in.pdf). With neither box marked it is deemed a single-use certificate. Its instructions cover the 90-day and three-year timing for sellers.

Rules change and differ by state. These notes are general information, not a statement that a form fits your sale.

= What it does not do =

* It does not verify a permit number with a state.
* It does not exempt part of a cart. A certificate applies to the whole order or is unticked.
* It does not calculate tax rates: it switches off the tax WooCommerce would otherwise charge. Renewal orders of subscription plugins are not handled.

// @pro-begin
= Pro =

* Several reminders before a certificate expires, on your schedule.
* A weekly email to the shop with certificates waiting and expiring.
* Refund the tax on an order placed while the certificate waited for review.
* CSV reports: the certificate register and tax-exempt orders by date.
* Add a certificate for a customer yourself, for paper or emailed ones.

Pro is sold on [catcode.com.ua](https://catcode.com.ua/modules/catcode-tax-exempt-certificates-for-woocommerce/), with a 7-day trial you start yourself.

// @pro-end
== Installation ==

1. Install and activate the plugin. WooCommerce must be active, with taxes switched on.
2. Open WooCommerce > Tax Certificates > Settings and check the reminder and the review email.
3. Buyers find Tax certificates in My Account, and a Tax exemption panel at checkout.
4. New certificates appear under WooCommerce > Tax Certificates.

== Frequently Asked Questions ==

= Does this make my shop compliant? =

No plugin can promise that. It keeps your certificates and applies the decisions you make. What a state accepts is a question for that state or your tax adviser.

= Which state is checked? =

The state WooCommerce uses for tax: shipping, billing or shop address, following your tax setting, and the shop address for local pickup. It must be one of the states on the certificate.

= What happens on the expiration date itself? =

The certificate still works through the end of that date, in your shop's time zone. It stops the next day.

= A certificate has no expiration date. What do I do? =

Tick "The certificate has no expiration date" when you approve. An empty date alone is refused, so nothing gets approved open-ended by accident. Some forms have their own renewal rules, so review such certificates from time to time.

= A buyer paid tax while waiting for review. =

Refund the tax in the WooCommerce order. The order screen shows that a certificate was waiting.

= What happens to certificates if I delete the plugin? =

They stay, since they may be needed as tax records, unless you tick the delete option in the settings first.

= Does an erasure request delete certificates? =

Rejected and unreviewed ones, yes. Approved ones are kept as tax records, and the WordPress tool says so. Delete them by hand when you no longer need them.

== Third-party libraries ==

* [Tom Select](https://github.com/orchidjs/tom-select) 2.6.2, Apache-2.0. Source: https://github.com/orchidjs/tom-select
* [flatpickr](https://github.com/flatpickr/flatpickr) 4.6.13, MIT. Source: https://github.com/flatpickr/flatpickr

Both are bundled in `assets/vendor` and loaded from your site.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
