=== CCMS Shipping Insurance Pro ===
Contributors: ccmshightech
Tags: woocommerce, shipping insurance, shipstation, easypost, shippo
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce, ccms-shipping-insurance-for-woocommerce
WC requires at least: 6.0
WC tested up to: 11.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add-on for CCMS Shipping Insurance for WooCommerce: connect insured orders to ShipStation, EasyPost, Shippo and the carriers, and see what your insurance earns.

== Description ==

CCMS Shipping Insurance Pro adds connections and a margin report to the free CCMS Shipping Insurance for WooCommerce plugin. It needs a CCMS Pro subscription: Pro features stay off until a license key is entered, and the free plugin keeps working on its own either way.

Nothing here sells or underwrites insurance. The free plugin collects the customer's fee; Pro helps you buy the matching cover and see whether the fee covers its cost. Every connection is switched off until you turn it on, and each one is explained on the **Connections** tab.

= ShipStation =

ShipStation buys insurance when a label is made, not at checkout. This connection fills one of ShipStation's custom fields with a short flag for every order where the customer added insurance, for example `INSURE | declared 40.00 USD | fee 2.75 | USPS`. A ShipStation automation rule that looks for the flag then adds the insurance to the shipment.

* Works through the official "ShipStation for WooCommerce" plugin; no ShipStation API keys are needed.
* Nothing here buys a label or spends money.
* Choose Custom Field 2 or 3, the flag text, and whether details are included.
* Warns you when the official plugin is missing or another plugin already uses the field you picked.
* Shows the flag on each order and a list of the latest insured orders.

= EasyPost =

EasyPost can insure a package whose label was made anywhere, using the tracking number and the declared value. This connection buys that insurance through your own EasyPost account, only for orders where the customer chose and paid for insurance.

* Manual mode adds a button to each insured order: enter the tracking number and buy.
* Automatic mode buys as soon as a tracking number is reported (by the official ShipStation plugin, the Shippo and carrier connections below, or any plugin that calls the `ccmssip_tracking_available` action).
* Set a most-to-insure limit per package (EasyPost insures up to $5,000).
* Test keys (EZTK) buy nothing real; the key is stored separately from other settings, never shown in full, and can be set in wp-config.php with `CCMSSIP_EASYPOST_API_KEY`.
* One automatic attempt per order. Failures and timeouts are written on the order and never retried on their own, so a package is never insured twice by mistake.

= Shippo =

Shippo adds insurance only while a label is being bought, and it cannot be added afterwards or requested from your store. This connection makes that step quick: each insured order shows the amount and contents to enter in Shippo. It can also read the tracking note Shippo writes back to the order, so EasyPost automatic mode can follow. It needs no Shippo API key and spends no money.

= FedEx, UPS and USPS =

The carriers sell insurance (declared value) only while the label is created, so there is nothing to buy afterwards. This connection shows the value to declare on the carrier's label, links to the carrier's claim page, and picks up tracking numbers saved by shipment-tracking plugins (such as WooCommerce Shipment Tracking) so EasyPost automatic mode can follow.

= Insurance Report =

What customers paid for insurance against what it cost you, by carrier and date, with a CSV export. What customers paid is exact. The cost is known for orders insured through EasyPost and for orders where you type the cost on the order screen. Orders with no cost are counted separately, not treated as free, and you can set an estimated cost as a percentage of the declared value for them.

= Requirements =

* WooCommerce, and the free CCMS Shipping Insurance for WooCommerce plugin (a version that includes add-on support).
* A CCMS Pro license key.
* For ShipStation: the official "ShipStation for WooCommerce" plugin. For EasyPost: your own EasyPost API key.

Carrier and insurer products, prices, limits, claim deadlines and eligibility are set by those companies and can change; check them in your own accounts. USPS, UPS, FedEx, ShipStation, EasyPost and Shippo are trademarks of their respective owners; this plugin is not affiliated with or endorsed by them.

== Installation ==

1. Install and activate WooCommerce and **CCMS Shipping Insurance for WooCommerce**.
2. Upload this plugin's ZIP via **Plugins → Add New → Upload Plugin** and activate it.
3. Go to **WooCommerce → Shipping Insurance → Pro License** and enter your license key.
4. Open the new **Connections** tab and switch on the connections you use.

== Frequently Asked Questions ==

= Do I still need the free plugin? =

Yes. The free plugin adds the insurance choice and fee at checkout and records it on each order. This add-on reads those order records.

= Does anything here spend money automatically? =

Only the EasyPost connection can, and only in the mode you choose, with your own EasyPost key, for orders the customer paid insurance on, up to your per-package limit. Use a test key (EZTK) first. It makes one attempt per order and never retries a failure or timeout on its own. The other connections only show information or pass data on.

= Why can I not buy insurance from FedEx, UPS, USPS or Shippo after the label is made? =

Those companies add insurance only while the label is bought. The Pro connections give you the exact value and contents to enter at that moment. EasyPost is different: it can insure a package afterwards, using the tracking number.

= Will the report be accurate? =

The amount customers paid is exact. The cost is only as complete as what has been recorded: EasyPost fees are recorded automatically, anything else you type on the order. The report counts orders with no cost separately, and you can set an estimate.

= What happens if my license lapses? =

Pro features switch off. Orders, settings and the free plugin are untouched, and nothing is deleted.

= Does it work with High-Performance Order Storage? =

Yes.

== External Services ==

When a license key is entered, the plugin sends the key and the site's address to `https://account.ccmssolutions.com/api/plugin-status`, run by Complete Content Management Services, to check the subscription, and re-checks about once an hour. Privacy policy: https://www.ccmssolutions.com/privacy-policy/ — Terms: https://www.ccmssolutions.com/terms/

The EasyPost connection, when you switch it on and enter your own API key, sends the tracking number, the amount to insure and an order reference (wc-order-ID) to `https://api.easypost.com/v2/insurances` to buy insurance, and reads `https://api.easypost.com/v2/insurances` when you press Test the key. EasyPost is run by EasyPost (Simpler Postage, Inc.): https://www.easypost.com/privacy — https://www.easypost.com/terms

The ShipStation, Shippo and FedEx/UPS/USPS connections send nothing from this plugin: they only add data that other plugins export, show information on the order screen, or read notes and tracking data already saved on your own orders.

== Changelog ==

= 1.0.0 =
* First release: ShipStation, EasyPost, Shippo and FedEx/UPS/USPS connections, the Insurance Report and the license.
