WooCommerce Docs

Documentation, Reference Materials, and Tutorials for your WooCommerce products


Canada Post

Canada Post is a premium shipping method that allows you get shipping rates from Canada Post’s API. It requires that your store use Canadian Dollars as its currency and your server has SimpleXML installed. The extension primarily works with cm and kg, but other units can be converted automatically.

Canada Post handles both domestic and international parcels.

The API and the built in box-packer require that non-virtual products have weights and dimensions set. More info at: Adding Dimensions and Weights to Products for Shipping.

Installation ↑ Back to Top

  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New to upload the file you downloaded with Choose File.
  3. Activate the extension.

More information at: Installing and Managing Plugins.

Getting Started ↑ Back to Top

We recommend using pretty permalinks before connecting your Canada Post account to avoid an error caused by Canada Post. Learn more about permalinks at Permalinks Settings, and choose any option except default.

The first step is to link your Canada Post account. A notification at the top of the admin screen will remind you to Register/Connect:

The connect prompt

  1. Click the Register/Connect button to be taken to Canada Post’s website.
  2. Log into your account or register as a new user to allow Woo to get shipping quotes from the API on your behalf.
  3. Canada Post may request that you enter a credit card for future automatic transactions, such as monthly fees, transaction fees, etc. You can change or update it later when you sign into My Business Profile on the Canada Post dashboard.
Note: A credit card is required by Canada Post, not WooCommerce. We never see or store your financial information.

You should be sent to the admin panel upon completion. If you want to disconnect your account in the future, click the link at top of the Settings page under WooCommerce > Settings > Shipping > Canada Post:

After connecting your account

API & Debug 

Go to: WooCommerce > Settings > Shipping > Canada Post.

  1. Connect/Disconnect your Canada Post Account
  2. Debug Mode – Tick the checkbox to log API requests and responses for the cart and checkout pages. Useful for troubleshooting.

Configuration ↑ Back to Top

  1. Go to: WooCommerce > Settings > Shipping.
  2. Select your Shipping Zone that you want to add the method to, and press the Add shipping method + button on the right
    Add shipping method
  3. Select Canada Post from the dropdown and press Add shipping method:
  4. Click on the new Canada Post method to configure the settings:
    1. Method Title – Enter a description, which is shown to customers in checkout.
    2. Origin PostcodeThis should be set to the postcode of the location from where you ship. It’s sent to the API to calculate rates.
    3. Method Availability –  Allows you to restrict to certain countries. Leave set to All Countries to make available to all customers.
    4. Quote Type – Commercial uses rates and discounts associated with your account; also used for VentureOne members. Select Counter to get normal rates you’d receive in person.
    5. Rate Cost – Base is the base rate cost. Due is the cost after taxes are applied.
    6. Lettermail – Use the dropdown to select Standard and/or Registered rates. Lettermail isn’t part of the Canada Post API, and rates are calculated using box packing and hardcoded prices. 
    7. Additional Options – Use the dropdown to select Coverage, Proof of Age and/or Signature for parcels.
    8. Delivery Time – Tick the checkbox if you want a delivery estimate (in days) displayed next to rates. Info pulled from the API.
    9. Parcel Packing Method – Use the dropdown to select Pack Individually, Weight of All Items or Pack with Weights and Dimensions (explanation below).
    10. Offer Rates – Use the dropdown to select All Rates (user chooses) or Cheapest Rate (single).
    11. Services – Rename and re-order Canada Post shipping rates and add price adjustments as a percentage or by dollar amount. Adjustments can be positive (surcharge/fee) or negative (discount).


Parcel Packing Methods ↑ Back to Top

There are three packing methods with Canada Post — each affects parcels you send to the API.


Each item in your cart (non-virtual) is sent to the Canada Post API. Quotes for all items are combined for the final cost.

Weight Based

The cart is be split into 30 kg packages, and each package sent to the API. No dimensions are sent, only weight.

Pack into boxes

Items are packed in pre-defined boxes and sent to the API. We recommend this option. See Box-Packing for more information.

Box-Packing ↑ Back to Top

The box packer included with this shipping method lets you group items into packages in which you define height, width, length, weight and max-weight. Packing is primarily volume based, but also considers item sizes.

The box packer is volume based. In most cases, it provides good results but is never as accurate as a real person packing a box (see BIN Packing Problem). Packing results are as accurate as they can be, and any anomalies should be accepted.

Setting up box sizes

Within Settings, go to the Box setting. Click Add Box to set up the box dimensions:

Box Settings

Outer dimensions are used for parcel dimensions and passed to the API.

Inner dimensions are used for packing, and items must fit within them.

Box weight is the weight of the actual box, and is added to the weight of contents. This increases the cost of shipping.

Max weight is the maximum weight your box can hold. This includes content weight and box weight.

How the calculation works

The packer does the following:

  1. Finds boxes that fit the items being packed, using H x W x D.
  2. Packs all items fitting into boxes, using volume.
  3. Uses largest box that fits 100% of items; or uses highest % packed box, and then returns unpacked items and repeats the process.
  4. Packs ‘unpackable’ items alone, using item dimensions.
  5. Returns all packed boxes.

Customer Usage ↑ Back to Top

Customers get quotes from two places after inputting their address:

  1. Cart page – using the shipping calculator
  2. Checkout page – by filling in shipping and billing forms
Rates can be selected by customers as usual.

Troubleshooting ↑ Back to Top

No rates returned/no rates available

  1. Ensure that you have connected your production Canada Post account.
  2. Enable development mode, or turn on WP_DEBUG to see debugging information on the cart page. This often reveals the issue.
  3. Check that products have sizes and weights set – without this, the calculation cannot be performed.
  4. Check that your store’s base country is Canada and has Canadian Dollars set as the currency (WooCommerce > Settings > General).

After attempting to authorize Canada Post, it brings me back to a page with a number 1 on the top left

You may need to update your permalink settings for WordPress to Pretty Permalinks.

Why are my lookups timing out?

Try opening Port 30000 for API communications.

Error message in cart: Fatal error: Cannot use object of type WP_Error as array in ../woocommerce-shipping-canada-post/shipping-canada-post.php

You see this error message if your server is unable to use the wp_remote_get() function. This can be verified using the Status Report:


In this case, we recommend contacting your hosting company so they update your server.

Back to the top