=== Maple Parcel – Shipping Rates with Canada Post for WooCommerce ===
Contributors: bluebrainmedia
Tags: woocommerce, shipping, canada post, shipping rates, canada
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Live Canada Post rates at WooCommerce checkout, using your own keys from Canada Post's new Developer Portal.

== Description ==

Canada Post has moved developers to a new Developer Portal. Keys made there don't work with plugins built for the old API, which answer with an E002 error. Maple Parcel is built for the new portal from the start: you create an app in your own Canada Post account, paste its key and secret into WooCommerce, and your customers see live Canada Post prices at checkout.

**Works with new Developer Portal keys only.** If you have a username and password from Canada Post's old developer program (what most older Canada Post plugins use), they won't connect here. You'll need to create an app in the new Developer Portal first; the FAQ below explains how.

Maple Parcel is not made, endorsed or supported by Canada Post.

== Installation ==

1. Install and activate Maple Parcel. WooCommerce must be active.
2. In the Canada Post Developer Portal, create an app and copy its key and secret.
3. Go to WooCommerce > Settings > Shipping > Maple Parcel and enter them.

== Frequently Asked Questions ==

= Do I need a Canada Post account? =

Yes. Rates are quoted with your own Developer Portal key and secret, and with your customer number for commercial rates.

= I have a username and password from Canada Post's old developer program. Can I use them? =

No. Maple Parcel only works with an app key and secret from Canada Post's new Developer Portal (https://developer-developpeur.canadapost-postescanada.ca/devportal-portaildesdeveloppeurs/). The old program's credentials are a different kind of login, and Canada Post will refuse them. To switch: sign in to the Developer Portal with your Canada Post business account, create an app, subscribe it to the Rating API, and paste its key and secret into the Maple Parcel settings. Your customer number stays the same.

= Can I keep my old plugin while I try Maple Parcel? =

Yes. Add Maple Parcel to a shipping zone alongside your current method, check the rates it shows, then remove the old one.

= Do rates to the US include duties and taxes? =

No. Maple Parcel shows Canada Post's shipping price only. Since August 2025, duties on parcels going to the US have to be paid before they ship, and Canada Post charges them when you buy the label, not when your customer checks out. So the rate at checkout doesn't cover duties, and you pay them yourself unless you charge for them some other way.

If you ship to the US, put it in its own shipping zone. Then either add a percentage to that zone's rates (Maple Parcel Pro's price adjustments) or use a separate plugin that charges duties at checkout.

Outside the US, duties work as they always have: the recipient usually pays them on delivery.

== External services ==

This plugin connects to Canada Post's API at api.canadapost-postescanada.ca, using the key and secret you enter.

* **OAuth token endpoint.** Sends your app's key and secret, to get an access token. This happens only when there is no valid cached token.
* **Rating API.** Sends the origin postal code, the destination postal code or country, parcel weight and size, and your customer number. This happens when the cart or checkout calculates shipping, and when you click Test connection.

No customer names, addresses beyond the postal code, emails or phone numbers are sent for rates.

A tracking number you add to an order is shown to the customer as a link to Canada Post's tracking page. The plugin itself sends nothing for this; Canada Post only sees the visit if the customer clicks the link.

Canada Post's terms and privacy policy apply to these requests:

* Terms of use: https://www.canadapost-postescanada.ca/cpc/en/support/kb/company-policies/terms-conditions/legal-terms-of-use-and-conditions.page
* Privacy: https://www.canadapost-postescanada.ca/cpc/en/our-company/transparency-and-trust/privacy-centre.page

Using the API also needs your own app on Canada Post's Developer Portal, under its Developer Portal Agreement.

== Changelog ==

= 1.1.1 =
* Fixed: if you upgrade to Pro and then delete this free version, your Canada Post keys and shipping zone settings are now kept for Pro. Before, deleting it cleared them.
* The "What Pro adds" panel now mentions Canada Post labels.

= 1.1.0 =
* Fixed: the order screen no longer shows an internal "_bbmmp_service" line under the shipping method.

= 1.0.0 =
* First release.
* Live Canada Post rates at cart and checkout, with keys from the new Developer Portal.
* Services per zone, delivery estimates, coverage and signature, free shipping over an amount, and a fallback rate.
* Tracking links: add a tracking number to an order and the customer's emails link to Canada Post tracking.

== Upgrade Notice ==

= 1.1.1 =
Update before you upgrade to Pro: deleting the free version no longer clears the settings Pro uses.

= 1.1.0 =
Tidies the order screen: an internal shipping note no longer shows under the shipping method.

= 1.0.0 =
First release: live Canada Post rates with new Developer Portal keys.
