=== ManageDuty for WooCommerce ===
Contributors: bullsnext
Tags: woocommerce, hs code, ioss number, ddp shipping, uk customs
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automated EU customs duty calculation, HS code classification, IOSS handling, and delivered duty paid (DDP) shipping PDFs for UK WooCommerce sellers.

== Description ==

ManageDuty is a customs compliance tool for UK WooCommerce stores shipping to the EU. With the new EU customs rules that took effect in July 2026, UK sellers need a fast way to handle EU customs charges without parcels getting stuck at the border.

ManageDuty automates the paperwork: it classifies your products with an HS code, applies your IOSS number, calculates the import duty and VAT owed, and generates a compliant delivered duty paid (DDP) commercial invoice for every order — automatically, in the background, every time an order is placed.

= Key Features for UK Sellers: =
* **Automated HS Code Classification:** Stop guessing. Every item in your WooCommerce store is automatically assigned the correct HS code.
* **IOSS Number Integration:** Add your IOSS registration number once and it's applied to every EU order, so customers never face a surprise customs charge at the door.
* **Delivered Duty Paid (DDP) Made Easy:** Purpose-built for DDP shipping from the UK to Europe — import duty and VAT are calculated automatically and a compliant commercial invoice PDF is generated per order.
* **EU Customs Duty Calculator:** Duty and VAT are calculated per destination country the moment an order's status changes, so paperwork is ready before the parcel ships.
* **No External Dashboard Required:** Connect your store, view order-level customs status, download invoices, and manage your plan — all from inside wp-admin.

If you're shipping from the UK to the EU, ManageDuty helps you avoid rejected parcels, customer complaints about surprise charges, and non-compliant paperwork.

= Requires a ManageDuty account =

This plugin connects to the ManageDuty service to perform HS code classification, duty/VAT calculation, and PDF generation. An account is created automatically the first time you connect (no separate signup step, no need to leave wp-admin). New stores get a 7-day free trial; paid plans (Starter, Growth, Pro) apply after the trial. See "External services" below for what data this involves.

== Installation ==

1. Upload the `manageduty-woocommerce` folder to `/wp-content/plugins/`, or install directly from the WordPress Plugins screen.
2. Activate the plugin through the "Plugins" menu in WordPress. WooCommerce must already be installed and active.
3. Go to **ManageDuty → Settings** in the WordPress admin menu.
4. Under "Connect Your Store," enter your email and a password (a ManageDuty account is created automatically if you don't already have one), your store URL (pre-filled), and a WooCommerce REST API Consumer Key/Secret — generate these under **WooCommerce → Settings → Advanced → REST API** if you don't have a pair yet.
5. Choose a plan (Free Trial is selected by default) and click **Connect My Store**.
6. That's it — new orders are processed automatically as their status changes. Visit **ManageDuty → Dashboard** for order status, duty/VAT totals, and invoice PDFs.

No separate account signup on an external website is required — the whole flow happens inside wp-admin.

== Frequently Asked Questions ==

= Do I need a ManageDuty account? =

Yes, but you don't need to create one separately. The "Connect Your Store" step on the Settings page creates your account automatically the first time you connect — just provide an email and password.

= Is this free? =

New stores get a 7-day free trial. After that, a paid plan (Starter, Growth, or Pro) is required to continue processing orders. You can change or cancel your plan any time from the Dashboard.

= Is my API token stored securely? =

Yes. The API token and webhook secret are encrypted with AES-256-CBC using a key derived from your WordPress AUTH_KEY constant. They are never stored in plain text.

= Does this break WooCommerce checkout? =

No. The plugin only fires on order status transitions in the background. All API calls are asynchronous from the customer's perspective. Any backend error is logged silently and never interrupts the customer flow.

= What happens if I disconnect my store? =

Disconnecting pauses processing — no new orders are sent, but your existing data, orders, and subscription are kept safe and you can reconnect at any time. Deleting your store is a separate, explicit action that permanently removes your ManageDuty account data.

== External services ==

This plugin relies on the ManageDuty API (operated by BullsNext) to classify products, calculate customs duty/VAT, and generate commercial invoice PDFs. This is a required part of the plugin's functionality — it cannot classify HS codes or calculate duty locally.

What is sent, and when:
* **When you connect your store:** the email and password you enter (to create or log into your ManageDuty account), your store URL, and your WooCommerce REST API Consumer Key/Secret.
* **When an order's status changes:** the order's line items, totals, and destination address, so duty/VAT can be calculated and an invoice generated.
* **When you view the Dashboard or an order's customs status:** a request is sent to fetch your stored orders and account/plan data.

This service is provided by BullsNext:
* Terms of Service: https://www.bullsnext.com/terms
* Privacy Policy: https://www.bullsnext.com/privacy-policy

== Changelog ==

= 1.0.0 =
* Initial public release on the WordPress repository
* Automated EU customs duty calculation, AI HS code classification, and DDP shipping PDF generation
* In-plugin Connect Your Store flow (account creation, WooCommerce connection, and plan selection in one step)
* AES-256-CBC encrypted token storage and HPOS compatibility

== Upgrade Notice ==

= 1.0.0 =
Initial public release.
