Setting Up USPS Real-Time Shipping Rates Follow
MyOrderDesk integrates with the United States Postal Service (USPS) API to provide real-time shipping quotes to your customers during the checkout process.
To use this integration, you will need a USPS Developer Account and a Consumer Key/Secret.
Prerequisites: Getting Your Credentials
Before configuring MyOrderDesk, you must generate API credentials on the USPS website.
- Log in to the USPS Developer Portal.
- Create a new App within their portal.
- When asked for API Products, ensure you select Domestic Prices and International Prices.
- Once the App is created, copy the Consumer Key and Consumer Secret. You will need these for the steps below.
Configuration in MyOrderDesk
1. Enable the Provider
- Navigate to Administration > Shopping Cart > Shipping Rates.
- Select the 3rd Party Rates tab.
- Click on the USPS (United States Postal Service) logo to open the configuration settings.
2. Enter API Credentials
In the settings window, fill out the following fields to authenticate with USPS:
- Consumer Key: Paste your USPS Consumer Key here.
- Consumer Secret: Paste your USPS Consumer Secret here.
- API User ID (Deprecated): This field is for legacy integrations. For new setups using the modern API (V3), you can leave this blank or ignore it.
- Zip Code: Enter the "Ship From" Zip Code where your packages originate
3. Configure Shipping Containers
If you're using custom/own pakcaging the USPS API requires accurate package dimensions to return a rate. You can define your standard box sizes here.
- Click the Edit Shipping Containers button.
- Click New Container.
- Description: Name your container (e.g., "Standard Letter," "Large Box").
- Dimensions: Enter the Length, Width, and Height.
- Max Weight: Define the maximum weight allowed for this specific container.
Troubleshooting
"Invalid Weight" or No Rates Returned
The USPS API requires a package weight to calculate a cost.
- Ensure that your Order Form passes a weight to the cart.
- Check that your Form Fields are correctly mapped to the Cart Weight property in the Field Options.
"Secret Error"
This error usually indicates that the Consumer Secret or Consumer ID is incorrect or invalid. Double-check that you have copied the strings exactly from the USPS Developer Portal and that there are no leading or trailing spaces.