How to Configure USPS Shipping Carrier in Magento 2?

How to Configure USPS Shipping Carrier in Magento 2?

Magento 2 shipping methods allow store owners to configure shipping based on their requirements and target market preferences. If you are in the US, one of the best shipping providers is the USPS which stands for United States Postal Services. USPS is also the best choice for Magento international shipping.

About the USPS – A Key Magento International Shipping Service Provider

USPS is an independent shipping service of the United States government, offering both domestic and international shipping services by land and air. The below image shows its revenue over the years.


Source: Statista

The below image shows the mail volume handled by the USPS.


Source: Statista

As you can see from the above image, the volume has been on a consistent decline. The primary reason is the ever-increasing competition from other providers. Nevertheless, USPS continues to be a good choice for Magento 2 stores operating in the US and those that require Magento international shipping.

How to Set Up USPS Using Magento 2 Shipping Settings

Magento 2 supports seven shipping methods by default, including USPS. The USPS offers the lowest prices among its competitors and is perfect for low-cost, non-urgent deliveries. Below, we are going to discuss the different steps you need to follow in order to configure the USPS shipping carrier in Magento 2.

Magento 2 Shipping Settings – Configuring USPS

Step 1: Open a USPS Shipping Account

Open a USPS Web Tools account to receive your User ID and a URL to the USPS test server.

Step 2: Enable USPS for your Store

  • Log into your Magento 2 admin panel and on the left sidebar, go to Stores -> Settings -> Configuration.
  • Under Sales, click Delivery Methods.
  • Expand the USPS section.

You will see the following form.


Configure the options as below.

  • Enabled for Checkout: Set this to Yes to enable USPS shipping in your store.
  • Gateway URL: Normally, the system value does not need to be changed. But if needed, enter the gateway URL to access the USPS shipping rates.
  • Title: Give a title that will appear during checkout.
  • User ID & Password: Enter the User ID and Password for your USPS account
  • Mode: Mode has the following two options.
    • 1: Development: Development mode runs USPS in a test environment. Make sure to change it to Live after running it in a development environment.
    • 2: Live: This runs USPS in a live production environment.

Step 3: Complete the Packaging Description

The following fields are related to the packaging details.

  • Packages Request Type: Set this option to one of the following. These options decide how the order is managed if sent in multiple packages.
    1: Divide to equal weight (one request): One submission request for multiple packages will do if the packages are divided by equal weight.
    2: Use origin weight (few requests): Multiple packages must be submitted as separate requests if using origin weight as the basis of calculating the shipping cost.
  • Container: Select the type of container usually used to ship the ordered products.
  • Size: Set the size of the typical package shipped from your store.
  • Machinable: Set it to Yes if your typical package can be processed by a machine. Set to No if it must be processed manually.
  • Maximum Package Weight: Enter the maximum package weight according to carrier requirements.

Step 4: Set up Handling Fees

Next comes the configuration of handling fees. The handling fee is optional and is an additional cost that is added to the DHL shipping cost.

  • Calculate Handling Fee: Set it to either Fixed or Percent depending upon your strategy.
  • Handling Applied: To determine how the handling fee is applied, set this option to either Per Order or Per Package.
  • Handling Fee: Enter the handling fee that will be applied per order or per package. For percentage, use the decimal format. For example, 0.10 for 10%.

Step 5: Specify Allowed Methods

Next, you can see the following fields that let you specify the allowed shipping methods under USPS.

  • Allowed Methods: Select all the methods you want to be available to your customers. These methods appear under USPS during checkout. You can select multiple methods by holding down the Ctrl key in PC and the Command key on Mac.
  • Free Method: If you want to provide a free shipping option through USPS, set it to the method you want to use for free shipping. If you prefer not to provide free shipping, keep it as None.
  • Enable Free Shipping Threshold: If you want a minimum order limit that should qualify the order for free shipping, change it to Enable. Then, enter the Free Shipping Amount Threshold.
  • Displayed Error Message: This is the default message if USPS is not available. You can change it if the method becomes available.

Step 6: Specify Applicable Countries

Finally, you need to specify which countries are applicable for the USPS shipping carrier.

  • Ship to Applicable Countries: Set it to All Allowed Countries if you want customers from any country to use this delivery method. When you choose Specific Countries, the Ship to Specific Countries list becomes active.
  • Ship to Specific Countries: Choose all countries you want the method to be available for.
  • Debug: Set it to Yes if you want to maintain a log file of all the shipments made through USPS.
  • Show Method if Not Applicable: Setting it to Yes will list all available shipping methods during checkout, including those that don’t apply to the shipment.
  • Sort Order: Enter a number to determine the sequence in which USPS appears when listed with other delivery methods during checkout. 0=first, 1= second, and so on.
  • Click Save Config.

Final Thoughts on Magento International Shipping – Setting Up the USPS

This concludes our article on how to configure USPS in Magento 2. If you have any questions, please don’t hesitate to contact us.

Other Articles You Might be Interested in: