Response from USPS Rate Calculator
Asked Answered
C

3

8

I need to get shipping rates from USPS.

I have signed up with them, got myself a user id and trying to use the sample request XML as shown on page - https://www.usps.com/webtools/htm/Rate-Calculators-v1-3.htm , but keeping getting following error response.

<Error>
<Number>80040b1a</Number>
<Description>API Authorization failure. RateV4 is not a valid API name for this protocol.</Description>
<Source>UspsCom::DoAuth</Source>

I cant figure out where I am missing the point. Google has not been helpful as well :-(

I am passing the API name as RateV4. I have tried with the international shipping API as well - IntlRateV2. And yes, I have tried the Secure https://secure.shippingapis.com/ShippingAPITest.dll api as well. And I have mailed to support staff. Nothing has worked.

Once this basic thing works, I plan to get the classes and use custom serialization to serialize my request and then deserialize the response. That would be better than using XMLs directly. But that would probably more suitable as other question. Getting the basic thing working is a concern right now. Thanks

Chelonian answered 25/10, 2011 at 6:1 Comment(2)
Post you code. The error is clear...usps.com/webtools/htm/Rate-Calculators-v1-3.htm didn't even work for me. The API name would likely be RateV3 not RateV4 based on the htm page.Edita
USPS test servers do not support V4. Requested access to prod servers, and it is working fine. Thanks. Too bad that it is not clearly mentioned ANYWHERE... (Just executed two dummy requests using V2, and got access to prod servers.)Chelonian
S
7

It means the server you are targeting does not support the RateV4. I think you need to use the production server for RateV4 even when doing tests.

Stereobate answered 25/10, 2011 at 6:41 Comment(4)
Thanks Simon. That's what I keep thinking. But they have mentioned that "the address to the test server is either testing.shippingapis.com/ShippingAPITest.dll or secure.shippingapis.com/ShippingAPITest.dll". Will have to again try to contact Customer Care :-(Chelonian
Turns out it is not the code which is causing the problem. USPS test servers do not support V4 of the rate API. V2 ran fine. Requested USPS for prod server access and V4 ran perfactly fine. Thanks again.Chelonian
And for those who are trying V2 of international shipping rates, that is not supported by test servers. You have to get access to prod servers for testing!Chelonian
V2 is no longer supported by the test servers. How they expect anyone to use them is beyond me.Medford
U
2

At the present time, no version of the Rate API actually works on the USPS test servers (as noted by CountMurphy on a previous comment). However, you need several successful API requests on the test server before your account will be approved for access to the production server. After some back and forth with USPS, they pointed me to certifying the TrackV2 API instead. This gives you access to the Rate API as well.

Here are two example TrackV2 requests I was given by USPS support. Be sure to include your actual USERID value. You must use these exact label numbers.

Example #1

http://production.shippingapis.com/ShippingAPITest.dll?API=TrackV2
&XML=<TrackRequest USERID="xxxxxxxx">
<TrackID ID="EJ958083578US"></TrackID></TrackRequest>

Example #2

http://production.shippingapis.com/ShippingAPITest.dll?API=TrackV2
&XML=<TrackRequest USERID="xxxxxxxx">
<TrackID ID="EJ958088694US"></TrackID></TrackRequest>
Utilitarian answered 7/10, 2012 at 5:54 Comment(1)
I just ran into the same problem. When I contacted USPS through their tech support email address, they replied that the tests aren't required for the Rate API and that they could go ahead and move my account to the production server.Beaudoin
B
1

When you try V2, that's what you will get

<Error>
<Number>80040b1a</Number>
<Description>API Disabled: RateV2.  </Description>
<Source>UspsCom::DoAuth</Source>

Backache answered 27/7, 2012 at 19:42 Comment(1)
When I was trying to do that, the error number was same. Good that they have changed the Description to something that makes sense. :-)Chelonian

© 2022 - 2024 — McMap. All rights reserved.