I'm doing work for a client that has a custom shopping cart for their website.  They were shipping only via FedEx but needed to add the US Postal Service as a shipping option.  They need to get rates for shipping and needed me to implement this for their site.  While the XML API was fairly straightforward I did run into a problem when testing.

I have never worked directly with USPS web services but surprisingly found it very easy to implement and was even more shocked at their service.  I had a problem and was able to actually call an 800 number after 7 PM and speak with a person almost immediately.

Now I did run into one problem, hence the call.  I like to thoroughly test my code in testing environments before I hit production servers.  I went to test my Rate request and kept receiving an error:

Description: API Authorization failure. RateV3 is not a valid API name for this protocol.

I checked back over their documentation and made sure my XML was correct.  Everything seemed in order.  I emailed support with this error information and got a reply telling me that I was approved for their production servers.  They did not really address the issue.  Anyway, the end result is what I found out was that their test servers are really not designed for actual testing beyond their preauthorized requests.  In other words they want you to send a canned request with only the User ID changed to their test sever.  If this works you start sending tests to production servers.  While I'd prefer to hit test servers while still verifying my code this is how it work.

If you need rate, tracking or address validation check out the USPS web tools.  They implement a fairly simple XML request and response API that is decently documented and free.
Print | posted on Wednesday, April 30, 2008 3:56 PM


# re: USPS - Rate API

left by tim at 6/19/2008 10:01 PM Gravatar
heh, had the same problem.. pretty worthless 'test' environment. i said screw it and told them i had tested everything and to give me authorization for the production server.

I used some asp code for the xml, and tried to rewrite it for .net and wasnt so successful >_<;

# re: USPS - Rate API

left by rishi at 2/11/2009 12:04 AM Gravatar

I got the following error when testing USPS in ASP.Net 2.0 :

API Authorization failure. DeliveryConfirmationV3 is not a valid API name for this protocol.

Please instruct me to remove the error.

# re: USPS - Rate API

left by rishi at 2/12/2009 2:41 AM Gravatar
I am getting the error

"The remote server returned an error: (502) Bad Gateway."

# re: USPS - Rate API

left by I have working asp code here at 9/2/2009 10:04 PM Gravatar
I have posted working classic asp code here that works with the usps rate api.

# re: USPS - Rate API

left by Leo at 9/3/2009 5:14 AM Gravatar
Here's the answer for this problem:

# re: USPS - Rate API

left by Chame at 12/9/2009 2:18 PM Gravatar
Hi Do you still have you code in classic ASP for this project? I'm trying to set up a test against the USPS web tools API and I'm am having some issues with the setup.

Thanks in advance

# re: USPS - Rate API

left by Ross at 3/20/2010 9:27 PM Gravatar
Oh CRAP! Thanks for this post! I may have kept batting my head against the wall trying to figure out what I've done wrong.

I too called USPS after reading this post - all is well and am now on the production server!

Thanks again for this post!
Email (never displayed)
Please add 7 and 2 and type the answer here: