UPS Shipping Method

You are here:

UPS Shipping Method allows you to get shipping rates from the UPS API. It requires that your server uses SimpleXML. The extension primarily works with measurements in Inches (in) and weight in Pounds (lbs), but other units can be converted automatically. Returned rates’ currency is based on origin country in the shipping instance setting.

UPS can calculate quotes for both domestic and international parcels.

Note: This extension does not handle freight shipping, and there is a weight limit of 150 lbs. The API and the built-in box packer require that non-virtual products have weights and dimensions set. More at: Adding Shipping Dimensions and Weights to Products.


  1. Download the extension from your WooCommerce dashboard.
  2. Go to Plugins > Add New > Upload and select the ZIP file you just downloaded.
  3. Click Install Now, and then Activate.

More information at: Installing and Managing Plugins.

API & Debug 

Go toWooCommerce > Settings > Shipping > UPS.

  1. UPS User ID – Get your UPS User ID from the developer site by signing up at UPS Developer Kit.
  2. UPS Password – Set by you during signup.
  3. UPS Access Key – Sent to you after signup.
  4. UPS Account Number – Sent to you after signup.
  5. Customer Classification – Determines what rates are returned. Note that Retail Rates will match the online calculator.
  6. Debug Mode – Enable/disable debug mode to show debugging information on your cart/checkout.
  7. Save changes.


  1. Go toWooCommerce > 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
  3. Select UPS from the dropdown and press Add shipping method:
  4. Configure the settings:
    • Method & Origin Settings
      1. Method Title – Name the shipping method. This is visible to customers.
      2. Origin City – Enter city you are sending from.
      3. Origin Postcode – Set to the postcode from where you ship. It is sent to the UPS API.
      4. Origin Country – Set to the country from where you ship. It is sent to the UPS API.
    • Services and Packaging
      1. Services – Choose to rename and/or rearrange the order of UPS shipping rates.
      2. Offer Rates – Select whether to display all rates available or only the cheapest.
      3. Negotiated Rates – Enable negotiated rates or not. More at: Account-Specific Negotiated Rates. This must be approved by UPS, or the API returns an error. It is sent to the UPS API.
      4. Delivery Confirmation – Optionally you may charge customers for delivery confirmation. This just adds the specified amount to the returned rates.
      5. Parcel Packing Method – See below.
      6. UPS Packaging – You can select from a built-in list of standard UPS packaging to use.
      7. Custom Boxes – Here you can add custom box sizes to pack into.
    • Advanced Options
      1. Origin Address – Sometimes you may need to enter the address for the sender/origin.
      2. Residential – Choose whether to indicate deliveries as residential or commercial addresses.
        * Users are permitted to enter PO Boxes as a shipping address, even though UPS does not allow it.
      3. Insured value – Request Insurance to be included in UPS rates.
      4. Fallback – Enter a fallback amount for shipping, if no rates are found.
      5. Weight/Dimension Units – Only change this if you’re getting the “This measurement system is not valid for the selected country method.”
Note: The UPS shipping extension is a calculator for all products in the cart and does not exclude products based on shipping classes.

Parcel Packing Methods

There are two packing methods with UPS, and each affects the parcels you send to the API.

Pack items individually (Default)

Each item in your cart (non-virtual) is sent to the UPS API. Quotes for all items are combined to calculate the final cost. Only the weight is required, but also entering product dimensions produces a more accurate quote. For even more accuracy, we recommend the box packer method.

To use this method, add a new product then scroll down to Product Data > Shipping to enter the product dimensions.

Pack into boxes with weights and dimensions (Recommended)

Using this method, you create your own custom box sizes in UPS Settings. The extension uses the weight/dimensions of products added to the cart, filling the custom box size from smallest to largest based on volume and size, then sends the number of boxes/size to the UPS API for a shipping estimate. Both product weight and dimensions are needed for this option to accurately calculate what boxes are needed.

Selecting this option you must follow the steps listed below for UPS Packaging or Custom Box Packing for this method to work.

UPS Packaging

UPS offers standard boxes for shipping. UPS Packaging:


Start typing the package you want to include, and it auto-populates the field for you.

Note: If you choose Pack into boxes with weights and dimensions (Recommended) but have not chosen any UPS Packaging, nor defined any custom boxes (as explained below), the plugin displays the error message: “UPS is enabled, and Parcel Packing Method is set to ‘Pack into boxes’, but no UPS Packaging is selected and there are no custom boxes defined. Items will be packed individually.”

Custom Box-Packing

The box packer included with this shipping method groups items into boxes that you define by height, width, length, weight, and max-weight. The packing is mainly volume based, but also considers item sizes.

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

