In this blog post, we have discussed the configuration of the USPS shipping method in Magento 2 with the below-listed steps :
Step 1: Create a shipping account in USPS
To receive the User ID and the link of the test server for USPS, you want to create a USPS shipping account.
Step 2: Apply USPS
- Enabled for Checkout: Select Yes or No to enable or disable the application of USPS.
- Gateway URL: To calculate the shipping for USPS carrier, you need to enter the Gateway URL here. There will be a default URL mentioned in this field, you don’t need to use any other URL.
- Title: Give a name to this shipping method which will appear on the checkout page in the shipping section.
- User ID and Password: Mention the User ID with a password of your USPS shipping account for the configuration.
- Mode: The mode of the USPS decides in which environment this extension will run i.e. in development (test) or live.
Step 3: Setup the packaging description
- Packages Request Type: You can select a package type of:
- Divide to equal weight: If the multiple shipment packages can be divided into equal weight, they can be offered as one single request.
- Use Origin Weight: If origin weight is applied to calculate the shipping rate then multiple packages need to be submitted as separate packages.
- Container: Select the standard package type for the shipment from Variable, Flat rate box, Flat rate Envelop, Rectangular and Non-rectangular.
- Size: Set the size of the package as Regular or Large.
- Machinable: If you want to process your standard package by machine then select yes in this field.
- Maximum Package Weight: Enter the maximum weight of the packages.
Step 4: Set up handling fees
- Calculate Handling Fees: Select the method from Fixed or Percent for calculating the handling fee.
- Handling Applied: In this field, you need to determine how the system should calculate the fee.
- Handling Fee: Enter the amount for handling fee.
Step 5: Assign Allowed Methods
- Allowed Methods: Select the methods for allowing it to your customers.
- Free Method: Define a USPS method which you need to offer as a free shipping method
- Free Shipping Amount Threshold: Select the minimum amount of the shipments by USPS shipping for free.
- Displayed Error Message: Write the error message to be displayed when the USPS shipping is not applicable.
Step 6: Allot Applicable countries
- Ship to Applicable Countries: Set All allowed countries or Specific countries for the shipments by USPS shipping.
- Ship to Specific Countries: Select the countries in which the USPS shipping will be supported.
- Debug: For the details of the USPS shipping method create a log file by selecting yes in this field.
- Show Method if Not Applicable: Set Yes or No for displaying the USPS shipping method in the shipping section if not or if applicable respectively.
- Sort Order: Set the order for the USPS shipping method to appear on the checkout page in the shipping section.
- Free Shipping Amount Threshold: Set yes in this field to enable the minimum amount to be applicable for free USPS shipping.
Click on Save Config to save and apply the settings on the storefront.
If you have any questions about this shipping method and its configuration on the Magento 2, please mention them in the comment section.