USPS Online Tools
If we are calculating the shipping rate for the cart dynamically, we need to get the shipping rate for the products from the USPS site in real time. To get the shipping rate from the USPS site, we need to send the weight of the products to the USPS site. The USPS site will then send the shipping rate to our site. This is the amount that we collect from the site user.
For your website to communicate with the USPS site, we will need:
- API Key
You will need to register for your own account at the USPS website:
How to Sign Up at USPS
The USPS website provides a simple registration form that you must complete to gain access to the USPS Web Tools system.
- Open a web browser and navigate to: https://www.usps.com/business/web-tools-apis/welcome.htm (opens in a new window)
- Complete all the required fields of the registration form.
- Click the Submit button.
- You will see a confirmation page thanking you for registering. You will receive a confirmation email within 24 hours.
Obtaining the API Credentials
The confirmation email that you receive from the USPS will contain a username and password. However, your account is still not active – meaning we cannot use this account in the production environment.
The USPS now requires you to contact them and request your account be moved to the production server. You can call their Internet Customer Care Center at 1-800-344-7779 or send them an email at email@example.com.
Note: Rate quotes will not show up on your website until you have called the Internet Customer Care Center and have your account moved to the production server.
Next, you need to send an email to firstname.lastname@example.org with the following information:
Subject: Production Server Access
I am using [Magento / Virtuemart / WP-Ecommerce] to provide an online store that includes a shipping rate lookup through USPS. In order for the extension to use this feature, I will need live production server access instead of the testing access I have so far.
My Username is 091*********
Note: Forward us the email that you have received. It may take a couple of days to receive a response from the USPS.