Setting up box sizes

  1. Go toWooCommerce > Settings > Shipping.
  2. Select your Shipping Zone containing UPS, then click UPS
  3. Scroll down to Custom Boxes and select Add Box to set up box dimensions:

Box Settings

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

Inner dimensions are used for packing, and items should fit within these.

Box weight is the weight of the actual box, and is added to the weight of contents.

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

How the calculation works

The packer:

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

Handling Fees

To add handling fees to shipping calculations, you can use a Price Adjustment column in the Services section. Each UPS service can be increased or decreased (by adding the “-” sign) separately, using price adjustment columns in the row.

Use the Price Adjustment ($) column to add a flat amount to the shipping quote. In this example, the 3-Day Select and Ground shipping methods are increased by $3.50.


Use the Price Adjustment (%) to increase the shipping quote by a percentage. In this example, the 3-Day Select and Ground shipping methods are increased by 1% of the quote returned by UPS.


Customer Usage

Customers get quotes, after inputting their address, from two places:

  • Cart page – via the shipping calculator
  • Checkout page – via the shipping and billing forms
Rates can be selected by customers as normal.

Available Shipping Services for UPS Extension

These services are included with the UPS Shipping extension:


3-Day Select
2nd Day Air
2nd Day Air AM
Next Day Air
Next Day Air Saver
Next Day Air Early AM


Worldwide Express
Worldwide Express Plus
Worldwide Expedited Standard
Worldwide Saver


I dropship items. Can I use multiple origin zip codes?

No, the WooCommerce UPS extension currently uses one origin zip code to request quotes from UPS.

Does this create shipping labels and tracking codes?

No it does not. It provides the integration between UPS and WooCommerce, so you can calculate shipping rates for customers and collect the correct amount of payment in checkout.

You get shipping labels and tracking numbers directly from UPS or can buy a different plugin to handle that for you.

Rates are not in the correct currency

UPS will use the currency that is enabled on your account. So if your site uses a different currency then the one which is set on the account, the rates won’t be returned. If the debug setting is enabled this will be indicated with a warning like:
[UPS] Rate for Standard (UPS) is in USD but store currency is EUR.

If you need to convert these rates to the correct currency we would suggest using the Multi Currency extension and setting up a conversion rate for both the account currency and the store currency.


No rates returned/no rates available

  • Confirm that your API credentials are correct.
  • Enable development mode, or turn on WP_DEBUG to see debugging information on the cart page. This often reveals the issue.
  • Check that your products have sizes and weights set – without this, the calculation cannot be performed.


If you would like to remove UPS as a shipping option for some shipping classes you can use the WooCommerce Conditional Shipping and Payments extension.

Or you can use code to do this.

Note: The following is considered custom code. We are happy to give it to you, but we are unable to provide support or help customize it to suit your store. Only use it if you are comfortable with PHP and custom coding and troubleshooting on your own.

You can add the following code to your functions.php. You need to change shipping classes used on the 14th line:

  * Check the cart for specific classes, remove UPS Shipping method if they are present
  * REMOVE THE TOP <?php if there is no ?> before (or you have an error after adding this)
  * Add the code to your theme functions.php file
  add_filter( ‘woocommerce_package_rates’, ‘unset_ups_shipping_method’ , 10, 2 );
  function unset_ups_shipping_method( $rates, $package ) {
  // Setup an array of shipping classes that do not allow UPS Shipping (@todo change this)
  $shippingclass_array = array( ‘no-ups’ );
  * loop through the cart looking for the products in the array above
  * and unset the Free shipping methods as necessary
  foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
  $shipping_class = get_the_terms( $values[‘product_id’], ‘product_shipping_class’ );
  if ( isset( $shipping_class[0]->slug ) && in_array( $shipping_class[0]->slug, $shippingclass_array ) ) {
  * Unset the shipping methods here
  unset( $rates[‘ups:01’] );
  unset( $rates[‘ups:02’] );
  unset( $rates[‘ups:03’] );
  unset( $rates[‘ups:04’] );
  unset( $rates[‘ups:05’] );
  unset( $rates[‘ups:06’] );
  unset( $rates[‘ups:07’] );
  unset( $rates[‘ups:08’] );
  unset( $rates[‘ups:09’] );
  unset( $rates[‘ups:10’] );
  unset( $rates[‘ups:11’] );
  unset( $rates[‘ups:12’] );
  unset( $rates[‘ups:13’] );
  unset( $rates[‘ups:14’] );
  unset( $rates[‘ups:15’] );
  // The rates have been removed, no point in carrying on
  // Return what’s left of the $rates array
  return $rates;
Was this article helpful?
Dislike 0
Views: 16